@dodoex/widgets 2.2.2-1 → 2.2.2-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/src/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +2 -1
- package/dist/cjs/src/components/Swap/components/TokenCard/index.d.ts +2 -1
- package/dist/cjs/src/components/TokenPicker/index.d.ts +2 -1
- package/dist/cjs/src/hooks/Token/type.d.ts +1 -0
- package/dist/cjs/src/hooks/Token/useTokenList.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/src/components/Swap/components/TokenCard/TokenPickerDialog.d.ts +2 -1
- package/dist/src/components/Swap/components/TokenCard/index.d.ts +2 -1
- package/dist/src/components/TokenPicker/index.d.ts +2 -1
- package/dist/src/hooks/Token/type.d.ts +1 -0
- package/dist/src/hooks/Token/useTokenList.d.ts +4 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41,4 +41,4 @@ object-assign
|
|
|
41
41
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
42
42
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
43
43
|
* @license MIT
|
|
44
|
-
*/!function(e){!function(){var t="input is invalid type",r="object"==typeof window,n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var o=!r&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=ce:o&&(n=self);var i=!n.JS_SHA3_NO_COMMON_JS&&e.exports,s=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),c=[4,1024,262144,67108864],l=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],d=[224,256,384,512],h=[128,256],f=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!s||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var m=function(e,t,r){return function(n){return new T(e,t,e).update(n)[r]()}},g=function(e,t,r){return function(n,o){return new T(e,t,o).update(n)[r]()}},y=function(e,t,r){return function(t,n,o,i){return E["cshake"+e].update(t,n,o,i)[r]()}},b=function(e,t,r){return function(t,n,o,i){return E["kmac"+e].update(t,n,o,i)[r]()}},v=function(e,t,r,n){for(var o=0;o<f.length;++o){var i=f[o];e[i]=t(r,n,i)}return e},w=function(e,t){var r=m(e,t,"hex");return r.create=function(){return new T(e,t,e)},r.update=function(e){return r.create().update(e)},v(r,m,e,t)},x=[{name:"keccak",padding:[1,256,65536,16777216],bits:d,createMethod:w},{name:"sha3",padding:[6,1536,393216,100663296],bits:d,createMethod:w},{name:"shake",padding:[31,7936,2031616,520093696],bits:h,createMethod:function(e,t){var r=g(e,t,"hex");return r.create=function(r){return new T(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},v(r,g,e,t)}},{name:"cshake",padding:c,bits:h,createMethod:function(e,t){var r=p[e],n=y(e,0,"hex");return n.create=function(n,o,i){return o||i?new T(e,t,n).bytepad([o,i],r):E["shake"+e].create(n)},n.update=function(e,t,r,o){return n.create(t,r,o).update(e)},v(n,y,e,t)}},{name:"kmac",padding:c,bits:h,createMethod:function(e,t){var r=p[e],n=b(e,0,"hex");return n.create=function(n,o,i){return new O(e,t,o).bytepad(["KMAC",i],r).bytepad([n],r)},n.update=function(e,t,r,o){return n.create(e,r,o).update(t)},v(n,b,e,t)}}],E={},A=[],R=0;R<x.length;++R)for(var _=x[R],k=_.bits,S=0;S<k.length;++S){var N=_.name+"_"+k[S];if(A.push(N),E[N]=_.createMethod(k[S],_.padding),"sha3"!==_.name){var M=_.name+k[S];A.push(M),E[M]=E[N]}}function T(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function O(e,t,r){T.call(this,e,t,r)}T.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var o,i,a=this.blocks,c=this.byteCount,u=e.length,d=this.blockCount,h=0,f=this.s;h<u;){if(this.reset)for(this.reset=!1,a[0]=this.block,o=1;o<d+1;++o)a[o]=0;if(r)for(o=this.start;h<u&&o<c;++h)a[o>>2]|=e[h]<<l[3&o++];else for(o=this.start;h<u&&o<c;++h)(i=e.charCodeAt(h))<128?a[o>>2]|=i<<l[3&o++]:i<2048?(a[o>>2]|=(192|i>>6)<<l[3&o++],a[o>>2]|=(128|63&i)<<l[3&o++]):i<55296||i>=57344?(a[o>>2]|=(224|i>>12)<<l[3&o++],a[o>>2]|=(128|i>>6&63)<<l[3&o++],a[o>>2]|=(128|63&i)<<l[3&o++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++h)),a[o>>2]|=(240|i>>18)<<l[3&o++],a[o>>2]|=(128|i>>12&63)<<l[3&o++],a[o>>2]|=(128|i>>6&63)<<l[3&o++],a[o>>2]|=(128|63&i)<<l[3&o++]);if(this.lastByteIndex=o,o>=c){for(this.start=o-c,this.block=a[d],o=0;o<d;++o)f[o]^=a[o];I(f),this.reset=!0}else this.start=o}return this},T.prototype.encode=function(e,t){var r=255&e,n=1,o=[r];for(r=255&(e>>=8);r>0;)o.unshift(r),r=255&(e>>=8),++n;return t?o.push(n):o.unshift(n),this.update(o),o.length},T.prototype.encodeString=function(e){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var o=0,i=e.length;if(r)o=i;else for(var a=0;a<e.length;++a){var c=e.charCodeAt(a);c<128?o+=1:c<2048?o+=2:c<55296||c>=57344?o+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++a)),o+=4)}return o+=this.encode(8*o),this.update(e),o},T.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var o=t-r%t,i=[];return i.length=o,this.update(i),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];I(n)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,s=0,c="";s<n;){for(i=0;i<t&&s<n;++i,++s)e=r[i],c+=a[e>>4&15]+a[15&e]+a[e>>12&15]+a[e>>8&15]+a[e>>20&15]+a[e>>16&15]+a[e>>28&15]+a[e>>24&15];s%t==0&&(I(r),i=0)}return o&&(e=r[i],c+=a[e>>4&15]+a[15&e],o>1&&(c+=a[e>>12&15]+a[e>>8&15]),o>2&&(c+=a[e>>20&15]+a[e>>16&15])),c},T.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,s=0,a=this.outputBits>>3;e=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(e);s<n;){for(i=0;i<t&&s<n;++i,++s)c[s]=r[i];s%t==0&&I(r)}return o&&(c[i]=r[i],e=e.slice(0,a)),e},T.prototype.buffer=T.prototype.arrayBuffer,T.prototype.digest=T.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,s=0,a=0,c=[];a<o;){for(s=0;s<r&&a<o;++s,++a)e=a<<2,t=n[s],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;a%r==0&&I(n)}return i&&(e=a<<2,t=n[s],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},O.prototype=new T,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var I=function(e){var t,r,n,o,i,s,a,c,l,d,h,f,p,m,g,y,b,v,w,x,E,A,R,_,k,S,N,M,T,O,I,F,W,C,j,U,D,B,V,P,Z,z,L,H,Y,X,J,G,q,K,Q,$,ee,te,re,ne,oe,ie,se,ae,ce,le,ue;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(c<<1|l>>>31),r=i^(l<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(d<<1|h>>>31),r=a^(h<<1|d>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(f<<1|p>>>31),r=l^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=d^(o<<1|i>>>31),r=h^(i<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],X=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,T=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,L=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,j=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,G=e[22]<<10|e[23]>>>22,q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,I=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,K=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,F=e[45]<<29|e[44]>>>3,W=e[44]<<29|e[45]>>>3,_=e[6]<<28|e[7]>>>4,k=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,oe=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,V=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,Y=e[9]<<27|e[8]>>>5,S=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,P=e[38]<<8|e[39]>>>24,Z=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,R=e[49]<<14|e[48]>>>18,e[0]=m^~y&v,e[1]=g^~b&w,e[10]=_^~S&M,e[11]=k^~N&T,e[20]=C^~U&B,e[21]=j^~D&V,e[30]=H^~X&G,e[31]=Y^~J&q,e[40]=te^~ne&ie,e[41]=re^~oe&se,e[2]=y^~v&x,e[3]=b^~w&E,e[12]=S^~M&O,e[13]=N^~T&I,e[22]=U^~B&P,e[23]=D^~V&Z,e[32]=X^~G&K,e[33]=J^~q&Q,e[42]=ne^~ie&ae,e[43]=oe^~se&ce,e[4]=v^~x&A,e[5]=w^~E&R,e[14]=M^~O&F,e[15]=T^~I&W,e[24]=B^~P&z,e[25]=V^~Z&L,e[34]=G^~K&$,e[35]=q^~Q&ee,e[44]=ie^~ae&le,e[45]=se^~ce&ue,e[6]=x^~A&m,e[7]=E^~R&g,e[16]=O^~F&_,e[17]=I^~W&k,e[26]=P^~z&C,e[27]=Z^~L&j,e[36]=K^~$&H,e[37]=Q^~ee&Y,e[46]=ae^~le&te,e[47]=ce^~ue&re,e[8]=A^~m&y,e[9]=R^~g&b,e[18]=F^~_&S,e[19]=W^~k&N,e[28]=z^~C&U,e[29]=L^~j&D,e[38]=$^~H&X,e[39]=ee^~Y&J,e[48]=le^~te&ne,e[49]=ue^~re&oe,e[0]^=u[n],e[1]^=u[n+1]};if(i)e.exports=E;else for(R=0;R<A.length;++R)n[A[R]]=E[A[R]]}()}(ps);var ms=ps.exports;function gs(e){return"0x"+ms.keccak_256(ns(e))}const ys=new qi("rlp/5.7.0");function bs(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function vs(e,t,r){let n=0;for(let o=0;o<r;o++)n=256*n+e[t+o];return n}function ws(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(ws(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=bs(t.length);return r.unshift(247+r.length),r.concat(t)}es(e)||ys.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(ns(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=bs(t.length);return r.unshift(183+r.length),r.concat(t)}function xs(e){return as(ws(e))}function Es(e,t,r,n){const o=[];for(;r<t+1+n;){const i=As(e,r);o.push(i.result),(r+=i.consumed)>t+1+n&&ys.throwError("child data too short",qi.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function As(e,t){if(0===e.length&&ys.throwError("data too short",qi.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&ys.throwError("data short segment too short",qi.errors.BUFFER_OVERRUN,{});const n=vs(e,t+1,r);return t+1+r+n>e.length&&ys.throwError("data long segment too short",qi.errors.BUFFER_OVERRUN,{}),Es(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&ys.throwError("data array too short",qi.errors.BUFFER_OVERRUN,{}),Es(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&ys.throwError("data array too short",qi.errors.BUFFER_OVERRUN,{});const n=vs(e,t+1,r);t+1+r+n>e.length&&ys.throwError("data array too short",qi.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:as(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&ys.throwError("data too short",qi.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:as(e.slice(t+1,t+1+r))}}return{consumed:1,result:as(e[t])}}function Rs(e){const t=ns(e),r=As(t,0);return r.consumed!==t.length&&ys.throwArgumentError("invalid rlp data","data",e),r.result}const _s=new qi("address/5.7.0");function ks(e){ss(e,20)||_s.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=ns(gs(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const Ss={};for(let e=0;e<10;e++)Ss[String(e)]=String(e);for(let e=0;e<26;e++)Ss[String.fromCharCode(65+e)]=String(10+e);const Ns=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function Ms(e){let t=null;if("string"!=typeof e&&_s.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=ks(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&_s.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)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Ss[e])).join("");for(;t.length>=Ns;){let e=t.substring(0,Ns);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e)&&_s.throwArgumentError("bad icap checksum","address",e),t=re(e.substring(4));t.length<40;)t="0"+t;t=ks("0x"+t)}else _s.throwArgumentError("invalid address","address",e);return t}const Ts=(e,t)=>{if(0===e.length||0===t.length)return!1;if(t.length===e.length)return e.toLowerCase()===t.toLowerCase();const r=e.substring(2,e.length).toLowerCase(),n=t.substring(2,t.length).toLowerCase();return r.length>n.length?r.endsWith(n):n.endsWith(r)};const Os=e=>{const t={isMainnet:1===e,isRinkeby:4===e,isGor:5===e};return Object.assign(Object.assign({},t),{isETH:t.isMainnet||t.isRinkeby||t.isGor})};var Is;!function(e){e[e.MAINNET=1]="MAINNET",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.BSC=56]="BSC",e[e.HECO=128]="HECO",e[e.POLYGON=137]="POLYGON",e[e.ARBITRUM_ONE=42161]="ARBITRUM_ONE",e[e.ARBITRUM_RINKEBY=421611]="ARBITRUM_RINKEBY",e[e.AURORA=1313161554]="AURORA",e[e.MOONRIVER=1285]="MOONRIVER",e[e.OKCHAIN=66]="OKCHAIN",e[e.OPTIMISM=10]="OPTIMISM",e[e.BOBA=288]="BOBA",e[e.AVALANCHE=43114]="AVALANCHE",e[e.CRONOS=25]="CRONOS"}(Is||(Is={}));const Fs={[Is.MAINNET]:["https://rpc.ankr.com/eth","https://eth-mainnet.public.blastapi.io","https://eth-rpc.gateway.pokt.network","https://main-rpc.linkpool.io"],[Is.RINKEBY]:["https://rinkeby-light.eth.linkpool.io/"],[Is.GOERLI]:["https://goerli.optimism.io/"],[Is.BSC]:["https://bsc-dataseed1.binance.org","https://bsc-dataseed2.binance.org","https://bsc-dataseed3.binance.org","https://bsc-dataseed4.binance.org","https://bsc-dataseed1.defibit.io","https://bsc-dataseed2.defibit.io","https://bsc-dataseed3.defibit.io","https://bsc-dataseed4.defibit.io","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed2.ninicoin.io","https://bsc-dataseed3.ninicoin.io","https://bsc-dataseed4.ninicoin.io","https://bsc-dataseed.binance.org","https://rpc.ankr.com/bsc","https://bscrpc.com","https://bsc.mytokenpocket.vip","https://binance.nodereal.io","https://rpc-bsc.bnb48.club"],[Is.HECO]:["https://http-mainnet.hecochain.com","https://pub001.hg.network/rpc"],[Is.POLYGON]:["https://polygon-rpc.com","https://rpc-mainnet.matic.network","https://matic-mainnet.chainstacklabs.com","https://rpc-mainnet.maticvigil.com","https://rpc-mainnet.matic.quiknode.pro","https://matic-mainnet-full-rpc.bwarelabs.com","https://matic-mainnet-archive-rpc.bwarelabs.com","https://poly-rpc.gateway.pokt.network","https://rpc.ankr.com/polygon","https://polygon-mainnet.public.blastapi.io"],[Is.ARBITRUM_ONE]:["https://arb1.arbitrum.io/rpc","https://rpc.ankr.com/arbitrum"],[Is.ARBITRUM_RINKEBY]:["https://rinkeby.arbitrum.io/rpc"],[Is.AURORA]:["https://mainnet.aurora.dev/"],[Is.MOONRIVER]:["https://rpc.api.moonriver.moonbeam.network","https://moonriver.api.onfinality.io/rpc?apikey=673e1fae-c9c9-4c7f-a3d5-2121e8274366","https://moonriver.api.onfinality.io/public","https://moonriver.public.blastapi.io"],[Is.OKCHAIN]:["https://exchainrpc.okex.org","https://okc-mainnet.gateway.pokt.network/v1/lb/6275309bea1b320039c893ff"],[Is.OPTIMISM]:["https://mainnet.optimism.io","https://optimism-mainnet.public.blastapi.io"],[Is.BOBA]:["https://mainnet.boba.network","https://boba-mainnet.gateway.pokt.network/v1/lb/623ad21b20354900396fed7f","https://lightning-replica.boba.network"],[Is.AVALANCHE]:["https://api.avax.network/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc"],[Is.CRONOS]:["https://evm.cronos.org","https://cronos-rpc.heavenswail.one","https://evm-cronos.crypto.org","https://cronosrpc-1.xstaking.sg","https://cronos-rpc.elk.finance"]},Ws={symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,showDecimals:4,wrappedTokenSymbol:"WETH"},Cs={[Is.MAINNET]:Object.assign(Object.assign({},Ws),{wrappedTokenAddress:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}),[Is.RINKEBY]:Object.assign(Object.assign({},Ws),{wrappedTokenAddress:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0"}),[Is.GOERLI]:Object.assign(Object.assign({},Ws),{wrappedTokenAddress:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"}),[Is.OPTIMISM]:Object.assign(Object.assign({},Ws),{wrappedTokenAddress:"0x4200000000000000000000000000000000000006"}),[Is.CRONOS]:Object.assign(Object.assign({},Ws),{symbol:"CRO",name:"Cronos",wrappedTokenSymbol:"WCRO",wrappedTokenAddress:"0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23"}),[Is.BOBA]:Object.assign(Object.assign({},Ws),{wrappedTokenAddress:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000"}),[Is.BSC]:Object.assign(Object.assign({},Ws),{symbol:"BNB",name:"BNB",wrappedTokenSymbol:"WBNB",wrappedTokenAddress:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}),[Is.OKCHAIN]:Object.assign(Object.assign({},Ws),{symbol:"OKT",name:"OKT",wrappedTokenSymbol:"WOKT",wrappedTokenAddress:"0x8F8526dbfd6E38E3D8307702cA8469Bae6C56C15"}),[Is.HECO]:Object.assign(Object.assign({},Ws),{symbol:"HT",name:"HT",showDecimals:6,wrappedTokenSymbol:"WHT",wrappedTokenAddress:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f"}),[Is.POLYGON]:Object.assign(Object.assign({},Ws),{symbol:"MATIC",name:"MATIC",showDecimals:6,wrappedTokenSymbol:"WMATIC",wrappedTokenAddress:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"}),[Is.MOONRIVER]:Object.assign(Object.assign({},Ws),{symbol:"MOVR",name:"MOVR",showDecimals:6,wrappedTokenSymbol:"WMOVR",wrappedTokenAddress:"0x98878b06940ae243284ca214f92bb71a2b032b8a"}),[Is.ARBITRUM_ONE]:Object.assign(Object.assign({},Ws),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"}),[Is.ARBITRUM_RINKEBY]:Object.assign(Object.assign({},Ws),{name:"Ether",showDecimals:6,wrappedTokenAddress:"0xEBbc3452Cc911591e4F18f3b36727Df45d6bd1f9"}),[Is.AURORA]:Object.assign(Object.assign({},Ws),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB"}),[Is.AVALANCHE]:Object.assign(Object.assign({},Ws),{symbol:"AVAX",name:"Avalanche",showDecimals:6,wrappedTokenSymbol:"WAVAX",wrappedTokenAddress:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"})},js={[Is.MAINNET]:"ethereum",[Is.RINKEBY]:"rinkeby",[Is.GOERLI]:"goerli",[Is.OPTIMISM]:"optimism",[Is.CRONOS]:"cronos",[Is.BOBA]:"boba",[Is.BSC]:"bsc",[Is.OKCHAIN]:"okex-chain",[Is.HECO]:"heco",[Is.POLYGON]:"polygon",[Is.MOONRIVER]:"moonriver",[Is.ARBITRUM_ONE]:"arbitrum",[Is.ARBITRUM_RINKEBY]:"arb-rinkeby",[Is.AURORA]:"aurora",[Is.AVALANCHE]:"avalanche"},Us={[Is.MAINNET]:"etherscan.io",[Is.RINKEBY]:"rinkeby.etherscan.io",[Is.GOERLI]:"goerli.etherscan.io",[Is.OPTIMISM]:"optimistic.etherscan.io",[Is.CRONOS]:"cronoscan.com",[Is.BOBA]:"blockexplorer.boba.network",[Is.BSC]:"bscscan.com",[Is.OKCHAIN]:"www.oklink.com/okexchain",[Is.HECO]:"hecoinfo.com",[Is.POLYGON]:"polygonscan.com",[Is.MOONRIVER]:"moonriver.moonscan.io",[Is.ARBITRUM_ONE]:"arbiscan.io",[Is.ARBITRUM_RINKEBY]:"testnet.arbiscan.io",[Is.AURORA]:"aurorascan.dev",[Is.AVALANCHE]:"snowtrace.io"};function Ds(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function Bs(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}const Vs={colorMode:"dark",slippage:3..toString(),ddl:20};var Ps=(e=Vs,t)=>{switch(t.type){case"SET_COLOR_MODE":return Object.assign(Object.assign({},e),{colorMode:t.payload});case"SET_SLIPPAGE":return Object.assign(Object.assign({},e),{slippage:t.payload});case"SET_TRANSACTION_DDL":return Object.assign(Object.assign({},e),{ddl:t.payload});default:return e}};const Zs={chainId:Is.MAINNET,latestBlockNumber:0};var zs=(e=Zs,t)=>{switch(t.type){case"SET_CHAIN_ID":return Object.assign(Object.assign({},e),{chainId:t.payload});case"SET_BLOCK_NUMBER":return Object.assign(Object.assign({},e),{latestBlockNumber:t.payload});default:return e}};const Ls={tokenList:[],popularTokenList:[],ethBalance:void 0,accountBalances:{},balanceLoadings:{},slippageWithTokens:[]};var Hs,Ys=(e=Ls,t)=>{switch(t.type){case"SET_TOKEN_LIST":return Object.assign(Object.assign({},e),{tokenList:t.payload});case"SET_POPULAR_TOKEN_LIST":return Object.assign(Object.assign({},e),{popularTokenList:t.payload});case"SET_SLIPPAGE_WITH_TOKENS":return Object.assign(Object.assign({},e),{slippageWithTokens:t.payload});case"SET_ETH_BALANCE":return Object.assign(Object.assign({},e),{ethBalance:t.payload});case"SET_DEFAULT_FROM_TOKEN":return Object.assign(Object.assign({},e),{defaultFromToken:t.payload});case"SET_DEFAULT_TO_TOKEN":return Object.assign(Object.assign({},e),{defaultToToken:t.payload});case"SET_ACCOUNT_BALANCES":return Object.assign(Object.assign({},e),{accountBalances:Object.assign(Object.assign({},e.accountBalances),t.payload)});case"SET_ACCOUNT_ALLOWANCES":const r=e.accountBalances;return Object.keys(r).map((e=>{r[e].tokenAllowances=t.payload})),Object.assign(Object.assign({},e),{accountBalances:r});case"SET_BALANCE_LOADINGS":return Object.assign(Object.assign({},e),{balanceLoadings:Object.assign(Object.assign({},e.balanceLoadings),t.payload)});default:return e}};!function(e){e.Initial="Initial",e.Pending="Pending",e.ApproveSuccess="ApproveSuccess",e.TxSuccess="TxSuccess",e.Failed="Failed"}(Hs||(Hs={}));const Xs={height:void 0,width:void 0,apikey:"",feeRate:0,rebateTo:"",isReverseRouting:!1,contractStatus:Hs.Initial};const Js={settings:Vs,wallet:Zs,globals:Xs,token:Ls},Gs=J({reducer:G({settings:Ps,wallet:zs,token:Ys,globals:(e=Xs,t)=>"SET_GLOBAL_PROPS"===t.type?Object.assign(Object.assign({},e),t.payload):e}),middleware:e=>e({serializableCheck:{ignoredActions:["SET_ACCOUNT_BALANCES","SET_ETH_BALANCE"],ignoredPaths:["token.accountBalances","token.ethBalance"]}}),preloadedState:Js}),qs=e=>(null!=e?e:Gs.getState()).wallet.chainId,Ks=e=>(null!=e?e:Gs.getState()).wallet.latestBlockNumber,Qs=e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_ACCOUNT_BALANCES",payload:e})})),$s=e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_BALANCE_LOADINGS",payload:e})})),ea="0x0000000000000000000000000000000000000000",ta=ne.from(-1),ra=ne.from(0),na=ne.from(1),oa=ne.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var ia=[{constant:!0,inputs:[],name:"getCurrentBlockTimestamp",outputs:[{name:"timestamp",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{components:[{name:"target",type:"address"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{name:"blockNumber",type:"uint256"},{name:"returnData",type:"bytes[]"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getLastBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockDifficulty",outputs:[{name:"difficulty",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockGasLimit",outputs:[{name:"gaslimit",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockCoinbase",outputs:[{name:"coinbase",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"}],sa={[Is.MAINNET]:{MULTI_CALL:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",DODO_APPROVE:"0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149",ERC20_HELPER:"0xD9ef2d1583e8Aa196123e773BE38B539a4d149df"},[Is.RINKEBY]:{MULTI_CALL:"0xb7E1C577f95959a3eD11f9281702850328b4e0e4",DODO_APPROVE:"0xcC8d87A7C747eeE4242045C47Ef25e0A81D56ae3",ERC20_HELPER:"0x6A42091d713A67E25a1D11aeE14E7AEB96E0331f"},[Is.GOERLI]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0xC9143e54021f4a6d33b9b89DBB9F458AaEdd56FB",ERC20_HELPER:"0x24549FC74B3076A962624A26370ed556c467F74C"},[Is.BSC]:{MULTI_CALL:"0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb",DODO_APPROVE:"0xa128Ba44B2738A558A1fdC06d6303d52D3Cef8c1",ERC20_HELPER:"0x566651Ad34f6306872FaC5fB95bbF4C9beE8D8F2"},[Is.HECO]:{MULTI_CALL:"0x76a328B3440B9276a31523e731B34082df7a6f1A",DODO_APPROVE:"0x68b6c06Ac8Aa359868393724d25D871921E97293",ERC20_HELPER:"0x270C2abC692Dd476B860CCbDfD6D8146BF61f8D8"},[Is.POLYGON]:{MULTI_CALL:"0xc9eD9B18e447e600238fe50e944B9062B664DEa4",DODO_APPROVE:"0x292E6b2e054e1157df71C1C9510265CA8C0c7672",ERC20_HELPER:"0xfd24312Ec7871A6D1a31e454D5AbB16c6c25a9b3"},[Is.ARBITRUM_ONE]:{MULTI_CALL:"0xF718F2bd590E5621e53f7b89398e52f7Acced8ca",DODO_APPROVE:"0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8",ERC20_HELPER:"0x7C062B9C584fA6eC2504270790D38240A2c5fE72"},[Is.ARBITRUM_RINKEBY]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0x5BaF16d57620Cb361F622232F3cb4090e35F3da2",ERC20_HELPER:"0x5B2fd46E6E3Ff1E479d651ec0b210882Aa9871dF"},[Is.AURORA]:{MULTI_CALL:"0x989DcAA95801C527C5B73AA65d3962dF9aCe1b0C",DODO_APPROVE:"0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619",ERC20_HELPER:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25"},[Is.MOONRIVER]:{MULTI_CALL:"0x2ff2CeE6E9359F9eA1cF2f51d18bF9F2045447E4",DODO_APPROVE:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25",ERC20_HELPER:"0x6373ceB657C83C91088d328622573FB766064Ac4"},[Is.OKCHAIN]:{MULTI_CALL:"0x5e84190a270333aCe5B9202a3F4ceBf11b81bB01",DODO_APPROVE:"0x7737fd30535c69545deeEa54AB8Dd590ccaEBD3c",ERC20_HELPER:"0x4775b1858f1e417C9609D455C3Ad8751ec01daC4"},[Is.OPTIMISM]:{MULTI_CALL:"0xb98Ac2fEFc8b73aeAE33D02BB00c26E12afCa9Df",DODO_APPROVE:"0xa492d6eABcdc3E204676f15B950bBdD448080364",ERC20_HELPER:"0x42E456ea0dd7538ea103fBb1d0388D14C97bB5b2"},[Is.BOBA]:{MULTI_CALL:"0xD56281EF996B6B29874C77D2e1464216E8043127",DODO_APPROVE:"0x8F8Dd7DB1bDA5eD3da8C9daf3bfa471c12d58486",ERC20_HELPER:"0x9FCFD9ff955D36856F8EE480471B05488C0eB5cA"},[Is.AVALANCHE]:{MULTI_CALL:"0x97f0153E7F5749640aDF3Ff9CFC518b79D6Fe53b",DODO_APPROVE:"0xCFea63e3DE31De53D68780Dd65675F169439e470",ERC20_HELPER:"0xC3528D128CC227fd60793007b5e3FdF7c2945282"},[Is.CRONOS]:{MULTI_CALL:"0x4f4408D78F9E9e242c17C635FbD0f1952951c917",DODO_APPROVE:"0x9B736bB8f336f61E16454DCA4dE130703D151042",ERC20_HELPER:"0xbd2F5c60cf7d60daD2106ceD4D21b90722761f14"}};var aa=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const ca=new qi("properties/5.7.0");function la(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function ua(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function da(e){return aa(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function ha(e){const t={};for(const r in e)t[r]=e[r];return t}const fa={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function pa(e){if(null==e||fa[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!pa(n))return!1}return!0}return ca.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ma(e){if(pa(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>ga(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&la(t,r,ga(n))}return t}return ca.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ga(e){return ma(e)}class ya{constructor(e){for(const t in e)this[t]=ga(e[t])}}const ba=new qi("abi/5.7.0"),va={};let wa={calldata:!0,memory:!0,storage:!0},xa={calldata:!0,memory:!0};function Ea(e,t){if("bytes"===e||"string"===e){if(wa[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&xa[t])return!0;return(wa[t]||"payable"===t)&&ba.throwArgumentError("invalid modifier","name",t),!1}function Aa(e,t){for(let r in t)la(e,r,t[r])}const Ra=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),_a=new RegExp(/^(.*)\[([0-9]*)\]$/);class ka{constructor(e,t){e!==va&&ba.throwError("use fromString",qi.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Aa(this,t);let r=this.type.match(_a);Aa(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:ka.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Ra.sighash),Ra[e]||ba.throwArgumentError("invalid format type","format",e),e===Ra.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Ra.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ra.full?", ":",")+")"):t+=this.type,e!==Ra.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ra.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?ka.fromString(e,t):ka.fromObject(e)}static fromObject(e){return ka.isParamType(e)?e:new ka(va,{name:e.name||null,type:Ua(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(ka.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){ba.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function o(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let i={type:"",name:"",state:{allowType:!0}},s=i;for(let r=0;r<e.length;r++){let i=e[r];switch(i){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(r),s.state.allowType=!1,s.type=Ua(s.type),s.components=[o(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),Ea(s.type,s.name)&&(s.name=""),s.type=Ua(s.type);let e=s;s=s.parent,s||n(r),delete e.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),Ea(s.type,s.name)&&(s.name=""),s.type=Ua(s.type);let a=o(s.parent);s.parent.components.push(a),delete s.parent,s=a;break;case" ":s.state.allowType&&""!==s.type&&(s.type=Ua(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(t||n(r),s.indexed&&n(r),s.indexed=!0,s.name=""):Ea(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(r),s.type+=i,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(r),s.type+=i,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=i,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=i,delete s.state.allowArray):s.state.readArray?s.type+=i:n(r)}}return s.parent&&ba.throwArgumentError("unexpected eof","param",e),delete i.state,"indexed"===s.name?(t||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):Ea(s.type,s.name)&&(s.name=""),i.type=Ua(i.type),i}(e,!!t),ka.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}}function Sa(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let o=0;o<e.length;o++){let i=e[o];","===i&&0===n?(t.push(r),r=""):(r+=i,"("===i?n++:")"===i&&(n--,-1===n&&ba.throwArgumentError("unbalanced parenthesis","value",e)))}r&&t.push(r);return t}(e).map((e=>ka.fromString(e,t)))}class Na{constructor(e,t){e!==va&&ba.throwError("use a static from method",qi.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Aa(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Na.isFragment(e)?e:"string"==typeof e?Na.fromString(e):Na.fromObject(e)}static fromObject(e){if(Na.isFragment(e))return e;switch(e.type){case"function":return Wa.fromObject(e);case"event":return Ma.fromObject(e);case"constructor":return Fa.fromObject(e);case"error":return ja.fromObject(e);case"fallback":case"receive":return null}return ba.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Ma.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Wa.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Fa.fromString(e.trim()):"error"===e.split(" ")[0]?ja.fromString(e.substring(5).trim()):ba.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Ma extends Na{format(e){if(e||(e=Ra.sighash),Ra[e]||ba.throwArgumentError("invalid format type","format",e),e===Ra.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ra.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",e!==Ra.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Ma.fromString(e):Ma.fromObject(e)}static fromObject(e){if(Ma.isEventFragment(e))return e;"event"!==e.type&&ba.throwArgumentError("invalid event object","value",e);const t={name:Ba(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(ka.fromObject):[],type:"event"};return new Ma(va,t)}static fromString(e){let t=e.match(Va);t||ba.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:ba.warn("unknown modifier: "+e)}})),Ma.fromObject({name:t[1].trim(),anonymous:r,inputs:Sa(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Ta(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&ba.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||ba.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=ne.from(r[1]),r[0]):e}function Oa(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Ia(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&ba.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&ba.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||ba.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&&ba.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&&ba.throwArgumentError("unable to determine stateMutability","value",e),t}class Fa extends Na{format(e){if(e||(e=Ra.sighash),Ra[e]||ba.throwArgumentError("invalid format type","format",e),e===Ra.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((t=>JSON.parse(t.format(e))))});e===Ra.sighash&&ba.throwError("cannot format a constructor for sighash",qi.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?Fa.fromString(e):Fa.fromObject(e)}static fromObject(e){if(Fa.isConstructorFragment(e))return e;"constructor"!==e.type&&ba.throwArgumentError("invalid constructor object","value",e);let t=Ia(e);t.constant&&ba.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(ka.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ne.from(e.gas):null};return new Fa(va,r)}static fromString(e){let t={type:"constructor"},r=(e=Ta(e,t)).match(Va);return r&&"constructor"===r[1].trim()||ba.throwArgumentError("invalid constructor string","value",e),t.inputs=Sa(r[2].trim(),!1),Oa(r[3].trim(),t),Fa.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Wa extends Fa{format(e){if(e||(e=Ra.sighash),Ra[e]||ba.throwArgumentError("invalid format type","format",e),e===Ra.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((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ra.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",e!==Ra.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Wa.fromString(e):Wa.fromObject(e)}static fromObject(e){if(Wa.isFunctionFragment(e))return e;"function"!==e.type&&ba.throwArgumentError("invalid function object","value",e);let t=Ia(e);const r={type:e.type,name:Ba(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(ka.fromObject):[],outputs:e.outputs?e.outputs.map(ka.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ne.from(e.gas):null};return new Wa(va,r)}static fromString(e){let t={type:"function"},r=(e=Ta(e,t)).split(" returns ");r.length>2&&ba.throwArgumentError("invalid function string","value",e);let n=r[0].match(Va);if(n||ba.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Ba(t.name),t.inputs=Sa(n[2],!1),Oa(n[3].trim(),t),r.length>1){let n=r[1].match(Va);""==n[1].trim()&&""==n[3].trim()||ba.throwArgumentError("unexpected tokens","value",e),t.outputs=Sa(n[2],!1)}else t.outputs=[];return Wa.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Ca(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||ba.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class ja extends Na{format(e){if(e||(e=Ra.sighash),Ra[e]||ba.throwArgumentError("invalid format type","format",e),e===Ra.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ra.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?ja.fromString(e):ja.fromObject(e)}static fromObject(e){if(ja.isErrorFragment(e))return e;"error"!==e.type&&ba.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Ba(e.name),inputs:e.inputs?e.inputs.map(ka.fromObject):[]};return Ca(new ja(va,t))}static fromString(e){let t={type:"error"},r=e.match(Va);return r||ba.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Ba(t.name),t.inputs=Sa(r[2],!1),Ca(ja.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Ua(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Da=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ba(e){return e&&e.match(Da)||ba.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Va=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Pa=new qi("abi/5.7.0");class Za{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Pa.throwArgumentError(e,this.localName,t)}}class za{constructor(e){la(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return us(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(os(e._data))}writeBytes(e){let t=ns(e);const r=t.length%this.wordSize;return r&&(t=os([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=ns(ne.from(e));return t.length>this.wordSize&&Pa.throwError("value out-of-bounds",qi.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=os([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class La{constructor(e,t,r,n){la(this,"_data",ns(e)),la(this,"wordSize",t||32),la(this,"_coerceFunc",r),la(this,"allowLoose",n),this._offset=0}get data(){return as(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):La.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Pa.throwError("data out-of-bounds",qi.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new La(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return ne.from(this.readBytes(this.wordSize))}}class Ha extends Za{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Ms(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Ms(hs(e.readValue().toHexString(),20))}}class Ya extends Za{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const Xa=new qi("abi/5.7.0");function Ja(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||Xa.throwError("cannot encode object for signature with missing names",qi.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&Xa.throwError("cannot encode object for signature with duplicate names",qi.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else Xa.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&Xa.throwArgumentError("types/value length mismatch","tuple",r);let o=new za(e.wordSize),i=new za(e.wordSize),s=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=i.length;e.encode(i,r);let n=o.writeUpdatableValue();s.push((e=>{n(e+t)}))}else e.encode(o,r)})),s.forEach((e=>{e(o.length)}));let a=e.appendWriter(o);return a+=e.appendWriter(i),a}function Ga(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let o=null;if(t.dynamic){let r=e.readValue(),i=n.subReader(r.toNumber());try{o=t.decode(i)}catch(e){if(e.code===qi.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}}else try{o=t.decode(e)}catch(e){if(e.code===qi.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}null!=o&&r.push(o)}));const o=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==o[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const i=r[t];i instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw i}}):r[n]=i}));for(let e=0;e<r.length;e++){const t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(r)}class qa extends Za{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),Xa.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let e=0;e<t.length;e++)n.push(this.coder);return Ja(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&Xa.throwError("insufficient data length",qi.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new Ya(this.coder));return e.coerce(this.name,Ga(e,r))}}class Ka extends Za{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class Qa extends Za{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=ns(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class $a extends Qa{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,as(super.decode(e)))}}class ec extends Za{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=ns(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,as(e.readBytes(this.size)))}}class tc extends Za{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}class rc extends Za{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=ne.from(t),n=oa.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(na).mul(ta)))&&this._throwError("value out-of-bounds",t)}else(r.lt(ra)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}const nc=new qi("strings/5.7.0");var oc,ic;function sc(e,t,r,n,o){if(e===ic.BAD_PREFIX||e===ic.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===ic.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(oc||(oc={})),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"}(ic||(ic={}));const ac=Object.freeze({error:function(e,t,r,n,o){return nc.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:sc,replace:function(e,t,r,n,o){return e===ic.OVERLONG?(n.push(o),0):(n.push(65533),sc(e,t,r))}});function cc(e,t){null==t&&(t=ac.error),e=ns(e);const r=[];let n=0;for(;n<e.length;){const o=e[n++];if(o>>7==0){r.push(o);continue}let i=null,s=null;if(192==(224&o))i=1,s=127;else if(224==(240&o))i=2,s=2047;else{if(240!=(248&o)){n+=t(128==(192&o)?ic.UNEXPECTED_CONTINUE:ic.BAD_PREFIX,n-1,e,r);continue}i=3,s=65535}if(n-1+i>=e.length){n+=t(ic.OVERRUN,n-1,e,r);continue}let a=o&(1<<8-i-1)-1;for(let o=0;o<i;o++){let o=e[n];if(128!=(192&o)){n+=t(ic.MISSING_CONTINUE,n,e,r),a=null;break}a=a<<6|63&o,n++}null!==a&&(a>1114111?n+=t(ic.OUT_OF_RANGE,n-1-i,e,r,a):a>=55296&&a<=57343?n+=t(ic.UTF16_SURROGATE,n-1-i,e,r,a):a<=s?n+=t(ic.OVERLONG,n-1-i,e,r,a):r.push(a))}return r}function lc(e,t=oc.current){t!=oc.current&&(nc.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const o=e.charCodeAt(t);if(t>=e.length||56320!=(64512&o))throw new Error("invalid utf-8 string");const i=65536+((1023&n)<<10)+(1023&o);r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(63&i|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return ns(r)}function uc(e,t){return cc(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}class dc extends Qa{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,lc(t))}decode(e){return uc(super.decode(e))}}class hc extends Za{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let o=r.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[n]))})),Object.freeze(e)}encode(e,t){return Ja(e,this.coders,t)}decode(e){return e.coerce(this.name,Ga(e,this.coders))}}const fc=new qi("abi/5.7.0"),pc=new RegExp(/^bytes([0-9]*)$/),mc=new RegExp(/^(u?int)([0-9]*)$/);const gc=new class{constructor(e){la(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Ha(e.name);case"bool":return new Ka(e.name);case"string":return new dc(e.name);case"bytes":return new $a(e.name);case"array":return new qa(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new hc((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new tc(e.name)}let t=e.type.match(mc);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&fc.throwArgumentError("invalid "+t[1]+" bit length","param",e),new rc(r/8,"int"===t[1],e.name)}if(t=e.type.match(pc),t){let r=parseInt(t[1]);return(0===r||r>32)&&fc.throwArgumentError("invalid bytes length","param",e),new ec(r,e.name)}return fc.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new La(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new za(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(ka.from(e))));return new hc(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&fc.throwError("types/values length mismatch",qi.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(ka.from(e)))),n=new hc(r,"_"),o=this._getWriter();return n.encode(o,t),o.data}decode(e,t,r){const n=e.map((e=>this._getCoder(ka.from(e))));return new hc(n,"_").decode(this._getReader(ns(t),r))}};function yc(e){return gs(lc(e))}function bc(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return ns(t)}function vc(e){e=ns(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function wc(e,t){null==t&&(t=1);const r=[],n=r.forEach,o=function(e,t){n.call(e,(function(e){t>0&&Array.isArray(e)?o(e,t-1):r.push(e)}))};return o(e,t),r}function xc(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),o=1,i=[0,1];for(let e=1;e<n;e++)i.push(o+=r());let s=r(),a=t;t+=s;let c=0,l=0;function u(){return 0==c&&(l=l<<8|e[t++],c=8),l>>--c&1}const d=Math.pow(2,31),h=d>>>1,f=h>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|u();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*o-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<i[n]?r=n:t=n}if(0==t)break;g.push(t);let s=y+Math.floor(b*i[t]/o),a=y+Math.floor(b*i[t+1]/o)-1;for(;0==((s^a)&h);)m=m<<1&p|u(),s=s<<1&p,a=a<<1&p|1;for(;s&~a&f;)m=m&h|m<<1&p>>>1|u(),s=s<<1^h,a=(a^h)<<1|h|1;y=s,b=1+a-s}let v=n-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return v+256+(e[a++]<<8|e[a++]);case 1:return v+e[a++];default:return t-1}}))}(e))}function Ec(e){return 1&e?~e>>1:e>>1}function Ac(e,t){let r=Array(e);for(let n=0,o=-1;n<e;n++)r[n]=o+=1+t();return r}function Rc(e,t){let r=Array(e);for(let n=0,o=0;n<e;n++)r[n]=o+=Ec(t());return r}function _c(e,t){let r=Ac(e(),e),n=e(),o=Ac(n,e),i=function(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}(n,e);for(let e=0;e<n;e++)for(let t=0;t<i[e];t++)r.push(o[e]+t);return t?r.map((e=>t[e])):r}function kc(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let o=0;o<t;o++)Rc(e,r).forEach(((e,t)=>n[t].push(e)));return n}function Sc(e,t){let r=1+t(),n=t(),o=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return wc(kc(o.length,1+e,t).map(((e,t)=>{const i=e[0],s=e.slice(1);return Array(o[t]).fill(void 0).map(((e,t)=>{let o=t*n;return[i+t*r,s.map((e=>e+o))]}))})))}function Nc(e,t){return kc(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Mc=xc(bc("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Tc=new Set(_c(Mc)),Oc=new Set(_c(Mc)),Ic=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(Sc(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Nc(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}(wc(t))}(Mc),Fc=function(e){let t=_c(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let o=_c(e,t);if(0==o.length)break;n.push({set:new Set(o),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let o=e(),i=o%3;o=o/3|0;let s=!!(1&o);return o>>=1,{branches:n,valid:i,fe0f:s,save:1==o,check:2==o}}()}(Mc);function Wc(e){return function(e,t=oc.current){return cc(lc(e,t))}(e)}function Cc(e){return e.filter((e=>65039!=e))}function jc(e){for(let t of e.split(".")){let e=Wc(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&45===e[2]&&45===e[3])throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function Uc(e){return jc(function(e,t){let r=Wc(e).reverse(),n=[];for(;r.length;){let e=Dc(r);if(e){n.push(...t(e));continue}let o=r.pop();if(Tc.has(o)){n.push(o);continue}if(Oc.has(o))continue;let i=Ic[o];if(!i)throw new Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`);n.push(...i)}return jc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,Cc))}function Dc(e,t){var r;let n,o,i=Fc,s=[],a=e.length;for(t&&(t.length=0);a;){let c=e[--a];if(i=null===(r=i.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!i)break;if(i.save)o=c;else if(i.check&&c===o)break;s.push(c),i.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),i.valid&&(n=s.slice(),2==i.valid&&n.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return n}const Bc=new qi("hash/5.7.0"),Vc=new Uint8Array(32);function Pc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Zc(e){const t=lc(Uc(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++){46===t[e]&&(r.push(Pc(t.slice(n,e))),n=e+1)}if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(Pc(t.slice(n))),r}function zc(e){"string"!=typeof e&&Bc.throwArgumentError("invalid ENS name; not a string","name",e);let t=Vc;const r=Zc(e);for(;r.length;)t=gs(os([t,gs(r.pop())]));return as(t)}Vc.fill(0);var Lc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Hc=new qi("hash/5.7.0"),Yc=new Uint8Array(32);Yc.fill(0);const Xc=ne.from(-1),Jc=ne.from(0),Gc=ne.from(1),qc=ne.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Kc=hs(Gc.toHexString(),32),Qc=hs(Jc.toHexString(),32),$c={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},el=["name","version","chainId","verifyingContract","salt"];function tl(e){return function(t){return"string"!=typeof t&&Hc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const rl={name:tl("name"),version:tl("version"),chainId:function(e){try{return ne.from(e).toString()}catch(e){}return Hc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Ms(e).toLowerCase()}catch(e){}return Hc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=ns(e);if(32!==t.length)throw new Error("bad length");return as(t)}catch(e){}return Hc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function nl(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&Hc.throwArgumentError("invalid numeric width","type",e);const o=qc.mask(r?n-1:n),i=r?o.add(Gc).mul(Xc):Jc;return function(t){const r=ne.from(t);return(r.lt(i)||r.gt(o))&&Hc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),hs(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Hc.throwArgumentError("invalid bytes width","type",e),function(t){return ns(t).length!==r&&Hc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=ns(e),r=t.length%32;return r?us([t,Yc.slice(r)]):as(t)}(t)}}}switch(e){case"address":return function(e){return hs(Ms(e),32)};case"bool":return function(e){return e?Kc:Qc};case"bytes":return function(e){return gs(e)};case"string":return function(e){return yc(e)}}return null}function ol(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class il{constructor(e){la(this,"types",Object.freeze(ga(e))),la(this,"_encoderCache",{}),la(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const o={};e[n].forEach((i=>{o[i.name]&&Hc.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(n)}`,"types",e),o[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&Hc.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e);nl(s)||(r[s]||Hc.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(n),t[n][s]=!0)}))}const o=Object.keys(r).filter((e=>0===r[e].length));0===o.length?Hc.throwArgumentError("missing primary type","types",e):o.length>1&&Hc.throwArgumentError(`ambiguous primary types or unused types: ${o.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),la(this,"primaryType",o[0]),function o(i,s){s[i]&&Hc.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",e),s[i]=!0,Object.keys(t[i]).forEach((e=>{r[e]&&(o(e,s),Object.keys(s).forEach((t=>{n[t][e]=!0})))})),delete s[i]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=ol(t,e[t])+r.map((t=>ol(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=nl(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Hc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let o=t.map(r);return this._types[e]&&(o=o.map(gs)),gs(us(o))}}const r=this.types[e];if(r){const t=yc(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?gs(n):n}));return n.unshift(t),us(n)}}return Hc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Hc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return gs(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(nl(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],o=parseInt(n[3]);return o>=0&&t.length!==o&&Hc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const o=this.types[e];return o?o.reduce(((e,{name:n,type:o})=>(e[n]=this._visit(o,t[n],r),e)),{}):Hc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new il(e)}static getPrimaryType(e){return il.from(e).primaryType}static hashStruct(e,t,r){return il.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=$c[r];n||Hc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>el.indexOf(e.name)-el.indexOf(t.name))),il.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return us(["0x1901",il.hashDomain(e),il.from(t).hash(r)])}static hash(e,t,r){return gs(il.encode(e,t,r))}static resolveNames(e,t,r,n){return Lc(this,void 0,void 0,(function*(){e=ha(e);const o={};e.verifyingContract&&!ss(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const i=il.from(t);i.visit(r,((e,t)=>("address"!==e||ss(t,20)||(o[t]="0x"),t)));for(const e in o)o[e]=yield n(e);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),r=i.visit(r,((e,t)=>"address"===e&&o[t]?o[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){il.hashDomain(e);const n={},o=[];el.forEach((t=>{const r=e[t];null!=r&&(n[t]=rl[t](r),o.push({name:t,type:$c[t]}))}));const i=il.from(t),s=ha(t);return s.EIP712Domain?Hc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):s.EIP712Domain=o,i.encode(r),{types:s,domain:n,primaryType:i.primaryType,message:i.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return as(ns(t));if(e.match(/^u?int/))return ne.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Hc.throwArgumentError("invalid string","value",t),t}return Hc.throwArgumentError("unsupported type","type",e)}))}}}const sl=new qi("abi/5.7.0");class al extends ya{}class cl extends ya{}class ll extends ya{}class ul extends ya{static isIndexed(e){return!(!e||!e._isIndexed)}}const dl={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function hl(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class fl{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,la(this,"fragments",t.map((e=>Na.from(e))).filter((e=>null!=e))),la(this,"_abiCoder",ua(new.target,"getAbiCoder")()),la(this,"functions",{}),la(this,"errors",{}),la(this,"events",{}),la(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void sl.warn("duplicate definition - constructor"):void la(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?sl.warn("duplicate definition - "+r):t[r]=e})),this.deploy||la(this,"deploy",Fa.from({payable:!1,type:"constructor"})),la(this,"_isInterface",!0)}format(e){e||(e=Ra.full),e===Ra.sighash&&sl.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ra.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return gc}static getAddress(e){return Ms(e)}static getSighash(e){return ls(yc(e.format()),0,4)}static getEventTopic(e){return yc(e.format())}getFunction(e){if(ss(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];sl.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?sl.throwArgumentError("no matching function","name",t):r.length>1&&sl.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Wa.fromString(e).format()];return t||sl.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(ss(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];sl.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?sl.throwArgumentError("no matching event","name",t):r.length>1&&sl.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Ma.fromString(e).format()];return t||sl.throwArgumentError("no matching event","signature",e),t}getError(e){if(ss(e)){const t=ua(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}sl.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?sl.throwArgumentError("no matching error","name",t):r.length>1&&sl.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Wa.fromString(e).format()];return t||sl.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return ua(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),ua(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=ns(t);return as(r.slice(0,4))!==this.getSighash(e)&&sl.throwArgumentError(`data signature does not match error ${e.name}.`,"data",as(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),as(os([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=ns(t);return as(r.slice(0,4))!==this.getSighash(e)&&sl.throwArgumentError(`data signature does not match function ${e.name}.`,"data",as(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),as(os([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=ns(t),n=null,o="",i=null,s=null,a=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=as(r.slice(0,4)),t=dl[e];if(t)i=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,a=t.signature,t.reason&&(n=i[0]),"Error"===s?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(i[0])}`:"Panic"===s&&(o=`; VM Exception while processing transaction: reverted with panic code ${i[0]}`);else try{const t=this.getError(e);i=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,a=t.format()}catch(e){}break}}return sl.throwError("call revert exception"+o,qi.errors.CALL_EXCEPTION,{method:e.format(),data:as(t),errorArgs:i,errorName:s,errorSignature:a,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),as(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&sl.throwError("too many arguments for "+e.format(),qi.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?yc(t):"bytes"===e.type?gs(as(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=ne.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),hs(as(t),32));for(t.forEach(((t,o)=>{let i=e.inputs[o];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?sl.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map((e=>n(i,e)))):r.push(n(i,t)):null!=t&&sl.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],o=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&sl.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,i)=>{const s=t[i];if(e.indexed)if("string"===e.type)r.push(yc(s));else if("bytes"===e.type)r.push(gs(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[s]))}else n.push(e),o.push(s)})),{data:this._abiCoder.encode(n,o),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);ss(r[0],32)&&r[0].toLowerCase()===t||sl.throwError("fragment/topic mismatch",qi.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],o=[],i=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(ka.fromObject({type:"bytes32",name:e.name})),i.push(!0)):(n.push(e),i.push(!1)):(o.push(e),i.push(!1))}));let s=null!=r?this._abiCoder.decode(n,os(r)):null,a=this._abiCoder.decode(o,t,!0),c=[],l=0,u=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==s)c[t]=new ul({_isIndexed:!0,hash:null});else if(i[t])c[t]=new ul({_isIndexed:!0,hash:s[u++]});else try{c[t]=s[u++]}catch(e){c[t]=e}else try{c[t]=a[l++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw hl(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e<c.length;e++){const t=c[e];t instanceof Error&&Object.defineProperty(c,e,{enumerable:!0,get:()=>{throw hl(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new cl({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:ne.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new al({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=as(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new ll({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}function pl(e,t,...r){return Bs(this,void 0,void 0,(function*(){const n=[];for(const e of r)for(const t of e)t.callData&&n.push(t.callData);const o=yield function(e,t,r){return Bs(this,void 0,void 0,(function*(){const n=yield ml(e,t,r),o=new Map;for(const{req:e,resp:t}of n)o.set(e,t);return e.map((e=>({req:e,resp:o.get(e)})))}))}(n,e,t),i=new Map;for(const{req:e,resp:t}of o)i.set(e,null==t?void 0:t.result);return r.map((e=>e.filter((e=>!e.callData||i.get(e.callData))).map(((e,t)=>e.processor(e.callData?i.get(e.callData):null,t)))))}))}function ml(e,t,r){return Bs(this,void 0,void 0,(function*(){let n=[e];e.length>800&&(n=i(e,800));let o=[];const s=n.map((e=>Bs(this,void 0,void 0,(function*(){const n=e.map((e=>[e.to,e.data])),i={data:t.interface.encodeFunctionData("aggregate",[n]),to:r};let s;try{s=yield t.provider.call(i)}catch(n){const i=e.length;if(i>20){const n=Math.floor(i/2),[s,a]=yield Promise.all([ml(e.slice(0,n),t,r),ml(e.slice(n,i),t,r)]);o=[...o,...s,...a]}else{const e="[sendCallReqs] error";console.error(e,n)}}if(void 0===s)throw new Error("Unexpected batch result");const[a,c]=gc.decode(["uint256","bytes[]"],s);if(e.length!==c.length)throw new Error("Unexpected length mismatch");return c.map(((t,r)=>({resp:{result:t},req:e[r]})))}))));return(yield Promise.allSettled(s)).filter((e=>"fulfilled"===e.status)).forEach((({value:e})=>{o=[...o,...e]})),o}))}function gl(e,t,r,n){if(!function(e){try{return Ms(e)}catch(e){return!1}}(e)||e===ea)throw Error(`Invalid 'address' parameter '${e}'.`);return new q(e,t,function(e,t){return t?function(e,t){return e.getSigner(t).connectUnchecked()}(e,t):e}(r,n))}function yl(){const{provider:e,account:t,chainId:r}=H(),[n,o]=f(!1),i=y((()=>sa[r]),[r]),s=g(((r,n)=>{if(e)return gl(r,n,e,t)}),[e,t]),a=g((e=>{if(!i)return;const{MULTI_CALL:t}=i,r=s(t,ia);return(()=>Bs(this,void 0,void 0,(function*(){if(r){o(!0);try{const[n]=yield pl(r,t,e);return n}catch(e){console.error("Contract: useMultiContract is error",e)}o(!1)}})))()}),[i,s]);return{getContract:s,contractConfig:i,call:a,loading:n}}var bl=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"isERC20",outputs:[{internalType:"bool",name:"isOk",type:"bool"},{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"judgeERC20",outputs:[{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"}];function vl(){const{provider:e,account:t}=H(),n=P(),o=Z(Ks);p((()=>{(()=>{Bs(this,void 0,void 0,(function*(){if(!e||!t)return;const o=yield e.getBalance(t);n((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_ETH_BALANCE",payload:e})})))(new r(o.toString()).div(1e18)))}))})()}),[e,t,n,o])}function wl(){const{provider:e,chainId:t}=H(),r=P(),n=g((()=>Bs(this,void 0,void 0,(function*(){if(!e||!t)return;const n=yield e.getBlockNumber();r((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_BLOCK_NUMBER",payload:e})})))(n))}))),[e,t]);return{updateBlockNumber:n}}var xl,El;!function(e){e.All="all",e.Default="default",e.Coingecko="coingecko"}(xl||(xl={})),function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(El||(El={}));var Al=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Rl=new qi("abstract-provider/5.7.0");class _l extends ya{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class kl{constructor(){Rl.checkAbstract(new.target,kl),la(this,"_isProvider",!0)}getFeeData(){return Al(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield da({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,o=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,o=ne.from("1500000000"),n=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:o,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}const Sl=new qi("networks/5.7.1");function Nl(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const o=["goerli","ropsten","rinkeby","sepolia"];try{const i=new t.PocketProvider(e,r.pocket);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const o=["ropsten"],i=new t.AnkrProvider(e,r.ankr);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let o=1;return null!=r.quorum?o=r.quorum:"homestead"===e&&(o=2),new t.FallbackProvider(n,o)}return n[0]};return t.renetwork=function(e){return Nl(e)},t}function Ml(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return Ml(e,t)},r}const Tl={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Nl("homestead")},Ol={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Nl("ropsten")},Il={chainId:63,name:"classicMordor",_defaultProvider:Ml("https://www.ethercluster.com/mordor","classicMordor")},Fl={unspecified:{chainId:0,name:"unspecified"},homestead:Tl,mainnet:Tl,morden:{chainId:2,name:"morden"},ropsten:Ol,testnet:Ol,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Nl("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Nl("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Nl("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Nl("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Ml("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Il,classicTestnet:Il,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Ml("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Nl("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Nl("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};class Wl{constructor(e){la(this,"alphabet",e),la(this,"base",e.length),la(this,"_alphabetMap",{}),la(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=ns(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e<t.length-1;++e)n+=this._leader;for(let e=r.length-1;e>=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let o=n;for(let e=0;e<t.length;++e)o+=t[e]*this.base,t[e]=255&o,o>>=8;for(;o>0;)t.push(255&o),o>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return ns(new Uint8Array(t.reverse()))}}new Wl("abcdefghijklmnopqrstuvwxyz234567");const Cl=new Wl("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var jl={},Ul={},Dl=Bl;function Bl(e,t){if(!e)throw new Error(t||"Assertion failed")}Bl.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Vl,Pl={exports:{}},Zl={exports:{}};!function(e){try{var t=require("util");if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=(Vl||(Vl=1,"function"==typeof Object.create?Zl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Zl.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),Zl.exports)}}(Pl);var zl=Dl,Ll=Pl.exports;function Hl(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function Yl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Xl(e){return 1===e.length?"0"+e:e}function Jl(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}Ul.inherits=Ll,Ul.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),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var i=e.charCodeAt(o);i<128?r[n++]=i:i<2048?(r[n++]=i>>6|192,r[n++]=63&i|128):Hl(e,o)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++o)),r[n++]=i>>18|240,r[n++]=i>>12&63|128,r[n++]=i>>6&63|128,r[n++]=63&i|128):(r[n++]=i>>12|224,r[n++]=i>>6&63|128,r[n++]=63&i|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},Ul.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=Xl(e[r].toString(16));return t},Ul.htonl=Yl,Ul.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e[n];"little"===t&&(o=Yl(o)),r+=Jl(o.toString(16))}return r},Ul.zero2=Xl,Ul.zero8=Jl,Ul.join32=function(e,t,r,n){var o=r-t;zl(o%4==0);for(var i=new Array(o/4),s=0,a=t;s<i.length;s++,a+=4){var c;c="big"===n?e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]:e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a],i[s]=c>>>0}return i},Ul.split32=function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n<e.length;n++,o+=4){var i=e[n];"big"===t?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},Ul.rotr32=function(e,t){return e>>>t|e<<32-t},Ul.rotl32=function(e,t){return e<<t|e>>>32-t},Ul.sum32=function(e,t){return e+t>>>0},Ul.sum32_3=function(e,t,r){return e+t+r>>>0},Ul.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},Ul.sum32_5=function(e,t,r,n,o){return e+t+r+n+o>>>0},Ul.sum64=function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,s=(i<n?1:0)+r+o;e[t]=s>>>0,e[t+1]=i},Ul.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},Ul.sum64_lo=function(e,t,r,n){return t+n>>>0},Ul.sum64_4_hi=function(e,t,r,n,o,i,s,a){var c=0,l=t;return c+=(l=l+n>>>0)<t?1:0,c+=(l=l+i>>>0)<i?1:0,e+r+o+s+(c+=(l=l+a>>>0)<a?1:0)>>>0},Ul.sum64_4_lo=function(e,t,r,n,o,i,s,a){return t+n+i+a>>>0},Ul.sum64_5_hi=function(e,t,r,n,o,i,s,a,c,l){var u=0,d=t;return u+=(d=d+n>>>0)<t?1:0,u+=(d=d+i>>>0)<i?1:0,u+=(d=d+a>>>0)<a?1:0,e+r+o+s+c+(u+=(d=d+l>>>0)<l?1:0)>>>0},Ul.sum64_5_lo=function(e,t,r,n,o,i,s,a,c,l){return t+n+i+a+l>>>0},Ul.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},Ul.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},Ul.shr64_hi=function(e,t,r){return e>>>r},Ul.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var Gl={},ql=Ul,Kl=Dl;function Ql(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Gl.BlockHash=Ql,Ql.prototype.update=function(e,t){if(e=ql.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=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=ql.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},Ql.prototype.digest=function(e){return this.update(this._pad()),Kl(null===this.pending),this._digest(e)},Ql.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n};var $l={},eu={},tu=Ul.rotr32;function ru(e,t,r){return e&t^~e&r}function nu(e,t,r){return e&t^e&r^t&r}function ou(e,t,r){return e^t^r}eu.ft_1=function(e,t,r,n){return 0===e?ru(t,r,n):1===e||3===e?ou(t,r,n):2===e?nu(t,r,n):void 0},eu.ch32=ru,eu.maj32=nu,eu.p32=ou,eu.s0_256=function(e){return tu(e,2)^tu(e,13)^tu(e,22)},eu.s1_256=function(e){return tu(e,6)^tu(e,11)^tu(e,25)},eu.g0_256=function(e){return tu(e,7)^tu(e,18)^e>>>3},eu.g1_256=function(e){return tu(e,17)^tu(e,19)^e>>>10};var iu=Ul,su=Gl,au=eu,cu=iu.rotl32,lu=iu.sum32,uu=iu.sum32_5,du=au.ft_1,hu=su.BlockHash,fu=[1518500249,1859775393,2400959708,3395469782];function pu(){if(!(this instanceof pu))return new pu;hu.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}iu.inherits(pu,hu);var mu=pu;pu.blockSize=512,pu.outSize=160,pu.hmacStrength=80,pu.padLength=64,pu.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=cu(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4];for(n=0;n<r.length;n++){var l=~~(n/20),u=uu(cu(o,5),du(l,i,s,a),c,r[n],fu[l]);c=a,a=s,s=cu(i,30),i=o,o=u}this.h[0]=lu(this.h[0],o),this.h[1]=lu(this.h[1],i),this.h[2]=lu(this.h[2],s),this.h[3]=lu(this.h[3],a),this.h[4]=lu(this.h[4],c)},pu.prototype._digest=function(e){return"hex"===e?iu.toHex32(this.h,"big"):iu.split32(this.h,"big")};var gu=Ul,yu=Gl,bu=eu,vu=Dl,wu=gu.sum32,xu=gu.sum32_4,Eu=gu.sum32_5,Au=bu.ch32,Ru=bu.maj32,_u=bu.s0_256,ku=bu.s1_256,Su=bu.g0_256,Nu=bu.g1_256,Mu=yu.BlockHash,Tu=[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 Ou(){if(!(this instanceof Ou))return new Ou;Mu.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Tu,this.W=new Array(64)}gu.inherits(Ou,Mu);var Iu=Ou;Ou.blockSize=512,Ou.outSize=256,Ou.hmacStrength=192,Ou.padLength=64,Ou.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=xu(Nu(r[n-2]),r[n-7],Su(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],l=this.h[5],u=this.h[6],d=this.h[7];for(vu(this.k.length===r.length),n=0;n<r.length;n++){var h=Eu(d,ku(c),Au(c,l,u),this.k[n],r[n]),f=wu(_u(o),Ru(o,i,s));d=u,u=l,l=c,c=wu(a,h),a=s,s=i,i=o,o=wu(h,f)}this.h[0]=wu(this.h[0],o),this.h[1]=wu(this.h[1],i),this.h[2]=wu(this.h[2],s),this.h[3]=wu(this.h[3],a),this.h[4]=wu(this.h[4],c),this.h[5]=wu(this.h[5],l),this.h[6]=wu(this.h[6],u),this.h[7]=wu(this.h[7],d)},Ou.prototype._digest=function(e){return"hex"===e?gu.toHex32(this.h,"big"):gu.split32(this.h,"big")};var Fu=Ul,Wu=Iu;function Cu(){if(!(this instanceof Cu))return new Cu;Wu.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Fu.inherits(Cu,Wu);var ju=Cu;Cu.blockSize=512,Cu.outSize=224,Cu.hmacStrength=192,Cu.padLength=64,Cu.prototype._digest=function(e){return"hex"===e?Fu.toHex32(this.h.slice(0,7),"big"):Fu.split32(this.h.slice(0,7),"big")};var Uu=Ul,Du=Gl,Bu=Dl,Vu=Uu.rotr64_hi,Pu=Uu.rotr64_lo,Zu=Uu.shr64_hi,zu=Uu.shr64_lo,Lu=Uu.sum64,Hu=Uu.sum64_hi,Yu=Uu.sum64_lo,Xu=Uu.sum64_4_hi,Ju=Uu.sum64_4_lo,Gu=Uu.sum64_5_hi,qu=Uu.sum64_5_lo,Ku=Du.BlockHash,Qu=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function $u(){if(!(this instanceof $u))return new $u;Ku.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Qu,this.W=new Array(160)}Uu.inherits($u,Ku);var ed=$u;function td(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function rd(e,t,r,n,o,i){var s=t&n^~t&i;return s<0&&(s+=4294967296),s}function nd(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function od(e,t,r,n,o,i){var s=t&n^t&i^n&i;return s<0&&(s+=4294967296),s}function id(e,t){var r=Vu(e,t,28)^Vu(t,e,2)^Vu(t,e,7);return r<0&&(r+=4294967296),r}function sd(e,t){var r=Pu(e,t,28)^Pu(t,e,2)^Pu(t,e,7);return r<0&&(r+=4294967296),r}function ad(e,t){var r=Vu(e,t,14)^Vu(e,t,18)^Vu(t,e,9);return r<0&&(r+=4294967296),r}function cd(e,t){var r=Pu(e,t,14)^Pu(e,t,18)^Pu(t,e,9);return r<0&&(r+=4294967296),r}function ld(e,t){var r=Vu(e,t,1)^Vu(e,t,8)^Zu(e,t,7);return r<0&&(r+=4294967296),r}function ud(e,t){var r=Pu(e,t,1)^Pu(e,t,8)^zu(e,t,7);return r<0&&(r+=4294967296),r}function dd(e,t){var r=Vu(e,t,19)^Vu(t,e,29)^Zu(e,t,6);return r<0&&(r+=4294967296),r}function hd(e,t){var r=Pu(e,t,19)^Pu(t,e,29)^zu(e,t,6);return r<0&&(r+=4294967296),r}$u.blockSize=1024,$u.outSize=512,$u.hmacStrength=192,$u.padLength=128,$u.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var o=dd(r[n-4],r[n-3]),i=hd(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=ld(r[n-30],r[n-29]),l=ud(r[n-30],r[n-29]),u=r[n-32],d=r[n-31];r[n]=Xu(o,i,s,a,c,l,u,d),r[n+1]=Ju(o,i,s,a,c,l,u,d)}},$u.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],o=this.h[1],i=this.h[2],s=this.h[3],a=this.h[4],c=this.h[5],l=this.h[6],u=this.h[7],d=this.h[8],h=this.h[9],f=this.h[10],p=this.h[11],m=this.h[12],g=this.h[13],y=this.h[14],b=this.h[15];Bu(this.k.length===r.length);for(var v=0;v<r.length;v+=2){var w=y,x=b,E=ad(d,h),A=cd(d,h),R=td(d,h,f,p,m),_=rd(d,h,f,p,m,g),k=this.k[v],S=this.k[v+1],N=r[v],M=r[v+1],T=Gu(w,x,E,A,R,_,k,S,N,M),O=qu(w,x,E,A,R,_,k,S,N,M);w=id(n,o),x=sd(n,o),E=nd(n,o,i,s,a),A=od(n,o,i,s,a,c);var I=Hu(w,x,E,A),F=Yu(w,x,E,A);y=m,b=g,m=f,g=p,f=d,p=h,d=Hu(l,u,T,O),h=Yu(u,u,T,O),l=a,u=c,a=i,c=s,i=n,s=o,n=Hu(T,O,I,F),o=Yu(T,O,I,F)}Lu(this.h,0,n,o),Lu(this.h,2,i,s),Lu(this.h,4,a,c),Lu(this.h,6,l,u),Lu(this.h,8,d,h),Lu(this.h,10,f,p),Lu(this.h,12,m,g),Lu(this.h,14,y,b)},$u.prototype._digest=function(e){return"hex"===e?Uu.toHex32(this.h,"big"):Uu.split32(this.h,"big")};var fd=Ul,pd=ed;function md(){if(!(this instanceof md))return new md;pd.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}fd.inherits(md,pd);var gd=md;md.blockSize=1024,md.outSize=384,md.hmacStrength=192,md.padLength=128,md.prototype._digest=function(e){return"hex"===e?fd.toHex32(this.h.slice(0,12),"big"):fd.split32(this.h.slice(0,12),"big")},$l.sha1=mu,$l.sha224=ju,$l.sha256=Iu,$l.sha384=gd,$l.sha512=ed;var yd={},bd=Ul,vd=Gl,wd=bd.rotl32,xd=bd.sum32,Ed=bd.sum32_3,Ad=bd.sum32_4,Rd=vd.BlockHash;function _d(){if(!(this instanceof _d))return new _d;Rd.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function kd(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function Sd(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Nd(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}bd.inherits(_d,Rd),yd.ripemd160=_d,_d.blockSize=512,_d.outSize=160,_d.hmacStrength=192,_d.padLength=64,_d.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],o=this.h[2],i=this.h[3],s=this.h[4],a=r,c=n,l=o,u=i,d=s,h=0;h<80;h++){var f=xd(wd(Ad(r,kd(h,n,o,i),e[Md[h]+t],Sd(h)),Od[h]),s);r=s,s=i,i=wd(o,10),o=n,n=f,f=xd(wd(Ad(a,kd(79-h,c,l,u),e[Td[h]+t],Nd(h)),Id[h]),d),a=d,d=u,u=wd(l,10),l=c,c=f}f=Ed(this.h[1],o,u),this.h[1]=Ed(this.h[2],i,d),this.h[2]=Ed(this.h[3],s,a),this.h[3]=Ed(this.h[4],r,c),this.h[4]=Ed(this.h[0],n,l),this.h[0]=f},_d.prototype._digest=function(e){return"hex"===e?bd.toHex32(this.h,"little"):bd.split32(this.h,"little")};var Md=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Td=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Od=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Id=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Fd=Ul,Wd=Dl;function Cd(e,t,r){if(!(this instanceof Cd))return new Cd(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(Fd.toArray(t,r))}var jd=Cd;Cd.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),Wd(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},Cd.prototype.update=function(e,t){return this.inner.update(e,t),this},Cd.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=jl;t.utils=Ul,t.common=Gl,t.sha=$l,t.ripemd=yd,t.hmac=jd,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}();var Ud=jl;function Dd(e){return"0x"+Ud.sha256().update(ns(e)).digest("hex")}new qi("sha2/5.7.0");var Bd=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};function Vd(e,t){return Bd(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),o=yield n.arrayBuffer(),i={};return n.headers.forEach?n.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{i[e.toLowerCase()]=n.headers.get(e)})),{headers:i,statusCode:n.status,statusMessage:n.statusText,body:ns(new Uint8Array(o))}}))}var Pd=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Zd=new qi("web/5.7.1");function zd(e){return new Promise((t=>{setTimeout(t,e)}))}function Ld(e,t){if(null==e)return null;if("string"==typeof e)return e;if(es(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return uc(e)}catch(e){}return as(e)}return e}function Hd(e,t,r){let n=null;if(null!=t){n=lc(t);const r="string"==typeof e?{url:e}:ha(e);if(r.headers){const e=0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length;e||(r.headers=ha(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return function(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Zd.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const o="object"==typeof e?e.throttleCallback:null,i="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Zd.assertArgument(i>0&&i%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);const s="object"==typeof e&&!!e.errorPassThrough,a={};let c=null;const l={method:"GET"};let u=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||Zd.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)a[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Zd.throwError("basic authentication requires a secure https url",qi.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;a.authorization={key:"Authorization",value:"Basic "+vc(lc(t))}}null!=e.skipFetchSetup&&(l.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(l.fetchOptions=ha(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),f=c?c.match(h):null;if(f)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":f[1]||"text/plain"},body:f[2]?bc(f[3]):(p=f[3],lc(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){Zd.throwError("processing response error",qi.errors.SERVER_ERROR,{body:Ld(f[1],f[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var p;t&&(l.method="POST",l.body=t,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(a).forEach((e=>{const t=a[e];m[t.key]=t.value})),l.headers=m;const g=function(){let e=null;return{promise:new Promise((function(t,r){d&&(e=setTimeout((()=>{null!=e&&(e=null,r(Zd.makeError("timeout",qi.errors.TIMEOUT,{requestBody:Ld(l.body,m["content-type"]),requestMethod:l.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return Pd(this,void 0,void 0,(function*(){for(let e=0;e<n;e++){let t=null;try{if(t=yield Vd(c,l),e<n)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===l.method&&e.match(/^https:/)){c=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(o&&(r=yield o(e,c)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):i*parseInt(String(Math.random()*Math.pow(2,e))),yield zd(r);continue}}}catch(e){t=e.response,null==t&&(g.cancel(),Zd.throwError("missing response",qi.errors.SERVER_ERROR,{requestBody:Ld(l.body,m["content-type"]),requestMethod:l.method,serverError:e,url:c}))}let a=t.body;if(u&&304===t.statusCode?a=null:!s&&(t.statusCode<200||t.statusCode>=300)&&(g.cancel(),Zd.throwError("bad response",qi.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Ld(a,t.headers?t.headers["content-type"]:null),requestBody:Ld(l.body,m["content-type"]),requestMethod:l.method,url:c})),r)try{const e=yield r(a,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e<n){let t=!0;if(o&&(t=yield o(e,c)),t){const t=i*parseInt(String(Math.random()*Math.pow(2,e)));yield zd(t);continue}}g.cancel(),Zd.throwError("processing response error",qi.errors.SERVER_ERROR,{body:Ld(a,t.headers?t.headers["content-type"]:null),error:r,requestBody:Ld(l.body,m["content-type"]),requestMethod:l.method,url:c})}return g.cancel(),a}return Zd.throwError("failed response",qi.errors.SERVER_ERROR,{requestBody:Ld(l.body,m["content-type"]),requestMethod:l.method,url:c})}))}();return Promise.race([g.promise,y])}(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(uc(e))}catch(t){Zd.throwError("invalid JSON",qi.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Yd(e,t){return t||(t={}),null==(t=ha(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let o=null,i=!1;const s=()=>!i&&(i=!0,o&&clearTimeout(o),!0);t.timeout&&(o=setTimeout((()=>{s()&&n(new Error("timeout"))}),t.timeout));const a=t.retryLimit;let c=0;!function o(){return e().then((function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",o);else if(t.onceBlock)t.onceBlock.once("block",o);else if(!i){if(c++,c>a)return void(s()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(o,e)}return null}),(function(e){s()&&n(e)}))}()}))}for(var Xd="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Jd={},Gd=0;Gd<Xd.length;Gd++){var qd=Xd.charAt(Gd);if(void 0!==Jd[qd])throw new TypeError(qd+" is ambiguous");Jd[qd]=Gd}function Kd(e){var t=e>>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 Qd(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=Kd(t)^n>>5}for(t=Kd(t),r=0;r<e.length;++r){var o=e.charCodeAt(r);t=Kd(t)^31&o}return t}function $d(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)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 i=e.slice(0,o),s=e.slice(o+1);if(s.length<6)return"Data too short";var a=Qd(i);if("string"==typeof a)return a;for(var c=[],l=0;l<s.length;++l){var u=s.charAt(l),d=Jd[u];if(void 0===d)return"Unknown character "+u;a=Kd(a)^d,l+6>=s.length||c.push(d)}return 1!==a?"Invalid checksum for "+e:{prefix:i,words:c}}function eh(e,t,r,n){for(var o=0,i=0,s=(1<<r)-1,a=[],c=0;c<e.length;++c)for(o=o<<t|e[c],i+=t;i>=r;)i-=r,a.push(o>>i&s);if(n)i>0&&a.push(o<<r-i&s);else{if(i>=t)return"Excess padding";if(o<<r-i&s)return"Non-zero padding"}return a}var th={decodeUnsafe:function(){var e=$d.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=$d.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");var n=Qd(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var o=e+"1",i=0;i<t.length;++i){var s=t[i];if(s>>5!=0)throw new Error("Non 5-bit word");n=Kd(n)^s,o+=Xd.charAt(s)}for(i=0;i<6;++i)n=Kd(n);for(n^=1,i=0;i<6;++i){o+=Xd.charAt(n>>5*(5-i)&31)}return o},toWordsUnsafe:function(e){var t=eh(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=eh(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=eh(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=eh(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}};const rh="providers/5.7.2";var nh={exports:{}};!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(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 i;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,n,o){for(var i=0,s=0,a=Math.min(e.length,n),c=t;c<a;c++){var l=e.charCodeAt(c)-48;i*=o,s=l>=49?l-49+10:l>=17?l-17+10:l,r(l>=0&&s<o,"Invalid character"),i+=s}return i}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,n):(this._parseBase(e,t,o),"le"===n&&this._initArray(this.toArray(),t,n)))},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,s,a=0;if("be"===n)for(o=e.length-1,i=0;o>=0;o-=3)s=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===n)for(o=0,i=0;o<e.length;o+=3)s=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);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<this.length;n++)this.words[n]=0;var o,i=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=a(e,t,n)<<i,this.words[s]|=67108863&o,i>=18?(i-=18,s+=1,this.words[s]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=a(e,t,n)<<i,this.words[s]|=67108863&o,i>=18?(i-=18,s+=1,this.words[s]|=o>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,s=i%n,a=Math.min(i,i-s)+r,l=0,u=r;u<a;u+=n)l=c(e,u,u+n,t),this.imuln(o),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==s){var d=1;for(l=c(e,u,e.length,t),u=0;u<s;u++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){l(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(e){o.prototype.inspect=u}else o.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],s=o*i,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var l=1;l<n;l++){for(var u=c>>>26,d=67108863&c,h=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=h;f++){var p=l-f|0;u+=(s=(o=0|e.words[p])*(i=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[l]=0|d,c=0|u}return 0!==c?r.words[l]=0|c:r.length--,r._strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<o|i)).toString(16);i=a>>>24-o&16777215,(o+=2)>=26&&(o-=26,s--),n=0!==i||s!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=h[e],u=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(u).toString(e);n=(p=p.idivn(u)).isZero()?m+n:d[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},i&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(i,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,o),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,o=0,i=0;o<this.length;o++){var s=this.words[o]<<i|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===i?(r<e.length&&(e[r++]=s>>24&255),n=0,i=0):(n=s>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,o=0,i=0;o<this.length;o++){var s=this.words[o]<<i|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===i?(r>=0&&(e[r--]=s>>24&255),n=0,i=0):(n=s>>>24,i+=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;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.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;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.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;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.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){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<o:this.words[n]&~(1<<o),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.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,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,s=0;s<n.length;s++)i=(t=(0|r.words[s])-(0|n.words[s])+i)>>26,this.words[s]=67108863&t;for(;0!==i&&s<r.length;s++)i=(t=(0|r.words[s])+i)>>26,this.words[s]=67108863&t;if(0===i&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,o,i,s=e.words,a=t.words,c=r.words,l=0,u=0|s[0],d=8191&u,h=u>>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,E=0|s[4],A=8191&E,R=E>>>13,_=0|s[5],k=8191&_,S=_>>>13,N=0|s[6],M=8191&N,T=N>>>13,O=0|s[7],I=8191&O,F=O>>>13,W=0|s[8],C=8191&W,j=W>>>13,U=0|s[9],D=8191&U,B=U>>>13,V=0|a[0],P=8191&V,Z=V>>>13,z=0|a[1],L=8191&z,H=z>>>13,Y=0|a[2],X=8191&Y,J=Y>>>13,G=0|a[3],q=8191&G,K=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,oe=0|a[6],ie=8191&oe,se=oe>>>13,ae=0|a[7],ce=8191&ae,le=ae>>>13,ue=0|a[8],de=8191&ue,he=ue>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(l+(n=Math.imul(d,P))|0)+((8191&(o=(o=Math.imul(d,Z))+Math.imul(h,P)|0))<<13)|0;l=((i=Math.imul(h,Z))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,P),o=(o=Math.imul(p,Z))+Math.imul(m,P)|0,i=Math.imul(m,Z);var ye=(l+(n=n+Math.imul(d,L)|0)|0)+((8191&(o=(o=o+Math.imul(d,H)|0)+Math.imul(h,L)|0))<<13)|0;l=((i=i+Math.imul(h,H)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,P),o=(o=Math.imul(y,Z))+Math.imul(b,P)|0,i=Math.imul(b,Z),n=n+Math.imul(p,L)|0,o=(o=o+Math.imul(p,H)|0)+Math.imul(m,L)|0,i=i+Math.imul(m,H)|0;var be=(l+(n=n+Math.imul(d,X)|0)|0)+((8191&(o=(o=o+Math.imul(d,J)|0)+Math.imul(h,X)|0))<<13)|0;l=((i=i+Math.imul(h,J)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,P),o=(o=Math.imul(w,Z))+Math.imul(x,P)|0,i=Math.imul(x,Z),n=n+Math.imul(y,L)|0,o=(o=o+Math.imul(y,H)|0)+Math.imul(b,L)|0,i=i+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,o=(o=o+Math.imul(p,J)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,J)|0;var ve=(l+(n=n+Math.imul(d,q)|0)|0)+((8191&(o=(o=o+Math.imul(d,K)|0)+Math.imul(h,q)|0))<<13)|0;l=((i=i+Math.imul(h,K)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(A,P),o=(o=Math.imul(A,Z))+Math.imul(R,P)|0,i=Math.imul(R,Z),n=n+Math.imul(w,L)|0,o=(o=o+Math.imul(w,H)|0)+Math.imul(x,L)|0,i=i+Math.imul(x,H)|0,n=n+Math.imul(y,X)|0,o=(o=o+Math.imul(y,J)|0)+Math.imul(b,X)|0,i=i+Math.imul(b,J)|0,n=n+Math.imul(p,q)|0,o=(o=o+Math.imul(p,K)|0)+Math.imul(m,q)|0,i=i+Math.imul(m,K)|0;var we=(l+(n=n+Math.imul(d,$)|0)|0)+((8191&(o=(o=o+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;l=((i=i+Math.imul(h,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(k,P),o=(o=Math.imul(k,Z))+Math.imul(S,P)|0,i=Math.imul(S,Z),n=n+Math.imul(A,L)|0,o=(o=o+Math.imul(A,H)|0)+Math.imul(R,L)|0,i=i+Math.imul(R,H)|0,n=n+Math.imul(w,X)|0,o=(o=o+Math.imul(w,J)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(y,q)|0,o=(o=o+Math.imul(y,K)|0)+Math.imul(b,q)|0,i=i+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,$)|0,i=i+Math.imul(m,ee)|0;var xe=(l+(n=n+Math.imul(d,re)|0)|0)+((8191&(o=(o=o+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;l=((i=i+Math.imul(h,ne)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(M,P),o=(o=Math.imul(M,Z))+Math.imul(T,P)|0,i=Math.imul(T,Z),n=n+Math.imul(k,L)|0,o=(o=o+Math.imul(k,H)|0)+Math.imul(S,L)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,J)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,J)|0,n=n+Math.imul(w,q)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(x,q)|0,i=i+Math.imul(x,K)|0,n=n+Math.imul(y,$)|0,o=(o=o+Math.imul(y,ee)|0)+Math.imul(b,$)|0,i=i+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0;var Ee=(l+(n=n+Math.imul(d,ie)|0)|0)+((8191&(o=(o=o+Math.imul(d,se)|0)+Math.imul(h,ie)|0))<<13)|0;l=((i=i+Math.imul(h,se)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(I,P),o=(o=Math.imul(I,Z))+Math.imul(F,P)|0,i=Math.imul(F,Z),n=n+Math.imul(M,L)|0,o=(o=o+Math.imul(M,H)|0)+Math.imul(T,L)|0,i=i+Math.imul(T,H)|0,n=n+Math.imul(k,X)|0,o=(o=o+Math.imul(k,J)|0)+Math.imul(S,X)|0,i=i+Math.imul(S,J)|0,n=n+Math.imul(A,q)|0,o=(o=o+Math.imul(A,K)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(x,$)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(y,re)|0,o=(o=o+Math.imul(y,ne)|0)+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,se)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,se)|0;var Ae=(l+(n=n+Math.imul(d,ce)|0)|0)+((8191&(o=(o=o+Math.imul(d,le)|0)+Math.imul(h,ce)|0))<<13)|0;l=((i=i+Math.imul(h,le)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,P),o=(o=Math.imul(C,Z))+Math.imul(j,P)|0,i=Math.imul(j,Z),n=n+Math.imul(I,L)|0,o=(o=o+Math.imul(I,H)|0)+Math.imul(F,L)|0,i=i+Math.imul(F,H)|0,n=n+Math.imul(M,X)|0,o=(o=o+Math.imul(M,J)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,J)|0,n=n+Math.imul(k,q)|0,o=(o=o+Math.imul(k,K)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(A,$)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(y,ie)|0,o=(o=o+Math.imul(y,se)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,le)|0)+Math.imul(m,ce)|0,i=i+Math.imul(m,le)|0;var Re=(l+(n=n+Math.imul(d,de)|0)|0)+((8191&(o=(o=o+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;l=((i=i+Math.imul(h,he)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,P),o=(o=Math.imul(D,Z))+Math.imul(B,P)|0,i=Math.imul(B,Z),n=n+Math.imul(C,L)|0,o=(o=o+Math.imul(C,H)|0)+Math.imul(j,L)|0,i=i+Math.imul(j,H)|0,n=n+Math.imul(I,X)|0,o=(o=o+Math.imul(I,J)|0)+Math.imul(F,X)|0,i=i+Math.imul(F,J)|0,n=n+Math.imul(M,q)|0,o=(o=o+Math.imul(M,K)|0)+Math.imul(T,q)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(k,$)|0,o=(o=o+Math.imul(k,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(A,re)|0,o=(o=o+Math.imul(A,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,se)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,se)|0,n=n+Math.imul(y,ce)|0,o=(o=o+Math.imul(y,le)|0)+Math.imul(b,ce)|0,i=i+Math.imul(b,le)|0,n=n+Math.imul(p,de)|0,o=(o=o+Math.imul(p,he)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,he)|0;var _e=(l+(n=n+Math.imul(d,pe)|0)|0)+((8191&(o=(o=o+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;l=((i=i+Math.imul(h,me)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(D,L),o=(o=Math.imul(D,H))+Math.imul(B,L)|0,i=Math.imul(B,H),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,J)|0)+Math.imul(j,X)|0,i=i+Math.imul(j,J)|0,n=n+Math.imul(I,q)|0,o=(o=o+Math.imul(I,K)|0)+Math.imul(F,q)|0,i=i+Math.imul(F,K)|0,n=n+Math.imul(M,$)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,n=n+Math.imul(k,re)|0,o=(o=o+Math.imul(k,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,se)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,se)|0,n=n+Math.imul(w,ce)|0,o=(o=o+Math.imul(w,le)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,le)|0,n=n+Math.imul(y,de)|0,o=(o=o+Math.imul(y,he)|0)+Math.imul(b,de)|0,i=i+Math.imul(b,he)|0;var ke=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,X),o=(o=Math.imul(D,J))+Math.imul(B,X)|0,i=Math.imul(B,J),n=n+Math.imul(C,q)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(j,q)|0,i=i+Math.imul(j,K)|0,n=n+Math.imul(I,$)|0,o=(o=o+Math.imul(I,ee)|0)+Math.imul(F,$)|0,i=i+Math.imul(F,ee)|0,n=n+Math.imul(M,re)|0,o=(o=o+Math.imul(M,ne)|0)+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,n=n+Math.imul(k,ie)|0,o=(o=o+Math.imul(k,se)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,se)|0,n=n+Math.imul(A,ce)|0,o=(o=o+Math.imul(A,le)|0)+Math.imul(R,ce)|0,i=i+Math.imul(R,le)|0,n=n+Math.imul(w,de)|0,o=(o=o+Math.imul(w,he)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,he)|0;var Se=(l+(n=n+Math.imul(y,pe)|0)|0)+((8191&(o=(o=o+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;l=((i=i+Math.imul(b,me)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),o=(o=Math.imul(D,K))+Math.imul(B,q)|0,i=Math.imul(B,K),n=n+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(I,re)|0,o=(o=o+Math.imul(I,ne)|0)+Math.imul(F,re)|0,i=i+Math.imul(F,ne)|0,n=n+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,se)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,se)|0,n=n+Math.imul(k,ce)|0,o=(o=o+Math.imul(k,le)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,le)|0,n=n+Math.imul(A,de)|0,o=(o=o+Math.imul(A,he)|0)+Math.imul(R,de)|0,i=i+Math.imul(R,he)|0;var Ne=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;l=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(D,$),o=(o=Math.imul(D,ee))+Math.imul(B,$)|0,i=Math.imul(B,ee),n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(I,ie)|0,o=(o=o+Math.imul(I,se)|0)+Math.imul(F,ie)|0,i=i+Math.imul(F,se)|0,n=n+Math.imul(M,ce)|0,o=(o=o+Math.imul(M,le)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,le)|0,n=n+Math.imul(k,de)|0,o=(o=o+Math.imul(k,he)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,he)|0;var Me=(l+(n=n+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,me)|0)+Math.imul(R,pe)|0))<<13)|0;l=((i=i+Math.imul(R,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,re),o=(o=Math.imul(D,ne))+Math.imul(B,re)|0,i=Math.imul(B,ne),n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,se)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,se)|0,n=n+Math.imul(I,ce)|0,o=(o=o+Math.imul(I,le)|0)+Math.imul(F,ce)|0,i=i+Math.imul(F,le)|0,n=n+Math.imul(M,de)|0,o=(o=o+Math.imul(M,he)|0)+Math.imul(T,de)|0,i=i+Math.imul(T,he)|0;var Te=(l+(n=n+Math.imul(k,pe)|0)|0)+((8191&(o=(o=o+Math.imul(k,me)|0)+Math.imul(S,pe)|0))<<13)|0;l=((i=i+Math.imul(S,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,ie),o=(o=Math.imul(D,se))+Math.imul(B,ie)|0,i=Math.imul(B,se),n=n+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,le)|0)+Math.imul(j,ce)|0,i=i+Math.imul(j,le)|0,n=n+Math.imul(I,de)|0,o=(o=o+Math.imul(I,he)|0)+Math.imul(F,de)|0,i=i+Math.imul(F,he)|0;var Oe=(l+(n=n+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(T,pe)|0))<<13)|0;l=((i=i+Math.imul(T,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,ce),o=(o=Math.imul(D,le))+Math.imul(B,ce)|0,i=Math.imul(B,le),n=n+Math.imul(C,de)|0,o=(o=o+Math.imul(C,he)|0)+Math.imul(j,de)|0,i=i+Math.imul(j,he)|0;var Ie=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(o=(o=o+Math.imul(I,me)|0)+Math.imul(F,pe)|0))<<13)|0;l=((i=i+Math.imul(F,me)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,de),o=(o=Math.imul(D,he))+Math.imul(B,de)|0,i=Math.imul(B,he);var Fe=(l+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,me)|0)+Math.imul(j,pe)|0))<<13)|0;l=((i=i+Math.imul(j,me)|0)+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863;var We=(l+(n=Math.imul(D,pe))|0)+((8191&(o=(o=Math.imul(D,me))+Math.imul(B,pe)|0))<<13)|0;return l=((i=Math.imul(B,me))+(o>>>13)|0)+(We>>>26)|0,We&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ee,c[7]=Ae,c[8]=Re,c[9]=_e,c[10]=ke,c[11]=Se,c[12]=Ne,c[13]=Me,c[14]=Te,c[15]=Oe,c[16]=Ie,c[17]=Fe,c[18]=We,0!==l&&(c[19]=l,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var s=o;o=0;for(var a=67108863&n,c=Math.min(i,t.length-1),l=Math.max(0,i-e.length+1);l<=c;l++){var u=i-l,d=(0|e.words[u])*(0|t.words[l]),h=67108863&d;a=67108863&(h=h+a|0),o+=(s=(s=s+(d/67108864|0)|0)+(h>>>26)|0)>>>26,s&=67108863}r.words[i]=a,n=s,s=o}return 0!==n?r.words[i]=n:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}Math.imul||(m=p),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?p(this,e,t):r<1024?g(this,e,t):y(this,e,t)},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,o=0;o<this.length;o++){var i=(0|this.words[o])*e,s=(67108863&i)+(67108863&n);n>>=26,n+=i/67108864|0,n+=s>>>26,this.words[o]=67108863&s}return 0!==n&&(this.words[o]=n,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<t.length;r++){var n=r/26|0,o=r%26;t[r]=e.words[n]>>>o&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&i,c=(0|this.words[t])-a<<n;this.words[t]=c|s,s=a>>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this._strip()},o.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,n){var o;r("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,s=Math.min((e-i)/26,this.length),a=67108863^67108863>>>i<<i,c=n;if(o-=s,o=Math.max(0,o),c){for(var l=0;l<s;l++)c.words[l]=this.words[l];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var u=0;for(l=this.length-1;l>=0&&(0!==u||l>=o);l--){var d=0|this.words[l];this.words[l]=u<<26-i|d>>>i,u=d&a}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},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){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<<t;return!(this.length<=n||!(this.words[n]&o))},o.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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(r("number"==typeof e),r(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,n){var o,i,s=e.length+n;this._expand(s);var a=0;for(o=0;o<e.length;o++){i=(0|this.words[o+n])+a;var c=(0|e.words[o])*t;a=((i-=67108863&c)>>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)a=(i=(0|this.words[o+n])+a)>>26,this.words[o+n]=67108863&i;if(0===a)return this._strip();for(r(-1===a),a=0,o=0;o<this.length;o++)a=(i=-(0|this.words[o])+a)>>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var l=0;l<a.length;l++)a.words[l]=0}var u=n.clone()._ishlnsubmul(i,1,c);0===u.negative&&(n=u,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):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,s,a},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),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?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),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var u=n.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(u),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(u),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(l)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;0==(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).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 o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||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){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,s=n;0!==i&&s<this.length;s++){var a=0|this.words[s];i=(a+=i)>>>26,a&=67108863,this.words[s]=a}return 0!==i&&(this.words[s]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(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 R(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(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 w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){R.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)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.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<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(w,v),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var s=0|e.words[o];e.words[o-10]=(s&r)<<4|i>>>22,i=s}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(x,v),n(E,v),n(A,v),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new x;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return b[e]=t,t},R.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},R.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},R.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},R.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},R.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)},R.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},R.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)},R.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},R.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},R.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},R.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},R.prototype.isqr=function(e){return this.imul(e,e.clone())},R.prototype.sqr=function(e){return this.mul(e,e)},R.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var d=this.pow(u,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(d,new o(1).iushln(p-g-1));h=h.redMul(y),d=y.redSqr(),f=f.redMul(d),p=g}return h},R.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},R.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],u=c-1;u>=0;u--){var d=l>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===n&&0===u)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},R.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},R.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new _(e)},n(_,R),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},_.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),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(nh,ce);var oh=nh.exports;function ih(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var sh=ah;function ah(e,t){if(!e)throw new Error(t||"Assertion failed")}ah.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var ch=ih((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),i=o>>8,s=255&o;i?r.push(i,s):r.push(s)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}})),lh=ih((function(e,t){var r=t;r.assert=sh,r.toArray=ch.toArray,r.zero2=ch.zero2,r.toHex=ch.toHex,r.encode=ch.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var o=1<<t+1,i=e.clone(),s=0;s<n.length;s++){var a,c=i.andln(o-1);i.isOdd()?(a=c>(o>>1)-1?(o>>1)-c:c,i.isubn(a)):a=0,n[s]=a,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var s,a,c=e.andln(3)+o&3,l=t.andln(3)+i&3;3===c&&(c=-1),3===l&&(l=-1),s=0==(1&c)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==l?c:-c,r[0].push(s),a=0==(1&l)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?l:-l,r[1].push(a),2*o===s+1&&(o=1-o),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new oh(e,"hex","le")}})),uh=lh.getNAF,dh=lh.getJSF,hh=lh.assert;function fh(e,t){this.type=e,this.p=new oh(t.p,16),this.red=t.prime?oh.red(t.prime):oh.mont(this.p),this.zero=new oh(0).toRed(this.red),this.one=new oh(1).toRed(this.red),this.two=new oh(2).toRed(this.red),this.n=t.n&&new oh(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ph=fh;function mh(e,t){this.curve=e,this.type=t,this.precomputed=null}fh.prototype.point=function(){throw new Error("Not implemented")},fh.prototype.validate=function(){throw new Error("Not implemented")},fh.prototype._fixedNafMul=function(e,t){hh(e.precomputed);var r=e._getDoubles(),n=uh(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var i,s,a=[];for(i=0;i<n.length;i+=r.step){s=0;for(var c=i+r.step-1;c>=i;c--)s=(s<<1)+n[c];a.push(s)}for(var l=this.jpoint(null,null,null),u=this.jpoint(null,null,null),d=o;d>0;d--){for(i=0;i<a.length;i++)(s=a[i])===d?u=u.mixedAdd(r.points[i]):s===-d&&(u=u.mixedAdd(r.points[i].neg()));l=l.add(u)}return l.toP()},fh.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,i=uh(t,r,this._bitLength),s=this.jpoint(null,null,null),a=i.length-1;a>=0;a--){for(var c=0;a>=0&&0===i[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var l=i[a];hh(0!==l),s="affine"===e.type?l>0?s.mixedAdd(o[l-1>>1]):s.mixedAdd(o[-l-1>>1].neg()):l>0?s.add(o[l-1>>1]):s.add(o[-l-1>>1].neg())}return"affine"===e.type?s.toP():s},fh.prototype._wnafMulAdd=function(e,t,r,n,o){var i,s,a,c=this._wnafT1,l=this._wnafT2,u=this._wnafT3,d=0;for(i=0;i<n;i++){var h=(a=t[i])._getNAFPoints(e);c[i]=h.wnd,l[i]=h.points}for(i=n-1;i>=1;i-=2){var f=i-1,p=i;if(1===c[f]&&1===c[p]){var m=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(m[1]=t[f].add(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].add(t[p].neg())):(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=dh(r[f],r[p]);for(d=Math.max(y[0].length,d),u[f]=new Array(d),u[p]=new Array(d),s=0;s<d;s++){var b=0|y[0][s],v=0|y[1][s];u[f][s]=g[3*(b+1)+(v+1)],u[p][s]=0,l[f]=m}}else u[f]=uh(r[f],c[f],this._bitLength),u[p]=uh(r[p],c[p],this._bitLength),d=Math.max(u[f].length,d),d=Math.max(u[p].length,d)}var w=this.jpoint(null,null,null),x=this._wnafT4;for(i=d;i>=0;i--){for(var E=0;i>=0;){var A=!0;for(s=0;s<n;s++)x[s]=0|u[s][i],0!==x[s]&&(A=!1);if(!A)break;E++,i--}if(i>=0&&E++,w=w.dblp(E),i<0)break;for(s=0;s<n;s++){var R=x[s];0!==R&&(R>0?a=l[s][R-1>>1]:R<0&&(a=l[s][-R-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(i=0;i<n;i++)l[i]=null;return o?w:w.toP()},fh.BasePoint=mh,mh.prototype.eq=function(){throw new Error("Not implemented")},mh.prototype.validate=function(){return this.curve.validate(this)},fh.prototype.decodePoint=function(e,t){e=lh.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?hh(e[e.length-1]%2==0):7===e[0]&&hh(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},mh.prototype.encodeCompressed=function(e){return this.encode(e,!0)},mh.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},mh.prototype.encode=function(e,t){return lh.encode(this._encode(t),e)},mh.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},mh.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},mh.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},mh.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},mh.prototype._getBeta=function(){return null},mh.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var gh=ih((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),yh=lh.assert;function bh(e){ph.call(this,"short",e),this.a=new oh(e.a,16).toRed(this.red),this.b=new oh(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}gh(bh,ph);var vh=bh;function wh(e,t,r,n){ph.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new oh(t,16),this.y=new oh(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function xh(e,t,r,n){ph.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new oh(0)):(this.x=new oh(t,16),this.y=new oh(r,16),this.z=new oh(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}bh.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new oh(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new oh(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],yh(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new oh(e.a,16),b:new oh(e.b,16)}})):this._getEndoBasis(r)}}},bh.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:oh.mont(e),r=new oh(2).toRed(t).redInvm(),n=r.redNeg(),o=new oh(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},bh.prototype._getEndoBasis=function(e){for(var t,r,n,o,i,s,a,c,l,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),f=new oh(1),p=new oh(0),m=new oh(0),g=new oh(1),y=0;0!==d.cmpn(0);){var b=h.div(d);c=h.sub(b.mul(d)),l=m.sub(b.mul(f));var v=g.sub(b.mul(p));if(!n&&c.cmp(u)<0)t=a.neg(),r=f,n=c.neg(),o=l;else if(n&&2==++y)break;a=c,h=d,d=c,m=f,f=l,g=p,p=v}i=c.neg(),s=l;var w=n.sqr().add(o.sqr());return i.sqr().add(s.sqr()).cmp(w)>=0&&(i=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),i.negative&&(i=i.neg(),s=s.neg()),[{a:n,b:o},{a:i,b:s}]},bh.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),s=o.mul(r.a),a=i.mul(n.a),c=o.mul(r.b),l=i.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(l).neg()}},bh.prototype.pointFromX=function(e,t){(e=new oh(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},bh.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},bh.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var s=this._endoSplit(t[i]),a=e[i],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*i]=a,n[2*i+1]=c,o[2*i]=s.k1,o[2*i+1]=s.k2}for(var l=this._wnafMulAdd(1,n,o,2*i,r),u=0;u<2*i;u++)n[u]=null,o[u]=null;return l},gh(wh,ph.BasePoint),bh.prototype.point=function(e,t,r){return new wh(this,e,t,r)},bh.prototype.pointFromJSON=function(e,t){return wh.fromJSON(this,e,t)},wh.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},wh.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},wh.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},wh.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},wh.prototype.isInfinity=function(){return this.inf},wh.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},wh.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),s=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},wh.prototype.getX=function(){return this.x.fromRed()},wh.prototype.getY=function(){return this.y.fromRed()},wh.prototype.mul=function(e){return e=new oh(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},wh.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},wh.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},wh.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},wh.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},wh.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},gh(xh,ph.BasePoint),bh.prototype.jpoint=function(e,t,r){return new xh(this,e,t,r)},xh.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},xh.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},xh.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(o),c=i.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),d=n.redMul(l),h=c.redSqr().redIAdd(u).redISub(d).redISub(d),f=c.redMul(d.redISub(h)).redISub(i.redMul(u)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(h,f,p)},xh.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=o.redSub(i);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),u=r.redMul(c),d=a.redSqr().redIAdd(l).redISub(u).redISub(u),h=a.redMul(u.redISub(d)).redISub(o.redMul(l)),f=this.z.redMul(s);return this.curve.jpoint(d,h,f)},xh.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),l=s.redAdd(s);for(t=0;t<e;t++){var u=i.redSqr(),d=l.redSqr(),h=d.redSqr(),f=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(c)),p=i.redMul(d),m=f.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=f.redMul(g);y=y.redIAdd(y).redISub(h);var b=l.redMul(a);t+1<e&&(c=c.redMul(h)),i=m,a=b,l=y}return this.curve.jpoint(i,l.redMul(o),a)},xh.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},xh.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),l=i.redIAdd(i);l=(l=l.redIAdd(l)).redIAdd(l),e=c,t=a.redMul(s.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),f=this.x.redAdd(d).redSqr().redISub(u).redISub(h);f=f.redIAdd(f);var p=u.redAdd(u).redIAdd(u),m=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},xh.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var l=i.redIAdd(i);l=(l=l.redIAdd(l)).redIAdd(l),t=a.redMul(s.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),f=this.x.redSub(u).redMul(this.x.redAdd(u));f=f.redAdd(f).redIAdd(f);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(u);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=f.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},xh.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=t.redSqr(),s=r.redSqr(),a=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),c=t.redAdd(t),l=(c=c.redIAdd(c)).redMul(s),u=a.redSqr().redISub(l.redAdd(l)),d=l.redISub(u),h=s.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=a.redMul(d).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(u,f,p)},xh.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var l=o.redIAdd(s).redSqr().redISub(i).redISub(a).redISub(c),u=t.redMul(l);u=(u=u.redIAdd(u)).redIAdd(u);var d=this.x.redMul(a).redISub(u);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(l.redMul(c.redISub(l)).redISub(s.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,h,f)},xh.prototype.mul=function(e,t){return e=new oh(e,t),this.curve._wnafMul(this,e)},xh.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},xh.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},xh.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},xh.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Eh=ih((function(e,t){var r=t;r.base=ph,r.short=vh,r.mont=null,r.edwards=null})),Ah=ih((function(e,t){var r,n=t,o=lh.assert;function i(e){"short"===e.type?this.curve=new Eh.short(e):"edwards"===e.type?this.curve=new Eh.edwards(e):this.curve=new Eh.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Ud.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Ud.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Ud.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Ud.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Ud.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ud.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ud.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Ud.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Rh(e){if(!(this instanceof Rh))return new Rh(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=ch.toArray(e.entropy,e.entropyEnc||"hex"),r=ch.toArray(e.nonce,e.nonceEnc||"hex"),n=ch.toArray(e.pers,e.persEnc||"hex");sh(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var _h=Rh;Rh.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Rh.prototype._hmac=function(){return new Ud.hmac(this.hash,this.K)},Rh.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Rh.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=ch.toArray(e,t),r=ch.toArray(r,n),sh(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Rh.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=ch.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var i=o.slice(0,e);return this._update(r),this._reseed++,ch.encode(i,t)};var kh=lh.assert;function Sh(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Nh=Sh;Sh.fromPublic=function(e,t,r){return t instanceof Sh?t:new Sh(e,{pub:t,pubEnc:r})},Sh.fromPrivate=function(e,t,r){return t instanceof Sh?t:new Sh(e,{priv:t,privEnc:r})},Sh.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Sh.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},Sh.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Sh.prototype._importPrivate=function(e,t){this.priv=new oh(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Sh.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?kh(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||kh(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},Sh.prototype.derive=function(e){return e.validate()||kh(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Sh.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Sh.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Sh.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Mh=lh.assert;function Th(e,t){if(e instanceof Th)return e;this._importDER(e,t)||(Mh(e.r&&e.s,"Signature without r or s"),this.r=new oh(e.r,16),this.s=new oh(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Oh=Th;function Ih(){this.place=0}function Fh(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,s=t.place;i<n;i++,s++)o<<=8,o|=e[s],o>>>=0;return!(o<=127)&&(t.place=s,o)}function Wh(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function Ch(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Th.prototype._importDER=function(e,t){e=lh.toArray(e,t);var r=new Ih;if(48!==e[r.place++])return!1;var n=Fh(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=Fh(e,r);if(!1===o)return!1;var i=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var s=Fh(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new oh(i),this.s=new oh(a),this.recoveryParam=null,!0},Th.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Wh(t),r=Wh(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];Ch(n,t.length),(n=n.concat(t)).push(2),Ch(n,r.length);var o=n.concat(r),i=[48];return Ch(i,o.length),i=i.concat(o),lh.encode(i,e)};var jh=function(){throw new Error("unsupported")},Uh=lh.assert;function Dh(e){if(!(this instanceof Dh))return new Dh(e);"string"==typeof e&&(Uh(Object.prototype.hasOwnProperty.call(Ah,e),"Unknown curve "+e),e=Ah[e]),e instanceof Ah.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Bh=Dh;Dh.prototype.keyPair=function(e){return new Nh(this,e)},Dh.prototype.keyFromPrivate=function(e,t){return Nh.fromPrivate(this,e,t)},Dh.prototype.keyFromPublic=function(e,t){return Nh.fromPublic(this,e,t)},Dh.prototype.genKeyPair=function(e){e||(e={});for(var t=new _h({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||jh(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new oh(2));;){var o=new oh(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},Dh.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Dh.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new oh(e,16));for(var o=this.n.byteLength(),i=t.getPrivate().toArray("be",o),s=e.toArray("be",o),a=new _h({hash:this.hash,entropy:i,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new oh(1)),l=0;;l++){var u=n.k?n.k(l):new oh(a.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(c)>=0)){var d=this.g.mul(u);if(!d.isInfinity()){var h=d.getX(),f=h.umod(this.n);if(0!==f.cmpn(0)){var p=u.invm(this.n).mul(f.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==h.cmp(f)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new Oh({r:f,s:p,recoveryParam:m})}}}}}},Dh.prototype.verify=function(e,t,r,n){e=this._truncateToN(new oh(e,16)),r=this.keyFromPublic(r,n);var o=(t=new Oh(t,"hex")).r,i=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var s,a=i.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},Dh.prototype.recoverPubKey=function(e,t,r,n){Uh((3&r)===r,"The recovery param is more than two bits"),t=new Oh(t,n);var o=this.n,i=new oh(e),s=t.r,a=t.s,c=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var u=t.r.invm(o),d=o.sub(i).mul(u).umod(o),h=a.mul(u).umod(o);return this.g.mulAdd(d,s,h)},Dh.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Oh(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var Vh=ih((function(e,t){var r=t;r.version="6.5.4",r.utils=lh,r.rand=function(){throw new Error("unsupported")},r.curve=Eh,r.curves=Ah,r.ec=Bh,r.eddsa=null})).ec;const Ph=new qi("signing-key/5.7.0");let Zh=null;function zh(){return Zh||(Zh=new Vh("secp256k1")),Zh}class Lh{constructor(e){la(this,"curve","secp256k1"),la(this,"privateKey",as(e)),32!==cs(this.privateKey)&&Ph.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=zh().keyFromPrivate(ns(this.privateKey));la(this,"publicKey","0x"+t.getPublic(!1,"hex")),la(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),la(this,"_isSigningKey",!0)}_addPoint(e){const t=zh().keyFromPublic(ns(this.publicKey)),r=zh().keyFromPublic(ns(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=zh().keyFromPrivate(ns(this.privateKey)),r=ns(e);32!==r.length&&Ph.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return fs({recoveryParam:n.recoveryParam,r:hs("0x"+n.r.toString(16),32),s:hs("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=zh().keyFromPrivate(ns(this.privateKey)),r=zh().keyFromPublic(ns(Hh(e)));return hs("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Hh(e,t){const r=ns(e);if(32===r.length){const e=new Lh(r);return t?"0x"+zh().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?as(r):"0x"+zh().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+zh().keyFromPublic(r).getPublic(!0,"hex"):as(r):Ph.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Yh=new qi("transactions/5.7.0");var Xh;function Jh(e){return"0x"===e?null:Ms(e)}function Gh(e){return"0x"===e?ra:ne.from(e)}function qh(e,t){return function(e){return Ms(ls(gs(ls(Hh(e),1)),12))}(function(e,t){const r=fs(t),n={r:ns(r.r),s:ns(r.s)};return"0x"+zh().recoverPubKey(ns(e),n,r.recoveryParam).encode("hex",!1)}(ns(e),t))}function Kh(e,t){const r=is(ne.from(e).toHexString());return r.length>32&&Yh.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Qh(e,t){return{address:Ms(e),storageKeys:(t||[]).map(((t,r)=>(32!==cs(t)&&Yh.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function $h(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&Yh.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Qh(e[0],e[1])):Qh(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Qh(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function ef(e){return $h(e).map((e=>[e.address,e.storageKeys]))}function tf(e,t){if(null!=e.gasPrice){const t=ne.from(e.gasPrice),r=ne.from(e.maxFeePerGas||0);t.eq(r)||Yh.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Kh(e.chainId||0,"chainId"),Kh(e.nonce||0,"nonce"),Kh(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Kh(e.maxFeePerGas||0,"maxFeePerGas"),Kh(e.gasLimit||0,"gasLimit"),null!=e.to?Ms(e.to):"0x",Kh(e.value||0,"value"),e.data||"0x",ef(e.accessList||[])];if(t){const e=fs(t);r.push(Kh(e.recoveryParam,"recoveryParam")),r.push(is(e.r)),r.push(is(e.s))}return us(["0x02",xs(r)])}function rf(e,t){const r=[Kh(e.chainId||0,"chainId"),Kh(e.nonce||0,"nonce"),Kh(e.gasPrice||0,"gasPrice"),Kh(e.gasLimit||0,"gasLimit"),null!=e.to?Ms(e.to):"0x",Kh(e.value||0,"value"),e.data||"0x",ef(e.accessList||[])];if(t){const e=fs(t);r.push(Kh(e.recoveryParam,"recoveryParam")),r.push(is(e.r)),r.push(is(e.s))}return us(["0x01",xs(r)])}function nf(e,t,r){try{const r=Gh(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){Yh.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=hs(t[1],32),e.s=hs(t[2],32);try{const t=gs(r(e));e.from=qh(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function of(e){const t=ns(e);if(t[0]>127)return function(e){const t=Rs(e);9!==t.length&&6!==t.length&&Yh.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Gh(t[0]).toNumber(),gasPrice:Gh(t[1]),gasLimit:Gh(t[2]),to:Jh(t[3]),value:Gh(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=ne.from(t[6]).toNumber()}catch(e){return r}if(r.r=hs(t[7],32),r.s=hs(t[8],32),ne.from(r.r).isZero()&&ne.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const o=t.slice(0,6);0!==r.chainId&&(o.push(as(r.chainId)),o.push("0x"),o.push("0x"),n-=2*r.chainId+8);const i=gs(xs(o));try{r.from=qh(i,{r:as(r.r),s:as(r.s),recoveryParam:n})}catch(e){}r.hash=gs(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=Rs(e.slice(1));8!==t.length&&11!==t.length&&Yh.throwArgumentError("invalid component count for transaction type: 1","payload",as(e));const r={type:1,chainId:Gh(t[0]).toNumber(),nonce:Gh(t[1]).toNumber(),gasPrice:Gh(t[2]),gasLimit:Gh(t[3]),to:Jh(t[4]),value:Gh(t[5]),data:t[6],accessList:$h(t[7])};return 8===t.length||(r.hash=gs(e),nf(r,t.slice(8),rf)),r}(t);case 2:return function(e){const t=Rs(e.slice(1));9!==t.length&&12!==t.length&&Yh.throwArgumentError("invalid component count for transaction type: 2","payload",as(e));const r=Gh(t[2]),n=Gh(t[3]),o={type:2,chainId:Gh(t[0]).toNumber(),nonce:Gh(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Gh(t[4]),to:Jh(t[5]),value:Gh(t[6]),data:t[7],accessList:$h(t[8])};return 9===t.length||(o.hash=gs(e),nf(o,t.slice(9),tf)),o}(t)}return Yh.throwError(`unsupported transaction type: ${t[0]}`,qi.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Xh||(Xh={}));const sf=new qi(rh);class af{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),o=this.data.bind(this),i=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:i,type:c,accessList:af.allowNull(this.accessList.bind(this),null),blockHash:af.allowNull(i,null),blockNumber:af.allowNull(a,null),transactionIndex:af.allowNull(a,null),confirmations:af.allowNull(a,null),from:t,gasPrice:af.allowNull(r),maxPriorityFeePerGas:af.allowNull(r),maxFeePerGas:af.allowNull(r),gasLimit:r,to:af.allowNull(t,null),value:r,nonce:a,data:o,r:af.allowNull(this.uint256),s:af.allowNull(this.uint256),v:af.allowNull(a),creates:af.allowNull(t,null),raw:af.allowNull(o)},e.transactionRequest={from:af.allowNull(t),nonce:af.allowNull(a),gasLimit:af.allowNull(r),gasPrice:af.allowNull(r),maxPriorityFeePerGas:af.allowNull(r),maxFeePerGas:af.allowNull(r),to:af.allowNull(t),value:af.allowNull(r),data:af.allowNull((e=>this.data(e,!0))),type:af.allowNull(a),accessList:af.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:i,address:t,topics:af.arrayOf(i),data:o,logIndex:a,blockHash:i},e.receipt={to:af.allowNull(this.address,null),from:af.allowNull(this.address,null),contractAddress:af.allowNull(t,null),transactionIndex:a,root:af.allowNull(s),gasUsed:r,logsBloom:af.allowNull(o),blockHash:i,transactionHash:i,logs:af.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:af.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:af.allowNull(r),status:af.allowNull(a),type:c},e.block={hash:af.allowNull(i),parentHash:i,number:a,timestamp:a,nonce:af.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:af.allowNull(t),extraData:o,transactions:af.allowNull(af.arrayOf(i)),baseFeePerGas:af.allowNull(r)},e.blockWithTransactions=ha(e.block),e.blockWithTransactions.transactions=af.allowNull(af.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:af.allowNull(n,void 0),toBlock:af.allowNull(n,void 0),blockHash:af.allowNull(i,void 0),address:af.allowNull(t,void 0),topics:af.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:af.allowNull(a),blockHash:af.allowNull(i),transactionIndex:a,removed:af.allowNull(this.boolean.bind(this)),address:t,data:af.allowFalsish(o,"0x"),topics:af.arrayOf(i),transactionHash:i,logIndex:a},e}accessList(e){return $h(e||[])}number(e){return"0x"===e?0:ne.from(e).toNumber()}type(e){return"0x"===e||null==e?0:ne.from(e).toNumber()}bigNumber(e){return ne.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),ss(e))?e.toLowerCase():sf.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return Ms(e)}callAddress(e){if(!ss(e,32))return null;const t=Ms(ls(e,12));return t===ea?null:t}contractAddress(e){return function(e){let t=null;try{t=Ms(e.from)}catch(t){_s.throwArgumentError("missing from address","transaction",e)}return Ms(ls(gs(xs([t,is(ns(ne.from(e.nonce).toHexString()))])),12))}(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||ss(e))return ds(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==cs(r)?sf.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=ne.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!ss(e))throw new Error("invalid uint256");return hs(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=af.check(t,e);return n._difficulty=null==r?null:ne.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return af.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&ne.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=af.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;ss(r)&&(r=ne.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),ss(r)&&(r=ne.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return of(e)}receiptLog(e){return af.check(this.formats.receiptLog,e)}receipt(e){const t=af.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=ne.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&sf.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):sf.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&sf.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return af.check(this.formats.filter,e)}filterLog(e){return af.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const o=e[n](t[n]);void 0!==o&&(r[n]=o)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var cf=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const lf=new qi(rh);function uf(e){return null==e?"null":(32!==cs(e)&&lf.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function df(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[uf(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return uf(e)})).join("&")}function hf(e){if("string"==typeof e){if(32===cs(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+df(e);if(_l.isForkEvent(e))throw lf.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+df(e.topics||[])}throw new Error("invalid event - "+e)}function ff(){return(new Date).getTime()}function pf(e){return new Promise((t=>{setTimeout(t,e)}))}const mf=["block","network","pending","poll"];class gf{constructor(e,t,r){la(this,"tag",e),la(this,"listener",t),la(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const o={};return r.length>0&&(o.topics=r),t&&"*"!==t&&(o.address=t),o}pollable(){return this.tag.indexOf(":")>=0||mf.indexOf(this.tag)>=0}}const yf={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 bf(e){return hs(ne.from(e).toHexString(),32)}function vf(e){return Cl.encode(os([e,ls(Dd(Dd(e)),0,4)]))}const wf=new RegExp("^(ipfs)://(.*)$","i"),xf=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),wf,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Ef(e,t){try{return uc(Af(e,t))}catch(e){}return null}function Af(e,t){if("0x"===e)return null;const r=ne.from(ls(e,t,t+32)).toNumber(),n=ne.from(ls(e,r,r+32)).toNumber();return ls(e,r+32,r+32+n)}function Rf(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):lf.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function _f(e){const t=ns(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function kf(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Sf(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const o=ns(e[n]);t[n]=_f(r),t.push(_f(o.length)),t.push(kf(o)),r+=32+32*Math.ceil(o.length/32)}return us(t)}class Nf{constructor(e,t,r,n){la(this,"provider",e),la(this,"name",r),la(this,"address",e.formatter.address(t)),la(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>ne.from(e).eq(1))).catch((e=>{if(e.code===qi.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return cf(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:us([e,zc(this.name),t||"0x"])};let n=!1;var o;(yield this.supportsWildcard())&&(n=!0,r.data=us(["0x9061b923",Sf([(o=this.name,as(os(Zc(o).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),r.data])]));try{let e=yield this.provider.call(r);return ns(e).length%32==4&&lf.throwError("resolver threw error",qi.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Af(e,0)),e}catch(e){if(e.code===qi.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return cf(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Af(r,0):null}))}_getAddress(e,t){const r=yf[String(e)];if(null==r&&lf.throwError(`unsupported coin type: ${e}`,qi.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=ns(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return vf(os([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return vf(os([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=th.toWords(n.slice(2));return e.unshift(t),th.encode(r.prefix,e)}}return null}getAddress(e){return cf(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===qi.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",bf(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&lf.throwError("invalid or unsupported coin data",qi.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return cf(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<xf.length;r++){const n=t.match(xf[r]);if(null==n)continue;const o=n[1].toLowerCase();switch(o){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:Rf(t)};case"erc721":case"erc1155":{const r="erc721"===o?"0xc87b56dd":"0x0e89341c";e.push({type:o,content:t});const i=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),c=hs(ne.from(s[1]).toHexString(),32);if("erc721"===o){const t=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:us(["0x6352211e",c])}));if(i!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===o){const t=ne.from(yield this.provider.call({to:a,data:us(["0x00fdd58e",hs(i,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const l={to:this.provider.formatter.address(s[0]),data:us([r,c])};let u=Ef(yield this.provider.call(l),0);if(null==u)return null;e.push({type:"metadata-url-base",content:u}),"erc1155"===o&&(u=u.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:u})),u.match(/^ipfs:/i)&&(u=Rf(u)),e.push({type:"metadata-url",content:u});const d=yield Hd(u);if(!d)return null;e.push({type:"metadata",content:JSON.stringify(d)});let h=d.image;if("string"!=typeof h)return null;if(h.match(/^(https:\/\/|data:)/i));else{if(null==h.match(wf))return null;e.push({type:"url-ipfs",content:h}),h=Rf(h)}return e.push({type:"url",content:h}),{linkage:e,url:h}}}}}catch(e){}return null}))}getContentHash(){return cf(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+Cl.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+Cl.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const o=e.match(/^0x90b2c605([0-9a-f]*)$/);if(o&&68===o[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+vc("0x"+o[1]).replace(/[=+\/]/g,(t=>e[t]))}return lf.throwError("invalid or unsupported content hash data",qi.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return cf(this,void 0,void 0,(function*(){let t=lc(e);t=os([bf(64),bf(t.length),t]),t.length%32!=0&&(t=os([t,hs("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",as(t));return null==r||"0x"===r?null:uc(r)}))}}let Mf=null,Tf=1;class Of extends kl{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),la(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=ua(new.target,"getNetwork")(e);t?(la(this,"_network",t),this.emit("network",t,null)):lf.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return cf(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||lf.throwError("no network detected",qi.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:la(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Yd((()=>this._ready().then((e=>e),(e=>{if(e.code!==qi.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Mf&&(Mf=new af),Mf}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in Fl){const r=Fl[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=Fl[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=Fl[e.name];if(!t)return"number"!=typeof e.chainId&&Sl.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&Sl.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return cf(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),o=t.toLowerCase(),i=[];for(let e=0;e<r.length;e++){const t=r[e],s=t.replace("{sender}",n).replace("{data}",o),a=t.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:n}),c=yield Hd({url:s,errorPassThrough:!0},a,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const l=c.message||"unknown error";if(c.status>=400&&c.status<500)return lf.throwError(`response not found during CCIP fetch: ${l}`,qi.errors.SERVER_ERROR,{url:t,errorMessage:l});i.push(l)}return lf.throwError(`error encountered during CCIP fetch: ${i.map((e=>JSON.stringify(e))).join(", ")}`,qi.errors.SERVER_ERROR,{urls:r,errorMessages:i})}))}_getInternalBlockNumber(e){return cf(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(ff()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=ff(),r=da({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const o=ff();return(e=ne.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:o}}));return this._internalBlockNumber=r,r.catch((e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return cf(this,void 0,void 0,(function*(){const e=Tf++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)lf.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",lf.makeError("network block skew detected",qi.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const o=n.toBlock-this._maxFilterBlockRange;o>n.fromBlock&&(n.fromBlock=o),n.fromBlock<0&&(n.fromBlock=0);const i=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(i)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return cf(this,void 0,void 0,(function*(){return lf.throwError("provider does not support network detection",qi.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return cf(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,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",t,e),yield pf(0),this._network;const r=lf.makeError("underlying network changed",qi.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){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((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=ff();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=ff(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return cf(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return cf(this,void 0,void 0,(function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=t?o:new Promise(((o,i)=>{const s=[];let a=!1;const c=function(){return!!a||(a=!0,s.forEach((e=>{e()})),!1)},l=e=>{e.confirmations<t||c()||o(e)};if(this.on(e,l),s.push((()=>{this.removeListener(e,l)})),n){let r=n.startBlock,o=null;const l=s=>cf(this,void 0,void 0,(function*(){a||(yield pf(1e3),this.getTransactionCount(n.from).then((u=>cf(this,void 0,void 0,(function*(){if(!a){if(u<=n.nonce)r=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==o&&(o=r-3,o<n.startBlock&&(o=n.startBlock));o<=s;){if(a)return;const r=yield this.getBlockWithTransactions(o);for(let o=0;o<r.transactions.length;o++){const s=r.transactions[o];if(s.hash===e)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,t);if(c())return;let o="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?o="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(o="cancelled"),void i(lf.makeError("transaction was replaced",qi.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===o||"cancelled"===o,reason:o,replacement:this._wrapTransaction(s),hash:e,receipt:r}))}}o++}}a||this.once("block",l)}}))),(e=>{a||this.once("block",l)})))}));if(a)return;this.once("block",l),s.push((()=>{this.removeListener("block",l)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||i(lf.makeError("timeout exceeded",qi.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),s.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return cf(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return ne.from(e)}catch(t){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield da({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return ne.from(n)}catch(e){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield da({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return ne.from(n).toNumber()}catch(e){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield da({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return as(n)}catch(e){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield da({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>ds(e)))}),o=yield this.perform("getStorageAt",n);try{return as(o)}catch(e){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==cs(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&lf.throwError("Transaction hash mismatch from Provider.sendTransaction.",qi.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>cf(this,void 0,void 0,(function*(){let o;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const i=yield this._waitForTransaction(e.hash,t,n,o);return null==i&&0===t?null:(this._emitted["t:"+e.hash]=i.blockNumber,0===i.status&&lf.throwError("transaction failed",qi.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:i}),i)})),n}sendTransaction(e){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>as(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return cf(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?ne.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?as(e):null)))})),this.formatter.transactionRequest(yield da(r))}))}_getFilter(e){return cf(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield da(t))}))}_call(e,t,r){return cf(this,void 0,void 0,(function*(){r>=10&&lf.throwError("CCIP read exceeded maximum redirections",qi.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,o=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===o.substring(0,10)&&cs(o)%32==4)try{const i=ls(o,4),s=ls(i,0,32);ne.from(s).eq(n)||lf.throwError("CCIP Read sender did not match",qi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const a=[],c=ne.from(ls(i,32,64)).toNumber(),l=ne.from(ls(i,c,c+32)).toNumber(),u=ls(i,c+32);for(let t=0;t<l;t++){const r=Ef(u,32*t);null==r&&lf.throwError("CCIP Read contained corrupt URL string",qi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),a.push(r)}const d=Af(i,64);ne.from(ls(i,100,128)).isZero()||lf.throwError("CCIP Read callback selector included junk",qi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const h=ls(i,96,100),f=Af(i,128),p=yield this.ccipReadFetch(e,d,a);null==p&&lf.throwError("CCIP Read disabled or provided no URLs",qi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const m={to:n,data:us([h,Sf([p,f])])};return this._call(m,t,r+1)}catch(e){if(e.code===qi.errors.SERVER_ERROR)throw e}try{return as(o)}catch(r){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:o,error:r})}}))}call(e,t){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield da({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(e){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield da({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return ne.from(r)}catch(e){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return cf(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&lf.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&lf.throwError("ENS name not configured",qi.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return cf(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if(ss(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),ss(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){lf.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return Yd((()=>cf(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;r<e.transactions.length;r++){const n=e.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map((e=>this._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return cf(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Yd((()=>cf(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return cf(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Yd((()=>cf(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield da({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),af.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return cf(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return cf(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&lf.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return cf(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new Nf(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return cf(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||lf.throwError("network does not support ENS",qi.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+zc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return cf(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(ss(e))throw t}"string"!=typeof e&&lf.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return cf(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=Ef(yield this.call({to:r,data:"0x691f3431"+zc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return cf(this,void 0,void 0,(function*(){let t=null;if(ss(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new Nf(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==qi.errors.CALL_EXCEPTION)throw e}try{const e=Ef(yield this.call({to:n,data:"0x691f3431"+zc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==qi.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return lf.throwError(e+" not implemented",qi.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new gf(hf(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],o=hf(e);return this._events=this._events.filter((e=>e.tag!==o||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=hf(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=hf(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,o=hf(e);return this._events=this._events.filter((e=>e.tag!==o||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=hf(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var If=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Ff=new qi("abstract-signer/5.7.0"),Wf=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Cf=[qi.errors.INSUFFICIENT_FUNDS,qi.errors.NONCE_EXPIRED,qi.errors.REPLACEMENT_UNDERPRICED];class jf{constructor(){Ff.checkAbstract(new.target,jf),la(this,"_isSigner",!0)}getBalance(e){return If(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return If(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return If(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield da(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return If(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield da(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return If(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return If(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return If(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return If(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return If(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===Wf.indexOf(t)&&Ff.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=ha(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Ff.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return If(this,void 0,void 0,(function*(){const t=yield da(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>If(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Ff.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||Ff.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Ff.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&Ff.throwError("network does not support EIP-1559",qi.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Ff.throwError("failed to get consistent fee data",qi.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(Cf.indexOf(e.code)>=0)throw e;return Ff.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",qi.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Ff.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield da(t)}))}_checkProvider(e){this.provider||Ff.throwError("missing provider",qi.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}var Uf=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Df=new qi(rh),Bf=["call","estimateGas"];function Vf(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=ss(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=Vf(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return Vf(JSON.parse(e),t)}catch(e){}return null}function Pf(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=Vf(t,!0);if(e)return e.data;Df.throwError("missing revert data in call exception; Transaction reverted without a reason string",qi.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=Vf(t.body,!1);null==r&&(r=Vf(t,!1)),r&&Df.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",qi.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let o=t.message;throw t.code===qi.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?o=t.error.message:"string"==typeof t.body?o=t.body:"string"==typeof t.responseText&&(o=t.responseText),o=(o||"").toLowerCase(),o.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Df.throwError("insufficient funds for intrinsic transaction cost",qi.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),o.match(/nonce (is )?too low/i)&&Df.throwError("nonce has already been used",qi.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),o.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Df.throwError("replacement fee too low",qi.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),o.match(/only replay-protected/i)&&Df.throwError("legacy pre-eip-155 transactions not supported",qi.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),Bf.indexOf(e)>=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Df.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",qi.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function Zf(e){return new Promise((function(t){setTimeout(t,e)}))}function zf(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Lf(e){return e?e.toLowerCase():e}const Hf={};class Yf extends jf{constructor(e,t,r){if(super(),e!==Hf)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");la(this,"provider",t),null==r&&(r=0),"string"==typeof r?(la(this,"_address",this.provider.formatter.address(r)),la(this,"_index",null)):"number"==typeof r?(la(this,"_index",r),la(this,"_address",null)):Df.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return Df.throwError("cannot alter JSON-RPC Signer connection",qi.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Xf(Hf,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&Df.throwError("unknown account #"+this._index,qi.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=ha(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=ha(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>Uf(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&Df.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),da({tx:da(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&Df.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&Df.throwError("user rejected transaction",qi.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),Pf("sendTransaction",e,n))))}))}signTransaction(e){return Df.throwError("signing transactions is unsupported",qi.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Uf(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Yd((()=>Uf(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return Uf(this,void 0,void 0,(function*(){const t="string"==typeof e?lc(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[as(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&Df.throwError("user rejected signing",qi.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return Uf(this,void 0,void 0,(function*(){const t="string"==typeof e?lc(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),as(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&Df.throwError("user rejected signing",qi.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return Uf(this,void 0,void 0,(function*(){const n=yield il.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(il.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&Df.throwError("user rejected signing",qi.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return Uf(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Xf extends Yf{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Jf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Gf extends Of{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=ua(this.constructor,"defaultUrl")()),la(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(ha(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Uf(this,void 0,void 0,(function*(){yield Zf(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=ua(this.constructor,"getNetwork");try{return t(ne.from(e).toNumber())}catch(t){return Df.throwError("could not detect network",qi.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return Df.throwError("could not detect network",qi.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Yf(Hf,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:ga(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const o=Hd(this.connection,JSON.stringify(r),zf).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=o,setTimeout((()=>{this._cache[e]=null}),0)),o}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Lf(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Lf(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Lf(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Lf(t.address),hs(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",[ua(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[ua(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Lf(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return Uf(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&ne.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ha(t)).transaction=ha(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&Df.throwError(e+" not implemented",qi.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return Pf(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const 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;let 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 Zf(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=ha(Jf);if(t)for(const e in t)t[e]&&(r[e]=!0);var n,o;o=r,(n=e)&&"object"==typeof n||ca.throwArgumentError("invalid object","object",n),Object.keys(n).forEach((e=>{o[e]||ca.throwArgumentError("invalid object key - "+e,"transaction:"+e,n)}));const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=ds(ne.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=as(e[t]))})),e.accessList&&(i.accessList=$h(e.accessList)),i}}function qf(e){return Number.parseInt(e,16)}new qi(rh);class Kf extends ee{constructor(e,t){super(e),this.customProvider=t,t.on("connect",(({chainId:e})=>{this.actions.update({chainId:qf(e)})})).on("disconnect",(e=>{var t;null===(t=this.onError)||void 0===t||t.call(this,e),this.actions.resetState()})).on("chainChanged",(e=>{this.actions.update({chainId:qf(e)})})).on("accountsChanged",(e=>{this.actions.update({accounts:e})}))}activate(){return Bs(this,void 0,void 0,(function*(){this.actions.startActivation();const e=this.customProvider;try{const[{chainId:t},r]=yield Promise.all([e.getNetwork(),e.listAccounts()]);this.actions.update({chainId:t,accounts:r})}catch(e){throw this.actions.resetState(),e}}))}}function Qf([e,t]){return[e,t]}var $f;function ep(){return ep=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ep.apply(this,arguments)}var tp,rp;function np(){return np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},np.apply(this,arguments)}var op;!function(e){e.INTEGRATOR="integrator",e.METAMASK="metamask",e.WALLET_CONNECT="walletConnect"}(op||(op={}));const ip={[op.METAMASK]:{name:"MetaMask",type:op.METAMASK,icon:function(e){return l.createElement("svg",ep({height:355,viewBox:"0 0 397 355",width:397,xmlns:"http://www.w3.org/2000/svg"},e),$f||($f=l.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(-1 -1)"},l.createElement("path",{d:"m114.622644 327.195472 52.004717 13.810198v-18.05949l4.245283-4.249292h29.716982v21.246459 14.872523h-31.839624l-39.268868-16.997169z",fill:"#cdbdb2"}),l.createElement("path",{d:"m199.528305 327.195472 50.943397 13.810198v-18.05949l4.245283-4.249292h29.716981v21.246459 14.872523h-31.839623l-39.268868-16.997169z",fill:"#cdbdb2",transform:"matrix(-1 0 0 1 483.96227 0)"}),l.createElement("path",{d:"m170.872644 287.889523-4.245283 35.056657 5.306604-4.249292h55.18868l6.367925 4.249292-4.245284-35.056657-8.490565-5.311615-42.452832 1.062323z",fill:"#393939"}),l.createElement("path",{d:"m142.216984 50.9915022 25.471698 59.4900858 11.674528 173.158643h41.391511l12.735849-173.158643 23.349056-59.4900858z",fill:"#f89c35"}),l.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),l.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),l.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),l.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),l.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 56.25-39.305949z",fill:"#eb8f35"}),l.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),l.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),l.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),l.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),l.createElement("path",{d:"m114.622644 327.195472 56.25-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3"}),l.createElement("path",{d:"m229.245286 327.195472 55.18868-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3",transform:"matrix(-1 0 0 1 513.679252 0)"}),l.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),l.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),l.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"}),l.createElement("g",{transform:"matrix(-1 0 0 1 399.056611 0)"},l.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),l.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),l.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),l.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),l.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 55.18868-38.243626z",fill:"#eb8f35"}),l.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),l.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),l.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),l.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),l.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),l.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),l.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"})))))},link:"https://metamask.io"},[op.WALLET_CONNECT]:{name:"WalletConnect",type:op.WALLET_CONNECT,icon:function(e){return l.createElement("svg",np({height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),tp||(tp=l.createElement("radialGradient",{id:"a",cx:"0%",cy:"50%",r:"100%"},l.createElement("stop",{offset:0,stopColor:"#5d9df6"}),l.createElement("stop",{offset:1,stopColor:"#006fff"}))),rp||(rp=l.createElement("g",{fill:"none",fillRule:"evenodd"},l.createElement("path",{d:"m256 0c141.384896 0 256 114.615104 256 256s-114.615104 256-256 256-256-114.615104-256-256 114.615104-256 256-256z",fill:"url(#a)"}),l.createElement("path",{d:"m64.6917558 37.7088298c51.5328072-50.2784397 135.0839942-50.2784397 186.6167992 0l6.202057 6.0510906c2.57664 2.5139218 2.57664 6.5897948 0 9.1037177l-21.215998 20.6995759c-1.288321 1.2569619-3.3771 1.2569619-4.665421 0l-8.534766-8.3270205c-35.950573-35.0754962-94.237969-35.0754962-130.188544 0l-9.1400282 8.9175519c-1.2883217 1.2569609-3.3771016 1.2569609-4.6654208 0l-21.2159973-20.6995759c-2.5766403-2.5139229-2.5766403-6.5897958 0-9.1037177zm230.4934852 42.8089117 18.882279 18.4227262c2.576627 2.5139103 2.576642 6.5897593.000032 9.1036863l-85.141498 83.070358c-2.576623 2.513941-6.754182 2.513969-9.33084.000066-.00001-.00001-.000023-.000023-.000033-.000034l-60.428256-58.957451c-.64416-.628481-1.68855-.628481-2.33271 0-.000004.000004-.000008.000007-.000012.000011l-60.4269683 58.957408c-2.5766141 2.513947-6.7541746 2.51399-9.3308408.000092-.0000151-.000014-.0000309-.000029-.0000467-.000046l-85.14386774-83.071463c-2.57663928-2.513921-2.57663928-6.589795 0-9.1037163l18.88231264-18.4226955c2.5766393-2.5139222 6.7541993-2.5139222 9.3308397 0l60.4291347 58.9582758c.6441608.62848 1.6885495.62848 2.3327103 0 .0000095-.000009.0000182-.000018.0000277-.000025l60.4261065-58.9582508c2.576581-2.51398 6.754142-2.5140743 9.33084-.0002103.000037.0000354.000072.0000709.000107.0001063l60.429056 58.9583548c.644159.628479 1.688549.628479 2.332709 0l60.428079-58.9571925c2.57664-2.5139231 6.754199-2.5139231 9.330839 0z",fill:"#fff",fillRule:"nonzero",transform:"translate(98 160)"}))))}}},sp={};function ap({provider:e,jsonRpcUrlMap:t,defaultChainId:r}){const n=console.error,o=y((()=>function(e,t){if(t){if(Gf.isProvider(t))return Qf(Y((e=>new Kf(e,t))));if(Gf.isProvider(t.provider))throw new Error("Eip1193Bridge is experimental: pass your ethers Provider directly");return Qf(Y((r=>new K({actions:r,provider:t,onError:e}))))}}(n,e)),[n,e]),i=y((()=>function(e){return Qf(Y((t=>new $({actions:t,onError:e}))))}(n)),[n]),s=y((()=>t?Object.assign(Object.assign({},Fs),t):Fs),[t]),a=y((()=>function(e,t,r,n){return Qf(Y((o=>new Q({actions:o,options:{rpc:t,qrcode:e},onError:n,defaultChainId:r}))))}(!0,s,r,n)),[s,r,n]);return o&&(sp[op.INTEGRATOR]=o),sp[op.METAMASK]=i,sp[op.WALLET_CONNECT]=a,Object.values(sp)}function cp(){const{chainId:e}=H(),t=Z(qs);return y((()=>e||t||1),[e,t])}var lp={};function up(e){e&&(e.value=!0)}function dp(){}function hp(e){return void 0===e.size&&(e.size=e.__iterate(pp)),e.size}function fp(e,t){if("number"!=typeof t){var r=t>>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?hp(e)+t:t}function pp(){return!0}function mp(e,t,r){return(0===e&&!vp(e)||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function gp(e,t){return bp(e,t,0)}function yp(e,t){return bp(e,t,t)}function bp(e,t,r){return void 0===e?r:vp(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function vp(e){return e<0||0===e&&1/e==-1/0}function wp(e){return Boolean(e&&e["@@__IMMUTABLE_ITERABLE__@@"])}function xp(e){return Boolean(e&&e["@@__IMMUTABLE_KEYED__@@"])}function Ep(e){return Boolean(e&&e["@@__IMMUTABLE_INDEXED__@@"])}function Ap(e){return xp(e)||Ep(e)}var Rp=function(e){return wp(e)?e:Lp(e)},_p=function(e){function t(e){return xp(e)?e:Hp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Rp),kp=function(e){function t(e){return Ep(e)?e:Yp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Rp),Sp=function(e){function t(e){return wp(e)&&!Ap(e)?e:Xp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Rp);Rp.Keyed=_p,Rp.Indexed=kp,Rp.Set=Sp;function Np(e){return Boolean(e&&e["@@__IMMUTABLE_SEQ__@@"])}function Mp(e){return Boolean(e&&e["@@__IMMUTABLE_RECORD__@@"])}function Tp(e){return wp(e)||Mp(e)}var Op="@@__IMMUTABLE_ORDERED__@@";function Ip(e){return Boolean(e&&e[Op])}var Fp="function"==typeof Symbol&&Symbol.iterator,Wp=Fp||"@@iterator",Cp=function(e){this.next=e};function jp(e,t,r,n){var o=0===e?t:1===e?r:[t,r];return n?n.value=o:n={value:o,done:!1},n}function Up(){return{value:void 0,done:!0}}function Dp(e){return!!Array.isArray(e)||!!Pp(e)}function Bp(e){return e&&"function"==typeof e.next}function Vp(e){var t=Pp(e);return t&&t.call(e)}function Pp(e){var t=e&&(Fp&&e[Fp]||e["@@iterator"]);if("function"==typeof t)return t}Cp.prototype.toString=function(){return"[Iterator]"},Cp.KEYS=0,Cp.VALUES=1,Cp.ENTRIES=2,Cp.prototype.inspect=Cp.prototype.toSource=function(){return this.toString()},Cp.prototype[Wp]=function(){return this};var Zp=Object.prototype.hasOwnProperty;function zp(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var Lp=function(e){function t(e){return null==e?Qp():Tp(e)?e.toSeq():function(e){var t=tm(e);if(t)return(n=Pp(r=e))&&n===r.entries?t.fromEntrySeq():function(e){var t=Pp(e);return t&&t===e.keys}(e)?t.toSetSeq():t;var r,n;if("object"==typeof e)return new Gp(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var r=this._cache;if(r){for(var n=r.length,o=0;o!==n;){var i=r[t?n-++o:o++];if(!1===e(i[1],i[0],this))break}return o}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var r=this._cache;if(r){var n=r.length,o=0;return new Cp((function(){if(o===n)return{value:void 0,done:!0};var i=r[t?n-++o:o++];return jp(e,i[0],i[1])}))}return this.__iteratorUncached(e,t)},t}(Rp),Hp=function(e){function t(e){return null==e?Qp().toKeyedSeq():wp(e)?xp(e)?e.toSeq():e.fromEntrySeq():Mp(e)?e.toSeq():$p(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(Lp),Yp=function(e){function t(e){return null==e?Qp():wp(e)?xp(e)?e.entrySeq():e.toIndexedSeq():Mp(e)?e.toSeq().entrySeq():em(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(Lp),Xp=function(e){function t(e){return(wp(e)&&!Ap(e)?e:Yp(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(Lp);Lp.isSeq=Np,Lp.Keyed=Hp,Lp.Set=Xp,Lp.Indexed=Yp,Lp.prototype["@@__IMMUTABLE_SEQ__@@"]=!0;var Jp=function(e){function t(e){this._array=e,this.size=e.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[fp(this,e)]:t},t.prototype.__iterate=function(e,t){for(var r=this._array,n=r.length,o=0;o!==n;){var i=t?n-++o:o++;if(!1===e(r[i],i,this))break}return o},t.prototype.__iterator=function(e,t){var r=this._array,n=r.length,o=0;return new Cp((function(){if(o===n)return{value:void 0,done:!0};var i=t?n-++o:o++;return jp(e,i,r[i])}))},t}(Yp),Gp=function(e){function t(e){var t=Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]);this._object=e,this._keys=t,this.size=t.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return Zp.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,o=n.length,i=0;i!==o;){var s=n[t?o-++i:i++];if(!1===e(r[s],s,this))break}return i},t.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,o=n.length,i=0;return new Cp((function(){if(i===o)return{value:void 0,done:!0};var s=n[t?o-++i:i++];return jp(e,s,r[s])}))},t}(Hp);Gp.prototype[Op]=!0;var qp,Kp=function(e){function t(e){this._collection=e,this.size=e.length||e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=Vp(this._collection),n=0;if(Bp(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,n++,this););return n},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=Vp(this._collection);if(!Bp(r))return new Cp(Up);var n=0;return new Cp((function(){var t=r.next();return t.done?t:jp(e,n++,t.value)}))},t}(Yp);function Qp(){return qp||(qp=new Jp([]))}function $p(e){var t=tm(e);if(t)return t.fromEntrySeq();if("object"==typeof e)return new Gp(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function em(e){var t=tm(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function tm(e){return zp(e)?new Jp(e):Dp(e)?new Kp(e):void 0}function rm(e){return Boolean(e&&e["@@__IMMUTABLE_MAP__@@"])}function nm(e){return rm(e)&&Ip(e)}function om(e){return Boolean(e&&"function"==typeof e.equals&&"function"==typeof e.hashCode)}function im(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(om(e)&&om(t)&&e.equals(t))}var sm="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function am(e){return e>>>1&1073741824|3221225471&e}var cm=Object.prototype.valueOf;function lm(e){if(null==e)return um(e);if("function"==typeof e.hashCode)return am(e.hashCode(e));var t,r=(t=e).valueOf!==cm&&"function"==typeof t.valueOf?t.valueOf(t):t;if(null==r)return um(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;t!==e&&(t^=4294967295*e);for(;e>4294967295;)t^=e/=4294967295;return am(t)}(r);case"string":return r.length>wm?function(e){var t=Am[e];void 0===t&&(t=dm(e),Em===xm&&(Em=0,Am={}),Em++,Am[e]=t);return t}(r):dm(r);case"object":case"function":return function(e){var t;if(gm&&void 0!==(t=mm.get(e)))return t;if(void 0!==(t=e[vm]))return t;if(!fm){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[vm]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=pm(),gm)mm.set(e,t);else{if(void 0!==hm&&!1===hm(e))throw new Error("Non-extensible objects are not allowed as keys.");if(fm)Object.defineProperty(e,vm,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[vm]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[vm]=t}}return t}(r);case"symbol":return function(e){var t=ym[e];if(void 0!==t)return t;return t=pm(),ym[e]=t,t}(r);default:if("function"==typeof r.toString)return dm(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function um(e){return null===e?1108378658:1108378659}function dm(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return am(t)}var hm=Object.isExtensible,fm=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();function pm(){var e=++bm;return 1073741824&bm&&(bm=0),e}var mm,gm="function"==typeof WeakMap;gm&&(mm=new WeakMap);var ym=Object.create(null),bm=0,vm="__immutablehash__";"function"==typeof Symbol&&(vm=Symbol(vm));var wm=16,xm=255,Em=0,Am={},Rm=function(e){function t(e,t){this._iter=e,this._useKeys=t,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this._iter.get(e,t)},t.prototype.has=function(e){return this._iter.has(e)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var e=this,t=Tm(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},t.prototype.map=function(e,t){var r=this,n=Mm(this,e,t);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(e,t)}),n},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t,n){return e(t,n,r)}),t)},t.prototype.__iterator=function(e,t){return this._iter.__iterator(e,t)},t}(Hp);Rm.prototype[Op]=!0;var _m=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this,n=0;return t&&hp(this),this._iter.__iterate((function(o){return e(o,t?r.size-++n:n++,r)}),t)},t.prototype.__iterator=function(e,t){var r=this,n=this._iter.__iterator(1,t),o=0;return t&&hp(this),new Cp((function(){var i=n.next();return i.done?i:jp(e,t?r.size-++o:o++,i.value,i)}))},t}(Yp),km=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new Cp((function(){var t=r.next();return t.done?t:jp(e,t.value,t.value,t)}))},t}(Xp),Sm=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){if(t){Pm(t);var n=wp(t);return e(n?t.get(1):t[1],n?t.get(0):t[0],r)}}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new Cp((function(){for(;;){var t=r.next();if(t.done)return t;var n=t.value;if(n){Pm(n);var o=wp(n);return jp(e,o?n.get(0):n[0],o?n.get(1):n[1],t)}}}))},t}(Hp);function Nm(e){var t=zm(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Lm,t.__iterateUncached=function(t,r){var n=this;return e.__iterate((function(e,r){return!1!==t(r,e,n)}),r)},t.__iteratorUncached=function(t,r){if(2===t){var n=e.__iterator(t,r);return new Cp((function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,r)},t}function Mm(e,t,r){var n=zm(e);return n.size=e.size,n.has=function(t){return e.has(t)},n.get=function(n,o){var i=e.get(n,lp);return i===lp?o:t.call(r,i,n,e)},n.__iterateUncached=function(n,o){var i=this;return e.__iterate((function(e,o,s){return!1!==n(t.call(r,e,o,s),o,i)}),o)},n.__iteratorUncached=function(n,o){var i=e.__iterator(2,o);return new Cp((function(){var o=i.next();if(o.done)return o;var s=o.value,a=s[0];return jp(n,a,t.call(r,s[1],a,e),o)}))},n}function Tm(e,t){var r=this,n=zm(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Nm(e);return t.reverse=function(){return e.flip()},t}),n.get=function(r,n){return e.get(t?r:-1-r,n)},n.has=function(r){return e.has(t?r:-1-r)},n.includes=function(t){return e.includes(t)},n.cacheResult=Lm,n.__iterate=function(r,n){var o=this,i=0;return n&&hp(e),e.__iterate((function(e,s){return r(e,t?s:n?o.size-++i:i++,o)}),!n)},n.__iterator=function(n,o){var i=0;o&&hp(e);var s=e.__iterator(2,!o);return new Cp((function(){var e=s.next();if(e.done)return e;var a=e.value;return jp(n,t?a[0]:o?r.size-++i:i++,a[1],e)}))},n}function Om(e,t,r,n){var o=zm(e);return n&&(o.has=function(n){var o=e.get(n,lp);return o!==lp&&!!t.call(r,o,n,e)},o.get=function(n,o){var i=e.get(n,lp);return i!==lp&&t.call(r,i,n,e)?i:o}),o.__iterateUncached=function(o,i){var s=this,a=0;return e.__iterate((function(e,i,c){if(t.call(r,e,i,c))return a++,o(e,n?i:a-1,s)}),i),a},o.__iteratorUncached=function(o,i){var s=e.__iterator(2,i),a=0;return new Cp((function(){for(;;){var i=s.next();if(i.done)return i;var c=i.value,l=c[0],u=c[1];if(t.call(r,u,l,e))return jp(o,n?l:a++,u,i)}}))},o}function Im(e,t,r,n){var o=e.size;if(mp(t,r,o))return e;var i=gp(t,o),s=yp(r,o);if(i!=i||s!=s)return Im(e.toSeq().cacheResult(),t,r,n);var a,c=s-i;c==c&&(a=c<0?0:c);var l=zm(e);return l.size=0===a?a:e.size&&a||void 0,!n&&Np(e)&&a>=0&&(l.get=function(t,r){return(t=fp(this,t))>=0&&t<a?e.get(t+i,r):r}),l.__iterateUncached=function(t,r){var o=this;if(0===a)return 0;if(r)return this.cacheResult().__iterate(t,r);var s=0,c=!0,l=0;return e.__iterate((function(e,r){if(!c||!(c=s++<i))return l++,!1!==t(e,n?r:l-1,o)&&l!==a})),l},l.__iteratorUncached=function(t,r){if(0!==a&&r)return this.cacheResult().__iterator(t,r);if(0===a)return new Cp(Up);var o=e.__iterator(t,r),s=0,c=0;return new Cp((function(){for(;s++<i;)o.next();if(++c>a)return{value:void 0,done:!0};var e=o.next();return n||1===t||e.done?e:jp(t,c-1,0===t?void 0:e.value[1],e)}))},l}function Fm(e,t,r,n){var o=zm(e);return o.__iterateUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterate(o,i);var a=!0,c=0;return e.__iterate((function(e,i,l){if(!a||!(a=t.call(r,e,i,l)))return c++,o(e,n?i:c-1,s)})),c},o.__iteratorUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterator(o,i);var a=e.__iterator(2,i),c=!0,l=0;return new Cp((function(){var e,i,u;do{if((e=a.next()).done)return n||1===o?e:jp(o,l++,0===o?void 0:e.value[1],e);var d=e.value;i=d[0],u=d[1],c&&(c=t.call(r,u,i,s))}while(c);return 2===o?e:jp(o,i,u,e)}))},o}function Wm(e,t){var r=xp(e),n=[e].concat(t).map((function(e){return wp(e)?r&&(e=_p(e)):e=r?$p(e):em(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===n.length)return e;if(1===n.length){var o=n[0];if(o===e||r&&xp(o)||Ep(e)&&Ep(o))return o}var i=new Jp(n);return r?i=i.toKeyedSeq():Ep(e)||(i=i.toSetSeq()),(i=i.flatten(!0)).size=n.reduce((function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}}),0),i}function Cm(e,t,r){var n=zm(e);return n.__iterateUncached=function(o,i){if(i)return this.cacheResult().__iterate(o,i);var s=0,a=!1;return function e(c,l){c.__iterate((function(i,c){return(!t||l<t)&&wp(i)?e(i,l+1):(s++,!1===o(i,r?c:s-1,n)&&(a=!0)),!a}),i)}(e,0),s},n.__iteratorUncached=function(n,o){if(o)return this.cacheResult().__iterator(n,o);var i=e.__iterator(n,o),s=[],a=0;return new Cp((function(){for(;i;){var e=i.next();if(!1===e.done){var c=e.value;if(2===n&&(c=c[1]),t&&!(s.length<t)||!wp(c))return r?e:jp(n,a++,c,e);s.push(i),i=c.__iterator(n,o)}else i=s.pop()}return{value:void 0,done:!0}}))},n}function jm(e,t,r){t||(t=Hm);var n=xp(e),o=0,i=e.toSeq().map((function(t,n){return[n,t,o++,r?r(t,n,e):t]})).valueSeq().toArray();return i.sort((function(e,r){return t(e[3],r[3])||e[2]-r[2]})).forEach(n?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),n?Hp(i):Ep(e)?Yp(i):Xp(i)}function Um(e,t,r){if(t||(t=Hm),r){var n=e.toSeq().map((function(t,n){return[t,r(t,n,e)]})).reduce((function(e,r){return Dm(t,e[1],r[1])?r:e}));return n&&n[0]}return e.reduce((function(e,r){return Dm(t,e,r)?r:e}))}function Dm(e,t,r){var n=e(r,t);return 0===n&&r!==t&&(null==r||r!=r)||n>0}function Bm(e,t,r,n){var o=zm(e),i=new Jp(r).map((function(e){return e.size}));return o.size=n?i.max():i.min(),o.__iterate=function(e,t){for(var r,n=this.__iterator(1,t),o=0;!(r=n.next()).done&&!1!==e(r.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=Rp(e),Vp(o?e.reverse():e)})),s=0,a=!1;return new Cp((function(){var r;return a||(r=i.map((function(e){return e.next()})),a=n?r.every((function(e){return e.done})):r.some((function(e){return e.done}))),a?{value:void 0,done:!0}:jp(e,s++,t.apply(null,r.map((function(e){return e.value}))))}))},o}function Vm(e,t){return e===t?e:Np(e)?t:e.constructor(t)}function Pm(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Zm(e){return xp(e)?_p:Ep(e)?kp:Sp}function zm(e){return Object.create((xp(e)?Hp:Ep(e)?Yp:Xp).prototype)}function Lm(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Lp.prototype.cacheResult.call(this)}function Hm(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e<t?-1:0}function Ym(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),o=0;o<r;o++)n[o]=e[o+t];return n}function Xm(e,t){if(!e)throw new Error(t)}function Jm(e){Xm(e!==1/0,"Cannot perform this action with an infinite size.")}function Gm(e){if(zp(e)&&"string"!=typeof e)return e;if(Ip(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}_m.prototype.cacheResult=Rm.prototype.cacheResult=km.prototype.cacheResult=Sm.prototype.cacheResult=Lm;var qm=Object.prototype.toString;function Km(e){return"object"==typeof e&&(Tp(e)||Array.isArray(e)||function(e){if(!e||"object"!=typeof e||"[object Object]"!==qm.call(e))return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var r=t,n=Object.getPrototypeOf(t);null!==n;)r=n,n=Object.getPrototypeOf(r);return r===t}(e))}function Qm(e){try{return"string"==typeof e?JSON.stringify(e):String(e)}catch(t){return JSON.stringify(e)}}function $m(e,t,r){return Tp(e)?e.get(t,r):function(e,t){return Tp(e)?e.has(t):Km(e)&&Zp.call(e,t)}(e,t)?"function"==typeof e.get?e.get(t):e[t]:r}function eg(e){if(Array.isArray(e))return Ym(e);var t={};for(var r in e)Zp.call(e,r)&&(t[r]=e[r]);return t}function tg(e,t,r,n){n||(n=r,r=void 0);var o=rg(Tp(e),e,Gm(t),0,r,n);return o===lp?r:o}function rg(e,t,r,n,o,i){var s=t===lp;if(n===r.length){var a=s?o:t,c=i(a);return c===a?t:c}if(!s&&!Km(t))throw new TypeError("Cannot update within non-data-structure value in path ["+r.slice(0,n).map(Qm)+"]: "+t);var l=r[n],u=s?lp:$m(t,l,lp),d=rg(u===lp?e:Tp(u),u,r,n+1,o,i);return d===u?t:d===lp?function(e,t){if(!Km(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Tp(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!Zp.call(e,t))return e;var r=eg(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}(t,l):function(e,t,r){if(!Km(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Tp(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(Zp.call(e,t)&&r===e[t])return e;var n=eg(e);return n[t]=r,n}(s?e?Fg():{}:t,l,d)}function ng(e,t){return function(e,t,r){return tg(e,t,lp,(function(){return r}))}(this,e,t)}function og(e){return function(e,t){return tg(e,t,(function(){return lp}))}(this,e)}function ig(e,t,r,n){return tg(e,[t],r,n)}function sg(e,t,r){return 1===arguments.length?e(this):ig(this,e,t,r)}function ag(e,t,r){return tg(this,e,t,r)}function cg(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return ug(this,e)}function lg(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return ug(this,t,e)}function ug(e,t,r){for(var n=[],o=0;o<t.length;o++){var i=_p(t[o]);0!==i.size&&n.push(i)}return 0===n.length?e:0!==e.toSeq().size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var t=r?function(t,n){ig(e,n,lp,(function(e){return e===lp?t:r(e,t,n)}))}:function(t,r){e.set(r,t)},o=0;o<n.length;o++)n[o].forEach(t)})):e.constructor(n[0])}function dg(e,t,r){return hg(e,t,function(e){function t(r,n,o){return Km(r)&&Km(n)&&(i=n,s=Lp(r),a=Lp(i),Ep(s)===Ep(a)&&xp(s)===xp(a))?hg(r,[n],t):e?e(r,n,o):n;var i,s,a}return t}(r))}function hg(e,t,r){if(!Km(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(Tp(e))return"function"==typeof r&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),o=e,i=n?kp:_p,s=n?function(t){o===e&&(o=eg(o)),o.push(t)}:function(t,n){var i=Zp.call(o,n),s=i&&r?r(o[n],t,n):t;i&&s===o[n]||(o===e&&(o=eg(o)),o[n]=s)},a=0;a<t.length;a++)i(t[a]).forEach(s);return o}function fg(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return dg(this,e)}function pg(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return dg(this,t,e)}function mg(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return tg(this,e,Fg(),(function(e){return hg(e,t)}))}function gg(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return tg(this,e,Fg(),(function(e){return dg(e,t)}))}function yg(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function bg(){return this.__ownerID?this:this.__ensureOwner(new dp)}function vg(){return this.__ensureOwner()}function wg(){return this.__altered}var xg=function(e){function t(t){return null==t?Fg():rm(t)&&!Ip(t)?t:Fg().withMutations((function(r){var n=e(t);Jm(n.size),n.forEach((function(e,t){return r.set(t,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Fg().withMutations((function(t){for(var r=0;r<e.length;r+=2){if(r+1>=e.length)throw new Error("Missing value for key: "+e[r]);t.set(e[r],e[r+1])}}))},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return Wg(this,e,t)},t.prototype.remove=function(e){return Wg(this,e,lp)},t.prototype.deleteAll=function(e){var t=Rp(e);return 0===t.size?this:this.withMutations((function(e){t.forEach((function(t){return e.remove(t)}))}))},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Fg()},t.prototype.sort=function(e){return oy(jm(this,e))},t.prototype.sortBy=function(e,t){return oy(jm(this,t,e))},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){n.forEach((function(o,i){n.set(i,e.call(t,o,i,r))}))}))},t.prototype.__iterator=function(e,t){return new Mg(this,e,t)},t.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate((function(t){return n++,e(t[1],t[0],r)}),t),n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ig(this.size,this._root,e,this.__hash):0===this.size?Fg():(this.__ownerID=e,this.__altered=!1,this)},t}(_p);xg.isMap=rm;var Eg=xg.prototype;Eg["@@__IMMUTABLE_MAP__@@"]=!0,Eg.delete=Eg.remove,Eg.removeAll=Eg.deleteAll,Eg.setIn=ng,Eg.removeIn=Eg.deleteIn=og,Eg.update=sg,Eg.updateIn=ag,Eg.merge=Eg.concat=cg,Eg.mergeWith=lg,Eg.mergeDeep=fg,Eg.mergeDeepWith=pg,Eg.mergeIn=mg,Eg.mergeDeepIn=gg,Eg.withMutations=yg,Eg.wasAltered=wg,Eg.asImmutable=vg,Eg["@@transducer/init"]=Eg.asMutable=bg,Eg["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},Eg["@@transducer/result"]=function(e){return e.asImmutable()};var Ag=function(e,t){this.ownerID=e,this.entries=t};Ag.prototype.get=function(e,t,r,n){for(var o=this.entries,i=0,s=o.length;i<s;i++)if(im(r,o[i][0]))return o[i][1];return n},Ag.prototype.update=function(e,t,r,n,o,i,s){for(var a=o===lp,c=this.entries,l=0,u=c.length;l<u&&!im(n,c[l][0]);l++);var d=l<u;if(d?c[l][1]===o:a)return this;if(up(s),(a||!d)&&up(i),!a||1!==c.length){if(!d&&!a&&c.length>=Vg)return function(e,t,r,n){e||(e=new dp);for(var o=new Sg(e,lm(r),[r,n]),i=0;i<t.length;i++){var s=t[i];o=o.update(e,0,void 0,s[0],s[1])}return o}(e,c,n,o);var h=e&&e===this.ownerID,f=h?c:Ym(c);return d?a?l===u-1?f.pop():f[l]=f.pop():f[l]=[n,o]:f.push([n,o]),h?(this.entries=f,this):new Ag(e,f)}};var Rg=function(e,t,r){this.ownerID=e,this.bitmap=t,this.nodes=r};Rg.prototype.get=function(e,t,r,n){void 0===t&&(t=lm(r));var o=1<<(31&(0===e?t:t>>>e)),i=this.bitmap;return 0==(i&o)?n:this.nodes[Dg(i&o-1)].get(e+5,t,r,n)},Rg.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=lm(n));var a=31&(0===t?r:r>>>t),c=1<<a,l=this.bitmap,u=0!=(l&c);if(!u&&o===lp)return this;var d=Dg(l&c-1),h=this.nodes,f=u?h[d]:void 0,p=Cg(f,e,t+5,r,n,o,i,s);if(p===f)return this;if(!u&&p&&h.length>=Pg)return function(e,t,r,n,o){for(var i=0,s=new Array(32),a=0;0!==r;a++,r>>>=1)s[a]=1&r?t[i++]:void 0;return s[n]=o,new _g(e,i+1,s)}(e,h,l,a,p);if(u&&!p&&2===h.length&&jg(h[1^d]))return h[1^d];if(u&&p&&1===h.length&&jg(p))return p;var m=e&&e===this.ownerID,g=u?p?l:l^c:l|c,y=u?p?Bg(h,d,p,m):function(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var o=new Array(n),i=0,s=0;s<n;s++)s===t&&(i=1),o[s]=e[s+i];return o}(h,d,m):function(e,t,r,n){var o=e.length+1;if(n&&t+1===o)return e[t]=r,e;for(var i=new Array(o),s=0,a=0;a<o;a++)a===t?(i[a]=r,s=-1):i[a]=e[a+s];return i}(h,d,p,m);return m?(this.bitmap=g,this.nodes=y,this):new Rg(e,g,y)};var _g=function(e,t,r){this.ownerID=e,this.count=t,this.nodes=r};_g.prototype.get=function(e,t,r,n){void 0===t&&(t=lm(r));var o=31&(0===e?t:t>>>e),i=this.nodes[o];return i?i.get(e+5,t,r,n):n},_g.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=lm(n));var a=31&(0===t?r:r>>>t),c=o===lp,l=this.nodes,u=l[a];if(c&&!u)return this;var d=Cg(u,e,t+5,r,n,o,i,s);if(d===u)return this;var h=this.count;if(u){if(!d&&--h<Zg)return function(e,t,r,n){for(var o=0,i=0,s=new Array(r),a=0,c=1,l=t.length;a<l;a++,c<<=1){var u=t[a];void 0!==u&&a!==n&&(o|=c,s[i++]=u)}return new Rg(e,o,s)}(e,l,h,a)}else h++;var f=e&&e===this.ownerID,p=Bg(l,a,d,f);return f?(this.count=h,this.nodes=p,this):new _g(e,h,p)};var kg=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entries=r};kg.prototype.get=function(e,t,r,n){for(var o=this.entries,i=0,s=o.length;i<s;i++)if(im(r,o[i][0]))return o[i][1];return n},kg.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=lm(n));var a=o===lp;if(r!==this.keyHash)return a?this:(up(s),up(i),Ug(this,e,t,r,[n,o]));for(var c=this.entries,l=0,u=c.length;l<u&&!im(n,c[l][0]);l++);var d=l<u;if(d?c[l][1]===o:a)return this;if(up(s),(a||!d)&&up(i),a&&2===u)return new Sg(e,this.keyHash,c[1^l]);var h=e&&e===this.ownerID,f=h?c:Ym(c);return d?a?l===u-1?f.pop():f[l]=f.pop():f[l]=[n,o]:f.push([n,o]),h?(this.entries=f,this):new kg(e,this.keyHash,f)};var Sg=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entry=r};Sg.prototype.get=function(e,t,r,n){return im(r,this.entry[0])?this.entry[1]:n},Sg.prototype.update=function(e,t,r,n,o,i,s){var a=o===lp,c=im(n,this.entry[0]);return(c?o===this.entry[1]:a)?this:(up(s),a?void up(i):c?e&&e===this.ownerID?(this.entry[1]=o,this):new Sg(e,this.keyHash,[n,o]):(up(i),Ug(this,e,t,lm(n),[n,o])))},Ag.prototype.iterate=kg.prototype.iterate=function(e,t){for(var r=this.entries,n=0,o=r.length-1;n<=o;n++)if(!1===e(r[t?o-n:n]))return!1},Rg.prototype.iterate=_g.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,o=r.length-1;n<=o;n++){var i=r[t?o-n:n];if(i&&!1===i.iterate(e,t))return!1}},Sg.prototype.iterate=function(e,t){return e(this.entry)};var Ng,Mg=function(e){function t(e,t,r){this._type=t,this._reverse=r,this._stack=e._root&&Og(e._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var r=t.node,n=t.index++,o=void 0;if(r.entry){if(0===n)return Tg(e,r.entry)}else if(r.entries){if(n<=(o=r.entries.length-1))return Tg(e,r.entries[this._reverse?o-n:n])}else if(n<=(o=r.nodes.length-1)){var i=r.nodes[this._reverse?o-n:n];if(i){if(i.entry)return Tg(e,i.entry);t=this._stack=Og(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}},t}(Cp);function Tg(e,t){return jp(e,t[0],t[1])}function Og(e,t){return{node:e,index:0,__prev:t}}function Ig(e,t,r,n){var o=Object.create(Eg);return o.size=e,o._root=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Fg(){return Ng||(Ng=Ig(0))}function Wg(e,t,r){var n,o;if(e._root){var i={value:!1},s={value:!1};if(n=Cg(e._root,e.__ownerID,0,void 0,t,r,i,s),!s.value)return e;o=e.size+(i.value?r===lp?-1:1:0)}else{if(r===lp)return e;o=1,n=new Ag(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=o,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?Ig(o,n):Fg()}function Cg(e,t,r,n,o,i,s,a){return e?e.update(t,r,n,o,i,s,a):i===lp?e:(up(a),up(s),new Sg(t,n,[o,i]))}function jg(e){return e.constructor===Sg||e.constructor===kg}function Ug(e,t,r,n,o){if(e.keyHash===n)return new kg(t,n,[e.entry,o]);var i,s=31&(0===r?e.keyHash:e.keyHash>>>r),a=31&(0===r?n:n>>>r),c=s===a?[Ug(e,t,r+5,n,o)]:(i=new Sg(t,n,o),s<a?[e,i]:[i,e]);return new Rg(t,1<<s|1<<a,c)}function Dg(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Bg(e,t,r,n){var o=n?e:Ym(e);return o[t]=r,o}var Vg=8,Pg=16,Zg=8;function zg(e){return Boolean(e&&e["@@__IMMUTABLE_LIST__@@"])}var Lg=function(e){function t(t){var r=Kg();if(null==t)return r;if(zg(t))return t;var n=e(t),o=n.size;return 0===o?r:(Jm(o),o>0&&o<32?qg(0,o,5,null,new Yg(n.toArray())):r.withMutations((function(e){e.setSize(o),n.forEach((function(t,r){return e.set(r,t)}))})))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(e,t){if((e=fp(this,e))>=0&&e<this.size){var r=ey(this,e+=this._origin);return r&&r.array[31&e]}return t},t.prototype.set=function(e,t){return function(e,t,r){if((t=fp(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?ty(e,t).set(0,r):ty(e,0,t+1).set(t,r)}));t+=e._origin;var n=e._tail,o=e._root,i={value:!1};t>=ry(e._capacity)?n=Qg(n,e.__ownerID,0,t,r,i):o=Qg(o,e.__ownerID,e._level,t,r,i);if(!i.value)return e;if(e.__ownerID)return e._root=o,e._tail=n,e.__hash=void 0,e.__altered=!0,e;return qg(e._origin,e._capacity,e._level,o,n)}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):Kg()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(r){ty(r,0,t+e.length);for(var n=0;n<e.length;n++)r.set(t+n,e[n])}))},t.prototype.pop=function(){return ty(this,0,-1)},t.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){ty(t,-e.length);for(var r=0;r<e.length;r++)t.set(r,e[r])}))},t.prototype.shift=function(){return ty(this,1)},t.prototype.concat=function(){for(var t=arguments,r=[],n=0;n<arguments.length;n++){var o=t[n],i=e("string"!=typeof o&&Dp(o)?o:[o]);0!==i.size&&r.push(i)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations((function(e){r.forEach((function(t){return t.forEach((function(t){return e.push(t)}))}))})):this.constructor(r[0])},t.prototype.setSize=function(e){return ty(this,0,e)},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){for(var o=0;o<r.size;o++)n.set(o,e.call(t,n.get(o),o,r))}))},t.prototype.slice=function(e,t){var r=this.size;return mp(e,t,r)?this:ty(this,gp(e,r),yp(t,r))},t.prototype.__iterator=function(e,t){var r=t?this.size:0,n=Gg(this,t);return new Cp((function(){var o=n();return o===Jg?{value:void 0,done:!0}:jp(e,t?--r:r++,o)}))},t.prototype.__iterate=function(e,t){for(var r,n=t?this.size:0,o=Gg(this,t);(r=o())!==Jg&&!1!==e(r,t?--n:n++,this););return n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?qg(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):0===this.size?Kg():(this.__ownerID=e,this.__altered=!1,this)},t}(kp);Lg.isList=zg;var Hg=Lg.prototype;Hg["@@__IMMUTABLE_LIST__@@"]=!0,Hg.delete=Hg.remove,Hg.merge=Hg.concat,Hg.setIn=ng,Hg.deleteIn=Hg.removeIn=og,Hg.update=sg,Hg.updateIn=ag,Hg.mergeIn=mg,Hg.mergeDeepIn=gg,Hg.withMutations=yg,Hg.wasAltered=wg,Hg.asImmutable=vg,Hg["@@transducer/init"]=Hg.asMutable=bg,Hg["@@transducer/step"]=function(e,t){return e.push(t)},Hg["@@transducer/result"]=function(e){return e.asImmutable()};var Yg=function(e,t){this.array=e,this.ownerID=t};Yg.prototype.removeBefore=function(e,t,r){if(r===t?1<<t:0===this.array.length)return this;var n=r>>>t&31;if(n>=this.array.length)return new Yg([],e);var o,i=0===n;if(t>0){var s=this.array[n];if((o=s&&s.removeBefore(e,t-5,r))===s&&i)return this}if(i&&!o)return this;var a=$g(this,e);if(!i)for(var c=0;c<n;c++)a.array[c]=void 0;return o&&(a.array[n]=o),a},Yg.prototype.removeAfter=function(e,t,r){if(r===(t?1<<t:0)||0===this.array.length)return this;var n,o=r-1>>>t&31;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((n=i&&i.removeAfter(e,t-5,r))===i&&o===this.array.length-1)return this}var s=$g(this,e);return s.array.splice(o+1),n&&(s.array[o]=n),s};var Xg,Jg={};function Gg(e,t){var r=e._origin,n=e._capacity,o=ry(n),i=e._tail;return s(e._root,e._level,0);function s(e,a,c){return 0===a?function(e,s){var a=s===o?i&&i.array:e&&e.array,c=s>r?0:r-s,l=n-s;l>32&&(l=32);return function(){if(c===l)return Jg;var e=t?--l:c++;return a&&a[e]}}(e,c):function(e,o,i){var a,c=e&&e.array,l=i>r?0:r-i>>o,u=1+(n-i>>o);u>32&&(u=32);return function(){for(;;){if(a){var e=a();if(e!==Jg)return e;a=null}if(l===u)return Jg;var r=t?--u:l++;a=s(c&&c[r],o-5,i+(r<<o))}}}(e,a,c)}}function qg(e,t,r,n,o,i,s){var a=Object.create(Hg);return a.size=t-e,a._origin=e,a._capacity=t,a._level=r,a._root=n,a._tail=o,a.__ownerID=i,a.__hash=s,a.__altered=!1,a}function Kg(){return Xg||(Xg=qg(0,0,5))}function Qg(e,t,r,n,o,i){var s,a=n>>>r&31,c=e&&a<e.array.length;if(!c&&void 0===o)return e;if(r>0){var l=e&&e.array[a],u=Qg(l,t,r-5,n,o,i);return u===l?e:((s=$g(e,t)).array[a]=u,s)}return c&&e.array[a]===o?e:(i&&up(i),s=$g(e,t),void 0===o&&a===s.array.length-1?s.array.pop():s.array[a]=o,s)}function $g(e,t){return t&&e&&t===e.ownerID?e:new Yg(e?e.array.slice():[],t)}function ey(e,t){if(t>=ry(e._capacity))return e._tail;if(t<1<<e._level+5){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&31],n-=5;return r}}function ty(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new dp,o=e._origin,i=e._capacity,s=o+t,a=void 0===r?i:r<0?i+r:o+r;if(s===o&&a===i)return e;if(s>=a)return e.clear();for(var c=e._level,l=e._root,u=0;s+u<0;)l=new Yg(l&&l.array.length?[void 0,l]:[],n),u+=1<<(c+=5);u&&(s+=u,o+=u,a+=u,i+=u);for(var d=ry(i),h=ry(a);h>=1<<c+5;)l=new Yg(l&&l.array.length?[l]:[],n),c+=5;var f=e._tail,p=h<d?ey(e,a-1):h>d?new Yg([],n):f;if(f&&h>d&&s<i&&f.array.length){for(var m=l=$g(l,n),g=c;g>5;g-=5){var y=d>>>g&31;m=m.array[y]=$g(m.array[y],n)}m.array[d>>>5&31]=f}if(a<i&&(p=p&&p.removeAfter(n,0,a)),s>=h)s-=h,a-=h,c=5,l=null,p=p&&p.removeBefore(n,0,s);else if(s>o||h<d){for(u=0;l;){var b=s>>>c&31;if(b!==h>>>c&31)break;b&&(u+=(1<<c)*b),c-=5,l=l.array[b]}l&&s>o&&(l=l.removeBefore(n,c,s-u)),l&&h<d&&(l=l.removeAfter(n,c,h-u)),u&&(s-=u,a-=u)}return e.__ownerID?(e.size=a-s,e._origin=s,e._capacity=a,e._level=c,e._root=l,e._tail=p,e.__hash=void 0,e.__altered=!0,e):qg(s,a,c,l,p)}function ry(e){return e<32?0:e-1>>>5<<5}var ny,oy=function(e){function t(e){return null==e?sy():nm(e)?e:sy().withMutations((function(t){var r=_p(e);Jm(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(e,t){var r=this._map.get(e);return void 0!==r?this._list.get(r)[1]:t},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):sy()},t.prototype.set=function(e,t){return ay(this,e,t)},t.prototype.remove=function(e){return ay(this,e,lp)},t.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],r)}),t)},t.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),r=this._list.__ensureOwner(e);return e?iy(t,r,e,this.__hash):0===this.size?sy():(this.__ownerID=e,this.__altered=!1,this._map=t,this._list=r,this)},t}(xg);function iy(e,t,r,n){var o=Object.create(oy.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function sy(){return ny||(ny=iy(Fg(),Kg()))}function ay(e,t,r){var n,o,i=e._map,s=e._list,a=i.get(t),c=void 0!==a;if(r===lp){if(!c)return e;s.size>=32&&s.size>=2*i.size?(n=(o=s.filter((function(e,t){return void 0!==e&&a!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(n.__ownerID=o.__ownerID=e.__ownerID)):(n=i.remove(t),o=a===s.size-1?s.pop():s.set(a,void 0))}else if(c){if(r===s.get(a)[1])return e;n=i,o=s.set(a,[t,r])}else n=i.set(t,s.size),o=s.set(s.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=o,e.__hash=void 0,e.__altered=!0,e):iy(n,o)}oy.isOrderedMap=nm,oy.prototype[Op]=!0,oy.prototype.delete=oy.prototype.remove;function cy(e){return Boolean(e&&e["@@__IMMUTABLE_STACK__@@"])}var ly=function(e){function t(e){return null==e?fy():cy(e)?e:fy().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var r=this._head;for(e=fp(this,e);r&&e--;)r=r.next;return r?r.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:e[n],next:r};return this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):hy(t,r)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&cy(t))return t;Jm(t.size);var r=this.size,n=this._head;return t.__iterate((function(e){r++,n={value:e,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):hy(r,n)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):fy()},t.prototype.slice=function(t,r){if(mp(t,r,this.size))return this;var n=gp(t,this.size);if(yp(r,this.size)!==this.size)return e.prototype.slice.call(this,t,r);for(var o=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):hy(o,i)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?hy(this.size,this._head,e,this.__hash):0===this.size?fy():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var r=this;if(t)return new Jp(this.toArray()).__iterate((function(t,n){return e(t,n,r)}),t);for(var n=0,o=this._head;o&&!1!==e(o.value,n++,this);)o=o.next;return n},t.prototype.__iterator=function(e,t){if(t)return new Jp(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new Cp((function(){if(n){var t=n.value;return n=n.next,jp(e,r++,t)}return{value:void 0,done:!0}}))},t}(kp);ly.isStack=cy;var uy,dy=ly.prototype;function hy(e,t,r,n){var o=Object.create(dy);return o.size=e,o._head=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function fy(){return uy||(uy=hy(0))}dy["@@__IMMUTABLE_STACK__@@"]=!0,dy.shift=dy.pop,dy.unshift=dy.push,dy.unshiftAll=dy.pushAll,dy.withMutations=yg,dy.wasAltered=wg,dy.asImmutable=vg,dy["@@transducer/init"]=dy.asMutable=bg,dy["@@transducer/step"]=function(e,t){return e.unshift(t)},dy["@@transducer/result"]=function(e){return e.asImmutable()};function py(e){return Boolean(e&&e["@@__IMMUTABLE_SET__@@"])}function my(e){return py(e)&&Ip(e)}function gy(e,t){if(e===t)return!0;if(!wp(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||xp(e)!==xp(t)||Ep(e)!==Ep(t)||Ip(e)!==Ip(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!Ap(e);if(Ip(e)){var n=e.entries();return t.every((function(e,t){var o=n.next().value;return o&&im(o[1],e)&&(r||im(o[0],t))}))&&n.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var s=!0,a=t.__iterate((function(t,n){if(r?!e.has(t):o?!im(t,e.get(n,lp)):!im(e.get(n,lp),t))return s=!1,!1}));return s&&e.size===a}function yy(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function by(e){if(!e||"object"!=typeof e)return e;if(!wp(e)){if(!Km(e))return e;e=Lp(e)}if(xp(e)){var t={};return e.__iterate((function(e,r){t[r]=by(e)})),t}var r=[];return e.__iterate((function(e){r.push(by(e))})),r}var vy=function(e){function t(t){return null==t?Ry():py(t)&&!Ip(t)?t:Ry().withMutations((function(r){var n=e(t);Jm(n.size),n.forEach((function(e){return r.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(_p(e).keySeq())},t.intersect=function(e){return(e=Rp(e).toArray()).length?xy.intersect.apply(t(e.pop()),e):Ry()},t.union=function(e){return(e=Rp(e).toArray()).length?xy.union.apply(t(e.pop()),e):Ry()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(e){return this._map.has(e)},t.prototype.add=function(e){return Ey(this,this._map.set(e,e))},t.prototype.remove=function(e){return Ey(this,this._map.remove(e))},t.prototype.clear=function(){return Ey(this,this._map.clear())},t.prototype.map=function(e,t){var r=this,n=!1,o=Ey(this,this._map.mapEntries((function(o){var i=o[1],s=e.call(t,i,i,r);return s!==i&&(n=!0),[s,s]}),t));return n?o:this},t.prototype.union=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return t=t.filter((function(e){return 0!==e.size})),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(r){for(var n=0;n<t.length;n++)e(t[n]).forEach((function(e){return r.add(e)}))})):this.constructor(t[0])},t.prototype.intersect=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.every((function(t){return t.includes(e)}))||n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.subtract=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.some((function(t){return t.includes(e)}))&&n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.sort=function(e){return Zy(jm(this,e))},t.prototype.sortBy=function(e,t){return Zy(jm(this,t,e))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){return this._map.__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):0===this.size?this.__empty():(this.__ownerID=e,this._map=t,this)},t}(Sp);vy.isSet=py;var wy,xy=vy.prototype;function Ey(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function Ay(e,t){var r=Object.create(xy);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function Ry(){return wy||(wy=Ay(Fg()))}xy["@@__IMMUTABLE_SET__@@"]=!0,xy.delete=xy.remove,xy.merge=xy.concat=xy.union,xy.withMutations=yg,xy.asImmutable=vg,xy["@@transducer/init"]=xy.asMutable=bg,xy["@@transducer/step"]=function(e,t){return e.add(t)},xy["@@transducer/result"]=function(e){return e.asImmutable()},xy.__empty=Ry,xy.__make=Ay;var _y,ky=function(e){function t(e,r,n){if(!(this instanceof t))return new t(e,r,n);if(Xm(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r<e&&(n=-n),this._start=e,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-e)/n-1)+1),0===this.size){if(_y)return _y;_y=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},t.prototype.get=function(e,t){return this.has(e)?this._start+fp(this,e)*this._step:t},t.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},t.prototype.slice=function(e,r){return mp(e,r,this.size)?this:(e=gp(e,this.size),(r=yp(r,this.size))<=e?new t(0,0):new t(this.get(e,this._end),this.get(r,this._end),this._step))},t.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var r=t/this._step;if(r>=0&&r<this.size)return r}return-1},t.prototype.lastIndexOf=function(e){return this.indexOf(e)},t.prototype.__iterate=function(e,t){for(var r=this.size,n=this._step,o=t?this._start+(r-1)*n:this._start,i=0;i!==r&&!1!==e(o,t?r-++i:i++,this);)o+=t?-n:n;return i},t.prototype.__iterator=function(e,t){var r=this.size,n=this._step,o=t?this._start+(r-1)*n:this._start,i=0;return new Cp((function(){if(i===r)return{value:void 0,done:!0};var s=o;return o+=t?-n:n,jp(e,t?r-++i:i++,s)}))},t.prototype.equals=function(e){return e instanceof t?this._start===e._start&&this._end===e._end&&this._step===e._step:gy(this,e)},t}(Yp);function Sy(e,t,r){for(var n=Gm(t),o=0;o!==n.length;)if((e=$m(e,n[o++],lp))===lp)return r;return e}function Ny(e,t){return Sy(this,e,t)}function My(){Jm(this.size);var e={};return this.__iterate((function(t,r){e[r]=t})),e}Rp.isIterable=wp,Rp.isKeyed=xp,Rp.isIndexed=Ep,Rp.isAssociative=Ap,Rp.isOrdered=Ip,Rp.Iterator=Cp,yy(Rp,{toArray:function(){Jm(this.size);var e=new Array(this.size||0),t=xp(this),r=0;return this.__iterate((function(n,o){e[r++]=t?[o,n]:n})),e},toIndexedSeq:function(){return new _m(this)},toJS:function(){return by(this)},toKeyedSeq:function(){return new Rm(this,!0)},toMap:function(){return xg(this.toKeyedSeq())},toObject:My,toOrderedMap:function(){return oy(this.toKeyedSeq())},toOrderedSet:function(){return Zy(xp(this)?this.valueSeq():this)},toSet:function(){return vy(xp(this)?this.valueSeq():this)},toSetSeq:function(){return new km(this)},toSeq:function(){return Ep(this)?this.toIndexedSeq():xp(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return ly(xp(this)?this.valueSeq():this)},toList:function(){return Lg(xp(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Vm(this,Wm(this,e))},includes:function(e){return this.some((function(t){return im(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){Jm(this.size);var r=!0;return this.__iterate((function(n,o,i){if(!e.call(t,n,o,i))return r=!1,!1})),r},filter:function(e,t){return Vm(this,Om(this,e,t,!0))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return Jm(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Jm(this.size),e=void 0!==e?""+e:",";var t="",r=!0;return this.__iterate((function(n){r?r=!1:t+=e,t+=null!=n?n.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return Vm(this,Mm(this,e,t))},reduce:function(e,t,r){return Wy(this,e,t,r,arguments.length<2,!1)},reduceRight:function(e,t,r){return Wy(this,e,t,r,arguments.length<2,!0)},reverse:function(){return Vm(this,Tm(this,!0))},slice:function(e,t){return Vm(this,Im(this,e,t,!0))},some:function(e,t){return!this.every(Uy(e),t)},sort:function(e){return Vm(this,jm(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return hp(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,r){var n=xg().asMutable();return e.__iterate((function(o,i){n.update(t.call(r,o,i,e),0,(function(e){return e+1}))})),n.asImmutable()}(this,e,t)},equals:function(e){return gy(this,e)},entrySeq:function(){var e=this;if(e._cache)return new Jp(e._cache);var t=e.toSeq().map(jy).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Uy(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate((function(r,o,i){if(e.call(t,r,o,i))return n=[o,r],!1})),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(e){return this.find(pp,null,e)},flatMap:function(e,t){return Vm(this,function(e,t,r){var n=Zm(e);return e.toSeq().map((function(o,i){return n(t.call(r,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Vm(this,Cm(this,e,!0))},fromEntrySeq:function(){return new Sm(this)},get:function(e,t){return this.find((function(t,r){return im(r,e)}),void 0,t)},getIn:Ny,groupBy:function(e,t){return function(e,t,r){var n=xp(e),o=(Ip(e)?oy():xg()).asMutable();e.__iterate((function(i,s){o.update(t.call(r,i,s,e),(function(e){return(e=e||[]).push(n?[s,i]:i),e}))}));var i=Zm(e);return o.map((function(t){return Vm(e,i(t))})).asImmutable()}(this,e,t)},has:function(e){return this.get(e,lp)!==lp},hasIn:function(e){return Sy(this,e,lp)!==lp},isSubset:function(e){return e="function"==typeof e.includes?e:Rp(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:Rp(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return im(t,e)}))},keySeq:function(){return this.toSeq().map(Cy).toIndexedSeq()},last:function(e){return this.toSeq().reverse().first(e)},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Um(this,e)},maxBy:function(e,t){return Um(this,t,e)},min:function(e){return Um(this,e?Dy(e):Vy)},minBy:function(e,t){return Um(this,t?Dy(t):Vy,e)},rest:function(){return this.slice(1)},skip:function(e){return 0===e?this:this.slice(Math.max(0,e))},skipLast:function(e){return 0===e?this:this.slice(0,-Math.max(0,e))},skipWhile:function(e,t){return Vm(this,Fm(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Uy(e),t)},sortBy:function(e,t){return Vm(this,jm(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return this.slice(-Math.max(0,e))},takeWhile:function(e,t){return Vm(this,function(e,t,r){var n=zm(e);return n.__iterateUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterate(n,o);var s=0;return e.__iterate((function(e,o,a){return t.call(r,e,o,a)&&++s&&n(e,o,i)})),s},n.__iteratorUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterator(n,o);var s=e.__iterator(2,o),a=!0;return new Cp((function(){if(!a)return{value:void 0,done:!0};var e=s.next();if(e.done)return e;var o=e.value,c=o[0],l=o[1];return t.call(r,l,c,i)?2===n?e:jp(n,c,l,e):(a=!1,{value:void 0,done:!0})}))},n}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Uy(e),t)},update:function(e){return e(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=Ip(e),r=xp(e),n=t?1:0,o=e.__iterate(r?t?function(e,t){n=31*n+Py(lm(e),lm(t))|0}:function(e,t){n=n+Py(lm(e),lm(t))|0}:t?function(e){n=31*n+lm(e)|0}:function(e){n=n+lm(e)|0});return function(e,t){return t=sm(t,3432918353),t=sm(t<<15|t>>>-15,461845907),t=sm(t<<13|t>>>-13,5),t=sm((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=am((t=sm(t^t>>>13,3266489909))^t>>>16)}(o,n)}(this))}});var Ty=Rp.prototype;Ty["@@__IMMUTABLE_ITERABLE__@@"]=!0,Ty[Wp]=Ty.values,Ty.toJSON=Ty.toArray,Ty.__toStringMapper=Qm,Ty.inspect=Ty.toSource=function(){return this.toString()},Ty.chain=Ty.flatMap,Ty.contains=Ty.includes,yy(_p,{flip:function(){return Vm(this,Nm(this))},mapEntries:function(e,t){var r=this,n=0;return Vm(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],n++,r)})).fromEntrySeq())},mapKeys:function(e,t){var r=this;return Vm(this,this.toSeq().flip().map((function(n,o){return e.call(t,n,o,r)})).flip())}});var Oy=_p.prototype;Oy["@@__IMMUTABLE_KEYED__@@"]=!0,Oy[Wp]=Ty.entries,Oy.toJSON=My,Oy.__toStringMapper=function(e,t){return Qm(t)+": "+Qm(e)},yy(kp,{toKeyedSeq:function(){return new Rm(this,!1)},filter:function(e,t){return Vm(this,Om(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Vm(this,Tm(this,!1))},slice:function(e,t){return Vm(this,Im(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(t||0,0),0===r||2===r&&!t)return this;e=gp(e,e<0?this.count():this.size);var n=this.slice(0,e);return Vm(this,1===r?n:n.concat(Ym(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return Vm(this,Cm(this,e,!1))},get:function(e,t){return(e=fp(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,r){return r===e}),void 0,t)},has:function(e){return(e=fp(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Vm(this,function(e,t){var r=zm(e);return r.size=e.size&&2*e.size-1,r.__iterateUncached=function(r,n){var o=this,i=0;return e.__iterate((function(e){return(!i||!1!==r(t,i++,o))&&!1!==r(e,i++,o)}),n),i},r.__iteratorUncached=function(r,n){var o,i=e.__iterator(1,n),s=0;return new Cp((function(){return(!o||s%2)&&(o=i.next()).done?o:s%2?jp(r,s++,t):jp(r,s++,o.value,o)}))},r}(this,e))},interleave:function(){var e=[this].concat(Ym(arguments)),t=Bm(this.toSeq(),Yp.of,e),r=t.flatten(!0);return t.size&&(r.size=t.size*e.length),Vm(this,r)},keySeq:function(){return ky(0,this.size)},last:function(e){return this.get(-1,e)},skipWhile:function(e,t){return Vm(this,Fm(this,e,t,!1))},zip:function(){var e=[this].concat(Ym(arguments));return Vm(this,Bm(this,By,e))},zipAll:function(){var e=[this].concat(Ym(arguments));return Vm(this,Bm(this,By,e,!0))},zipWith:function(e){var t=Ym(arguments);return t[0]=this,Vm(this,Bm(this,e,t))}});var Iy=kp.prototype;Iy["@@__IMMUTABLE_INDEXED__@@"]=!0,Iy[Op]=!0,yy(Sp,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}});var Fy=Sp.prototype;function Wy(e,t,r,n,o,i){return Jm(e.size),e.__iterate((function(e,i,s){o?(o=!1,r=e):r=t.call(n,r,e,i,s)}),i),r}function Cy(e,t){return t}function jy(e,t){return[t,e]}function Uy(e){return function(){return!e.apply(this,arguments)}}function Dy(e){return function(){return-e.apply(this,arguments)}}function By(){return Ym(arguments)}function Vy(e,t){return e<t?1:e>t?-1:0}function Py(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}Fy.has=Ty.includes,Fy.contains=Fy.includes,Fy.keys=Fy.values,yy(Hp,Oy),yy(Yp,Iy),yy(Xp,Fy);var Zy=function(e){function t(e){return null==e?Yy():my(e)?e:Yy().withMutations((function(t){var r=Sp(e);Jm(r.size),r.forEach((function(e){return t.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(_p(e).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(vy);Zy.isOrderedSet=my;var zy,Ly=Zy.prototype;function Hy(e,t){var r=Object.create(Ly);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function Yy(){return zy||(zy=Hy(sy()))}Ly[Op]=!0,Ly.zip=Iy.zip,Ly.zipWith=Iy.zipWith,Ly.zipAll=Iy.zipAll,Ly.__empty=Yy,Ly.__make=Hy;var Xy=function(e,t){var r;!function(e){if(Mp(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Tp(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===e||"object"!=typeof e)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(e);var n=function(i){var s=this;if(i instanceof n)return i;if(!(this instanceof n))return new n(i);if(!r){r=!0;var a=Object.keys(e),c=o._indices={};o._name=t,o._keys=a,o._defaultValues=e;for(var l=0;l<a.length;l++){var u=a[l];c[u]=l,o[u]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+qy(this)+' with property "'+u+'" since that property name is part of the Record API.'):Qy(o,u)}}return this.__ownerID=void 0,this._values=Lg().withMutations((function(e){e.setSize(s._keys.length),_p(i).forEach((function(t,r){e.set(s._indices[r],t===s._defaultValues[r]?void 0:t)}))})),this},o=n.prototype=Object.create(Jy);return o.constructor=n,t&&(n.displayName=t),n};Xy.prototype.toString=function(){for(var e,t=qy(this)+" { ",r=this._keys,n=0,o=r.length;n!==o;n++)t+=(n?", ":"")+(e=r[n])+": "+Qm(this.get(e));return t+" }"},Xy.prototype.equals=function(e){return this===e||Mp(e)&&Ky(this).equals(Ky(e))},Xy.prototype.hashCode=function(){return Ky(this).hashCode()},Xy.prototype.has=function(e){return this._indices.hasOwnProperty(e)},Xy.prototype.get=function(e,t){if(!this.has(e))return t;var r=this._indices[e],n=this._values.get(r);return void 0===n?this._defaultValues[e]:n},Xy.prototype.set=function(e,t){if(this.has(e)){var r=this._values.set(this._indices[e],t===this._defaultValues[e]?void 0:t);if(r!==this._values&&!this.__ownerID)return Gy(this,r)}return this},Xy.prototype.remove=function(e){return this.set(e)},Xy.prototype.clear=function(){var e=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:Gy(this,e)},Xy.prototype.wasAltered=function(){return this._values.wasAltered()},Xy.prototype.toSeq=function(){return Ky(this)},Xy.prototype.toJS=function(){return by(this)},Xy.prototype.entries=function(){return this.__iterator(2)},Xy.prototype.__iterator=function(e,t){return Ky(this).__iterator(e,t)},Xy.prototype.__iterate=function(e,t){return Ky(this).__iterate(e,t)},Xy.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._values.__ensureOwner(e);return e?Gy(this,t,e):(this.__ownerID=e,this._values=t,this)},Xy.isRecord=Mp,Xy.getDescriptiveName=qy;var Jy=Xy.prototype;function Gy(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function qy(e){return e.constructor.displayName||e.constructor.name||"Record"}function Ky(e){return $p(e._keys.map((function(t){return[t,e.get(t)]})))}function Qy(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){Xm(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}catch(e){}}Jy["@@__IMMUTABLE_RECORD__@@"]=!0,Jy.delete=Jy.remove,Jy.deleteIn=Jy.removeIn=og,Jy.getIn=Ny,Jy.hasIn=Ty.hasIn,Jy.merge=cg,Jy.mergeWith=lg,Jy.mergeIn=mg,Jy.mergeDeep=fg,Jy.mergeDeepWith=pg,Jy.mergeDeepIn=gg,Jy.setIn=ng,Jy.update=sg,Jy.updateIn=ag,Jy.withMutations=yg,Jy.asMutable=bg,Jy.asImmutable=vg,Jy[Wp]=Jy.entries,Jy.toJSON=Jy.toObject=Ty.toObject,Jy.inspect=Jy.toSource=function(){return this.toString()};var $y;function eb(){const e=cp(),[t,r]=f($y.Initial),[n,o]=f(Lg([])),i=g((()=>Bs(this,void 0,void 0,(function*(){try{r($y.Loading);const t=(e=>({[Is.ARBITRUM_ONE]:"https://tokens.coingecko.com/arbitrum-one/all.json",[Is.AURORA]:"https://tokens.coingecko.com/aurora/all.json",[Is.BSC]:"https://tokens.coingecko.com/binance-smart-chain/all.json"}[e]||"https://tokens.coingecko.com/uniswap/all.json"))(e),n=yield te.get(t);n&&n.data&&n.data.tokens&&o(Lg(n.data.tokens)),r($y.Success)}catch(e){r($y.Failed),console.error(e)}}))),[e]);return p((()=>{e&&i()}),[e]),{cgTokenList:n,loading:t===$y.Loading,refetch:i}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}($y||($y={}));var tb=[{chainId:1,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/prKmKP8yDTuPMHTCZ_DcxG8BqsuHNO8w5KDmJWmPodg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOUVaWU1ER2ZVN3g2N3ZBZThqWkUxZzA0RExUaFhaV0JIb09wZFhpeXhHRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTVRBeU4xOHhNekkyTjJGbE5EY3dMbkJ1WncucG5n.webp"},{chainId:1,address:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:1,address:"0x4Fabb145d64652a948d72533023f6E7A623C7C53",name:"Binance USD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/xZmadzpVOnpuq2jNG_5EGKeqMET0LU_gmfnp4VxkcxI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSHQwWXZKMGNnU0lGTFM0aHExTV9jOXVITV9fMHpXaHBKSGVOQU5neTBuby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMkoxYzJSZk4ySTJOalJpWWpReVpDOWlkWE5rWHpkaU5qWTBZbUkwTW1RdWNHNW4ucG5n.webp"},{chainId:1,address:"0x6b175474e89094c44da98b954eedeac495271d0f",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/h2lbKBfBJ2LNSTNCuwjsBkshT4eXzDDmAV0lhWS0llA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUnVJNWt2eHBwalI4TTZsenFZZVAyTTB4eVFMUGJ0S1hONDdWVTN1dUszZy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWmpBNU5qUmpPVFUxT1M1d2JtYy5wbmc.webp"},{chainId:1,address:"0x43dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/PGIGjN4ix9pInoESO_mCmajbMpygApWZyGKaE6vyJFk/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8veFJDQ0hnQXBuaENRTFZNUXAwdTdwd0pSQzIxRHJ4cFY0b2Z0bndaYnRmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5UaGxZelEyTlRFelpTOUVUMFJQWHpVNFpXTTBOalV4TTJVdWMzWm4uc3Zn.webp"},{chainId:1,address:"0xdac17f958d2ee523a2206206994597c13d831ec7",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:1,address:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:1,address:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/mI69kq-S-tNT1W57qYizPd5r2WNFzpAq5y6NhOcrTkY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVEZhSVNLVVZIWThLTVhyTkVmZDRXRUJmMGJoSHRweHY3Q1hDT0dKbGY2by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmT0dVeFpEaG1PVEEyWlM1d2JtYy5wbmc.webp"},{chainId:4,address:"0x99cf6999fc481663fb10be55827f3584e3c25f3c",name:"LINE",decimals:18,symbol:"LINE",logoURI:""},{chainId:4,address:"0xeaa70c2a40820dF9D38149C84dd943CFcB562587",name:"DODO",decimals:18,symbol:"DODO",logoURI:""},{chainId:4,address:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:""},{chainId:4,address:"0xab0733588776B8881F7712f6AbCa98F510e6B63D",name:"USDC",decimals:6,symbol:"USDC",logoURI:""},{chainId:4,address:"0x0aDCBAE18580120667f7Ff6c6451A426B13c67B7",name:"USDT Token",decimals:6,symbol:"USDT",logoURI:""},{chainId:4,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,symbol:"ETH",logoURI:""},{chainId:5,symbol:"USDC",address:"0xC4106029d03c33731Ca01Ba59b5A6368c660E596",name:"USDC",decimals:6,logoURI:""},{chainId:5,symbol:"USDT",address:"0xed8a325D87D3b6edED04FB992A1482231647EE5e",name:"USDT Token",decimals:6,logoURI:""},{chainId:5,symbol:"WETH",address:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",name:"Wrapped Ether",decimals:18,logoURI:""},{chainId:5,symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,logoURI:""},{chainId:56,address:"0xe9e7cea3dedca5984780bafc599bd69add087d56",name:"BUSD Token",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/BvxyffA5gsLB4bLmlOVkfu7AVami78-VcW_6_i8I6kc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vbC1Sa25meFB3ZXlCOGVYSWJ2b04wdHczLTlzckZOckxfRHdTTnRLSHVRRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDJOa2JsOXRaV1JwWVY5a2IyUnZaWGhmYVc5ZlluVnpaRjgyTXpsbFlqZzNZV0V4WDJKMWMyUmZOak01WldJNE4yRmhNVjlsT1dVMVlXRTBOemxtTG5OMlp3LnN2Zw.webp"},{chainId:56,address:"0x55d398326f99059ff775485246999027b3197955",name:"Tether USD",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/QOl7CvP_WSmTUOMthbxQsNKjDj0s5kSjup69dW_-UeA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTjdQU3RXV2ZGaGNTVzM1QlE2TEJIaF9keVROUEJqa1RLTXRwTll5cEhSWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDJOa2JsOXRaV1JwWVY5a2IyUnZaWGhmYVc5ZmRYTmtkRjh4TlRZME1XWmpaRFF3WDNWelpIUmZNVFUyTkRGbVkyUTBNRjlqWmpJMVpUYzVZVE5qTG5OMlp3LnN2Zw.webp"},{chainId:56,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"BNB",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:56,address:"0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c",name:"BTCB Token",decimals:18,symbol:"BTCB",logoURI:"https://cmp.dodoex.io/fZG0z_RZ1U73_LuuC3RGrrZvNR-bgrCUjkwvaro-PCY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZ1NXN0RuYWNkMnc2YWxSQnFmcENqTHNDZWJhc2VtQTc0dDJlTEdDZjhfNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWmpJNVlXRmpZamxoTVM1d2JtYy5wbmc.webp"},{chainId:56,address:"0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3",name:"Dai Token",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/bhz9Vtma8hPb_-GnhwqQkhfTQ5PwKcR1Qbzn7aBKlfs/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZW04OHB4YXNDdEg0Nl9BcjhVandzZWR2SFBFUUtjVWVkc0FmV2lvenB2Yy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWVRoaFptSmxaRFppWkM1d2JtYy5wbmc.webp"},{chainId:56,address:"0x67ee3Cb086F8a16f34beE3ca72FAD36F7Db929e2",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/PGIGjN4ix9pInoESO_mCmajbMpygApWZyGKaE6vyJFk/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8veFJDQ0hnQXBuaENRTFZNUXAwdTdwd0pSQzIxRHJ4cFY0b2Z0bndaYnRmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5UaGxZelEyTlRFelpTOUVUMFJQWHpVNFpXTTBOalV4TTJVdWMzWm4uc3Zn.webp"},{chainId:56,address:"0x2170ed0880ac9a755fd29b2688956bd959f933f8",name:"Ethereum Token",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:56,address:"0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",name:"Binance-Peg USD Coin",decimals:18,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:56,address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",name:"Wrapped BNB",decimals:18,symbol:"WBNB",logoURI:"https://cmp.dodoex.io/-Pua5rc9k9iW4yuF5ajLVKzMkRhBq06D8HiEZ5gjezA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMDZOWTdBTmdOYWdFOHpXYUMtX2IzYXVPOUxsTEp6QlpLTUR3VlM5eW9DQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmT1dRellXTmtZMlEzTnk1d2JtYy5wbmc.webp"},{chainId:128,address:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f",name:"Wrapped HT",decimals:18,symbol:"WHT",logoURI:"https://cmp.dodoex.io/6EZiEnx7kuHSxfpDGIpuE4z8LW4wNE1ck8fZrc5zRaQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vR010ZUtqTkRTN1ZRT1Jpd0k3TU9OWE1zcFdEc0VYYmxjX1hheXc4cTVEay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTWpVd01sOHpaRGt5TjJWaE4yVTVMbkJ1WncucG5n.webp"},{chainId:128,address:"0x0298c2b32eae4da002a15f36fdf7615bea3da047",name:"Heco-Peg HUSD Token",decimals:8,symbol:"HUSD",logoURI:"https://cmp.dodoex.io/LiOyD0GGt0t4bk4xz3RWAxvqFPyYCqfM4z0AqneT3xM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVXRWWnNCVUxTREZNR002SUM0OGI0VV9UV05oYUU4MzFkdnh1Y1hkLTE2by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTkRjM09WODFZbU0yWVdFek9EUTRMbkJ1WncucG5n.webp"},{chainId:128,address:"0x3d760a45d0887dfd89a2f5385a236b29cb46ed2a",name:"Heco-Peg DAIHECO Token",decimals:18,symbol:"DAI-HECO",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:128,address:"0x64ff637fb478863b7468bc97d30a5bf3a428a1fd",name:"Heco-Peg ETH Token",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/prKmKP8yDTuPMHTCZ_DcxG8BqsuHNO8w5KDmJWmPodg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOUVaWU1ER2ZVN3g2N3ZBZThqWkUxZzA0RExUaFhaV0JIb09wZFhpeXhHRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTVRBeU4xOHhNekkyTjJGbE5EY3dMbkJ1WncucG5n.webp"},{chainId:128,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"HT",decimals:18,symbol:"HT",logoURI:"https://cmp.dodoex.io/6EZiEnx7kuHSxfpDGIpuE4z8LW4wNE1ck8fZrc5zRaQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vR010ZUtqTkRTN1ZRT1Jpd0k3TU9OWE1zcFdEc0VYYmxjX1hheXc4cTVEay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTWpVd01sOHpaRGt5TjJWaE4yVTVMbkJ1WncucG5n.webp"},{chainId:128,address:"0x9362bbef4b8313a8aa9f0c9808b80577aa26b73b",name:"Heco-Peg USDCHECO Token",decimals:6,symbol:"USDC-HECO",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:128,address:"0xa71edc38d189767582c38a3145b5873052c3e47a",name:"Heco-Peg USDTHECO Token",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:137,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"MATIC",decimals:18,symbol:"MATIC",logoURI:"https://cmp.dodoex.io/cQFrEB6yGIqMkh_6Pie8VR3kIStL58IS-y8FbroHVwA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vc2VNUUk2dkpoaXljeldrczJaWWdGdk8zSEoxSWFIa053LXZYeXFneER4US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMekZmTWpkbE56TXlNRE13TWk4eFh6STNaVGN6TWpBek1ESXVjRzVuLnBuZw.webp"},{chainId:137,address:"0xe4bf2864ebec7b7fdf6eeca9bacae7cdfdaffe78",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/KEPetVp3nQkB6BZ_cb05trEfBbGxFEg92UnF8NZsEzM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVE5wTlRseEJGbFRDalM1ZFh3SWJ3Mm1hZ3NPUFFkZ3Z1UEhuZDZrNWdyMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk4yUTBaamxtTldOaU15OUVUMFJQWHpka05HWTVaalZqWWpNdWNHNW4ucG5n.webp"},{chainId:137,address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/hdRkGay_hj0t1OzN5C3c30cmch26tJhHUSroffg7ciY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOHd3UndQOG9DTTdBcF9NOW11bGVOQWRqYjhBOXpvX2FYUE5pVTNBYUtzYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhnMlgwSXhOelUwTnpSZlJUZzVNRGswWDBNME5GOUVZVGs0WWprMU5GOUZaV1JsWDBGRFh6UTVOVEkzTVdRd1gwWmZiRzluYjE4MFpXSXdNVE0zTVRZeExuQnVady5wbmc.webp"},{chainId:137,address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",name:"Ether",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:137,address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/er3iAGv39hCC7F8AydW_AteD3hnZj9HI2XcAaruHeqA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVE9WUWtzN3JQWU5OZWdmNTRuNC1Za1NGTFYyLXVGZmlJRFVYem85aVMzOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlFUQmlPRFk1T1RGak5qSXhPR0l6Tm1NeFpERTVYMFEwWVRKbE9WOUZZakJqWDBVek5qQTJaVjlDTkRoZmJHOW5iMTlpTmpGbE5EVmtNbVF6TG5CdVp3LnBuZw.webp"},{chainId:137,address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/WeK6L9_RjWUfAsnMuOAdyXIZVE3JK_H3lZU5vk2m7Tg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTFJ0aEt6X2VrSXdmTEh6NnAycW5rSkRFeUk1RXZrODlXQ0J2VW43MUJLNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoa1gwRkRYekUzWDBZNU5UaGZSREpsWlRVeU0yRXlNakEyTWpBMk9UazBOVGszWDBNeE0xOUVPRE14WldNM1gyeHZaMjlmWXpCbU9XVTFaamxoTmk1d2JtYy5wbmc.webp"},{chainId:137,address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/_KjvB9pCVqbIIv_UnQvRWpjySBHiFnuHNSXUm_52UZM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDQ4OVYzTW1NMi1qaFJueEQ2Y3MyY1gydXdGS2tkRHpiRGZsbkZhTTJxOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhneU1qWXdYMFpCUTE4MVgwVTFOVFF5WVRjM00xOUJZVFEwWmw5Q1gwTm1aVjlFWmpkZlF6RTVNMkpqTWw5RE5UazVYMnh2WjI5Zk5HTmpORE0zTlRneFppNXdibWMucG5n.webp"},{chainId:137,address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",name:"Wrapped MATIC",decimals:18,symbol:"WMATIC",logoURI:"https://cmp.dodoex.io/HfZVSaAES3QRplSybW2uoKmYf6pVTRaxufn95_Qto_A/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMERhZEZTUUVFX0d4YlBoMHY3Wk1Hb1FwaWtOQm1vaWFyZTFlaFdJbU44dy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjFoZEdsalgyVmlOekZtTkdFMU9XRXZiV0YwYVdOZlpXSTNNV1kwWVRVNVlTNTNaV0p3LndlYnA.webp"},{chainId:42161,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"ETH",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:42161,address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/6VmZGvbENd4TM1VK0rsYrfznRtG-GwxP-zCy2qyc9bM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWnJZUDB0ZHVTLUdDNE5FTThmRmV1RHhVWklPNUZpWnpqdkdBc0lfNlBQMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh5TW1GbU4yVTVOVFJpTDFkRlZFaGZhV052Ymw4eU1tRm1OMlU1TlRSaUxuQnVady5wbmc.webp"},{chainId:42161,address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:42161,address:"0x69Eb4FA4a2fbd498C257C57Ea8b7655a2559A581",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/6U51l5aajoRrCaO6cpbrclQ2olWNDzuShggOCfoktCA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8va3RkSlhwQ3dsQVZtZXNPb1dvQV95SG9IazBnV3UxUExienBKa1AxYnlJdy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5tTmtPVEV4WXprNE15OUVUMFJQWHpaalpEa3hNV001T0RNdWNHNW4ucG5n.webp"},{chainId:42161,address:"0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",name:"USD Coin (Arb1)",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:42161,address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:42161,address:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:1285,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"MOVR",decimals:18,symbol:"MOVR",logoURI:"https://cmp.dodoex.io/Clhd0YhBfsWh48Ej4taGHcJ7dfKiCbtdMgyhNU7QAJg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZlBFT3c5LVdpQWhDVDJteGRmQ2gtb2hnQU1aaXBvWnllUl9TcVNpa3R4NC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMemt5T0RWZk4yWTVNREF5T1dNMU1pODVNamcxWHpkbU9UQXdNamxqTlRJdWQyVmljQS53ZWJw.webp"},{chainId:1285,address:"0x98878b06940ae243284ca214f92bb71a2b032b8a",name:"Wrapped MOVR",decimals:18,symbol:"WMOVR",logoURI:"https://cmp.dodoex.io/oXW0_VSLU29rbyQK3LtaHymbMfdv6F_ri20EeyMVBEU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMDVYMDFLd21zZXFRNFB6SGxJdEdvN3dveHVaUkFVbmQ5bDhCNU5VQ2N6by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMGhmVG1OdmRWOUlNSGhmTkRBd2VEUXdNRjlrTlRBNFpHSmxNVE0yTDBoZlRtTnZkVjlJTUhoZk5EQXdlRFF3TUY5a05UQTRaR0psTVRNMkxtcHdady5qcGc.webp"},{chainId:1285,address:"0x5D9ab5522c64E1F6ef5e3627ECCc093f56167818",name:"Binance USD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/SKu1xTvsm3q0RZC9CdiGw0zkq9k1P2ygK4TMenBYNC8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQVMtWEpUX3pncF9MSlFxdFJiaE1Fd3lTZlNBMWp0MUhHbUFGYV9QQUdTdy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5aWRYTmtYems0TjJNd1lUUmtNRGt1YW5Cbi5qcGc.webp"},{chainId:1285,address:"0x80A16016cC4A2E6a2CACA8a4a498b1699fF0f844",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:1285,address:"0xE9460BD2FFB12b668fA32919C785C239f974D37C",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/onw4bpUWC5-GPBwFMHLE3BcRaQ1S_hqlUxW-8H3l5g0/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTi1ITXhGVWtxUU9fR3cxRFl1empZblgwejFzQ1pIMG1nMWRlOG5Qdmk2NC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zll6SXdZVEl4WTJFNU5pOUVUMFJQWDJNeU1HRXlNV05oT1RZdWNHNW4ucG5n.webp"},{chainId:1285,address:"0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:1285,address:"0xB44a9B6905aF7c801311e8F4E76932ee959c663C",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/LyxjB8w94UjDhRuXa9xNlg7YcMuOC6akWBPCtgbq_Qw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vLXNSOWJzZTlrLTFIY1VUeUE3WE9KZWplQkRRS2ZtSFpRV2I3RE1iemlHMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkhSZk1UVTJOREZtWTJRME1DOTFjMlIwWHpFMU5qUXhabU5rTkRBdWMzWm4uc3Zn.webp"},{chainId:1285,address:"0x2bF9b864cdc97b08B6D79ad4663e71B8aB65c45c",name:"WBNB Token",decimals:18,symbol:"WBNB",logoURI:"https://cmp.dodoex.io/HSdBZz6OV3HFUq1RqW8hdavA1cfhjWEfqP12BINZppw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUTAzVVlDM3hSN0J2SHo5UmgtcHZ0WWctRGdPNlF1b2xKUmE0QjBHaWlmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5aWJtSmZNalE0TmpZeFpHTXhaaTVxY0djLmpwZw.webp"},{chainId:1285,address:"0x6aB6d61428fde76768D7b45D8BFeec19c6eF91A8",name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/6qiR9e_WPVs0u8U4DgdGMcaKFzJzypJqME5wUNe7XsY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMUMxeHZaUVJ4b0NlTW1sNXg0eUMzTGcySmhNXzYwcHpMMlk3elBwSGJFQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMnh2WjI5Zk4ySXpNMlU0TW1WbFlTOXNiMmR2WHpkaU16TmxPREpsWldFdWNHNW4ucG5n.webp"},{chainId:1285,address:"0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:66,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"OKT",decimals:18,symbol:"OKT",logoURI:"https://cmp.dodoex.io/pcltGNcIp7DP33nj3YxxBpuFEekNcOW3pwq9tjSrpY4/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTzJHSDJYTndRancwbXMzQXNidG5xNzRkVEROVld3QWFOU1dXU2ZnU01QTS9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RTVOalF5T1RCZk1qQXlNakExTWpBd056STNORFl3TWpJdWMzWm4uc3Zn.webp"},{chainId:66,address:"0x382bB369d343125BfB2117af9c149795C6C65C50",name:"USDT",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:66,address:"0x218c3c3D49d0E7B37aff0D8bB079de36Ae61A4c0",name:"BNB",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:66,address:"0x54e4622DC504176b3BB432dCCAf504569699a7fF",name:"BTCK",decimals:18,symbol:"BTCK",logoURI:"https://cmp.dodoex.io/L3kcNUKg94qnX8OPFlEvHKqWybnJD8SA9HTne3PW-Rg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vNU1MQTB3Q3V6eEs4Q3ZMV0RqempuOVhzalBTWE1zbUpWZ0RRN1RPMG9FWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpVUTB0Zk1HWmlaRGRsTWpnNU5pOUNWRU5MWHpCbVltUTNaVEk0T1RZdWNHNW4ucG5n.webp"},{chainId:66,address:"0x332730a4F6E03D9C55829435f10360E13cfA41Ff",name:"BUSD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/-aEkA13gC6lOFoRyGeSy2BotE5YY3WUmcSlPa9Rpddc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaXVmSjhaNHFJYzlMMDgtNHpxRUMxWl94WVlqRkEtT3BqS1FJbmQyeHpHUS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpWVTBSZk1XTTJNRFpqTjJZeE55OUNWVk5FWHpGak5qQTJZemRtTVRjdWNHNW4ucG5n.webp"},{chainId:66,address:"0x21cDE7E32a6CAF4742d00d44B07279e7596d26B9",name:"DAIK",decimals:18,symbol:"DAIK",logoURI:"https://cmp.dodoex.io/LOb-sXupURNN9HA0zBSfLfpZlx52N9qRSDUyzk3cg0A/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vck5pZzMtWU5TOUl4T3ZHX19taTFRSU9WYTZsczdZNXViRVhGcTJJVGplby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJCU1V0Zk5ESTVNV1l4WlRoa1pTOUVRVWxMWHpReU9URm1NV1U0WkdVdWNHNW4ucG5n.webp"},{chainId:66,address:"0xEF71CA2EE68F45B9Ad6F72fbdb33d707b872315C",name:"ETHK",decimals:18,symbol:"ETHK",logoURI:"https://cmp.dodoex.io/IwBclhMMQLOo79RdRo6-HnUiXxshO_hSi02YK3L6MFI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcFBSd192aEx2MHh3WkRHU2k3eGYyYVJiQjlocVhfU2tacUdGc3RJR0pYRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFZVU0V0Zk1UQTVNamMzTW1VMU9DOUZWRWhMWHpFd09USTNOekpsTlRndWNHNW4ucG5n.webp"},{chainId:66,address:"0xc946DAf81b08146B1C7A8Da2A851Ddf2B3EAaf85",name:"USDC",decimals:18,symbol:"USDC",logoURI:"https://cmp.dodoex.io/bXLFjIP5_obFZS9jvWA1bZc2b2Vsw4-tqcvj10aPUpU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcXhZT0hTcDYzemNTaDVHRVV1SFlya3JGS2s1MW9zLVUycG42bjNXV2pYay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZk1UTTFZak13TkRkaVpDOVZVMFJEWHpFek5XSXpNRFEzWW1RdWNHNW4ucG5n.webp"},{chainId:66,address:"0xdCAC52E001f5bd413aa6ea83956438F29098166b",name:"USDK",decimals:18,symbol:"USDK",logoURI:"https://cmp.dodoex.io/X-_D75ZOpI-yC70WjdgC8wiqcssfRIALEv0eUfD3HiE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vd290dHEzaWdkTDVzQlhSR2VFZkhQLTNpZHhDZzV0V3VGQmE3YjNrNUZITS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkV0Zk56aGpZekV6TW1OaVpDOVZVMFJMWHpjNFkyTXhNekpqWW1RdWNHNW4ucG5n.webp"},{chainId:66,address:"0x506f731F7656e2FB34b587B912808f2a7aB640BD",name:"WBTCK",decimals:18,symbol:"WBTCK",logoURI:"https://cmp.dodoex.io/7Gb1gYkvjWESf9ungWe4YKOrr5GY5UILmTwU_U95kCA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOTQ4NWZpU2NmUzBNc2V1YVZXWXo2Z1RuNVVidXJvZkxmN1VGSWhMdndjTS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOTFgyVXlZamRpWVRJNU16TXZWMEpVUTB0ZlpUSmlOMkpoTWprek15NXdibWMucG5n.webp"},{chainId:288,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ethereum",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:288,address:"0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:288,address:"0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b",name:"Binance",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:288,address:"0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7",name:"Boba Token",decimals:18,symbol:"BOBA",logoURI:"https://cmp.dodoex.io/p7--p24wKrXpF7IGh6Q_RT6J0ZGS2_FURnXxeyMDvO4/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQlVsWE9GWS1wUTIxbTJJOTdIRFN2VHlvMzR2MGJWQllYU1ByczFwaWNuYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpQUWtGZk16SmtZamczT1dJMk1TOUNUMEpCWHpNeVpHSTROemxpTmpFdWNHNW4ucG5n.webp"},{chainId:288,address:"0xf74195Bb8a5cf652411867c5C2C5b8C2a402be35",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:288,address:"0x572c5B5BF34f75FB62c39b9BFE9A75bb0bb47984",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/8CGANX_wy00isVg8PgA_A-IKbfIn55Yu9ZujzUukXlQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDJhLVNEOFJvWDlGaW9IUVNzSkh2WkZzNlBpbVlNTWxTZGhZalJmMXVVQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk1tRm1NMll4WkRZd055OUVUMFJQWHpKaFpqTm1NV1EyTURjdWNHNW4ucG5n.webp"},{chainId:288,address:"0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:288,address:"0xdc0486f8bf31DF57a952bcd3c1d3e166e3d9eC8b",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:288,address:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000",name:"Wrapped Ethereum",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ethereum",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:1313161554,address:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",name:"Wrapped Ethereum",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0x8BEc47865aDe3B172A928df8f990Bc7f2A3b9f79",name:"Aurora",decimals:18,symbol:"Aurora",logoURI:"https://cmp.dodoex.io/2C2jfpO2-VYuwlga3SdtP5I6eJNJXIYq3LvPU4aFuiU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcHFWVWlJOEQ4VU5iUEZYRElvUnA3cFhEZFc4dmx4dWEtTmxubmxlam1PMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMkYxY205eVlWOHlOVEprWlRFeE56YzBMMkYxY205eVlWOHlOVEprWlRFeE56YzBMbmRsWW5BLndlYnA.webp"},{chainId:1313161554,address:"0xe3520349F477A5F6EB06107066048508498A291b",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:1313161554,address:"0xe301eD8C7630C9678c39E4E45193D1e7Dfb914f7",name:"DODO Bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/SEcMDWMmtHb3GFW5l7fTKYurpTqALHdZI3D6qzad1rs/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQXRNMzllUjhRQzhYTl8tem5HU0pSLS1lV0tPUW91V3p2ci0zQ014WlJTSS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMekl3TUhneU1EQmZNVjh3WWpReFl6VTJZV1UxTHpJd01IZ3lNREJmTVY4d1lqUXhZelUyWVdVMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0x4988a896b1227218e4A686fdE5EabdcAbd91571f",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:1313161554,address:"0xF4eB217Ba2454613b15dBdea6e5f22276410e89e",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:43114,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Avalanche",decimals:18,symbol:"AVAX",logoURI:"https://cmp.dodoex.io/yBkeC0v6hqQP-wNBxAq_C_D6JTYUc4Q86Wh6WIciESI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcmpNamFFdHJ5WUZxNks3TkpxYkRWczlEZF80aHp4ZUo3YnB0eGgtVERDYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjEzWDI1ZlRqaHRNRjgwTURCNE5EQXdYems0WlRKaU5EQm1PRGN2YlhkZmJsOU9PRzB3WHpRd01IZzBNREJmT1RobE1tSTBNR1k0Tnk1cWNHYy5qcGc.webp"},{chainId:43114,address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",name:"Wrapped AVAX",decimals:18,symbol:"WAVAX",logoURI:"https://cmp.dodoex.io/yBkeC0v6hqQP-wNBxAq_C_D6JTYUc4Q86Wh6WIciESI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcmpNamFFdHJ5WUZxNks3TkpxYkRWczlEZF80aHp4ZUo3YnB0eGgtVERDYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjEzWDI1ZlRqaHRNRjgwTURCNE5EQXdYems0WlRKaU5EQm1PRGN2YlhkZmJsOU9PRzB3WHpRd01IZzBNREJmT1RobE1tSTBNR1k0Tnk1cWNHYy5qcGc.webp"},{chainId:43114,address:"0x19860CCB0A68fd4213aB9D8266F7bBf05A8dDe98",name:"Binance USD",decimals:18,symbol:"BUSD.e",logoURI:"https://cmp.dodoex.io/-aEkA13gC6lOFoRyGeSy2BotE5YY3WUmcSlPa9Rpddc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaXVmSjhaNHFJYzlMMDgtNHpxRUMxWl94WVlqRkEtT3BqS1FJbmQyeHpHUS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpWVTBSZk1XTTJNRFpqTjJZeE55OUNWVk5FWHpGak5qQTJZemRtTVRjdWNHNW4ucG5n.webp"},{chainId:43114,address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",name:"Dai Stablecoin",decimals:18,symbol:"DAI.e",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:43114,address:"0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664",name:"USD Coin",decimals:6,symbol:"USDC.e",logoURI:"https://cmp.dodoex.io/bXLFjIP5_obFZS9jvWA1bZc2b2Vsw4-tqcvj10aPUpU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcXhZT0hTcDYzemNTaDVHRVV1SFlya3JGS2s1MW9zLVUycG42bjNXV2pYay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZk1UTTFZak13TkRkaVpDOVZVMFJEWHpFek5XSXpNRFEzWW1RdWNHNW4ucG5n.webp"},{chainId:43114,address:"0xc7198437980c041c805A1EDcbA50c1Ce5db95118",name:"Tether USD",decimals:6,symbol:"USDT.e ",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:43114,address:"0x50b7545627a5162F82A992c33b87aDc75187B218",name:"Wrapped BTC",decimals:8,symbol:"WBTC.e",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:43114,address:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",name:"Wrapped Ether",decimals:18,symbol:"WETH.e",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:25,address:"0x66e428c3f67a68878562e79A0234c1F83c208770",name:"USDT",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/p_nSk7MW-bCcwp-tgtWC8az4e4Q0YMirg6rv6yVjC-I/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vODVNVlpTTllrTFlySWdlX2VQemNVOUpydkNKeFpDM2JhaGV0NnN5S0d5WS9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RTJPREl3TWpoZk1qQXlNakExTVRjd016STVNakV6TURjdWQyVmljQS53ZWJw.webp"},{chainId:25,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"CRO",decimals:1,symbol:"CRO",logoURI:"https://cmp.dodoex.io/HYsQIOyyuC6P1Ik_Rs5a6ws2CKMzJbajJewE77C0rf8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZzc2UURUMEIwbHJjc3VTSTlodTZTTnlqMEp3WWNtUEFRWV9qWDV0VVBhMC9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6YzRNRGc0TkRkZk1qQXlNakExTVRjd056UXdNekExTWpFdWNHNW4ucG5n.webp"},{chainId:10,address:"0x4200000000000000000000000000000000000006",name:"WETH",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/f9SbZq39ynUZS5ueKvAwzLmKUfcZvYpKDaysT3dkcvM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vc2NkVzJUWjladmRiX3BVSjZ3b2YzeHRvYk94YUw3bEV5RmhhemhJUFhlMC9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RXdNamd3TkRaZk1qQXlNakEwTWpJd01UQXpORGc1TURVdWNHNW4ucG5n.webp"},{chainId:10,address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",name:"DAI",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/04gwZiu2K_9fdb2zLwzsX1nONCbBWrZOvTyOoEFhx3g/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaDJCcmdhUmZxUzBLZDBEOVpZbEUteEtNMVdzeFFtRzBEWVpKOGJCaWN4US9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6SXlNRFUwTVRsZk1qQXlNakEwTWpJd01UQTBNak00TlRVdWFuQm4uanBn.webp"},{chainId:10,address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",name:"USDC",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/XbtxsPIscM6p5ClHbLO0JumFHA9U23eON8-MDh-Plkg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaG1nM3hRa1BUTUtkcUNFVnd0LXU4S2lwTW5od1JCdGhLYWxENW9vSWlTZy9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6UXlNRFEyTkRaZk1qQXlNakEwTWpJd01UQTFNekF4TmpVdWNHNW4ucG5n.webp"},{chainId:10,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"ETH",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/bcyoORJ04NyP1HhYUZ9RrTZ-MEOFeNnMcrr__JZ6Ruw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vV1lHaU9IVFVnVWs4Q3Z3WmNyN0hWX2w4SlNrQjRVQUh1UXpzaWd4U3Nmay9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6VTVPREk0T1Y4eU1ESXlNRFF5TWpBeU1qTTBNelk0TlM1d2JtYy5wbmc.webp"}];function rb({tokenList:e,popularTokenList:t}){const n=P(),[o,i]=f([]),{account:c}=H(),l=cp(),{cgTokenList:u}=eb(),d=Z(Ks),h=y((()=>(null==tb?void 0:tb.filter((e=>e.chainId===l)))||[]),[tb,l]),m=y((()=>(null==t?void 0:t.filter((e=>e.chainId===l)))||[]),[t,l]);!function({tokenList:e,addresses:t,blockNumber:n}){const{account:o}=H(),i=P(),s=y((()=>[...(null==e?void 0:e.map((e=>e.address)))||[],...t||[]].map((e=>e.toLocaleLowerCase()))),[e,JSON.stringify(t)]),{getContract:a,contractConfig:c,call:l}=yl(),[u,d]=f(),h=y((()=>{if(!o||!s.length||!c)return;const{DODO_APPROVE:e,ERC20_HELPER:t}=c,n=a(t,bl);if(!n)return;let l={};const u=s.map((i=>(l[i]=!0,{callData:{data:n.interface.encodeFunctionData("isERC20",[i,o,e]),to:t},processor:e=>{const t=new fl(bl).decodeFunctionResult("isERC20",e),{balance:n,isOk:o}=t,s=parseInt(t.decimals),a=new r(10).pow(s),c=new r(t.allownance.toString()).div(a);return o?{address:i,decimals:s,symbol:t.symbol,name:t.name,balance:new r(n.toString()).div(a),allowance:c}:{address:i,balance:new r(0),allowance:new r(0)}}})));return i($s(l)),u}),[o,a,JSON.stringify(s)]);p((()=>{(()=>{Bs(this,void 0,void 0,(function*(){if(!h)return;const e=yield l(h),t={};e&&(e.forEach((e=>{e.address.toLocaleLowerCase()!=="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE".toLocaleLowerCase()&&(t[e.address.toLocaleLowerCase()]={tokenBalances:e.balance,tokenAllowances:e.allowance})})),i(Qs(t))),d(e);let r={};s.forEach((e=>{r[e]=!1})),i($s(r))}))})()}),[h,n])}({addresses:y((()=>{const e=o.map((({address:e})=>e));return null==t||t.forEach((({address:t})=>{e.includes(t)||e.push(t)})),e}),[o,t]),blockNumber:d}),p((()=>{(()=>{Bs(this,void 0,void 0,(function*(){let t=[];if(s(e))t=e;else if(e===xl.Coingecko||e===xl.All){const e=h.concat(u.toArray());t=a(m,e,(e=>e.address.toLowerCase()))}else t=a(m,h,(e=>e.address.toLowerCase()));const r=l,o=t.filter((e=>e.chainId===r));i(o),n((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_TOKEN_LIST",payload:e})})))(o))}))})()}),[e,n,l,u,m,h]),p((()=>{n(Qs({}))}),[c,l]),p((()=>{n((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_POPULAR_TOKEN_LIST",payload:e})})))(m))}),[m,n])}const nb=e=>(null!=e?e:Gs.getState()).token.tokenList,ob=(e,t)=>(null!=t?t:Gs.getState()).token.popularTokenList.filter((({chainId:t})=>e===t)),ib=e=>(null!=e?e:Gs.getState()).token.accountBalances,sb=e=>(null!=e?e:Gs.getState()).token.ethBalance||new r(NaN),ab=e=>(null!=e?e:Gs.getState()).token.defaultFromToken,cb=e=>(null!=e?e:Gs.getState()).token.defaultToToken,lb=e=>(null!=e?e:Gs.getState()).token.balanceLoadings;function ub(){const{account:e,chainId:t}=H(),r=Z(ib),n=Z(sb),o=y((()=>Cs[t||1]),[t]),i=g((t=>{var i;if(!e)return null;if(t.symbol===o.symbol&&Ts(t.address,o.address))return!n||(null==n?void 0:n.isNaN())?null:n;const s=null===(i=r[t.address.toLocaleLowerCase()])||void 0===i?void 0:i.tokenBalances;return!s||(null==s?void 0:s.isNaN())?null:s}),[r,n,e]);return i}var db;function hb(e,t,r,n=0){if(r&&(e=e.toLocaleLowerCase(),t=t.toLocaleLowerCase()),e===t)return db.fully+n;const o=e.indexOf(t);return 0===o?db.prefix+n:o>0?db.other+n:db.none}!function(e){e[e.fully=1]="fully",e[e.prefix=2]="prefix",e[e.other=3]="other",e[e.none=0]="none"}(db||(db={}));function fb({value:e,onChange:t,occupiedAddrs:n,hiddenAddrs:o,showAddrs:i}){const[s,a]=f(""),c=Z(nb),l=cp(),u=ub(),d=Z((e=>ob(l,e))),h=y((()=>(null==tb?void 0:tb.filter((e=>e.chainId===l)))||[]),[tb,l]),p=y((()=>new Set(o?o.map((e=>e.toLowerCase())):void 0)),[o]),m=y((()=>i?new Set(i.map((e=>e.toLowerCase()))):void 0),[i]),b=g((e=>e.filter((e=>{if(e.chainId!==l)return!1;let t=!0;return t=m?m.has(e.address.toLowerCase()):!p.has(e.address.toLowerCase()),t}))),[m,l,p]),v=g((t=>{if(null===t)return null;const o=[];s?t.forEach((e=>{const t=((e,t,{matchAddress:r}={})=>{if(!t)return 0;const n=t.toLocaleLowerCase();let o=0;r&&e.address.toLocaleLowerCase()===n&&(o=1),o||(o=hb(e.symbol.toLocaleLowerCase(),n,!1,1));if(o)e.name.toLocaleLowerCase()===n&&(o=db.fully+1);else{let t=hb(e.name.toLocaleLowerCase(),n,!1,10);t=t===db.fully+10?db.fully+1:t,o=t}return o})(e,s,{matchAddress:!0});t&&o.push({sort:t,token:e})})):t.forEach((e=>{o.push({sort:0,token:e})}));const i=[];return o.sort(((t,o)=>{const i=t.token,s=o.token;if(e){if(i.address===e.address)return-1;if(s.address===e.address)return 1}if(null==n?void 0:n.includes(i.address))return-1;if(null==n?void 0:n.includes(s.address))return 1;const a=u&&u(i)||new r(0),c=u&&u(s)||new r(0);if(!a.eq(c))return a.gt(c)?-1:1;if(t.sort!==o.sort)return t.sort>o.sort?1:-1;const l=d.map((e=>e.address));if(null==l?void 0:l.includes(i.address))return-1;if(null==l?void 0:l.includes(s.address))return 1;const f=h.map((e=>e.address));return(null==f?void 0:f.includes(i.address))?-1:(null==f?void 0:f.includes(s.address))?1:i.symbol.localeCompare(s.symbol)})).some((e=>!!(s&&i.length>21)||(i.push(e.token),!1))),i}),[s,u,n,e,d,h]),w=g((e=>{const r=e.address.toLowerCase();t(e,!!(null==n?void 0:n.some((e=>e.toLowerCase()===r))))}),[t,n]),x=y((()=>{const e=b(c);return v(e)||[]}),[c,b,v]);return{filter:s,setFilter:a,showTokenList:x,onSelectToken:w}}function pb({width:e=24,height:t=24,marginRight:r=8,url:n,zIndex:o,cross:i,address:s,token:a,sx:c}){const[l,u]=f(!1),[d,h]=f(""),[m,b]=f(""),[v,w]=f(!1),x=g((()=>u(!0)),[]);let E=function(e){const t=Z(nb),{chainId:r}=H();return y((()=>{if(!e)return;let n=t.find((({address:t,chainId:n})=>n===r&&t===e));return n||(n=t.find((({address:t})=>t===e))),n}),[e,t,r])}(s);a&&(E=a);const A=s||(null==E?void 0:E.address),R=null==E?void 0:E.symbol,_=null==R?void 0:R.charAt(0).toUpperCase(),k=y((()=>{const e=null==E?void 0:E.logoURI;return n||e||""}),[n,E]);return p((()=>{w(!1)}),[A,k]),p((()=>{i&&(k?function(e,t){const r=new XMLHttpRequest;let n;r.onload=function(){const e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(r.response)},r.onerror=function(){t()};try{n=new URL(e)}catch(e){}finally{r.open("GET",n||e),r.responseType="blob",r.send()}}(k,(e=>{h(e)})):h(""))}),[k,i]),p((()=>{try{let t=A;if(t&&t.length<15&&(t=t.padEnd(15,"0")),t){const r=new L(t,{size:e,format:"svg",margin:.2,background:[255,234,4,255]}).toString();b(`data:image/svg+xml;base64,${r}`)}}catch(e){console.error("generate Identicon error: ",e)}}),[A,e]),Ie.exports.jsxs(Kr,{sx:Object.assign({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",minWidth:e,width:e,height:t,marginRight:r,zIndex:o},c||{}),style:{width:e,height:t},children:[!l&&Ie.exports.jsx(Kr,{sx:{typography:"ht",height:"100%",width:"100%",borderRadius:"50%",border:"transparent 2px solid",borderColor:"text.primary",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"center"},children:_}),Ie.exports.jsx(Kr,{component:"img",src:!(i?d:k)||v?m:i?d:k,onLoad:x,onError:e=>{const t=e.target;A&&m&&w(!0),t.onerror=null},sx:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",borderRadius:"50%",overflow:"hidden",width:"100%",height:"100%"}})]})}function mb({token:t,onClick:r}){var n,o;const i=Jr();return Ie.exports.jsxs(Kr,{component:zn,sx:{display:"flex",alignItems:"center",color:i.palette.text.primary,typography:"h5",fontWeight:600},onClick:e=>{r&&r(e)},"data-testid":"swap-select-token-btn",children:[(null==t?void 0:t.address)?Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(pb,{url:null==t?void 0:t.logoURI,address:null!==(n=null==t?void 0:t.address)&&void 0!==n?n:"",marginRight:6}),Ie.exports.jsx(Kr,{children:null!==(o=null==t?void 0:t.symbol)&&void 0!==o?o:"-"})]}):Ie.exports.jsx(e,{id:"SELECT TOKEN"}),Ie.exports.jsx(Kr,{sx:{ml:7,width:12,transform:"rotateX(180deg)"},component:k})]})}function gb({onClick:t,balance:r,decimals:n,address:o,showMaxBtn:i}){const{palette:s}=Jr();return Ie.exports.jsxs(Kr,{sx:{display:"flex",typography:"body2",color:s.text.secondary},children:[Ie.exports.jsx(e,{id:"Balance:"})," ",o?Ui({input:r,decimals:Math.min(n||4,4)}):"-",i&&r&&r.gt(0)&&Ie.exports.jsx(Kr,{component:zn,sx:{ml:6,color:(null==r?void 0:r.gt(0))?s.primary.main:s.text.disabled,cursor:o&&t?"pointer":"unset"},onClick:()=>t&&t(r?r.toString():""),children:Ie.exports.jsx(e,{id:"Max"})})]})}function yb({readOnly:e,sx:t,value:r,decimals:n,onChange:o,suffix:i,withClear:s,onFocus:a,placeholder:c}){const l=Jr(),u=y((()=>i||(s&&r&&o?Ie.exports.jsx(Kr,{component:zn,sx:{ml:5,width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{o&&o("")},children:Ie.exports.jsx(Kr,{component:_,sx:{width:12,color:"text.primary"}})}):void 0)),[o,i,l.palette.text.primary,r,s]);return Ie.exports.jsxs(Kr,{sx:Object.assign({mt:12,display:"flex",justifyContent:"space-between",alignItems:"center"},t),"data-testid":"number-input-wrapper",children:[Ie.exports.jsx(eo,{fullWidth:!0,value:r,readOnly:e,placeholder:c||"0.00",onFocus:a,onChange:e=>{const t=e.target.value,r=0===t.length?"":Vi(t,n);o&&o(r)},sx:{width:"inherit",border:"none","& .MuiInput-input":{fontSize:24,border:"none",outline:"none",height:24,padding:0,color:"text.primary","&::placeholder":{fontSize:24,color:"text.disabled"}}}}),!e&&r&&u]})}function bb({open:e,onClose:t,afterClose:r,title:n,rightSlot:o,canBack:i=!0,children:s,height:a,testId:c}){return Ie.exports.jsxs(Kr,{sx:{position:"absolute",top:e?0:"100%",transition:"top 300ms",zIndex:1,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",borderRadius:16,height:a},"data-testid":c,"data-active":e?"1":"0",children:[n?Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:20},children:[Ie.exports.jsx(Kr,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:n}),o,!o&&i&&Ie.exports.jsx(Kr,{component:_,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),setTimeout((()=>r&&r()),300)}})]}):"",s]})}const vb=e=>(null!=e?e:Gs.getState()).globals;function wb({token:e,disabled:t,onClick:r}){return Ie.exports.jsxs(Kr,{sx:Object.assign({display:"inline-flex",alignItems:"center",p:8,border:"solid 1px",typography:"body2",borderRadius:8},t?{borderColor:"transparent",backgroundColor:"border.disabled",cursor:"auto"}:{borderColor:"border.main",cursor:"pointer","&:hover":{backgroundColor:"hover.default"}}),onClick:()=>{t||r()},children:[Ie.exports.jsx(pb,{token:e}),e.symbol]})}function xb({token:e,disabled:t,style:n,onClick:o}){const i=Jr(),s=ub(),{account:a}=H(),c=s(e),l=c?ji({input:c}):"";return Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2",px:6,py:5,borderRadius:8,cursor:t?"auto":"pointer",opacity:t?.5:1,"&:hover":{backgroundColor:"hover.default"}},style:n,onClick:()=>{t||o()},"data-testid":"token-picker-item",children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(pb,{token:e}),Ie.exports.jsxs(Kr,{children:[Ie.exports.jsx(Kr,{sx:{fontWeight:600,textAlign:"left"},children:e.symbol}),a&&Ie.exports.jsx(Kr,{sx:{mt:4,textAlign:"left"},children:new r(l).gte(0)?l:Ie.exports.jsx(Kr,{component:E,width:18,sx:{"& path":{fill:i.palette.text.disabled},animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}}})})]})]}),Ie.exports.jsx(Kr,{sx:{color:"text.secondary",textAlign:"right"},children:e.name})]})}function Eb({value:e,onChange:t,occupiedAddrs:r,hiddenAddrs:n,showAddrs:o,visible:i}){const s=cp(),a=Z((e=>ob(s,e))),{showTokenList:c,filter:l,setFilter:u,onSelectToken:d}=fb({value:e,onChange:t,occupiedAddrs:r,hiddenAddrs:n,showAddrs:o}),m=h(null),[y,b]=f(0);p((()=>{i&&m.current&&b(m.current.offsetHeight-34)}),[m,i]);const v=g((({key:t,index:r,style:n})=>{const o=!!(null==a?void 0:a.length);if(0===r&&o)return Ie.exports.jsx(Kr,{sx:{position:"relative",display:"flex",gap:8,flexWrap:"wrap",pb:32,"&::after":{content:'""',position:"absolute",bottom:16,left:0,right:0,height:"1px",backgroundColor:"border.main"}},style:Object.assign(Object.assign({},n),{visibility:n.height?"visible":"hidden",height:n.height?n.height:"auto"}),children:a.map((t=>Ie.exports.jsx(wb,{token:t,disabled:(null==e?void 0:e.address)===t.address,onClick:()=>d(t)},t.address)))},t);const i=c[o?r-1:r];return Ie.exports.jsx(xb,{token:i,disabled:!!e&&e.address===i.address,style:n,onClick:()=>d(i)},t)}),[c,a,e]),w=g((e=>{if(0===e&&(null==a?void 0:a.length)){return 74+51*Math.floor(a.length/3)}return 52}),[a]);return Ie.exports.jsxs(Kr,{sx:{display:"flex",flexDirection:"column",px:20,flex:1},children:[Ie.exports.jsx(ao,{fullWidth:!0,height:48,value:l,onChange:e=>u(e.target.value),clearValue:()=>u(""),placeholder:ie._("Enter the token symbol or address")}),Ie.exports.jsx(Kr,{sx:{mt:16,pb:16,flex:1,minHeight:64},ref:m,children:Ie.exports.jsx(se,{height:y,itemCount:c.length+((null==a?void 0:a.length)?1:0),itemSize:w,width:"100%",className:"token-list",children:v},a.length)})]})}function Ab({open:t,value:r,onClose:n,occupiedAddrs:o,onTokenChange:i}){const{height:s}=Z(vb);return Ie.exports.jsx(bb,{height:s,open:t,onClose:n,title:Ie.exports.jsx(e,{id:"Select a token"}),testId:"token-picker-wrapper",children:Ie.exports.jsx(Eb,{value:r,visible:t,onChange:i,occupiedAddrs:o})})}function Rb({sx:e,amt:t,token:r,readOnly:n,showMaxBtn:o,onMaxClick:i,fiatPriceTxt:s,occupiedAddrs:a,onInputFocus:c,onTokenClick:l,onInputChange:u,onTokenChange:d}){const h=Jr(),p=ub(),[m,g]=f(!1),y=r?p(r):null;return Ie.exports.jsxs(Kr,{sx:Object.assign({width:"100%",minHeight:133,padding:20,borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:h.palette.background.input},e),children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Ie.exports.jsx(mb,{token:r,onClick:()=>g(!0)}),Ie.exports.jsx(gb,{balance:y,onClick:i,showMaxBtn:o,address:null==r?void 0:r.address,decimals:null==r?void 0:r.decimals})]}),Ie.exports.jsx(yb,{value:t,onFocus:c,onChange:u,readOnly:n,withClear:!0}),Ie.exports.jsx(Kr,{sx:{mt:4,typography:"body2",color:h.palette.text.secondary},children:s}),Ie.exports.jsx(Ab,{value:r,open:m,occupiedAddrs:a,onClose:()=>{g(!1),l&&l()},onTokenChange:(e,t)=>{g(!1),setTimeout((()=>d(e,t)),300)}})]})}const _b=(e,t)=>{const r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?1==i&&11!=s?"one":2==i&&12!=s?"two":3==i&&13!=s?"few":"other":1==e&&n?"one":"other"},kb={"en-US":_b,"zh-CN":(e,t)=>"other",pseudo:_b};function Sb({locale:e,children:r}){return p((()=>{(()=>{Bs(this,void 0,void 0,(function*(){yield function(e="en-US"){return Bs(this,void 0,void 0,(function*(){ie.loadLocaleData(e,{plurals:()=>kb[e]});try{const t=yield import(`./locales/${e}.js`);ie.load(e,t.messages||t.default.messages)}catch(e){}ie.activate(e)}))}(e)}))})()}),[e]),Ie.exports.jsx(t,{i18n:ie,children:r})}var Nb,Mb,Tb;!function(e){e[e.Running=0]="Running",e[e.Success=1]="Success",e[e.Failed=2]="Failed",e[e.Warning=3]="Warning"}(Nb||(Nb={})),function(e){e.Canceled="canceled",e.Failed="failed",e.Success="success",e.Submitted="submitted"}(Mb||(Mb={})),function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(Tb||(Tb={}));var Ob,Ib=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"guy",type:"address"},{name:"wad",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];!function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.Warning=2]="Warning"}(Ob||(Ob={}));const Fb=(e,t)=>Bs(void 0,void 0,void 0,(function*(){const{value:r,from:n,to:o,data:i}=e,s={from:n,to:o,value:r,data:i};r&&!/^0x0*$/.test(r)||delete s.value;try{return(yield t.estimateGas(s)).add(5e4)}catch(e){t.call(s).then((e=>{if("test"!==process.env.NODE_ENV)throw new Error("Unexpected issue with estimating the gas. Please try again.")})).catch((e=>{if("test"!==process.env.NODE_ENV)throw e}))}return null})),Wb=(e,t)=>Bs(void 0,void 0,void 0,(function*(){try{return yield t.getSigner().sendTransaction(e)}catch(e){throw 4001===(null==e?void 0:e.code)?new Error(ie._("Transaction rejected.")):e}}));var Cb,jb;!function(e){e.Approval="APPROVAL",e.TX="TX",e.TypedSign="TypedSign"}(Cb||(Cb={})),function(e){e.Normal="Normal",e.Privacy="Privacy",e.LimitOrder="LimitOrder",e.RFQ="RFQ"}(jb||(jb={}));const Ub=new r(2).pow(256).minus(1),Db=e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_GLOBAL_PROPS",payload:e})}));function Bb({onTxFail:e,onTxSubmit:t,onTxSuccess:n}={}){const{account:o,provider:i}=H(),s=cp(),[a,c]=f(!1),[l,u]=f(new Map),d=P(),[h,p]=f(null),[m,b]=f(""),[v,w]=f(null),[x,E]=f(!1),[A,R]=f(),{updateBlockNumber:_}=wl(),k=g(((a,l,h,f=!1,m,g,y,v)=>Bs(this,void 0,void 0,(function*(){if(b(""),p(""),!o||!i)throw new Error("Submission: Cannot execute step when the wallet is disconnected");let x,A,k;R((()=>y)),c(!1);try{if(c(!0),l.opcode===Cb.Approval)k=yield((e,t,n,o,i,s)=>Bs(void 0,void 0,void 0,(function*(){const a=gl(e,Ib,i,s).interface.encodeFunctionData("approve",[n,o.toFixed()]),c={from:t,to:e,data:a,value:`0x${new r("0").toString(16)}`,gasLimit:void 0},l=yield Fb(c,i);return l&&(c.gasLimit=l),yield Wb(c,i)})))(l.token.address,o,l.contract,l.amt||Ub,i,o),x=k.hash,b(x);else{if(l.opcode!==Cb.TX)throw new Error(`Op ${l.opcode} not implemented!`);if(""===l.to)throw new Error("Submission: malformed to");if(0===l.data.length)throw new Error("Submission: malformed data");if(0===l.data.indexOf("0x")&&l.data.length<=2)throw new Error("Submission: malformed data");if(A={value:l.value,data:l.data,to:l.to,gasLimit:l.gasLimit,from:o,chainId:s},!A.gasLimit)try{const e=yield Fb(A,i);e&&(A.gasLimit=e)}catch(e){console.debug(e)}if(k=yield Wb(A,i),x=k.hash,b(x),!x)throw new Error(`Unexpected tx: ${x}`)}}catch(t){if(c(!1),w({spec:l,brief:a,subtitle:h}),console.error(t),t.message){d(Db({contractStatus:Hs.Failed}));const r={error:t.message,brief:a};g&&Object.assign(r,g),e&&e(t,g),p(function(e,t){var r;const n=null===(r=Cs[e])||void 0===r?void 0:r.symbol,o=[{error:"insufficient",msg:ie._("Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet",{EtherTokenSymbol:n})},{error:["External Swap execution Failed","Return amount is not enough"],msg:ie._("Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.")},{error:"SafeERC20: low-level call failed",msg:ie._("SafeERC20: low-level call failed. Please contact the DODO team.")},{error:["User denied","cancel","User rejected","user rejected"],msg:ie._("User denied transaction signature.")},{error:["Cannot set properties of undefined (setting 'loadingDefauIts'){\"originalError\":{",'[ethjs-query]while formatting outputs from RPC\'["value":["code":-32000,"message":"header not found"))'],msg:ie._("RPC node data exception")},{error:['execution reverted:FORCESTOP ["originalError"'],msg:ie._("ForceStop exception")},{error:["replacement transaction underpriced","Gasprice too low","transaction underprice"],msg:ie._("Gas price is too low, please adjust in your wallet and try again")},{error:["MINT_INVALID"],msg:ie._("No ForceStop access")},{error:["NOT_PHASE_EXE"],msg:ie._("Unable to SETTLE during the cooling-off period")},{error:["params specify an EIP-1559transaction but the currentnetwork does not support"],msg:ie._("Wallet incompatibility")},{error:["ALREADY_SETTLED"],msg:ie._("This CP has been settled by other addrs")},{error:["create RFQ order failed]:LESS_THAN_FEE_LIMIT"],msg:ie._("Service update, please wait and try again")}];let i="";return o.some((e=>Array.isArray(e.error)?e.error.some((r=>t.indexOf(r)>-1&&(i=e.msg,!0))):t.indexOf(e.error)>-1&&(i=e.msg,!0))),i||t}(s,t.message))}return Mb.Failed}w({spec:l,brief:a,subtitle:h}),E(!1),c(!1);const S=Object.assign(Object.assign(Object.assign(Object.assign({brief:a},l),A),{tx:x,subtitle:h}),g);d(Db({contractStatus:Hs.Pending})),t&&t(x,S),m&&m();const N={brief:a,spec:l,tx:x,subtitle:h};if(u((e=>e.set(x,[N,Nb.Running]))),f)return Mb.Submitted;if(m&&m(),null==k?void 0:k.wait){const e=yield k.wait(1);if(E(!0),e.status===Tb.Success)return"TX"===S.opcode&&d(Db({contractStatus:Hs.TxSuccess})),"APPROVAL"===S.opcode&&d(Db({contractStatus:Hs.ApproveSuccess})),v&&v(x),n&&n(x,S),yield _(),u((e=>e.set(x,[N,Nb.Success]))),Mb.Success}return yield _(),E(!0),u((e=>e.set(x,[N,Nb.Failed]))),Mb.Failed}))),[o,s,c,i,_]),S=y((()=>({execute:k,requests:l,setShowing:w,waitingSubmit:a})),[k,l,w]),N=g((()=>{w(null),A&&(A(),R(void 0))}),[A]);return{showing:v,showingDone:x,transactionTx:m,errorMessage:h,setErrorMessage:p,closeShowing:N,ctxVal:S,requests:l}}function Vb(){const{requests:e}=Zb(),t=[];return null==e||e.forEach((function([e,r]){r===Nb.Running&&t.push(e)})),{runningRequests:t,isInflight:t.length>0}}const Pb=v({execute:()=>Promise.resolve(Mb.Canceled),requests:void 0,waitingSubmit:!1});function Zb(){return b(Pb)}var zb;function Lb(){return Lb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lb.apply(this,arguments)}var Hb=function(e){return l.createElement("svg",Lb({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),zb||(zb=l.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},l.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},l.createElement("g",{transform:"translate(18.000000, 291.000000)"},l.createElement("g",{transform:"translate(40.000000, 83.000000)"},l.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"})))))))};function Yb({showingDone:e,errorMessage:t}){return t?Ie.exports.jsx(Kr,{component:S,sx:{width:64,height:64,color:"error.main"}}):e?Ie.exports.jsx(Kr,{component:N,sx:{width:64,height:64,color:"success.main"}}):Ie.exports.jsx(Kr,{sx:{mx:"auto",border:e=>{var t;return`6px solid ${null===(t=e.palette)||void 0===t?void 0:t.background.input}`},borderRadius:"50%",width:"64px",height:"64px",position:"relative",animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}},children:Ie.exports.jsx(Kr,{component:Hb,sx:{position:"absolute",top:"-6px",right:"-6px",color:"primary.main"}})})}function Xb({showingDone:e,showing:t}){return Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[Ie.exports.jsx(Kr,{sx:{mt:60},children:e?ie._("{0} confirmed",{0:null==t?void 0:t.brief}):ie._("{0} pending",{0:null==t?void 0:t.brief})}),(null==t?void 0:t.subtitle)?Ie.exports.jsx(Kr,{sx:{mt:20,typography:"body2"},children:null==t?void 0:t.subtitle}):""]})}function Jb({isStarted:t,isEnded:r,tx:n}){const[o,i]=f(0),{chainId:s}=H(),a=y((()=>`https://${Us[s||1]}/tx/${n}`),[n,s]),c=y((()=>{const e=Math.floor(o/60),t=o%60;return e?`${e}m ${t}s`:`${t}s`}),[o]),l=h();return p((()=>(t&&(i(0),clearInterval(l.current),l.current=setInterval((()=>{i((e=>e+1))}),1e3)),()=>{clearInterval(l.current)})),[t]),p((()=>{clearInterval(l.current)}),[r]),Ie.exports.jsxs(Kr,{sx:{mt:20,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.secondary",border:"solid 1px transparent",borderTopColor:"border.main"},children:[Ie.exports.jsxs(Kr,{children:[Ie.exports.jsx(e,{id:"Transaction Time:"}),c]}),Ie.exports.jsxs(so,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:a,target:"_blank",rel:"noopener noreferrer",children:[Ie.exports.jsx(e,{id:"Tx"}),Ie.exports.jsx(Kr,{component:M,sx:{width:16,height:16,ml:6}})]})]})}function Gb(t){var{children:r}=t,n=Ds(t,["children"]);const{ctxVal:o,showing:i,closeShowing:s,showingDone:a,errorMessage:c,transactionTx:l}=Bb(n),u=P();return Ie.exports.jsxs(Pb.Provider,{value:o,children:[r,Ie.exports.jsx(bb,{open:!!i,onClose:s,children:Ie.exports.jsxs(Kr,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto"},children:[Ie.exports.jsxs(Kr,{children:[Ie.exports.jsx(Kr,{sx:{textAlign:"center",pt:60},children:Ie.exports.jsx(Yb,{showingDone:a,errorMessage:c})}),c?Ie.exports.jsxs(Kr,{sx:{textAlign:"center",mt:60},children:[Ie.exports.jsx(Kr,{children:Ie.exports.jsx(e,{id:"Something went wrong."})}),Ie.exports.jsx(Kr,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:c})]}):Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(Xb,{showingDone:a,showing:i}),Ie.exports.jsx(Jb,{isStarted:!!i,isEnded:a,tx:l})]})]}),Ie.exports.jsx(Bn,{fullWidth:!0,size:Bn.Size.big,onClick:()=>{u(Db({contractStatus:Hs.Initial})),s()},sx:{mt:20},children:c?Ie.exports.jsx(e,{id:"Dismiss"}):Ie.exports.jsx(e,{id:"Close"})})]})})]})}function qb({token:e,fiatPrice:t}){return{marginAmount:y((()=>{var o;const i=null!==(o=null==e?void 0:e.decimals)&&void 0!==o?o:6,s=((e,t,r)=>{const o=new n(e).times(new n(10).pow(t));return r?o:o.dp(0)})(null!=t?new r(500).div(t):new r(0),i);return(s.lt(new r(1).times(new r(10).pow(i-3)))?new r(0):s).toString(10)}),[null==e?void 0:e.decimals,t])}}function Kb({width:e,height:t,feeRate:r,rebateTo:n,colorMode:o,apikey:i,defaultChainId:s,defaultToToken:a,defaultFromToken:c}){const l=P();p((()=>{o&&l((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_COLOR_MODE",payload:e})})))(o))}),[o]),p((()=>{var e;s&&l((e=s,t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_CHAIN_ID",payload:e})}))))}),[s]),p((()=>{l(Db({height:t}))}),[t]),p((()=>{l(Db({width:e}))}),[e]),p((()=>{i&&l(Db({apikey:i}))}),[i]),p((()=>{r&&l(Db({feeRate:r}))}),[r]),p((()=>{n&&l(Db({rebateTo:n}))}),[n]),p((()=>{c&&l((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_FROM_TOKEN",payload:e})})))(c))}),[c]),p((()=>{a&&l((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_TO_TOKEN",payload:e})})))(a))}),[a])}function Qb({refetch:e,interval:t}){let r;p((()=>(e(),clearTimeout(r),r=setInterval((()=>{e()}),null!=t?t:15e3),()=>clearTimeout(r))),[e])}function $b({fromToken:e,toToken:t,chainId:r}){const[n,o]=f(!1),{apikey:i}=Z(vb),[s,a]=f(""),[c,l]=f(""),u=g((()=>{if(!r||!e||!t)return;o(!0);const n=[e,t];te.post("https://api.dodoex.io/frontend-price-api/current/batch",{networks:n.map((()=>(e=>js[e]||js[Is.MAINNET])(r))),addresses:n.map((e=>e.address)),symbols:n.map((e=>e.symbol)),isCache:!0},{headers:{apikey:i}}).then((r=>{var n;o(!1);const i=null===(n=r.data)||void 0===n?void 0:n.data;i&&(a(i.find((t=>t.address===e.address)).price),l(i.find((e=>e.address===t.address)).price))})).catch((e=>{o(!1),console.error(e)}))}),[r,e,t,i]);return Qb({refetch:u}),{loading:n,refetch:u,toFiatPrice:c,fromFiatPrice:s}}const ev=e=>(null!=e?e:Gs.getState()).settings.slippage,tv=e=>(null!=e?e:Gs.getState()).settings.ddl;var rv;function nv({toToken:e,fromToken:t,fromAmount:r,toAmount:n,marginAmount:o}){const{account:i,chainId:s,provider:a}=H(),c=Z(qs),l=y((()=>s||c),[s,c]),u=Z(ev)||3,d=Z(tv)||20,{feeRate:h,rebateTo:p,apikey:m,isReverseRouting:b}=Z(vb),v=y((()=>Math.floor(Date.now()/1e3)+60*d),[d]),[w,x]=f(rv.Initial),[E,A]=f(null),[R,_]=f(""),[k,S]=f(null),[N,M]=f(null),[T,O]=f(null),[I,F]=f(ne.from(0)),[W,C]=f(null),[j,U]=f(null),[D,B]=f(""),[V,P]=f(""),[z,L]=f(""),[Y,X]=f(0),J=g((()=>Bs(this,void 0,void 0,(function*(){if(!l||!t||!e)return;if(!b&&!r)return;if(b&&!n)return;x(rv.Loading);const o={chainId:l,deadLine:v,apikey:m,slippage:u,source:"dodoV2AndMixWasm",toTokenAddress:e.address,toTokenDecimals:e.decimals,fromTokenAddress:t.address,fromTokenDecimals:t.decimals,userAddr:i||"0x0000000000000000000000000000000000000000"};b?o.toAmount=oe(String(n||1),e.decimals).toString():o.fromAmount=oe(String(r||1),t.decimals).toString(),p&&h&&(o.rebateTo=p,o.fee=h);try{const e=(yield te.get("https://api.dodoex.io/route-service/v2/widget/getdodoroute",{params:o})).data.data;if((null==e?void 0:e.resAmount)?(x(rv.Success),A(e.resAmount),O(e.priceImpact),C(e.resPricePerFromToken),U(e.resPricePerToToken),S(e.baseFeeAmount),M(e.additionalFeeAmount),B(e.to),P(e.data),_(e.value),L(e.useSource),X(e.duration)):x(rv.Failed),!i||!a)return;const t=yield Fb({from:i,to:e.to,value:e.value,data:e.data},a);t&&F(t)}catch(e){x(rv.Failed),console.error(e)}}))),[v,i,l,e,h,u,p,t,a,r,n,m,b]);Qb({refetch:J});const G=y((()=>{const e=b?n:r;return w!==rv.Loading&&e?E:null}),[w,b,n,r,E]),q=function(){const{chainId:e,account:t}=H(),r=Zb(),n=g((({to:e,data:n,useSource:o,duration:i,ddl:s,gasLimit:a,subtitle:c,value:l})=>{const u=60*s,d=l;o&&"weth"!==o.toLowerCase()&&a&&a.lt(3e4)&&console.debug("Warning: GasLimit less than the minimum!");const h={from:t,to:e,data:n,value:d,route:o,duration:i,ddlSecRel:u,gasLimit:a};r.execute(ie._("Swap"),Object.assign({opcode:Cb.TX},h),c)}),[t,e]);return n}(),K=g((e=>{t&&(b?E:r)&&q({to:D,data:V,useSource:z,duration:Y,ddl:d,value:R,subtitle:e})}),[D,d,V,Y,z,t,r,I,E,R,b]);return{status:w,refetch:J,priceImpact:T,executeSwap:K,baseFeeAmount:k,resAmount:G,additionalFeeAmount:N,resPricePerToToken:j,resPricePerFromToken:W}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(rv||(rv={}));function ov(e){rb(e),vl(),wl();const{provider:t,connector:r}=H();p((()=>{const t=e.defaultChainId||1;(null==r?void 0:r.connectEagerly)?r.connectEagerly(t):r.activate(t)}),[r]),p((()=>{const e=null==t?void 0:t.provider;e&&e.once&&e.once("chainChanged",(()=>{setTimeout((()=>{window.location.reload()}),200||100)}))}),[t]);const n=e.width||375,o=e.height||494;return Kb(Object.assign(Object.assign({},e),{width:n,height:o})),Ie.exports.jsx(Kr,{sx:{width:n,height:o,overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",minWidth:335,minHeight:494,borderRadius:16,backgroundColor:"background.paper"},className:"dodo-widget-container",children:Ie.exports.jsx(Gb,{...e,children:e.children})})}function iv(e){const t=function(e){for(var t=void 0===e?{}:e,r=t.mode,n=void 0===r?"light":r,i=t.lang,s=t.theme,a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];var l=xn(n,s,i);return Vr(l=a.reduce((function(e,t){return o(e,t)}),l))}({mode:e.colorMode,theme:e.theme,lang:e.locale||"en-US"}),r=y((()=>e.defaultChainId||1),[e.defaultChainId]),n=ap({provider:e.provider,jsonRpcUrlMap:e.jsonRpcUrlMap,defaultChainId:r}),i=`${n.length}+${e.jsonRpcUrlMap?Object.entries(e.jsonRpcUrlMap):""}+${e.defaultChainId}+${r}`;return Ie.exports.jsx(z,{store:Gs,children:Ie.exports.jsx(Sb,{locale:e.locale,children:Ie.exports.jsx(pn,{theme:t,children:Ie.exports.jsxs(X,{connectors:n,children:[Ie.exports.jsx(_n,{container:".dodo-widget-container"}),Ie.exports.jsx(ov,{...e})]},i)})})})}function sv(e){const{width:t}=Z(vb),r=y((()=>{let e="";return"number"==typeof t?e=`${t}px`:t&&(e=t),e?`calc(${e} - 40px)`:"auto"}),[t]);return Ie.exports.jsx(Ci,{container:document.querySelector(".dodo-widget-container"),maxWidth:r,...e})}function av({onClick:e}){const t=Jr();return Ie.exports.jsx(so,{sx:{width:"100%",position:"relative"},onClick:e,children:Ie.exports.jsx(Kr,{component:zn,sx:{width:36,height:36,borderRadius:"50%",backgroundColor:t.palette.background.input,border:`4px solid ${t.palette.background.paper}`,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%) rotate(-90deg)"},children:Ie.exports.jsx(Kr,{component:T,sx:{width:18,color:"text.secondary"}})})})}function cv({open:t,execute:n,onClose:o,toToken:i,fromToken:s,fromAmount:a,toAmount:c,priceImpact:l,clearFromAmt:u,clearToAmt:d,baseFeeAmount:h,curToFiatPrice:m,curFromFiatPrice:g,pricePerFromToken:b,additionalFeeAmount:v}){var w,x;const E=Jr(),A=Z(ev),R=P(),{contractStatus:_}=Z(vb),S=y((()=>new r(l).gt(15)),[l]),[N,M]=f(!1),[T,W]=f(!1);return p((()=>{_!==Hs.Pending&&o(),_===Hs.TxSuccess&&(d(),u())}),[_]),p((()=>{M(!1)}),[m]),Ie.exports.jsx(bb,{open:t,onClose:()=>{R(Db({contractStatus:Hs.Initial})),o()},title:Ie.exports.jsx(e,{id:"Swap summary"}),children:Ie.exports.jsxs(Kr,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${E.palette.border.main}`},children:[Ie.exports.jsxs(Kr,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${E.palette.border.main}`},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsxs(Kr,{children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[Ie.exports.jsx(pb,{width:16,height:16,url:null==s?void 0:s.logoURI,address:null!==(w=null==s?void 0:s.address)&&void 0!==w?w:"",marginRight:6}),Ie.exports.jsx(Kr,{children:`${Ui({input:a,decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),Ie.exports.jsx(Kr,{sx:{mt:4,typography:"h6",color:E.palette.text.secondary},children:g?`$${ji({input:g,showDecimals:1})}`:"-"})]}),Ie.exports.jsx(Kr,{sx:{width:16,mx:16},component:O}),Ie.exports.jsxs(Kr,{children:[Ie.exports.jsxs(Kr,{sx:{display:"flex"},children:[Ie.exports.jsx(pb,{width:16,height:16,marginRight:6,url:null==i?void 0:i.logoURI,address:null!==(x=null==i?void 0:i.address)&&void 0!==x?x:""}),Ie.exports.jsx(Kr,{children:`${Ui({input:c,decimals:null==i?void 0:i.decimals})} ${null==i?void 0:i.symbol}`})]}),Ie.exports.jsx(Kr,{sx:{typography:"h6",mt:4,color:E.palette.text.secondary},children:m?`$${ji({input:m,showDecimals:1})}(${l}%)`:"-"})]})]}),Ie.exports.jsx(Kr,{sx:{mt:12,typography:"h6"},children:`1 ${null==s?void 0:s.symbol} = ${Ui({input:new r(c).dividedBy(new r(a)),decimals:null==i?void 0:i.decimals})} ${null==i?void 0:i.symbol}`})]}),Ie.exports.jsxs(Kr,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${E.palette.border.main}`},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:E.palette.text.secondary},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(Kr,{sx:{width:16,mr:7},component:I}),Ie.exports.jsx(e,{id:"Swap Detail"})]}),Ie.exports.jsx(Kr,{component:zn,children:Ie.exports.jsx(Kr,{onClick:()=>W(!T),sx:{width:10,color:"text.secondary",transform:T?"rotateX(0deg)":"rotateX(180deg)"},component:k})})]}),Ie.exports.jsxs(Kr,{sx:{mt:16,display:T?"initial":"none"},children:[Ie.exports.jsxs(Kr,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Basic Fee"}),Ie.exports.jsx(sv,{title:Ie.exports.jsx(e,{id:"Estimated service provider fees"}),ml:5})]}),Ie.exports.jsx(Kr,{children:`${Ui({input:h,decimals:null==i?void 0:i.decimals})} ${null==i?void 0:i.symbol}`})]}),Ie.exports.jsxs(Kr,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Additional Fee"}),Ie.exports.jsx(sv,{title:Ie.exports.jsx(e,{id:"Additional routing fees set by the Widget user"}),ml:5})]}),Ie.exports.jsx(Kr,{children:`${Ui({input:v,decimals:null==i?void 0:i.decimals})} ${null==i?void 0:i.symbol}`})]}),Ie.exports.jsxs(Kr,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Price Impact"}),Ie.exports.jsx(sv,{title:Ie.exports.jsx(e,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),Ie.exports.jsx(Kr,{children:`${l}%`})]}),Ie.exports.jsxs(Kr,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Slippage"}),Ie.exports.jsx(sv,{title:Ie.exports.jsx(e,{id:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),Ie.exports.jsx(Kr,{children:A})]})]})]}),Ie.exports.jsx(Kr,{sx:{flex:1}}),S&&Ie.exports.jsxs(Kr,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>M(!N),children:[Ie.exports.jsx(Kr,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:N?Ie.exports.jsx(Kr,{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:Ie.exports.jsx(Kr,{component:F,sx:{width:14,color:"#1a1a1b"}})}):Ie.exports.jsx(Kr,{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${E.palette.text.secondary}`}})}),Ie.exports.jsx(Kr,{children:Ie.exports.jsx(e,{components:{0:Ie.exports.jsx(Kr,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:l},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),Ie.exports.jsx(Bn,{isLoading:_==Hs.Pending,disabled:S&&!N,fullWidth:!0,onClick:()=>{n(),R(Db({contractStatus:Hs.Pending}))},children:_==Hs.Pending?Ie.exports.jsx(e,{id:"Confirming"}):Ie.exports.jsx(e,{id:"Confirm swap"})})]})})}function lv(e){var{sx:t,maxVal:r,decimals:o=2,onInputChange:i}=e,s=Ds(e,["sx","maxVal","decimals","onInputChange"]);return Jr(),Ie.exports.jsx(eo,{...s,onChange:e=>{const t=0===e.target.value.length?null:Vi(e.target.value,o),s=r&&t&&new n(t).gt(r)?r.toString():t;console.log("finalVal:",s),i&&i(s)}})}function uv({open:t,onClose:r}){const n=Jr(),o=P(),i=Z(ev),s=Z(tv),a=y((()=>Number(i)>=50),[i]);return Ie.exports.jsx(bb,{open:t,onClose:r,title:Ie.exports.jsx(e,{id:"Settings"}),children:Ie.exports.jsxs(Kr,{sx:{mx:20},children:[Ie.exports.jsxs(Kr,{sx:{py:20,borderTop:`1px solid ${n.palette.border.main}`},children:[Ie.exports.jsxs(Kr,{sx:{mb:16,display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Slippage Tolerance"}),Ie.exports.jsx(sv,{title:Ie.exports.jsx(e,{id:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),Ie.exports.jsxs(Kr,{sx:{display:"flex",flexDirection:"column"},children:[Ie.exports.jsx(lv,{fullWidth:!0,maxVal:100,value:i,placeholder:3..toString(),onInputChange:e=>{o((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_SLIPPAGE",payload:e})})))(e))},suffix:Ie.exports.jsx(Kr,{sx:{color:"text.disabled"},children:"%"}),height:36}),a&&Ie.exports.jsx(Kr,{sx:{typography:"h6",mt:6,color:"error.main"},children:Ie.exports.jsx(e,{id:"Maximum slippage do not exceed 50%"})})]})]}),Ie.exports.jsxs(Kr,{sx:{py:20,borderTop:`1px solid ${n.palette.border.main}`},children:[Ie.exports.jsxs(Kr,{sx:{mb:16,display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Transaction Deadline"}),Ie.exports.jsx(sv,{title:Ie.exports.jsx(e,{id:"If your transaction time exceeds the deadline, your transaction will be rescinded."}),ml:7})]}),Ie.exports.jsx(lv,{value:s,fullWidth:!0,height:36,placeholder:ie._("{DEFAULT_SWAP_DDL} minutes",{DEFAULT_SWAP_DDL:20}),onInputChange:e=>{o((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_TRANSACTION_DDL",payload:e})})))(e?Math.max(Number(e),1):""))}})]})]})})}function dv({toToken:t,fromToken:r,priceStatus:n,pricePerToToken:o,pricePerFromToken:i}){const[s,a]=f("-"),[c,l]=f(null),[u,d]=f("-"),[h,m]=f(null);p((()=>{a(null==r?void 0:r.symbol),d(null==t?void 0:t.symbol),l(o),m(i)}),[r,t,o,i]);const y=g((()=>{a(u),d(s),l(h),m(c)}),[s,c,u,h]);return Ie.exports.jsx(Kr,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:{[rv.Initial]:"-",[rv.Loading]:Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(co,{sx:{mr:5}}),Ie.exports.jsx(e,{id:"Fetching best price..."})]}),[rv.Failed]:Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(Kr,{component:W,sx:{width:15,mr:5,color:"warning.main"}}),Ie.exports.jsx(e,{id:"Quote not available"})]}),[rv.Success]:Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(Kr,{sx:{typography:"body2"},children:`1 ${s} = ${ji({input:h,showDecimals:4})} ${u}`}),Ie.exports.jsx(Kr,{component:zn,sx:{width:18,height:18,ml:6,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:Ie.exports.jsx(Kr,{sx:{width:16,color:"text.secondary"},onClick:y,component:C})})]})}[n]})}function hv({open:t,onClose:r}){const n=Z(qs);return Ie.exports.jsx(bb,{title:Ie.exports.jsx(e,{id:"Connect to your wallet"}),open:t,onClose:r,children:Ie.exports.jsx(Kr,{sx:{mx:20,pb:20,border:"1px solid transparent",borderTopColor:"border.main"},children:Object.values(ip).map((t=>Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",flexDirection:"column",mt:20,p:20,backgroundColor:"background.tag",borderRadius:12,cursor:"pointer","&:hover":{backgroundColor:"hover.default"}},onClick:()=>{!function(e,t,r){var n;const o=sp[e];if(!o)throw new Error(`Unknown wallet type: ${e}`);const[i]=o;null===(n=i.activate(t))||void 0===n||n.catch((e=>{4001!==e.code?r(e):i.connectEagerly?i.connectEagerly(t):i.activate(t)}))}(t.type,n,(e=>{console.error(e)}))},children:[Ie.exports.jsx(Kr,{component:t.icon,sx:{width:32,height:32}}),Ie.exports.jsx(Kr,{sx:{mt:8,typography:"caption"},children:t.name}),Ie.exports.jsx(Kr,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:Ie.exports.jsx(e,{id:"Connect to your {0} Wallet",values:{0:t.name}})})]},t.type)))})})}function fv(){const{connector:t}=H(),[r,n]=f(!1);return Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(Bn,{size:Bn.Size.big,fullWidth:!0,onClick:()=>{t.deactivate?t.deactivate():t.resetState(),n(!0)},"data-testid":"connect-wallet-btn",children:Ie.exports.jsx(e,{id:"Connect to a wallet"})}),Ie.exports.jsx(hv,{open:r,onClose:()=>n(!1)})]})}const pv=({account:e,chainId:t,offset:n,contractAddress:o})=>{var i;const s=Z(qs),a=y((()=>{var e;return sa[null!==(e=t)&&void 0!==e?e:s]}),[t]),{isETH:c}=y((()=>Os(t)),[t]),{DODO_APPROVE:l}=a||{},u=null!==(i=null!=o?o:l)&&void 0!==i?i:null,d=function(e){const{account:t}=H(),n=Z(qs),o=Z(ib),i=y((()=>Cs[n]),[n]),s=g((n=>{var s;if(!t||!e)return null;if(n.symbol===i.symbol&&Ts(n.address,i.address))return new r(Ub);const a=null===(s=null==o?void 0:o[n.address.toLowerCase()])||void 0===s?void 0:s.tokenAllowances;return null!=a?a:null}),[t,e,i.symbol,i.address,o]);return s}(u),h=ub(),{runningRequests:f}=Vb(),p=Z(lb),m=y((()=>{var e;return null===(e=Cs[null!=t?t:s])||void 0===e?void 0:e.address}),[t]),b=g(((t,o,i)=>{if(!t)return El.Loading;const s=!!(null==f?void 0:f.find((e=>e.spec.opcode===Cb.Approval&&e.spec.token.address===(null==t?void 0:t.address)))),a=null!=i?i:t?h(t):null,c=t?d(t):null,l=new r(null!=o?o:0);if(!e)return El.Unchecked;if(!a||l.minus(null!=n?n:0).gt(a))return El.Unchecked;if(l.isZero())return El.Unchecked;return t.address===m?El.Sufficient:s?El.Approving:c&&l.minus(null!=n?n:0).gt(c)?El.Insufficient:El.Sufficient}),[h,d,e,n,u,t,p,f,m]),v=g((e=>{const t=e?d(e):null;return("USDT"===(null==e?void 0:e.symbol)||(null==e?void 0:e.address.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&null!==t&&t.gt(0)}),[d]),w=Zb(),x=P(),E=g(((t,n)=>Bs(void 0,void 0,void 0,(function*(){if(!u||!e||!t)return;const o=(e=>{let t=e.symbol;return t.indexOf("DLP_")>-1&&(t=t.replace("DLP_","")),t.indexOf("DLP")>-1&&(t=t.replace("DLP","LP")),t})(t),i=n?new r(0):void 0,s=n?ie._("Reset"):ie._("Approve");var a;(yield w.execute(`${s} ${o}`,{opcode:Cb.Approval,token:t,contract:u,amt:i}))===Mb.Success&&x((a=null!=i?i:Ub,e=>Bs(void 0,void 0,void 0,(function*(){e({type:"SET_ACCOUNT_ALLOWANCES",payload:a})}))))}))),[u,e,t,w,x]),A=g((e=>{const t=new r(0);if(!e)return t.toString();const n=h(e);if(!n)return t.toString();let o=n;const i=c?.1:.02;return m===(null==e?void 0:e.address)&&(o=n.gt(i)?n.minus(i):t),o.toString()}),[t,h,c]);return{getApprovalState:b,getPendingRest:v,getMaxBalance:A,submitApprove:E}};function mv(){var t,n;const o=Jr(),{isInflight:i}=Vb(),{chainId:s,account:a}=H(),l=P(),{isReverseRouting:u}=Z(vb),d=Z(qs),h=Z(cb),m=Z(ab),{isETH:b}=y((()=>Os(s)),[s]),v=y((()=>{var e;return null===(e=Cs[null!=s?s:d])||void 0===e?void 0:e.address}),[s]),[w,x]=f(""),[E,A]=f(""),[R,_]=f(""),[k,S]=f(""),N=y((()=>c((e=>_(e)),1e3)),[]),M=y((()=>c((e=>S(e)),1e3)),[]),[T,I]=f(null),[F,C]=f(null),[D,B]=f(!1),[V,z]=f(!1),{toFiatPrice:L,fromFiatPrice:Y}=$b({chainId:s,toToken:F,fromToken:T}),X=ub(),J=y((()=>T?X(T):null),[T,X]);y((()=>F?X(F):null),[F,X]);const{getApprovalState:G,submitApprove:q,getPendingRest:K,getMaxBalance:Q}=pv({account:a,chainId:s}),$=y((()=>K(u?F:T)),[null==T?void 0:T.address,null==F?void 0:F.address,K,u]),{marginAmount:ee}=qb({token:u?F:T,fiatPrice:u?L:Y}),{resAmount:te,priceImpact:re,executeSwap:ne,baseFeeAmount:oe,additionalFeeAmount:ie,resPricePerToToken:se,resPricePerFromToken:ae,status:ce}=nv({toToken:F,fromToken:T,marginAmount:ee,fromAmount:R,toAmount:k}),le=g((e=>{const t=e.toString();x(t),N(t)}),[x,N]),ue=g((e=>{const t=e.toString();A(t),M(t)}),[A,M]);p((()=>{s&&(C(null),I(null),u?ue(""):le("")),m&&m.chainId===s&&(I(m),m.amount&&(l(Db({isReverseRouting:!1})),le(m.amount))),h&&h.chainId===s&&(C(h),h.amount&&m&&!m.amount&&(l(Db({isReverseRouting:!0})),ue(h.amount)))}),[h,m,s,le,ue]);const de=g((()=>{le(""),ue(""),I(F),C(T)}),[I,F,C,T,le,ue]),he=g((e=>u?ue(Q(F)):le(Q(T))),[le,ue,Q,T,F,u]),fe=y((()=>(100*Number(re)).toFixed(2)),[re]),pe=y((()=>{const e=u?te:R;return e&&Y?new r(Y).multipliedBy(e):null}),[Y,R,u,te]),me=y((()=>{const e=u?k:te;return e&&L?new r(L).multipliedBy(e):null}),[L,k,u,te]),ge=y((()=>Ie.exports.jsxs(Kr,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[Ie.exports.jsx(sv,{title:Ie.exports.jsx(e,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),Ie.exports.jsxs(Kr,{sx:{display:"flex"},children:[Ie.exports.jsx(e,{id:"Current price impact"}),Ie.exports.jsxs(Kr,{sx:{color:o.palette.error.main,ml:4},children:[fe,"%"]})]})]})),[fe]),ye=y((()=>Ie.exports.jsx(dv,{toToken:F,fromToken:T,priceStatus:ce,pricePerToToken:se,pricePerFromToken:ae})),[F,T,ce,se,ae]),be=y((()=>!Is[s||1]),[s]),ve=y((()=>ce===rv.Loading?Ie.exports.jsx(Kr,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(co,{sx:{mr:5}}),Ie.exports.jsx(e,{id:"Fetching best price..."})]})}):be?Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(Kr,{component:W,sx:{mr:6,width:16,color:"warning.main"}}),Ie.exports.jsx(e,{id:"Unsupported network - switch to trade"})]}):w&&new r(fe).gt(15)?ge:ye),[ce,ye,w,ge,fe,be]),we=y((()=>u?new r(E).gt(0)?Ui({input:te,decimals:null==T?void 0:T.decimals}):"-":w),[w,E,te,T,u]),xe=y((()=>u?E:new r(w).gt(0)?Ui({input:te,decimals:null==F?void 0:F.decimals}):"-"),[w,E,te,F,u]),Ee=y((()=>{const t=G(T,u?te||0:R),n=t===El.Approving,o=t===El.Insufficient&&!$,s=b?.1:.02,c=v===(null==T?void 0:T.address),l=new r(J||0);return a?i?Ie.exports.jsx(Bn,{fullWidth:!0,isLoading:!0,disabled:!0,children:Ie.exports.jsx(e,{id:"Transaction Pending"})}):T&&F?o?Ie.exports.jsx(Bn,{fullWidth:!0,disabled:n,onClick:()=>q(T),children:n?Ie.exports.jsx(e,{id:"Approving"}):Ie.exports.jsx(e,{id:"Approve"})}):new r(u?k:R).gt(0)?ce===rv.Loading?Ie.exports.jsx(Bn,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-fetch-price-btn",children:Ie.exports.jsx(e,{id:"Fetching Price..."})}):te&&ce!==rv.Failed?l.lt(u?te:R)||c&&l.lte(s)?Ie.exports.jsx(Bn,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-insufficient-balance-btn",children:Ie.exports.jsx(e,{id:"Insufficient balance"})}):Ie.exports.jsx(Bn,{fullWidth:!0,onClick:()=>B(!0),"data-testid":"swap-review-btn",children:Ie.exports.jsx(e,{id:"Review Swap"})}):Ie.exports.jsx(Bn,{fullWidth:!0,disabled:!0,children:Ie.exports.jsx(e,{id:"Quote not available"})}):Ie.exports.jsx(Bn,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-enter-amount-btn",children:Ie.exports.jsx(e,{id:"Enter an amount"})}):Ie.exports.jsx(Bn,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-select-token-btn",children:Ie.exports.jsx(e,{id:"Select Tokens"})}):Ie.exports.jsx(fv,{})}),[b,a,k,R,F,te,T,i,ne,$,q,ce,J,G,v,u]),Ae=y((()=>T&&F?Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(pb,{token:T,sx:{width:16,height:16,mr:6}}),`${Ui({input:u?te:R,decimals:null==T?void 0:T.decimals})} ${null==T?void 0:T.symbol}`,Ie.exports.jsx(Kr,{component:O,sx:{width:12,height:12,mx:16}}),Ie.exports.jsx(pb,{token:F,sx:{width:16,height:16,mr:6}}),`${Ui({input:u?k:te,decimals:null==F?void 0:F.decimals})} ${null==F?void 0:F.symbol}`]}):Ie.exports.jsx(Kr,{})),[T,F,R,k,te,u]);return Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",justifyContent:"space-between",typography:"caption",margin:20},children:[Ie.exports.jsx(e,{id:"Swap"}),Ie.exports.jsx(Kr,{component:zn,children:Ie.exports.jsx(Kr,{component:j,onClick:()=>z(!0),sx:{width:19,height:19,color:"text.primary",cursor:"pointer"}})})]}),Ie.exports.jsxs(Kr,{sx:{flex:1,padding:"0 20px 20px",overflowY:"auto"},children:[Ie.exports.jsxs(Kr,{children:[Ie.exports.jsx(Rb,{sx:{mb:4},token:T,amt:we,onMaxClick:he,onInputChange:le,onInputFocus:()=>{u&&le(""),l(Db({isReverseRouting:!1}))},showMaxBtn:!u&&!w,occupiedAddrs:[null!==(t=null==F?void 0:F.address)&&void 0!==t?t:""],fiatPriceTxt:pe?`$${ji({input:pe,showDecimals:1})}`:"-",onTokenChange:(e,t)=>{if(t)return de();le(""),ue(""),I(e)},readOnly:u}),Ie.exports.jsx(av,{onClick:de}),Ie.exports.jsx(Rb,{token:F,amt:xe,onInputChange:ue,onInputFocus:()=>{u||ue(""),l(Db({isReverseRouting:!0}))},occupiedAddrs:[null!==(n=null==T?void 0:T.address)&&void 0!==n?n:""],fiatPriceTxt:me?`$${ji({input:me,showDecimals:1})}(${fe}%)`:"-",onTokenChange:(e,t)=>{if(t)return de();le(""),ue(""),C(e)},readOnly:!u}),Ie.exports.jsx(Kr,{sx:{py:12,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:ve})]}),Ee,Ie.exports.jsxs(Kr,{sx:{mt:13,display:"flex",typography:"h6",cursor:"pointer",justifyContent:"center",alignItems:"center",color:o.palette.text.disabled},onClick:()=>window.open("https://app.dodoex.io"),children:[Ie.exports.jsx(Kr,{sx:{width:24,typography:"body2",transform:"translate(1px, 2px)","& path":{fill:o.palette.text.disabled}},component:U}),Ie.exports.jsx(e,{id:"Powered by DODO protocol"})]})]}),Ie.exports.jsx(cv,{toToken:F,fromToken:T,fromAmount:u?te:R,toAmount:u?k:te,open:D,baseFeeAmount:oe,priceImpact:fe,additionalFeeAmount:ie,curToFiatPrice:me,execute:()=>ne(Ae),clearFromAmt:()=>le(""),clearToAmt:()=>ue(""),curFromFiatPrice:pe,pricePerFromToken:ae,onClose:()=>B(!1)}),Ie.exports.jsx(uv,{open:V,onClose:()=>z(!1)})]})}var gv,yv=V;if("production"===process.env.NODE_ENV)gv=yv.createRoot,yv.hydrateRoot;else{var bv=yv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;gv=function(e,t){bv.usingClientEntryPoint=!0;try{return yv.createRoot(e,t)}finally{bv.usingClientEntryPoint=!1}}}function vv(e){return Ie.exports.jsx(iv,{...e,children:Ie.exports.jsx(mv,{})})}function wv(e){const t=document.getElementById("dodo-swap-widget");gv(t).render(Ie.exports.jsx(iv,{...e,children:Ie.exports.jsx(mv,{})}))}export{wv as InitSwapWidget,vv as SwapWidget};
|
|
44
|
+
*/!function(e){!function(){var t="input is invalid type",r="object"==typeof window,n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var o=!r&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=ce:o&&(n=self);var i=!n.JS_SHA3_NO_COMMON_JS&&e.exports,s=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),c=[4,1024,262144,67108864],l=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],d=[224,256,384,512],h=[128,256],f=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!s||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var m=function(e,t,r){return function(n){return new T(e,t,e).update(n)[r]()}},g=function(e,t,r){return function(n,o){return new T(e,t,o).update(n)[r]()}},y=function(e,t,r){return function(t,n,o,i){return E["cshake"+e].update(t,n,o,i)[r]()}},b=function(e,t,r){return function(t,n,o,i){return E["kmac"+e].update(t,n,o,i)[r]()}},v=function(e,t,r,n){for(var o=0;o<f.length;++o){var i=f[o];e[i]=t(r,n,i)}return e},w=function(e,t){var r=m(e,t,"hex");return r.create=function(){return new T(e,t,e)},r.update=function(e){return r.create().update(e)},v(r,m,e,t)},x=[{name:"keccak",padding:[1,256,65536,16777216],bits:d,createMethod:w},{name:"sha3",padding:[6,1536,393216,100663296],bits:d,createMethod:w},{name:"shake",padding:[31,7936,2031616,520093696],bits:h,createMethod:function(e,t){var r=g(e,t,"hex");return r.create=function(r){return new T(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},v(r,g,e,t)}},{name:"cshake",padding:c,bits:h,createMethod:function(e,t){var r=p[e],n=y(e,0,"hex");return n.create=function(n,o,i){return o||i?new T(e,t,n).bytepad([o,i],r):E["shake"+e].create(n)},n.update=function(e,t,r,o){return n.create(t,r,o).update(e)},v(n,y,e,t)}},{name:"kmac",padding:c,bits:h,createMethod:function(e,t){var r=p[e],n=b(e,0,"hex");return n.create=function(n,o,i){return new O(e,t,o).bytepad(["KMAC",i],r).bytepad([n],r)},n.update=function(e,t,r,o){return n.create(e,r,o).update(t)},v(n,b,e,t)}}],E={},A=[],R=0;R<x.length;++R)for(var _=x[R],k=_.bits,S=0;S<k.length;++S){var N=_.name+"_"+k[S];if(A.push(N),E[N]=_.createMethod(k[S],_.padding),"sha3"!==_.name){var M=_.name+k[S];A.push(M),E[M]=E[N]}}function T(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function O(e,t,r){T.call(this,e,t,r)}T.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var o,i,a=this.blocks,c=this.byteCount,u=e.length,d=this.blockCount,h=0,f=this.s;h<u;){if(this.reset)for(this.reset=!1,a[0]=this.block,o=1;o<d+1;++o)a[o]=0;if(r)for(o=this.start;h<u&&o<c;++h)a[o>>2]|=e[h]<<l[3&o++];else for(o=this.start;h<u&&o<c;++h)(i=e.charCodeAt(h))<128?a[o>>2]|=i<<l[3&o++]:i<2048?(a[o>>2]|=(192|i>>6)<<l[3&o++],a[o>>2]|=(128|63&i)<<l[3&o++]):i<55296||i>=57344?(a[o>>2]|=(224|i>>12)<<l[3&o++],a[o>>2]|=(128|i>>6&63)<<l[3&o++],a[o>>2]|=(128|63&i)<<l[3&o++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++h)),a[o>>2]|=(240|i>>18)<<l[3&o++],a[o>>2]|=(128|i>>12&63)<<l[3&o++],a[o>>2]|=(128|i>>6&63)<<l[3&o++],a[o>>2]|=(128|63&i)<<l[3&o++]);if(this.lastByteIndex=o,o>=c){for(this.start=o-c,this.block=a[d],o=0;o<d;++o)f[o]^=a[o];I(f),this.reset=!0}else this.start=o}return this},T.prototype.encode=function(e,t){var r=255&e,n=1,o=[r];for(r=255&(e>>=8);r>0;)o.unshift(r),r=255&(e>>=8),++n;return t?o.push(n):o.unshift(n),this.update(o),o.length},T.prototype.encodeString=function(e){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(s&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||s&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var o=0,i=e.length;if(r)o=i;else for(var a=0;a<e.length;++a){var c=e.charCodeAt(a);c<128?o+=1:c<2048?o+=2:c<55296||c>=57344?o+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++a)),o+=4)}return o+=this.encode(8*o),this.update(e),o},T.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var o=t-r%t,i=[];return i.length=o,this.update(i),this},T.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];I(n)}},T.prototype.toString=T.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,s=0,c="";s<n;){for(i=0;i<t&&s<n;++i,++s)e=r[i],c+=a[e>>4&15]+a[15&e]+a[e>>12&15]+a[e>>8&15]+a[e>>20&15]+a[e>>16&15]+a[e>>28&15]+a[e>>24&15];s%t==0&&(I(r),i=0)}return o&&(e=r[i],c+=a[e>>4&15]+a[15&e],o>1&&(c+=a[e>>12&15]+a[e>>8&15]),o>2&&(c+=a[e>>20&15]+a[e>>16&15])),c},T.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,o=this.extraBytes,i=0,s=0,a=this.outputBits>>3;e=o?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(e);s<n;){for(i=0;i<t&&s<n;++i,++s)c[s]=r[i];s%t==0&&I(r)}return o&&(c[i]=r[i],e=e.slice(0,a)),e},T.prototype.buffer=T.prototype.arrayBuffer,T.prototype.digest=T.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,o=this.outputBlocks,i=this.extraBytes,s=0,a=0,c=[];a<o;){for(s=0;s<r&&a<o;++s,++a)e=a<<2,t=n[s],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;a%r==0&&I(n)}return i&&(e=a<<2,t=n[s],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},O.prototype=new T,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var I=function(e){var t,r,n,o,i,s,a,c,l,d,h,f,p,m,g,y,b,v,w,x,E,A,R,_,k,S,N,M,T,O,I,F,W,C,j,U,D,B,V,P,Z,z,L,H,Y,X,J,G,q,K,Q,$,ee,te,re,ne,oe,ie,se,ae,ce,le,ue;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(c<<1|l>>>31),r=i^(l<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(d<<1|h>>>31),r=a^(h<<1|d>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(f<<1|p>>>31),r=l^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=d^(o<<1|i>>>31),r=h^(i<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],X=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,T=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,L=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,j=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,G=e[22]<<10|e[23]>>>22,q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,I=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,U=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,K=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,F=e[45]<<29|e[44]>>>3,W=e[44]<<29|e[45]>>>3,_=e[6]<<28|e[7]>>>4,k=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,oe=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,V=e[27]<<25|e[26]>>>7,x=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,H=e[8]<<27|e[9]>>>5,Y=e[9]<<27|e[8]>>>5,S=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,P=e[38]<<8|e[39]>>>24,Z=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,R=e[49]<<14|e[48]>>>18,e[0]=m^~y&v,e[1]=g^~b&w,e[10]=_^~S&M,e[11]=k^~N&T,e[20]=C^~U&B,e[21]=j^~D&V,e[30]=H^~X&G,e[31]=Y^~J&q,e[40]=te^~ne&ie,e[41]=re^~oe&se,e[2]=y^~v&x,e[3]=b^~w&E,e[12]=S^~M&O,e[13]=N^~T&I,e[22]=U^~B&P,e[23]=D^~V&Z,e[32]=X^~G&K,e[33]=J^~q&Q,e[42]=ne^~ie&ae,e[43]=oe^~se&ce,e[4]=v^~x&A,e[5]=w^~E&R,e[14]=M^~O&F,e[15]=T^~I&W,e[24]=B^~P&z,e[25]=V^~Z&L,e[34]=G^~K&$,e[35]=q^~Q&ee,e[44]=ie^~ae&le,e[45]=se^~ce&ue,e[6]=x^~A&m,e[7]=E^~R&g,e[16]=O^~F&_,e[17]=I^~W&k,e[26]=P^~z&C,e[27]=Z^~L&j,e[36]=K^~$&H,e[37]=Q^~ee&Y,e[46]=ae^~le&te,e[47]=ce^~ue&re,e[8]=A^~m&y,e[9]=R^~g&b,e[18]=F^~_&S,e[19]=W^~k&N,e[28]=z^~C&U,e[29]=L^~j&D,e[38]=$^~H&X,e[39]=ee^~Y&J,e[48]=le^~te&ne,e[49]=ue^~re&oe,e[0]^=u[n],e[1]^=u[n+1]};if(i)e.exports=E;else for(R=0;R<A.length;++R)n[A[R]]=E[A[R]]}()}(ps);var ms=ps.exports;function gs(e){return"0x"+ms.keccak_256(ns(e))}const ys=new qi("rlp/5.7.0");function bs(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function vs(e,t,r){let n=0;for(let o=0;o<r;o++)n=256*n+e[t+o];return n}function ws(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(ws(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=bs(t.length);return r.unshift(247+r.length),r.concat(t)}es(e)||ys.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(ns(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=bs(t.length);return r.unshift(183+r.length),r.concat(t)}function xs(e){return as(ws(e))}function Es(e,t,r,n){const o=[];for(;r<t+1+n;){const i=As(e,r);o.push(i.result),(r+=i.consumed)>t+1+n&&ys.throwError("child data too short",qi.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function As(e,t){if(0===e.length&&ys.throwError("data too short",qi.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&ys.throwError("data short segment too short",qi.errors.BUFFER_OVERRUN,{});const n=vs(e,t+1,r);return t+1+r+n>e.length&&ys.throwError("data long segment too short",qi.errors.BUFFER_OVERRUN,{}),Es(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&ys.throwError("data array too short",qi.errors.BUFFER_OVERRUN,{}),Es(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&ys.throwError("data array too short",qi.errors.BUFFER_OVERRUN,{});const n=vs(e,t+1,r);t+1+r+n>e.length&&ys.throwError("data array too short",qi.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:as(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&ys.throwError("data too short",qi.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:as(e.slice(t+1,t+1+r))}}return{consumed:1,result:as(e[t])}}function Rs(e){const t=ns(e),r=As(t,0);return r.consumed!==t.length&&ys.throwArgumentError("invalid rlp data","data",e),r.result}const _s=new qi("address/5.7.0");function ks(e){ss(e,20)||_s.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=ns(gs(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const Ss={};for(let e=0;e<10;e++)Ss[String(e)]=String(e);for(let e=0;e<26;e++)Ss[String.fromCharCode(65+e)]=String(10+e);const Ns=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function Ms(e){let t=null;if("string"!=typeof e&&_s.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=ks(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&_s.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)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Ss[e])).join("");for(;t.length>=Ns;){let e=t.substring(0,Ns);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e)&&_s.throwArgumentError("bad icap checksum","address",e),t=re(e.substring(4));t.length<40;)t="0"+t;t=ks("0x"+t)}else _s.throwArgumentError("invalid address","address",e);return t}const Ts=(e,t)=>{if(0===e.length||0===t.length)return!1;if(t.length===e.length)return e.toLowerCase()===t.toLowerCase();const r=e.substring(2,e.length).toLowerCase(),n=t.substring(2,t.length).toLowerCase();return r.length>n.length?r.endsWith(n):n.endsWith(r)};const Os=e=>{const t={isMainnet:1===e,isRinkeby:4===e,isGor:5===e};return Object.assign(Object.assign({},t),{isETH:t.isMainnet||t.isRinkeby||t.isGor})};var Is;!function(e){e[e.MAINNET=1]="MAINNET",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.BSC=56]="BSC",e[e.HECO=128]="HECO",e[e.POLYGON=137]="POLYGON",e[e.ARBITRUM_ONE=42161]="ARBITRUM_ONE",e[e.ARBITRUM_RINKEBY=421611]="ARBITRUM_RINKEBY",e[e.AURORA=1313161554]="AURORA",e[e.MOONRIVER=1285]="MOONRIVER",e[e.OKCHAIN=66]="OKCHAIN",e[e.OPTIMISM=10]="OPTIMISM",e[e.BOBA=288]="BOBA",e[e.AVALANCHE=43114]="AVALANCHE",e[e.CRONOS=25]="CRONOS"}(Is||(Is={}));const Fs={[Is.MAINNET]:["https://rpc.ankr.com/eth","https://eth-mainnet.public.blastapi.io","https://eth-rpc.gateway.pokt.network","https://main-rpc.linkpool.io"],[Is.RINKEBY]:["https://rinkeby-light.eth.linkpool.io/"],[Is.GOERLI]:["https://goerli.optimism.io/"],[Is.BSC]:["https://bsc-dataseed1.binance.org","https://bsc-dataseed2.binance.org","https://bsc-dataseed3.binance.org","https://bsc-dataseed4.binance.org","https://bsc-dataseed1.defibit.io","https://bsc-dataseed2.defibit.io","https://bsc-dataseed3.defibit.io","https://bsc-dataseed4.defibit.io","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed2.ninicoin.io","https://bsc-dataseed3.ninicoin.io","https://bsc-dataseed4.ninicoin.io","https://bsc-dataseed.binance.org","https://rpc.ankr.com/bsc","https://bscrpc.com","https://bsc.mytokenpocket.vip","https://binance.nodereal.io","https://rpc-bsc.bnb48.club"],[Is.HECO]:["https://http-mainnet.hecochain.com","https://pub001.hg.network/rpc"],[Is.POLYGON]:["https://polygon-rpc.com","https://rpc-mainnet.matic.network","https://matic-mainnet.chainstacklabs.com","https://rpc-mainnet.maticvigil.com","https://rpc-mainnet.matic.quiknode.pro","https://matic-mainnet-full-rpc.bwarelabs.com","https://matic-mainnet-archive-rpc.bwarelabs.com","https://poly-rpc.gateway.pokt.network","https://rpc.ankr.com/polygon","https://polygon-mainnet.public.blastapi.io"],[Is.ARBITRUM_ONE]:["https://arb1.arbitrum.io/rpc","https://rpc.ankr.com/arbitrum"],[Is.ARBITRUM_RINKEBY]:["https://rinkeby.arbitrum.io/rpc"],[Is.AURORA]:["https://mainnet.aurora.dev/"],[Is.MOONRIVER]:["https://rpc.api.moonriver.moonbeam.network","https://moonriver.api.onfinality.io/rpc?apikey=673e1fae-c9c9-4c7f-a3d5-2121e8274366","https://moonriver.api.onfinality.io/public","https://moonriver.public.blastapi.io"],[Is.OKCHAIN]:["https://exchainrpc.okex.org","https://okc-mainnet.gateway.pokt.network/v1/lb/6275309bea1b320039c893ff"],[Is.OPTIMISM]:["https://mainnet.optimism.io","https://optimism-mainnet.public.blastapi.io"],[Is.BOBA]:["https://mainnet.boba.network","https://boba-mainnet.gateway.pokt.network/v1/lb/623ad21b20354900396fed7f","https://lightning-replica.boba.network"],[Is.AVALANCHE]:["https://api.avax.network/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://ava-mainnet.public.blastapi.io/ext/bc/C/rpc"],[Is.CRONOS]:["https://evm.cronos.org","https://cronos-rpc.heavenswail.one","https://evm-cronos.crypto.org","https://cronosrpc-1.xstaking.sg","https://cronos-rpc.elk.finance"]},Ws={symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,showDecimals:4,wrappedTokenSymbol:"WETH"},Cs={[Is.MAINNET]:Object.assign(Object.assign({},Ws),{wrappedTokenAddress:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}),[Is.RINKEBY]:Object.assign(Object.assign({},Ws),{wrappedTokenAddress:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0"}),[Is.GOERLI]:Object.assign(Object.assign({},Ws),{wrappedTokenAddress:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"}),[Is.OPTIMISM]:Object.assign(Object.assign({},Ws),{wrappedTokenAddress:"0x4200000000000000000000000000000000000006"}),[Is.CRONOS]:Object.assign(Object.assign({},Ws),{symbol:"CRO",name:"Cronos",wrappedTokenSymbol:"WCRO",wrappedTokenAddress:"0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23"}),[Is.BOBA]:Object.assign(Object.assign({},Ws),{wrappedTokenAddress:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000"}),[Is.BSC]:Object.assign(Object.assign({},Ws),{symbol:"BNB",name:"BNB",wrappedTokenSymbol:"WBNB",wrappedTokenAddress:"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}),[Is.OKCHAIN]:Object.assign(Object.assign({},Ws),{symbol:"OKT",name:"OKT",wrappedTokenSymbol:"WOKT",wrappedTokenAddress:"0x8F8526dbfd6E38E3D8307702cA8469Bae6C56C15"}),[Is.HECO]:Object.assign(Object.assign({},Ws),{symbol:"HT",name:"HT",showDecimals:6,wrappedTokenSymbol:"WHT",wrappedTokenAddress:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f"}),[Is.POLYGON]:Object.assign(Object.assign({},Ws),{symbol:"MATIC",name:"MATIC",showDecimals:6,wrappedTokenSymbol:"WMATIC",wrappedTokenAddress:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"}),[Is.MOONRIVER]:Object.assign(Object.assign({},Ws),{symbol:"MOVR",name:"MOVR",showDecimals:6,wrappedTokenSymbol:"WMOVR",wrappedTokenAddress:"0x98878b06940ae243284ca214f92bb71a2b032b8a"}),[Is.ARBITRUM_ONE]:Object.assign(Object.assign({},Ws),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"}),[Is.ARBITRUM_RINKEBY]:Object.assign(Object.assign({},Ws),{name:"Ether",showDecimals:6,wrappedTokenAddress:"0xEBbc3452Cc911591e4F18f3b36727Df45d6bd1f9"}),[Is.AURORA]:Object.assign(Object.assign({},Ws),{name:"Ethereum",showDecimals:6,wrappedTokenAddress:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB"}),[Is.AVALANCHE]:Object.assign(Object.assign({},Ws),{symbol:"AVAX",name:"Avalanche",showDecimals:6,wrappedTokenSymbol:"WAVAX",wrappedTokenAddress:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7"})},js={[Is.MAINNET]:"ethereum",[Is.RINKEBY]:"rinkeby",[Is.GOERLI]:"goerli",[Is.OPTIMISM]:"optimism",[Is.CRONOS]:"cronos",[Is.BOBA]:"boba",[Is.BSC]:"bsc",[Is.OKCHAIN]:"okex-chain",[Is.HECO]:"heco",[Is.POLYGON]:"polygon",[Is.MOONRIVER]:"moonriver",[Is.ARBITRUM_ONE]:"arbitrum",[Is.ARBITRUM_RINKEBY]:"arb-rinkeby",[Is.AURORA]:"aurora",[Is.AVALANCHE]:"avalanche"},Us={[Is.MAINNET]:"etherscan.io",[Is.RINKEBY]:"rinkeby.etherscan.io",[Is.GOERLI]:"goerli.etherscan.io",[Is.OPTIMISM]:"optimistic.etherscan.io",[Is.CRONOS]:"cronoscan.com",[Is.BOBA]:"blockexplorer.boba.network",[Is.BSC]:"bscscan.com",[Is.OKCHAIN]:"www.oklink.com/okexchain",[Is.HECO]:"hecoinfo.com",[Is.POLYGON]:"polygonscan.com",[Is.MOONRIVER]:"moonriver.moonscan.io",[Is.ARBITRUM_ONE]:"arbiscan.io",[Is.ARBITRUM_RINKEBY]:"testnet.arbiscan.io",[Is.AURORA]:"aurorascan.dev",[Is.AVALANCHE]:"snowtrace.io"};function Ds(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function Bs(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}const Vs={colorMode:"dark",slippage:3..toString(),ddl:20};var Ps=(e=Vs,t)=>{switch(t.type){case"SET_COLOR_MODE":return Object.assign(Object.assign({},e),{colorMode:t.payload});case"SET_SLIPPAGE":return Object.assign(Object.assign({},e),{slippage:t.payload});case"SET_TRANSACTION_DDL":return Object.assign(Object.assign({},e),{ddl:t.payload});default:return e}};const Zs={chainId:Is.MAINNET,latestBlockNumber:0};var zs=(e=Zs,t)=>{switch(t.type){case"SET_CHAIN_ID":return Object.assign(Object.assign({},e),{chainId:t.payload});case"SET_BLOCK_NUMBER":return Object.assign(Object.assign({},e),{latestBlockNumber:t.payload});default:return e}};const Ls={tokenList:[],popularTokenList:[],ethBalance:void 0,accountBalances:{},balanceLoadings:{},slippageWithTokens:[]};var Hs,Ys=(e=Ls,t)=>{switch(t.type){case"SET_TOKEN_LIST":return Object.assign(Object.assign({},e),{tokenList:t.payload});case"SET_POPULAR_TOKEN_LIST":return Object.assign(Object.assign({},e),{popularTokenList:t.payload});case"SET_SLIPPAGE_WITH_TOKENS":return Object.assign(Object.assign({},e),{slippageWithTokens:t.payload});case"SET_ETH_BALANCE":return Object.assign(Object.assign({},e),{ethBalance:t.payload});case"SET_DEFAULT_FROM_TOKEN":return Object.assign(Object.assign({},e),{defaultFromToken:t.payload});case"SET_DEFAULT_TO_TOKEN":return Object.assign(Object.assign({},e),{defaultToToken:t.payload});case"SET_ACCOUNT_BALANCES":return Object.assign(Object.assign({},e),{accountBalances:Object.assign(Object.assign({},e.accountBalances),t.payload)});case"SET_ACCOUNT_ALLOWANCES":const r=e.accountBalances;return Object.keys(r).map((e=>{r[e].tokenAllowances=t.payload})),Object.assign(Object.assign({},e),{accountBalances:r});case"SET_BALANCE_LOADINGS":return Object.assign(Object.assign({},e),{balanceLoadings:Object.assign(Object.assign({},e.balanceLoadings),t.payload)});default:return e}};!function(e){e.Initial="Initial",e.Pending="Pending",e.ApproveSuccess="ApproveSuccess",e.TxSuccess="TxSuccess",e.Failed="Failed"}(Hs||(Hs={}));const Xs={height:void 0,width:void 0,apikey:"",feeRate:0,rebateTo:"",isReverseRouting:!1,contractStatus:Hs.Initial};const Js={settings:Vs,wallet:Zs,globals:Xs,token:Ls},Gs=J({reducer:G({settings:Ps,wallet:zs,token:Ys,globals:(e=Xs,t)=>"SET_GLOBAL_PROPS"===t.type?Object.assign(Object.assign({},e),t.payload):e}),middleware:e=>e({serializableCheck:{ignoredActions:["SET_ACCOUNT_BALANCES","SET_ETH_BALANCE"],ignoredPaths:["token.accountBalances","token.ethBalance"]}}),preloadedState:Js}),qs=e=>(null!=e?e:Gs.getState()).wallet.chainId,Ks=e=>(null!=e?e:Gs.getState()).wallet.latestBlockNumber,Qs=e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_ACCOUNT_BALANCES",payload:e})})),$s=e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_BALANCE_LOADINGS",payload:e})})),ea="0x0000000000000000000000000000000000000000",ta=ne.from(-1),ra=ne.from(0),na=ne.from(1),oa=ne.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var ia=[{constant:!0,inputs:[],name:"getCurrentBlockTimestamp",outputs:[{name:"timestamp",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{components:[{name:"target",type:"address"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{name:"blockNumber",type:"uint256"},{name:"returnData",type:"bytes[]"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"getLastBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockDifficulty",outputs:[{name:"difficulty",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockGasLimit",outputs:[{name:"gaslimit",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getCurrentBlockCoinbase",outputs:[{name:"coinbase",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{name:"blockHash",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"}],sa={[Is.MAINNET]:{MULTI_CALL:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",DODO_APPROVE:"0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149",ERC20_HELPER:"0xD9ef2d1583e8Aa196123e773BE38B539a4d149df"},[Is.RINKEBY]:{MULTI_CALL:"0xb7E1C577f95959a3eD11f9281702850328b4e0e4",DODO_APPROVE:"0xcC8d87A7C747eeE4242045C47Ef25e0A81D56ae3",ERC20_HELPER:"0x6A42091d713A67E25a1D11aeE14E7AEB96E0331f"},[Is.GOERLI]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0xC9143e54021f4a6d33b9b89DBB9F458AaEdd56FB",ERC20_HELPER:"0x24549FC74B3076A962624A26370ed556c467F74C"},[Is.BSC]:{MULTI_CALL:"0x1Ee38d535d541c55C9dae27B12edf090C608E6Fb",DODO_APPROVE:"0xa128Ba44B2738A558A1fdC06d6303d52D3Cef8c1",ERC20_HELPER:"0x566651Ad34f6306872FaC5fB95bbF4C9beE8D8F2"},[Is.HECO]:{MULTI_CALL:"0x76a328B3440B9276a31523e731B34082df7a6f1A",DODO_APPROVE:"0x68b6c06Ac8Aa359868393724d25D871921E97293",ERC20_HELPER:"0x270C2abC692Dd476B860CCbDfD6D8146BF61f8D8"},[Is.POLYGON]:{MULTI_CALL:"0xc9eD9B18e447e600238fe50e944B9062B664DEa4",DODO_APPROVE:"0x292E6b2e054e1157df71C1C9510265CA8C0c7672",ERC20_HELPER:"0xfd24312Ec7871A6D1a31e454D5AbB16c6c25a9b3"},[Is.ARBITRUM_ONE]:{MULTI_CALL:"0xF718F2bd590E5621e53f7b89398e52f7Acced8ca",DODO_APPROVE:"0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8",ERC20_HELPER:"0x7C062B9C584fA6eC2504270790D38240A2c5fE72"},[Is.ARBITRUM_RINKEBY]:{MULTI_CALL:"0x696E25A5e2AEd1C55E6d6Cfa0532Bbda9020165d",DODO_APPROVE:"0x5BaF16d57620Cb361F622232F3cb4090e35F3da2",ERC20_HELPER:"0x5B2fd46E6E3Ff1E479d651ec0b210882Aa9871dF"},[Is.AURORA]:{MULTI_CALL:"0x989DcAA95801C527C5B73AA65d3962dF9aCe1b0C",DODO_APPROVE:"0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619",ERC20_HELPER:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25"},[Is.MOONRIVER]:{MULTI_CALL:"0x2ff2CeE6E9359F9eA1cF2f51d18bF9F2045447E4",DODO_APPROVE:"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25",ERC20_HELPER:"0x6373ceB657C83C91088d328622573FB766064Ac4"},[Is.OKCHAIN]:{MULTI_CALL:"0x5e84190a270333aCe5B9202a3F4ceBf11b81bB01",DODO_APPROVE:"0x7737fd30535c69545deeEa54AB8Dd590ccaEBD3c",ERC20_HELPER:"0x4775b1858f1e417C9609D455C3Ad8751ec01daC4"},[Is.OPTIMISM]:{MULTI_CALL:"0xb98Ac2fEFc8b73aeAE33D02BB00c26E12afCa9Df",DODO_APPROVE:"0xa492d6eABcdc3E204676f15B950bBdD448080364",ERC20_HELPER:"0x42E456ea0dd7538ea103fBb1d0388D14C97bB5b2"},[Is.BOBA]:{MULTI_CALL:"0xD56281EF996B6B29874C77D2e1464216E8043127",DODO_APPROVE:"0x8F8Dd7DB1bDA5eD3da8C9daf3bfa471c12d58486",ERC20_HELPER:"0x9FCFD9ff955D36856F8EE480471B05488C0eB5cA"},[Is.AVALANCHE]:{MULTI_CALL:"0x97f0153E7F5749640aDF3Ff9CFC518b79D6Fe53b",DODO_APPROVE:"0xCFea63e3DE31De53D68780Dd65675F169439e470",ERC20_HELPER:"0xC3528D128CC227fd60793007b5e3FdF7c2945282"},[Is.CRONOS]:{MULTI_CALL:"0x4f4408D78F9E9e242c17C635FbD0f1952951c917",DODO_APPROVE:"0x9B736bB8f336f61E16454DCA4dE130703D151042",ERC20_HELPER:"0xbd2F5c60cf7d60daD2106ceD4D21b90722761f14"}};var aa=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const ca=new qi("properties/5.7.0");function la(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function ua(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function da(e){return aa(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function ha(e){const t={};for(const r in e)t[r]=e[r];return t}const fa={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function pa(e){if(null==e||fa[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!pa(n))return!1}return!0}return ca.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ma(e){if(pa(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>ga(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&la(t,r,ga(n))}return t}return ca.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ga(e){return ma(e)}class ya{constructor(e){for(const t in e)this[t]=ga(e[t])}}const ba=new qi("abi/5.7.0"),va={};let wa={calldata:!0,memory:!0,storage:!0},xa={calldata:!0,memory:!0};function Ea(e,t){if("bytes"===e||"string"===e){if(wa[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&xa[t])return!0;return(wa[t]||"payable"===t)&&ba.throwArgumentError("invalid modifier","name",t),!1}function Aa(e,t){for(let r in t)la(e,r,t[r])}const Ra=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),_a=new RegExp(/^(.*)\[([0-9]*)\]$/);class ka{constructor(e,t){e!==va&&ba.throwError("use fromString",qi.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Aa(this,t);let r=this.type.match(_a);Aa(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:ka.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Ra.sighash),Ra[e]||ba.throwArgumentError("invalid format type","format",e),e===Ra.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Ra.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ra.full?", ":",")+")"):t+=this.type,e!==Ra.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ra.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?ka.fromString(e,t):ka.fromObject(e)}static fromObject(e){return ka.isParamType(e)?e:new ka(va,{name:e.name||null,type:Ua(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(ka.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){ba.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function o(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let i={type:"",name:"",state:{allowType:!0}},s=i;for(let r=0;r<e.length;r++){let i=e[r];switch(i){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(r),s.state.allowType=!1,s.type=Ua(s.type),s.components=[o(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),Ea(s.type,s.name)&&(s.name=""),s.type=Ua(s.type);let e=s;s=s.parent,s||n(r),delete e.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),Ea(s.type,s.name)&&(s.name=""),s.type=Ua(s.type);let a=o(s.parent);s.parent.components.push(a),delete s.parent,s=a;break;case" ":s.state.allowType&&""!==s.type&&(s.type=Ua(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(t||n(r),s.indexed&&n(r),s.indexed=!0,s.name=""):Ea(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(r),s.type+=i,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(r),s.type+=i,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=i,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=i,delete s.state.allowArray):s.state.readArray?s.type+=i:n(r)}}return s.parent&&ba.throwArgumentError("unexpected eof","param",e),delete i.state,"indexed"===s.name?(t||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):Ea(s.type,s.name)&&(s.name=""),i.type=Ua(i.type),i}(e,!!t),ka.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}}function Sa(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let o=0;o<e.length;o++){let i=e[o];","===i&&0===n?(t.push(r),r=""):(r+=i,"("===i?n++:")"===i&&(n--,-1===n&&ba.throwArgumentError("unbalanced parenthesis","value",e)))}r&&t.push(r);return t}(e).map((e=>ka.fromString(e,t)))}class Na{constructor(e,t){e!==va&&ba.throwError("use a static from method",qi.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Aa(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Na.isFragment(e)?e:"string"==typeof e?Na.fromString(e):Na.fromObject(e)}static fromObject(e){if(Na.isFragment(e))return e;switch(e.type){case"function":return Wa.fromObject(e);case"event":return Ma.fromObject(e);case"constructor":return Fa.fromObject(e);case"error":return ja.fromObject(e);case"fallback":case"receive":return null}return ba.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Ma.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Wa.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Fa.fromString(e.trim()):"error"===e.split(" ")[0]?ja.fromString(e.substring(5).trim()):ba.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Ma extends Na{format(e){if(e||(e=Ra.sighash),Ra[e]||ba.throwArgumentError("invalid format type","format",e),e===Ra.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ra.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",e!==Ra.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Ma.fromString(e):Ma.fromObject(e)}static fromObject(e){if(Ma.isEventFragment(e))return e;"event"!==e.type&&ba.throwArgumentError("invalid event object","value",e);const t={name:Ba(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(ka.fromObject):[],type:"event"};return new Ma(va,t)}static fromString(e){let t=e.match(Va);t||ba.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:ba.warn("unknown modifier: "+e)}})),Ma.fromObject({name:t[1].trim(),anonymous:r,inputs:Sa(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Ta(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&ba.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||ba.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=ne.from(r[1]),r[0]):e}function Oa(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Ia(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&ba.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&ba.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||ba.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&&ba.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&&ba.throwArgumentError("unable to determine stateMutability","value",e),t}class Fa extends Na{format(e){if(e||(e=Ra.sighash),Ra[e]||ba.throwArgumentError("invalid format type","format",e),e===Ra.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((t=>JSON.parse(t.format(e))))});e===Ra.sighash&&ba.throwError("cannot format a constructor for sighash",qi.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?Fa.fromString(e):Fa.fromObject(e)}static fromObject(e){if(Fa.isConstructorFragment(e))return e;"constructor"!==e.type&&ba.throwArgumentError("invalid constructor object","value",e);let t=Ia(e);t.constant&&ba.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(ka.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ne.from(e.gas):null};return new Fa(va,r)}static fromString(e){let t={type:"constructor"},r=(e=Ta(e,t)).match(Va);return r&&"constructor"===r[1].trim()||ba.throwArgumentError("invalid constructor string","value",e),t.inputs=Sa(r[2].trim(),!1),Oa(r[3].trim(),t),Fa.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Wa extends Fa{format(e){if(e||(e=Ra.sighash),Ra[e]||ba.throwArgumentError("invalid format type","format",e),e===Ra.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((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ra.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",e!==Ra.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Wa.fromString(e):Wa.fromObject(e)}static fromObject(e){if(Wa.isFunctionFragment(e))return e;"function"!==e.type&&ba.throwArgumentError("invalid function object","value",e);let t=Ia(e);const r={type:e.type,name:Ba(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(ka.fromObject):[],outputs:e.outputs?e.outputs.map(ka.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?ne.from(e.gas):null};return new Wa(va,r)}static fromString(e){let t={type:"function"},r=(e=Ta(e,t)).split(" returns ");r.length>2&&ba.throwArgumentError("invalid function string","value",e);let n=r[0].match(Va);if(n||ba.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Ba(t.name),t.inputs=Sa(n[2],!1),Oa(n[3].trim(),t),r.length>1){let n=r[1].match(Va);""==n[1].trim()&&""==n[3].trim()||ba.throwArgumentError("unexpected tokens","value",e),t.outputs=Sa(n[2],!1)}else t.outputs=[];return Wa.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Ca(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||ba.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class ja extends Na{format(e){if(e||(e=Ra.sighash),Ra[e]||ba.throwArgumentError("invalid format type","format",e),e===Ra.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ra.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?ja.fromString(e):ja.fromObject(e)}static fromObject(e){if(ja.isErrorFragment(e))return e;"error"!==e.type&&ba.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Ba(e.name),inputs:e.inputs?e.inputs.map(ka.fromObject):[]};return Ca(new ja(va,t))}static fromString(e){let t={type:"error"},r=e.match(Va);return r||ba.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Ba(t.name),t.inputs=Sa(r[2],!1),Ca(ja.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Ua(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Da=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ba(e){return e&&e.match(Da)||ba.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Va=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Pa=new qi("abi/5.7.0");class Za{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Pa.throwArgumentError(e,this.localName,t)}}class za{constructor(e){la(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return us(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(os(e._data))}writeBytes(e){let t=ns(e);const r=t.length%this.wordSize;return r&&(t=os([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=ns(ne.from(e));return t.length>this.wordSize&&Pa.throwError("value out-of-bounds",qi.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=os([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class La{constructor(e,t,r,n){la(this,"_data",ns(e)),la(this,"wordSize",t||32),la(this,"_coerceFunc",r),la(this,"allowLoose",n),this._offset=0}get data(){return as(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):La.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Pa.throwError("data out-of-bounds",qi.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new La(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return ne.from(this.readBytes(this.wordSize))}}class Ha extends Za{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Ms(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Ms(hs(e.readValue().toHexString(),20))}}class Ya extends Za{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const Xa=new qi("abi/5.7.0");function Ja(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||Xa.throwError("cannot encode object for signature with missing names",qi.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&Xa.throwError("cannot encode object for signature with duplicate names",qi.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else Xa.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&Xa.throwArgumentError("types/value length mismatch","tuple",r);let o=new za(e.wordSize),i=new za(e.wordSize),s=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=i.length;e.encode(i,r);let n=o.writeUpdatableValue();s.push((e=>{n(e+t)}))}else e.encode(o,r)})),s.forEach((e=>{e(o.length)}));let a=e.appendWriter(o);return a+=e.appendWriter(i),a}function Ga(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let o=null;if(t.dynamic){let r=e.readValue(),i=n.subReader(r.toNumber());try{o=t.decode(i)}catch(e){if(e.code===qi.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}}else try{o=t.decode(e)}catch(e){if(e.code===qi.errors.BUFFER_OVERRUN)throw e;o=e,o.baseType=t.name,o.name=t.localName,o.type=t.type}null!=o&&r.push(o)}));const o=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==o[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const i=r[t];i instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw i}}):r[n]=i}));for(let e=0;e<r.length;e++){const t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(r)}class qa extends Za{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),Xa.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let e=0;e<t.length;e++)n.push(this.coder);return Ja(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&Xa.throwError("insufficient data length",qi.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new Ya(this.coder));return e.coerce(this.name,Ga(e,r))}}class Ka extends Za{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class Qa extends Za{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=ns(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class $a extends Qa{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,as(super.decode(e)))}}class ec extends Za{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=ns(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,as(e.readBytes(this.size)))}}class tc extends Za{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}class rc extends Za{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=ne.from(t),n=oa.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(na).mul(ta)))&&this._throwError("value out-of-bounds",t)}else(r.lt(ra)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}const nc=new qi("strings/5.7.0");var oc,ic;function sc(e,t,r,n,o){if(e===ic.BAD_PREFIX||e===ic.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===ic.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(oc||(oc={})),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"}(ic||(ic={}));const ac=Object.freeze({error:function(e,t,r,n,o){return nc.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:sc,replace:function(e,t,r,n,o){return e===ic.OVERLONG?(n.push(o),0):(n.push(65533),sc(e,t,r))}});function cc(e,t){null==t&&(t=ac.error),e=ns(e);const r=[];let n=0;for(;n<e.length;){const o=e[n++];if(o>>7==0){r.push(o);continue}let i=null,s=null;if(192==(224&o))i=1,s=127;else if(224==(240&o))i=2,s=2047;else{if(240!=(248&o)){n+=t(128==(192&o)?ic.UNEXPECTED_CONTINUE:ic.BAD_PREFIX,n-1,e,r);continue}i=3,s=65535}if(n-1+i>=e.length){n+=t(ic.OVERRUN,n-1,e,r);continue}let a=o&(1<<8-i-1)-1;for(let o=0;o<i;o++){let o=e[n];if(128!=(192&o)){n+=t(ic.MISSING_CONTINUE,n,e,r),a=null;break}a=a<<6|63&o,n++}null!==a&&(a>1114111?n+=t(ic.OUT_OF_RANGE,n-1-i,e,r,a):a>=55296&&a<=57343?n+=t(ic.UTF16_SURROGATE,n-1-i,e,r,a):a<=s?n+=t(ic.OVERLONG,n-1-i,e,r,a):r.push(a))}return r}function lc(e,t=oc.current){t!=oc.current&&(nc.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const o=e.charCodeAt(t);if(t>=e.length||56320!=(64512&o))throw new Error("invalid utf-8 string");const i=65536+((1023&n)<<10)+(1023&o);r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(63&i|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return ns(r)}function uc(e,t){return cc(e,t).map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}class dc extends Qa{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,lc(t))}decode(e){return uc(super.decode(e))}}class hc extends Za{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let o=r.localName;o&&1===t[o]&&("length"===o&&(o="_length"),null==e[o]&&(e[o]=e[n]))})),Object.freeze(e)}encode(e,t){return Ja(e,this.coders,t)}decode(e){return e.coerce(this.name,Ga(e,this.coders))}}const fc=new qi("abi/5.7.0"),pc=new RegExp(/^bytes([0-9]*)$/),mc=new RegExp(/^(u?int)([0-9]*)$/);const gc=new class{constructor(e){la(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Ha(e.name);case"bool":return new Ka(e.name);case"string":return new dc(e.name);case"bytes":return new $a(e.name);case"array":return new qa(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new hc((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new tc(e.name)}let t=e.type.match(mc);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&fc.throwArgumentError("invalid "+t[1]+" bit length","param",e),new rc(r/8,"int"===t[1],e.name)}if(t=e.type.match(pc),t){let r=parseInt(t[1]);return(0===r||r>32)&&fc.throwArgumentError("invalid bytes length","param",e),new ec(r,e.name)}return fc.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new La(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new za(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(ka.from(e))));return new hc(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&fc.throwError("types/values length mismatch",qi.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(ka.from(e)))),n=new hc(r,"_"),o=this._getWriter();return n.encode(o,t),o.data}decode(e,t,r){const n=e.map((e=>this._getCoder(ka.from(e))));return new hc(n,"_").decode(this._getReader(ns(t),r))}};function yc(e){return gs(lc(e))}function bc(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return ns(t)}function vc(e){e=ns(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function wc(e,t){null==t&&(t=1);const r=[],n=r.forEach,o=function(e,t){n.call(e,(function(e){t>0&&Array.isArray(e)?o(e,t-1):r.push(e)}))};return o(e,t),r}function xc(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),o=1,i=[0,1];for(let e=1;e<n;e++)i.push(o+=r());let s=r(),a=t;t+=s;let c=0,l=0;function u(){return 0==c&&(l=l<<8|e[t++],c=8),l>>--c&1}const d=Math.pow(2,31),h=d>>>1,f=h>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|u();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*o-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<i[n]?r=n:t=n}if(0==t)break;g.push(t);let s=y+Math.floor(b*i[t]/o),a=y+Math.floor(b*i[t+1]/o)-1;for(;0==((s^a)&h);)m=m<<1&p|u(),s=s<<1&p,a=a<<1&p|1;for(;s&~a&f;)m=m&h|m<<1&p>>>1|u(),s=s<<1^h,a=(a^h)<<1|h|1;y=s,b=1+a-s}let v=n-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return v+256+(e[a++]<<8|e[a++]);case 1:return v+e[a++];default:return t-1}}))}(e))}function Ec(e){return 1&e?~e>>1:e>>1}function Ac(e,t){let r=Array(e);for(let n=0,o=-1;n<e;n++)r[n]=o+=1+t();return r}function Rc(e,t){let r=Array(e);for(let n=0,o=0;n<e;n++)r[n]=o+=Ec(t());return r}function _c(e,t){let r=Ac(e(),e),n=e(),o=Ac(n,e),i=function(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}(n,e);for(let e=0;e<n;e++)for(let t=0;t<i[e];t++)r.push(o[e]+t);return t?r.map((e=>t[e])):r}function kc(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let o=0;o<t;o++)Rc(e,r).forEach(((e,t)=>n[t].push(e)));return n}function Sc(e,t){let r=1+t(),n=t(),o=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return wc(kc(o.length,1+e,t).map(((e,t)=>{const i=e[0],s=e.slice(1);return Array(o[t]).fill(void 0).map(((e,t)=>{let o=t*n;return[i+t*r,s.map((e=>e+o))]}))})))}function Nc(e,t){return kc(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Mc=xc(bc("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Tc=new Set(_c(Mc)),Oc=new Set(_c(Mc)),Ic=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(Sc(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Nc(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}(wc(t))}(Mc),Fc=function(e){let t=_c(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let o=_c(e,t);if(0==o.length)break;n.push({set:new Set(o),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let o=e(),i=o%3;o=o/3|0;let s=!!(1&o);return o>>=1,{branches:n,valid:i,fe0f:s,save:1==o,check:2==o}}()}(Mc);function Wc(e){return function(e,t=oc.current){return cc(lc(e,t))}(e)}function Cc(e){return e.filter((e=>65039!=e))}function jc(e){for(let t of e.split(".")){let e=Wc(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&45===e[2]&&45===e[3])throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function Uc(e){return jc(function(e,t){let r=Wc(e).reverse(),n=[];for(;r.length;){let e=Dc(r);if(e){n.push(...t(e));continue}let o=r.pop();if(Tc.has(o)){n.push(o);continue}if(Oc.has(o))continue;let i=Ic[o];if(!i)throw new Error(`Disallowed codepoint: 0x${o.toString(16).toUpperCase()}`);n.push(...i)}return jc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,Cc))}function Dc(e,t){var r;let n,o,i=Fc,s=[],a=e.length;for(t&&(t.length=0);a;){let c=e[--a];if(i=null===(r=i.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!i)break;if(i.save)o=c;else if(i.check&&c===o)break;s.push(c),i.fe0f&&(s.push(65039),a>0&&65039==e[a-1]&&a--),i.valid&&(n=s.slice(),2==i.valid&&n.splice(1,1),t&&t.push(...e.slice(a).reverse()),e.length=a)}return n}const Bc=new qi("hash/5.7.0"),Vc=new Uint8Array(32);function Pc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Zc(e){const t=lc(Uc(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++){46===t[e]&&(r.push(Pc(t.slice(n,e))),n=e+1)}if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(Pc(t.slice(n))),r}function zc(e){"string"!=typeof e&&Bc.throwArgumentError("invalid ENS name; not a string","name",e);let t=Vc;const r=Zc(e);for(;r.length;)t=gs(os([t,gs(r.pop())]));return as(t)}Vc.fill(0);var Lc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Hc=new qi("hash/5.7.0"),Yc=new Uint8Array(32);Yc.fill(0);const Xc=ne.from(-1),Jc=ne.from(0),Gc=ne.from(1),qc=ne.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Kc=hs(Gc.toHexString(),32),Qc=hs(Jc.toHexString(),32),$c={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},el=["name","version","chainId","verifyingContract","salt"];function tl(e){return function(t){return"string"!=typeof t&&Hc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const rl={name:tl("name"),version:tl("version"),chainId:function(e){try{return ne.from(e).toString()}catch(e){}return Hc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Ms(e).toLowerCase()}catch(e){}return Hc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=ns(e);if(32!==t.length)throw new Error("bad length");return as(t)}catch(e){}return Hc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function nl(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&Hc.throwArgumentError("invalid numeric width","type",e);const o=qc.mask(r?n-1:n),i=r?o.add(Gc).mul(Xc):Jc;return function(t){const r=ne.from(t);return(r.lt(i)||r.gt(o))&&Hc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),hs(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Hc.throwArgumentError("invalid bytes width","type",e),function(t){return ns(t).length!==r&&Hc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=ns(e),r=t.length%32;return r?us([t,Yc.slice(r)]):as(t)}(t)}}}switch(e){case"address":return function(e){return hs(Ms(e),32)};case"bool":return function(e){return e?Kc:Qc};case"bytes":return function(e){return gs(e)};case"string":return function(e){return yc(e)}}return null}function ol(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class il{constructor(e){la(this,"types",Object.freeze(ga(e))),la(this,"_encoderCache",{}),la(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const o={};e[n].forEach((i=>{o[i.name]&&Hc.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(n)}`,"types",e),o[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&Hc.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e);nl(s)||(r[s]||Hc.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(n),t[n][s]=!0)}))}const o=Object.keys(r).filter((e=>0===r[e].length));0===o.length?Hc.throwArgumentError("missing primary type","types",e):o.length>1&&Hc.throwArgumentError(`ambiguous primary types or unused types: ${o.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),la(this,"primaryType",o[0]),function o(i,s){s[i]&&Hc.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",e),s[i]=!0,Object.keys(t[i]).forEach((e=>{r[e]&&(o(e,s),Object.keys(s).forEach((t=>{n[t][e]=!0})))})),delete s[i]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=ol(t,e[t])+r.map((t=>ol(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=nl(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Hc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let o=t.map(r);return this._types[e]&&(o=o.map(gs)),gs(us(o))}}const r=this.types[e];if(r){const t=yc(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?gs(n):n}));return n.unshift(t),us(n)}}return Hc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Hc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return gs(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(nl(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],o=parseInt(n[3]);return o>=0&&t.length!==o&&Hc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const o=this.types[e];return o?o.reduce(((e,{name:n,type:o})=>(e[n]=this._visit(o,t[n],r),e)),{}):Hc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new il(e)}static getPrimaryType(e){return il.from(e).primaryType}static hashStruct(e,t,r){return il.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=$c[r];n||Hc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>el.indexOf(e.name)-el.indexOf(t.name))),il.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return us(["0x1901",il.hashDomain(e),il.from(t).hash(r)])}static hash(e,t,r){return gs(il.encode(e,t,r))}static resolveNames(e,t,r,n){return Lc(this,void 0,void 0,(function*(){e=ha(e);const o={};e.verifyingContract&&!ss(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const i=il.from(t);i.visit(r,((e,t)=>("address"!==e||ss(t,20)||(o[t]="0x"),t)));for(const e in o)o[e]=yield n(e);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),r=i.visit(r,((e,t)=>"address"===e&&o[t]?o[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){il.hashDomain(e);const n={},o=[];el.forEach((t=>{const r=e[t];null!=r&&(n[t]=rl[t](r),o.push({name:t,type:$c[t]}))}));const i=il.from(t),s=ha(t);return s.EIP712Domain?Hc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):s.EIP712Domain=o,i.encode(r),{types:s,domain:n,primaryType:i.primaryType,message:i.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return as(ns(t));if(e.match(/^u?int/))return ne.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Hc.throwArgumentError("invalid string","value",t),t}return Hc.throwArgumentError("unsupported type","type",e)}))}}}const sl=new qi("abi/5.7.0");class al extends ya{}class cl extends ya{}class ll extends ya{}class ul extends ya{static isIndexed(e){return!(!e||!e._isIndexed)}}const dl={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function hl(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class fl{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,la(this,"fragments",t.map((e=>Na.from(e))).filter((e=>null!=e))),la(this,"_abiCoder",ua(new.target,"getAbiCoder")()),la(this,"functions",{}),la(this,"errors",{}),la(this,"events",{}),la(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void sl.warn("duplicate definition - constructor"):void la(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?sl.warn("duplicate definition - "+r):t[r]=e})),this.deploy||la(this,"deploy",Fa.from({payable:!1,type:"constructor"})),la(this,"_isInterface",!0)}format(e){e||(e=Ra.full),e===Ra.sighash&&sl.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ra.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return gc}static getAddress(e){return Ms(e)}static getSighash(e){return ls(yc(e.format()),0,4)}static getEventTopic(e){return yc(e.format())}getFunction(e){if(ss(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];sl.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?sl.throwArgumentError("no matching function","name",t):r.length>1&&sl.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Wa.fromString(e).format()];return t||sl.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(ss(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];sl.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?sl.throwArgumentError("no matching event","name",t):r.length>1&&sl.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Ma.fromString(e).format()];return t||sl.throwArgumentError("no matching event","signature",e),t}getError(e){if(ss(e)){const t=ua(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}sl.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?sl.throwArgumentError("no matching error","name",t):r.length>1&&sl.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Wa.fromString(e).format()];return t||sl.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return ua(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),ua(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=ns(t);return as(r.slice(0,4))!==this.getSighash(e)&&sl.throwArgumentError(`data signature does not match error ${e.name}.`,"data",as(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),as(os([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=ns(t);return as(r.slice(0,4))!==this.getSighash(e)&&sl.throwArgumentError(`data signature does not match function ${e.name}.`,"data",as(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),as(os([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=ns(t),n=null,o="",i=null,s=null,a=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=as(r.slice(0,4)),t=dl[e];if(t)i=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,a=t.signature,t.reason&&(n=i[0]),"Error"===s?o=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(i[0])}`:"Panic"===s&&(o=`; VM Exception while processing transaction: reverted with panic code ${i[0]}`);else try{const t=this.getError(e);i=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,a=t.format()}catch(e){}break}}return sl.throwError("call revert exception"+o,qi.errors.CALL_EXCEPTION,{method:e.format(),data:as(t),errorArgs:i,errorName:s,errorSignature:a,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),as(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&sl.throwError("too many arguments for "+e.format(),qi.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?yc(t):"bytes"===e.type?gs(as(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=ne.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),hs(as(t),32));for(t.forEach(((t,o)=>{let i=e.inputs[o];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?sl.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map((e=>n(i,e)))):r.push(n(i,t)):null!=t&&sl.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],o=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&sl.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,i)=>{const s=t[i];if(e.indexed)if("string"===e.type)r.push(yc(s));else if("bytes"===e.type)r.push(gs(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[s]))}else n.push(e),o.push(s)})),{data:this._abiCoder.encode(n,o),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);ss(r[0],32)&&r[0].toLowerCase()===t||sl.throwError("fragment/topic mismatch",qi.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],o=[],i=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(ka.fromObject({type:"bytes32",name:e.name})),i.push(!0)):(n.push(e),i.push(!1)):(o.push(e),i.push(!1))}));let s=null!=r?this._abiCoder.decode(n,os(r)):null,a=this._abiCoder.decode(o,t,!0),c=[],l=0,u=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==s)c[t]=new ul({_isIndexed:!0,hash:null});else if(i[t])c[t]=new ul({_isIndexed:!0,hash:s[u++]});else try{c[t]=s[u++]}catch(e){c[t]=e}else try{c[t]=a[l++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw hl(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e<c.length;e++){const t=c[e];t instanceof Error&&Object.defineProperty(c,e,{enumerable:!0,get:()=>{throw hl(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new cl({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:ne.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new al({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=as(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new ll({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}function pl(e,t,...r){return Bs(this,void 0,void 0,(function*(){const n=[];for(const e of r)for(const t of e)t.callData&&n.push(t.callData);const o=yield function(e,t,r){return Bs(this,void 0,void 0,(function*(){const n=yield ml(e,t,r),o=new Map;for(const{req:e,resp:t}of n)o.set(e,t);return e.map((e=>({req:e,resp:o.get(e)})))}))}(n,e,t),i=new Map;for(const{req:e,resp:t}of o)i.set(e,null==t?void 0:t.result);return r.map((e=>e.filter((e=>!e.callData||i.get(e.callData))).map(((e,t)=>e.processor(e.callData?i.get(e.callData):null,t)))))}))}function ml(e,t,r){return Bs(this,void 0,void 0,(function*(){let n=[e];e.length>800&&(n=i(e,800));let o=[];const s=n.map((e=>Bs(this,void 0,void 0,(function*(){const n=e.map((e=>[e.to,e.data])),i={data:t.interface.encodeFunctionData("aggregate",[n]),to:r};let s;try{s=yield t.provider.call(i)}catch(n){const i=e.length;if(i>20){const n=Math.floor(i/2),[s,a]=yield Promise.all([ml(e.slice(0,n),t,r),ml(e.slice(n,i),t,r)]);o=[...o,...s,...a]}else{const e="[sendCallReqs] error";console.error(e,n)}}if(void 0===s)throw new Error("Unexpected batch result");const[a,c]=gc.decode(["uint256","bytes[]"],s);if(e.length!==c.length)throw new Error("Unexpected length mismatch");return c.map(((t,r)=>({resp:{result:t},req:e[r]})))}))));return(yield Promise.allSettled(s)).filter((e=>"fulfilled"===e.status)).forEach((({value:e})=>{o=[...o,...e]})),o}))}function gl(e,t,r,n){if(!function(e){try{return Ms(e)}catch(e){return!1}}(e)||e===ea)throw Error(`Invalid 'address' parameter '${e}'.`);return new q(e,t,function(e,t){return t?function(e,t){return e.getSigner(t).connectUnchecked()}(e,t):e}(r,n))}function yl(){const{provider:e,account:t,chainId:r}=H(),[n,o]=f(!1),i=y((()=>sa[r]),[r]),s=g(((r,n)=>{if(e)return gl(r,n,e,t)}),[e,t]),a=g((e=>{if(!i)return;const{MULTI_CALL:t}=i,r=s(t,ia);return(()=>Bs(this,void 0,void 0,(function*(){if(r){o(!0);try{const[n]=yield pl(r,t,e);return n}catch(e){console.error("Contract: useMultiContract is error",e)}o(!1)}})))()}),[i,s]);return{getContract:s,contractConfig:i,call:a,loading:n}}var bl=[{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"isERC20",outputs:[{internalType:"bool",name:"isOk",type:"bool"},{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"user",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"judgeERC20",outputs:[{internalType:"string",name:"symbol",type:"string"},{internalType:"string",name:"name",type:"string"},{internalType:"uint256",name:"decimals",type:"uint256"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"allownance",type:"uint256"}],stateMutability:"view",type:"function"}];function vl(){const{provider:e,account:t}=H(),n=P(),o=Z(Ks);p((()=>{(()=>{Bs(this,void 0,void 0,(function*(){if(!e||!t)return;const o=yield e.getBalance(t);n((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_ETH_BALANCE",payload:e})})))(new r(o.toString()).div(1e18)))}))})()}),[e,t,n,o])}function wl(){const{provider:e,chainId:t}=H(),r=P(),n=g((()=>Bs(this,void 0,void 0,(function*(){if(!e||!t)return;const n=yield e.getBlockNumber();r((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_BLOCK_NUMBER",payload:e})})))(n))}))),[e,t]);return{updateBlockNumber:n}}var xl,El;!function(e){e.All="all",e.Default="default",e.Coingecko="coingecko"}(xl||(xl={})),function(e){e.Loading="Loading",e.Insufficient="ApprovalInsufficient",e.Approving="Approving",e.Sufficient="Sufficient",e.Unchecked="Unchecked"}(El||(El={}));var Al=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Rl=new qi("abstract-provider/5.7.0");class _l extends ya{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class kl{constructor(){Rl.checkAbstract(new.target,kl),la(this,"_isProvider",!0)}getFeeData(){return Al(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield da({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,o=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,o=ne.from("1500000000"),n=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:o,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}const Sl=new qi("networks/5.7.1");function Nl(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const o=["goerli","ropsten","rinkeby","sepolia"];try{const i=new t.PocketProvider(e,r.pocket);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const o=["ropsten"],i=new t.AnkrProvider(e,r.ankr);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let o=1;return null!=r.quorum?o=r.quorum:"homestead"===e&&(o=2),new t.FallbackProvider(n,o)}return n[0]};return t.renetwork=function(e){return Nl(e)},t}function Ml(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return Ml(e,t)},r}const Tl={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Nl("homestead")},Ol={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Nl("ropsten")},Il={chainId:63,name:"classicMordor",_defaultProvider:Ml("https://www.ethercluster.com/mordor","classicMordor")},Fl={unspecified:{chainId:0,name:"unspecified"},homestead:Tl,mainnet:Tl,morden:{chainId:2,name:"morden"},ropsten:Ol,testnet:Ol,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Nl("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Nl("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Nl("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Nl("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Ml("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Il,classicTestnet:Il,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Ml("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Nl("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Nl("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};class Wl{constructor(e){la(this,"alphabet",e),la(this,"base",e.length),la(this,"_alphabetMap",{}),la(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=ns(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e<t.length-1;++e)n+=this._leader;for(let e=r.length-1;e>=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let o=n;for(let e=0;e<t.length;++e)o+=t[e]*this.base,t[e]=255&o,o>>=8;for(;o>0;)t.push(255&o),o>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return ns(new Uint8Array(t.reverse()))}}new Wl("abcdefghijklmnopqrstuvwxyz234567");const Cl=new Wl("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var jl={},Ul={},Dl=Bl;function Bl(e,t){if(!e)throw new Error(t||"Assertion failed")}Bl.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Vl,Pl={exports:{}},Zl={exports:{}};!function(e){try{var t=require("util");if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=(Vl||(Vl=1,"function"==typeof Object.create?Zl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Zl.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),Zl.exports)}}(Pl);var zl=Dl,Ll=Pl.exports;function Hl(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function Yl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function Xl(e){return 1===e.length?"0"+e:e}function Jl(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}Ul.inherits=Ll,Ul.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),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var n=0,o=0;o<e.length;o++){var i=e.charCodeAt(o);i<128?r[n++]=i:i<2048?(r[n++]=i>>6|192,r[n++]=63&i|128):Hl(e,o)?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++o)),r[n++]=i>>18|240,r[n++]=i>>12&63|128,r[n++]=i>>6&63|128,r[n++]=63&i|128):(r[n++]=i>>12|224,r[n++]=i>>6&63|128,r[n++]=63&i|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r},Ul.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=Xl(e[r].toString(16));return t},Ul.htonl=Yl,Ul.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e[n];"little"===t&&(o=Yl(o)),r+=Jl(o.toString(16))}return r},Ul.zero2=Xl,Ul.zero8=Jl,Ul.join32=function(e,t,r,n){var o=r-t;zl(o%4==0);for(var i=new Array(o/4),s=0,a=t;s<i.length;s++,a+=4){var c;c="big"===n?e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]:e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a],i[s]=c>>>0}return i},Ul.split32=function(e,t){for(var r=new Array(4*e.length),n=0,o=0;n<e.length;n++,o+=4){var i=e[n];"big"===t?(r[o]=i>>>24,r[o+1]=i>>>16&255,r[o+2]=i>>>8&255,r[o+3]=255&i):(r[o+3]=i>>>24,r[o+2]=i>>>16&255,r[o+1]=i>>>8&255,r[o]=255&i)}return r},Ul.rotr32=function(e,t){return e>>>t|e<<32-t},Ul.rotl32=function(e,t){return e<<t|e>>>32-t},Ul.sum32=function(e,t){return e+t>>>0},Ul.sum32_3=function(e,t,r){return e+t+r>>>0},Ul.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},Ul.sum32_5=function(e,t,r,n,o){return e+t+r+n+o>>>0},Ul.sum64=function(e,t,r,n){var o=e[t],i=n+e[t+1]>>>0,s=(i<n?1:0)+r+o;e[t]=s>>>0,e[t+1]=i},Ul.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},Ul.sum64_lo=function(e,t,r,n){return t+n>>>0},Ul.sum64_4_hi=function(e,t,r,n,o,i,s,a){var c=0,l=t;return c+=(l=l+n>>>0)<t?1:0,c+=(l=l+i>>>0)<i?1:0,e+r+o+s+(c+=(l=l+a>>>0)<a?1:0)>>>0},Ul.sum64_4_lo=function(e,t,r,n,o,i,s,a){return t+n+i+a>>>0},Ul.sum64_5_hi=function(e,t,r,n,o,i,s,a,c,l){var u=0,d=t;return u+=(d=d+n>>>0)<t?1:0,u+=(d=d+i>>>0)<i?1:0,u+=(d=d+a>>>0)<a?1:0,e+r+o+s+c+(u+=(d=d+l>>>0)<l?1:0)>>>0},Ul.sum64_5_lo=function(e,t,r,n,o,i,s,a,c,l){return t+n+i+a+l>>>0},Ul.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},Ul.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},Ul.shr64_hi=function(e,t,r){return e>>>r},Ul.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var Gl={},ql=Ul,Kl=Dl;function Ql(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Gl.BlockHash=Ql,Ql.prototype.update=function(e,t){if(e=ql.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=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=ql.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},Ql.prototype.digest=function(e){return this.update(this._pad()),Kl(null===this.pending),this._digest(e)},Ql.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var o=1;o<r;o++)n[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[o++]=0;n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=e>>>24&255,n[o++]=e>>>16&255,n[o++]=e>>>8&255,n[o++]=255&e}else for(n[o++]=255&e,n[o++]=e>>>8&255,n[o++]=e>>>16&255,n[o++]=e>>>24&255,n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=0,i=8;i<this.padLength;i++)n[o++]=0;return n};var $l={},eu={},tu=Ul.rotr32;function ru(e,t,r){return e&t^~e&r}function nu(e,t,r){return e&t^e&r^t&r}function ou(e,t,r){return e^t^r}eu.ft_1=function(e,t,r,n){return 0===e?ru(t,r,n):1===e||3===e?ou(t,r,n):2===e?nu(t,r,n):void 0},eu.ch32=ru,eu.maj32=nu,eu.p32=ou,eu.s0_256=function(e){return tu(e,2)^tu(e,13)^tu(e,22)},eu.s1_256=function(e){return tu(e,6)^tu(e,11)^tu(e,25)},eu.g0_256=function(e){return tu(e,7)^tu(e,18)^e>>>3},eu.g1_256=function(e){return tu(e,17)^tu(e,19)^e>>>10};var iu=Ul,su=Gl,au=eu,cu=iu.rotl32,lu=iu.sum32,uu=iu.sum32_5,du=au.ft_1,hu=su.BlockHash,fu=[1518500249,1859775393,2400959708,3395469782];function pu(){if(!(this instanceof pu))return new pu;hu.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}iu.inherits(pu,hu);var mu=pu;pu.blockSize=512,pu.outSize=160,pu.hmacStrength=80,pu.padLength=64,pu.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=cu(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var o=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4];for(n=0;n<r.length;n++){var l=~~(n/20),u=uu(cu(o,5),du(l,i,s,a),c,r[n],fu[l]);c=a,a=s,s=cu(i,30),i=o,o=u}this.h[0]=lu(this.h[0],o),this.h[1]=lu(this.h[1],i),this.h[2]=lu(this.h[2],s),this.h[3]=lu(this.h[3],a),this.h[4]=lu(this.h[4],c)},pu.prototype._digest=function(e){return"hex"===e?iu.toHex32(this.h,"big"):iu.split32(this.h,"big")};var gu=Ul,yu=Gl,bu=eu,vu=Dl,wu=gu.sum32,xu=gu.sum32_4,Eu=gu.sum32_5,Au=bu.ch32,Ru=bu.maj32,_u=bu.s0_256,ku=bu.s1_256,Su=bu.g0_256,Nu=bu.g1_256,Mu=yu.BlockHash,Tu=[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 Ou(){if(!(this instanceof Ou))return new Ou;Mu.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Tu,this.W=new Array(64)}gu.inherits(Ou,Mu);var Iu=Ou;Ou.blockSize=512,Ou.outSize=256,Ou.hmacStrength=192,Ou.padLength=64,Ou.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=xu(Nu(r[n-2]),r[n-7],Su(r[n-15]),r[n-16]);var o=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],l=this.h[5],u=this.h[6],d=this.h[7];for(vu(this.k.length===r.length),n=0;n<r.length;n++){var h=Eu(d,ku(c),Au(c,l,u),this.k[n],r[n]),f=wu(_u(o),Ru(o,i,s));d=u,u=l,l=c,c=wu(a,h),a=s,s=i,i=o,o=wu(h,f)}this.h[0]=wu(this.h[0],o),this.h[1]=wu(this.h[1],i),this.h[2]=wu(this.h[2],s),this.h[3]=wu(this.h[3],a),this.h[4]=wu(this.h[4],c),this.h[5]=wu(this.h[5],l),this.h[6]=wu(this.h[6],u),this.h[7]=wu(this.h[7],d)},Ou.prototype._digest=function(e){return"hex"===e?gu.toHex32(this.h,"big"):gu.split32(this.h,"big")};var Fu=Ul,Wu=Iu;function Cu(){if(!(this instanceof Cu))return new Cu;Wu.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Fu.inherits(Cu,Wu);var ju=Cu;Cu.blockSize=512,Cu.outSize=224,Cu.hmacStrength=192,Cu.padLength=64,Cu.prototype._digest=function(e){return"hex"===e?Fu.toHex32(this.h.slice(0,7),"big"):Fu.split32(this.h.slice(0,7),"big")};var Uu=Ul,Du=Gl,Bu=Dl,Vu=Uu.rotr64_hi,Pu=Uu.rotr64_lo,Zu=Uu.shr64_hi,zu=Uu.shr64_lo,Lu=Uu.sum64,Hu=Uu.sum64_hi,Yu=Uu.sum64_lo,Xu=Uu.sum64_4_hi,Ju=Uu.sum64_4_lo,Gu=Uu.sum64_5_hi,qu=Uu.sum64_5_lo,Ku=Du.BlockHash,Qu=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function $u(){if(!(this instanceof $u))return new $u;Ku.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Qu,this.W=new Array(160)}Uu.inherits($u,Ku);var ed=$u;function td(e,t,r,n,o){var i=e&r^~e&o;return i<0&&(i+=4294967296),i}function rd(e,t,r,n,o,i){var s=t&n^~t&i;return s<0&&(s+=4294967296),s}function nd(e,t,r,n,o){var i=e&r^e&o^r&o;return i<0&&(i+=4294967296),i}function od(e,t,r,n,o,i){var s=t&n^t&i^n&i;return s<0&&(s+=4294967296),s}function id(e,t){var r=Vu(e,t,28)^Vu(t,e,2)^Vu(t,e,7);return r<0&&(r+=4294967296),r}function sd(e,t){var r=Pu(e,t,28)^Pu(t,e,2)^Pu(t,e,7);return r<0&&(r+=4294967296),r}function ad(e,t){var r=Vu(e,t,14)^Vu(e,t,18)^Vu(t,e,9);return r<0&&(r+=4294967296),r}function cd(e,t){var r=Pu(e,t,14)^Pu(e,t,18)^Pu(t,e,9);return r<0&&(r+=4294967296),r}function ld(e,t){var r=Vu(e,t,1)^Vu(e,t,8)^Zu(e,t,7);return r<0&&(r+=4294967296),r}function ud(e,t){var r=Pu(e,t,1)^Pu(e,t,8)^zu(e,t,7);return r<0&&(r+=4294967296),r}function dd(e,t){var r=Vu(e,t,19)^Vu(t,e,29)^Zu(e,t,6);return r<0&&(r+=4294967296),r}function hd(e,t){var r=Pu(e,t,19)^Pu(t,e,29)^zu(e,t,6);return r<0&&(r+=4294967296),r}$u.blockSize=1024,$u.outSize=512,$u.hmacStrength=192,$u.padLength=128,$u.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var o=dd(r[n-4],r[n-3]),i=hd(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=ld(r[n-30],r[n-29]),l=ud(r[n-30],r[n-29]),u=r[n-32],d=r[n-31];r[n]=Xu(o,i,s,a,c,l,u,d),r[n+1]=Ju(o,i,s,a,c,l,u,d)}},$u.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],o=this.h[1],i=this.h[2],s=this.h[3],a=this.h[4],c=this.h[5],l=this.h[6],u=this.h[7],d=this.h[8],h=this.h[9],f=this.h[10],p=this.h[11],m=this.h[12],g=this.h[13],y=this.h[14],b=this.h[15];Bu(this.k.length===r.length);for(var v=0;v<r.length;v+=2){var w=y,x=b,E=ad(d,h),A=cd(d,h),R=td(d,h,f,p,m),_=rd(d,h,f,p,m,g),k=this.k[v],S=this.k[v+1],N=r[v],M=r[v+1],T=Gu(w,x,E,A,R,_,k,S,N,M),O=qu(w,x,E,A,R,_,k,S,N,M);w=id(n,o),x=sd(n,o),E=nd(n,o,i,s,a),A=od(n,o,i,s,a,c);var I=Hu(w,x,E,A),F=Yu(w,x,E,A);y=m,b=g,m=f,g=p,f=d,p=h,d=Hu(l,u,T,O),h=Yu(u,u,T,O),l=a,u=c,a=i,c=s,i=n,s=o,n=Hu(T,O,I,F),o=Yu(T,O,I,F)}Lu(this.h,0,n,o),Lu(this.h,2,i,s),Lu(this.h,4,a,c),Lu(this.h,6,l,u),Lu(this.h,8,d,h),Lu(this.h,10,f,p),Lu(this.h,12,m,g),Lu(this.h,14,y,b)},$u.prototype._digest=function(e){return"hex"===e?Uu.toHex32(this.h,"big"):Uu.split32(this.h,"big")};var fd=Ul,pd=ed;function md(){if(!(this instanceof md))return new md;pd.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}fd.inherits(md,pd);var gd=md;md.blockSize=1024,md.outSize=384,md.hmacStrength=192,md.padLength=128,md.prototype._digest=function(e){return"hex"===e?fd.toHex32(this.h.slice(0,12),"big"):fd.split32(this.h.slice(0,12),"big")},$l.sha1=mu,$l.sha224=ju,$l.sha256=Iu,$l.sha384=gd,$l.sha512=ed;var yd={},bd=Ul,vd=Gl,wd=bd.rotl32,xd=bd.sum32,Ed=bd.sum32_3,Ad=bd.sum32_4,Rd=vd.BlockHash;function _d(){if(!(this instanceof _d))return new _d;Rd.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function kd(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function Sd(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Nd(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}bd.inherits(_d,Rd),yd.ripemd160=_d,_d.blockSize=512,_d.outSize=160,_d.hmacStrength=192,_d.padLength=64,_d.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],o=this.h[2],i=this.h[3],s=this.h[4],a=r,c=n,l=o,u=i,d=s,h=0;h<80;h++){var f=xd(wd(Ad(r,kd(h,n,o,i),e[Md[h]+t],Sd(h)),Od[h]),s);r=s,s=i,i=wd(o,10),o=n,n=f,f=xd(wd(Ad(a,kd(79-h,c,l,u),e[Td[h]+t],Nd(h)),Id[h]),d),a=d,d=u,u=wd(l,10),l=c,c=f}f=Ed(this.h[1],o,u),this.h[1]=Ed(this.h[2],i,d),this.h[2]=Ed(this.h[3],s,a),this.h[3]=Ed(this.h[4],r,c),this.h[4]=Ed(this.h[0],n,l),this.h[0]=f},_d.prototype._digest=function(e){return"hex"===e?bd.toHex32(this.h,"little"):bd.split32(this.h,"little")};var Md=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Td=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Od=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Id=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Fd=Ul,Wd=Dl;function Cd(e,t,r){if(!(this instanceof Cd))return new Cd(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(Fd.toArray(t,r))}var jd=Cd;Cd.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),Wd(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},Cd.prototype.update=function(e,t){return this.inner.update(e,t),this},Cd.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=jl;t.utils=Ul,t.common=Gl,t.sha=$l,t.ripemd=yd,t.hmac=jd,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}();var Ud=jl;function Dd(e){return"0x"+Ud.sha256().update(ns(e)).digest("hex")}new qi("sha2/5.7.0");var Bd=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};function Vd(e,t){return Bd(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),o=yield n.arrayBuffer(),i={};return n.headers.forEach?n.headers.forEach(((e,t)=>{i[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{i[e.toLowerCase()]=n.headers.get(e)})),{headers:i,statusCode:n.status,statusMessage:n.statusText,body:ns(new Uint8Array(o))}}))}var Pd=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Zd=new qi("web/5.7.1");function zd(e){return new Promise((t=>{setTimeout(t,e)}))}function Ld(e,t){if(null==e)return null;if("string"==typeof e)return e;if(es(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return uc(e)}catch(e){}return as(e)}return e}function Hd(e,t,r){let n=null;if(null!=t){n=lc(t);const r="string"==typeof e?{url:e}:ha(e);if(r.headers){const e=0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length;e||(r.headers=ha(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return function(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Zd.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const o="object"==typeof e?e.throttleCallback:null,i="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Zd.assertArgument(i>0&&i%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",i);const s="object"==typeof e&&!!e.errorPassThrough,a={};let c=null;const l={method:"GET"};let u=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||Zd.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)a[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Zd.throwError("basic authentication requires a secure https url",qi.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;a.authorization={key:"Authorization",value:"Basic "+vc(lc(t))}}null!=e.skipFetchSetup&&(l.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(l.fetchOptions=ha(e.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),f=c?c.match(h):null;if(f)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":f[1]||"text/plain"},body:f[2]?bc(f[3]):(p=f[3],lc(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){Zd.throwError("processing response error",qi.errors.SERVER_ERROR,{body:Ld(f[1],f[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var p;t&&(l.method="POST",l.body=t,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(a).forEach((e=>{const t=a[e];m[t.key]=t.value})),l.headers=m;const g=function(){let e=null;return{promise:new Promise((function(t,r){d&&(e=setTimeout((()=>{null!=e&&(e=null,r(Zd.makeError("timeout",qi.errors.TIMEOUT,{requestBody:Ld(l.body,m["content-type"]),requestMethod:l.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return Pd(this,void 0,void 0,(function*(){for(let e=0;e<n;e++){let t=null;try{if(t=yield Vd(c,l),e<n)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===l.method&&e.match(/^https:/)){c=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(o&&(r=yield o(e,c)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):i*parseInt(String(Math.random()*Math.pow(2,e))),yield zd(r);continue}}}catch(e){t=e.response,null==t&&(g.cancel(),Zd.throwError("missing response",qi.errors.SERVER_ERROR,{requestBody:Ld(l.body,m["content-type"]),requestMethod:l.method,serverError:e,url:c}))}let a=t.body;if(u&&304===t.statusCode?a=null:!s&&(t.statusCode<200||t.statusCode>=300)&&(g.cancel(),Zd.throwError("bad response",qi.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Ld(a,t.headers?t.headers["content-type"]:null),requestBody:Ld(l.body,m["content-type"]),requestMethod:l.method,url:c})),r)try{const e=yield r(a,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e<n){let t=!0;if(o&&(t=yield o(e,c)),t){const t=i*parseInt(String(Math.random()*Math.pow(2,e)));yield zd(t);continue}}g.cancel(),Zd.throwError("processing response error",qi.errors.SERVER_ERROR,{body:Ld(a,t.headers?t.headers["content-type"]:null),error:r,requestBody:Ld(l.body,m["content-type"]),requestMethod:l.method,url:c})}return g.cancel(),a}return Zd.throwError("failed response",qi.errors.SERVER_ERROR,{requestBody:Ld(l.body,m["content-type"]),requestMethod:l.method,url:c})}))}();return Promise.race([g.promise,y])}(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(uc(e))}catch(t){Zd.throwError("invalid JSON",qi.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Yd(e,t){return t||(t={}),null==(t=ha(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let o=null,i=!1;const s=()=>!i&&(i=!0,o&&clearTimeout(o),!0);t.timeout&&(o=setTimeout((()=>{s()&&n(new Error("timeout"))}),t.timeout));const a=t.retryLimit;let c=0;!function o(){return e().then((function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",o);else if(t.onceBlock)t.onceBlock.once("block",o);else if(!i){if(c++,c>a)return void(s()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(o,e)}return null}),(function(e){s()&&n(e)}))}()}))}for(var Xd="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Jd={},Gd=0;Gd<Xd.length;Gd++){var qd=Xd.charAt(Gd);if(void 0!==Jd[qd])throw new TypeError(qd+" is ambiguous");Jd[qd]=Gd}function Kd(e){var t=e>>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 Qd(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=Kd(t)^n>>5}for(t=Kd(t),r=0;r<e.length;++r){var o=e.charCodeAt(r);t=Kd(t)^31&o}return t}function $d(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)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 i=e.slice(0,o),s=e.slice(o+1);if(s.length<6)return"Data too short";var a=Qd(i);if("string"==typeof a)return a;for(var c=[],l=0;l<s.length;++l){var u=s.charAt(l),d=Jd[u];if(void 0===d)return"Unknown character "+u;a=Kd(a)^d,l+6>=s.length||c.push(d)}return 1!==a?"Invalid checksum for "+e:{prefix:i,words:c}}function eh(e,t,r,n){for(var o=0,i=0,s=(1<<r)-1,a=[],c=0;c<e.length;++c)for(o=o<<t|e[c],i+=t;i>=r;)i-=r,a.push(o>>i&s);if(n)i>0&&a.push(o<<r-i&s);else{if(i>=t)return"Excess padding";if(o<<r-i&s)return"Non-zero padding"}return a}var th={decodeUnsafe:function(){var e=$d.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=$d.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");var n=Qd(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var o=e+"1",i=0;i<t.length;++i){var s=t[i];if(s>>5!=0)throw new Error("Non 5-bit word");n=Kd(n)^s,o+=Xd.charAt(s)}for(i=0;i<6;++i)n=Kd(n);for(n^=1,i=0;i<6;++i){o+=Xd.charAt(n>>5*(5-i)&31)}return o},toWordsUnsafe:function(e){var t=eh(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=eh(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=eh(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=eh(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}};const rh="providers/5.7.2";var nh={exports:{}};!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(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 i;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{i="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:require("buffer").Buffer}catch(e){}function s(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,n,o){for(var i=0,s=0,a=Math.min(e.length,n),c=t;c<a;c++){var l=e.charCodeAt(c)-48;i*=o,s=l>=49?l-49+10:l>=17?l-17+10:l,r(l>=0&&s<o,"Invalid character"),i+=s}return i}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var o=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o<e.length&&(16===t?this._parseHex(e,o,n):(this._parseBase(e,t,o),"le"===n&&this._initArray(this.toArray(),t,n)))},o.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},o.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var o=0;o<this.length;o++)this.words[o]=0;var i,s,a=0;if("be"===n)for(o=e.length-1,i=0;o>=0;o-=3)s=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===n)for(o=0,i=0;o<e.length;o+=3)s=e[o]|e[o+1]<<8|e[o+2]<<16,this.words[i]|=s<<a&67108863,this.words[i+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);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<this.length;n++)this.words[n]=0;var o,i=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)o=a(e,t,n)<<i,this.words[s]|=67108863&o,i>=18?(i-=18,s+=1,this.words[s]|=o>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)o=a(e,t,n)<<i,this.words[s]|=67108863&o,i>=18?(i-=18,s+=1,this.words[s]|=o>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,o=1;o<=67108863;o*=t)n++;n--,o=o/t|0;for(var i=e.length-r,s=i%n,a=Math.min(i,i-s)+r,l=0,u=r;u<a;u+=n)l=c(e,u,u+n,t),this.imuln(o),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==s){var d=1;for(l=c(e,u,e.length,t),u=0;u<s;u++)d*=t;this.imuln(d),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){l(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(e){o.prototype.inspect=u}else o.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var o=0|e.words[0],i=0|t.words[0],s=o*i,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var l=1;l<n;l++){for(var u=c>>>26,d=67108863&c,h=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=h;f++){var p=l-f|0;u+=(s=(o=0|e.words[p])*(i=0|t.words[f])+d)/67108864|0,d=67108863&s}r.words[l]=0|d,c=0|u}return 0!==c?r.words[l]=0|c:r.length--,r._strip()}o.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var o=0,i=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<o|i)).toString(16);i=a>>>24-o&16777215,(o+=2)>=26&&(o-=26,s--),n=0!==i||s!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==i&&(n=i.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=h[e],u=f[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(u).toString(e);n=(p=p.idivn(u)).isZero()?m+n:d[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},i&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(i,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,n){this._strip();var o=this.byteLength(),i=n||Math.max(1,o);r(o<=i,"byte array longer than desired length"),r(i>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,o),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,o=0,i=0;o<this.length;o++){var s=this.words[o]<<i|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===i?(r<e.length&&(e[r++]=s>>24&255),n=0,i=0):(n=s>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,o=0,i=0;o<this.length;o++){var s=this.words[o]<<i|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===i?(r>=0&&(e[r--]=s>>24&255),n=0,i=0):(n=s>>>24,i+=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;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.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;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.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;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.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){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var o=0;o<t;o++)this.words[o]=67108863&~this.words[o];return n>0&&(this.words[o]=~this.words[o]&67108863>>26-n),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,o=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<o:this.words[n]&~(1<<o),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var o=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+o,this.words[i]=67108863&t,o=t>>>26;for(;0!==o&&i<r.length;i++)t=(0|r.words[i])+o,this.words[i]=67108863&t,o=t>>>26;if(this.length=r.length,0!==o)this.words[this.length]=o,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.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,o=this.cmp(e);if(0===o)return this.negative=0,this.length=1,this.words[0]=0,this;o>0?(r=this,n=e):(r=e,n=this);for(var i=0,s=0;s<n.length;s++)i=(t=(0|r.words[s])-(0|n.words[s])+i)>>26,this.words[s]=67108863&t;for(;0!==i&&s<r.length;s++)i=(t=(0|r.words[s])+i)>>26,this.words[s]=67108863&t;if(0===i&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,o,i,s=e.words,a=t.words,c=r.words,l=0,u=0|s[0],d=8191&u,h=u>>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,E=0|s[4],A=8191&E,R=E>>>13,_=0|s[5],k=8191&_,S=_>>>13,N=0|s[6],M=8191&N,T=N>>>13,O=0|s[7],I=8191&O,F=O>>>13,W=0|s[8],C=8191&W,j=W>>>13,U=0|s[9],D=8191&U,B=U>>>13,V=0|a[0],P=8191&V,Z=V>>>13,z=0|a[1],L=8191&z,H=z>>>13,Y=0|a[2],X=8191&Y,J=Y>>>13,G=0|a[3],q=8191&G,K=G>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,oe=0|a[6],ie=8191&oe,se=oe>>>13,ae=0|a[7],ce=8191&ae,le=ae>>>13,ue=0|a[8],de=8191&ue,he=ue>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(l+(n=Math.imul(d,P))|0)+((8191&(o=(o=Math.imul(d,Z))+Math.imul(h,P)|0))<<13)|0;l=((i=Math.imul(h,Z))+(o>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,P),o=(o=Math.imul(p,Z))+Math.imul(m,P)|0,i=Math.imul(m,Z);var ye=(l+(n=n+Math.imul(d,L)|0)|0)+((8191&(o=(o=o+Math.imul(d,H)|0)+Math.imul(h,L)|0))<<13)|0;l=((i=i+Math.imul(h,H)|0)+(o>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,P),o=(o=Math.imul(y,Z))+Math.imul(b,P)|0,i=Math.imul(b,Z),n=n+Math.imul(p,L)|0,o=(o=o+Math.imul(p,H)|0)+Math.imul(m,L)|0,i=i+Math.imul(m,H)|0;var be=(l+(n=n+Math.imul(d,X)|0)|0)+((8191&(o=(o=o+Math.imul(d,J)|0)+Math.imul(h,X)|0))<<13)|0;l=((i=i+Math.imul(h,J)|0)+(o>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,P),o=(o=Math.imul(w,Z))+Math.imul(x,P)|0,i=Math.imul(x,Z),n=n+Math.imul(y,L)|0,o=(o=o+Math.imul(y,H)|0)+Math.imul(b,L)|0,i=i+Math.imul(b,H)|0,n=n+Math.imul(p,X)|0,o=(o=o+Math.imul(p,J)|0)+Math.imul(m,X)|0,i=i+Math.imul(m,J)|0;var ve=(l+(n=n+Math.imul(d,q)|0)|0)+((8191&(o=(o=o+Math.imul(d,K)|0)+Math.imul(h,q)|0))<<13)|0;l=((i=i+Math.imul(h,K)|0)+(o>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(A,P),o=(o=Math.imul(A,Z))+Math.imul(R,P)|0,i=Math.imul(R,Z),n=n+Math.imul(w,L)|0,o=(o=o+Math.imul(w,H)|0)+Math.imul(x,L)|0,i=i+Math.imul(x,H)|0,n=n+Math.imul(y,X)|0,o=(o=o+Math.imul(y,J)|0)+Math.imul(b,X)|0,i=i+Math.imul(b,J)|0,n=n+Math.imul(p,q)|0,o=(o=o+Math.imul(p,K)|0)+Math.imul(m,q)|0,i=i+Math.imul(m,K)|0;var we=(l+(n=n+Math.imul(d,$)|0)|0)+((8191&(o=(o=o+Math.imul(d,ee)|0)+Math.imul(h,$)|0))<<13)|0;l=((i=i+Math.imul(h,ee)|0)+(o>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(k,P),o=(o=Math.imul(k,Z))+Math.imul(S,P)|0,i=Math.imul(S,Z),n=n+Math.imul(A,L)|0,o=(o=o+Math.imul(A,H)|0)+Math.imul(R,L)|0,i=i+Math.imul(R,H)|0,n=n+Math.imul(w,X)|0,o=(o=o+Math.imul(w,J)|0)+Math.imul(x,X)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(y,q)|0,o=(o=o+Math.imul(y,K)|0)+Math.imul(b,q)|0,i=i+Math.imul(b,K)|0,n=n+Math.imul(p,$)|0,o=(o=o+Math.imul(p,ee)|0)+Math.imul(m,$)|0,i=i+Math.imul(m,ee)|0;var xe=(l+(n=n+Math.imul(d,re)|0)|0)+((8191&(o=(o=o+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;l=((i=i+Math.imul(h,ne)|0)+(o>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(M,P),o=(o=Math.imul(M,Z))+Math.imul(T,P)|0,i=Math.imul(T,Z),n=n+Math.imul(k,L)|0,o=(o=o+Math.imul(k,H)|0)+Math.imul(S,L)|0,i=i+Math.imul(S,H)|0,n=n+Math.imul(A,X)|0,o=(o=o+Math.imul(A,J)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,J)|0,n=n+Math.imul(w,q)|0,o=(o=o+Math.imul(w,K)|0)+Math.imul(x,q)|0,i=i+Math.imul(x,K)|0,n=n+Math.imul(y,$)|0,o=(o=o+Math.imul(y,ee)|0)+Math.imul(b,$)|0,i=i+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,o=(o=o+Math.imul(p,ne)|0)+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0;var Ee=(l+(n=n+Math.imul(d,ie)|0)|0)+((8191&(o=(o=o+Math.imul(d,se)|0)+Math.imul(h,ie)|0))<<13)|0;l=((i=i+Math.imul(h,se)|0)+(o>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(I,P),o=(o=Math.imul(I,Z))+Math.imul(F,P)|0,i=Math.imul(F,Z),n=n+Math.imul(M,L)|0,o=(o=o+Math.imul(M,H)|0)+Math.imul(T,L)|0,i=i+Math.imul(T,H)|0,n=n+Math.imul(k,X)|0,o=(o=o+Math.imul(k,J)|0)+Math.imul(S,X)|0,i=i+Math.imul(S,J)|0,n=n+Math.imul(A,q)|0,o=(o=o+Math.imul(A,K)|0)+Math.imul(R,q)|0,i=i+Math.imul(R,K)|0,n=n+Math.imul(w,$)|0,o=(o=o+Math.imul(w,ee)|0)+Math.imul(x,$)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(y,re)|0,o=(o=o+Math.imul(y,ne)|0)+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0,n=n+Math.imul(p,ie)|0,o=(o=o+Math.imul(p,se)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,se)|0;var Ae=(l+(n=n+Math.imul(d,ce)|0)|0)+((8191&(o=(o=o+Math.imul(d,le)|0)+Math.imul(h,ce)|0))<<13)|0;l=((i=i+Math.imul(h,le)|0)+(o>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,P),o=(o=Math.imul(C,Z))+Math.imul(j,P)|0,i=Math.imul(j,Z),n=n+Math.imul(I,L)|0,o=(o=o+Math.imul(I,H)|0)+Math.imul(F,L)|0,i=i+Math.imul(F,H)|0,n=n+Math.imul(M,X)|0,o=(o=o+Math.imul(M,J)|0)+Math.imul(T,X)|0,i=i+Math.imul(T,J)|0,n=n+Math.imul(k,q)|0,o=(o=o+Math.imul(k,K)|0)+Math.imul(S,q)|0,i=i+Math.imul(S,K)|0,n=n+Math.imul(A,$)|0,o=(o=o+Math.imul(A,ee)|0)+Math.imul(R,$)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(w,re)|0,o=(o=o+Math.imul(w,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(y,ie)|0,o=(o=o+Math.imul(y,se)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,o=(o=o+Math.imul(p,le)|0)+Math.imul(m,ce)|0,i=i+Math.imul(m,le)|0;var Re=(l+(n=n+Math.imul(d,de)|0)|0)+((8191&(o=(o=o+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;l=((i=i+Math.imul(h,he)|0)+(o>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,P),o=(o=Math.imul(D,Z))+Math.imul(B,P)|0,i=Math.imul(B,Z),n=n+Math.imul(C,L)|0,o=(o=o+Math.imul(C,H)|0)+Math.imul(j,L)|0,i=i+Math.imul(j,H)|0,n=n+Math.imul(I,X)|0,o=(o=o+Math.imul(I,J)|0)+Math.imul(F,X)|0,i=i+Math.imul(F,J)|0,n=n+Math.imul(M,q)|0,o=(o=o+Math.imul(M,K)|0)+Math.imul(T,q)|0,i=i+Math.imul(T,K)|0,n=n+Math.imul(k,$)|0,o=(o=o+Math.imul(k,ee)|0)+Math.imul(S,$)|0,i=i+Math.imul(S,ee)|0,n=n+Math.imul(A,re)|0,o=(o=o+Math.imul(A,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(w,ie)|0,o=(o=o+Math.imul(w,se)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,se)|0,n=n+Math.imul(y,ce)|0,o=(o=o+Math.imul(y,le)|0)+Math.imul(b,ce)|0,i=i+Math.imul(b,le)|0,n=n+Math.imul(p,de)|0,o=(o=o+Math.imul(p,he)|0)+Math.imul(m,de)|0,i=i+Math.imul(m,he)|0;var _e=(l+(n=n+Math.imul(d,pe)|0)|0)+((8191&(o=(o=o+Math.imul(d,me)|0)+Math.imul(h,pe)|0))<<13)|0;l=((i=i+Math.imul(h,me)|0)+(o>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(D,L),o=(o=Math.imul(D,H))+Math.imul(B,L)|0,i=Math.imul(B,H),n=n+Math.imul(C,X)|0,o=(o=o+Math.imul(C,J)|0)+Math.imul(j,X)|0,i=i+Math.imul(j,J)|0,n=n+Math.imul(I,q)|0,o=(o=o+Math.imul(I,K)|0)+Math.imul(F,q)|0,i=i+Math.imul(F,K)|0,n=n+Math.imul(M,$)|0,o=(o=o+Math.imul(M,ee)|0)+Math.imul(T,$)|0,i=i+Math.imul(T,ee)|0,n=n+Math.imul(k,re)|0,o=(o=o+Math.imul(k,ne)|0)+Math.imul(S,re)|0,i=i+Math.imul(S,ne)|0,n=n+Math.imul(A,ie)|0,o=(o=o+Math.imul(A,se)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,se)|0,n=n+Math.imul(w,ce)|0,o=(o=o+Math.imul(w,le)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,le)|0,n=n+Math.imul(y,de)|0,o=(o=o+Math.imul(y,he)|0)+Math.imul(b,de)|0,i=i+Math.imul(b,he)|0;var ke=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(o=(o=o+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;l=((i=i+Math.imul(m,me)|0)+(o>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,X),o=(o=Math.imul(D,J))+Math.imul(B,X)|0,i=Math.imul(B,J),n=n+Math.imul(C,q)|0,o=(o=o+Math.imul(C,K)|0)+Math.imul(j,q)|0,i=i+Math.imul(j,K)|0,n=n+Math.imul(I,$)|0,o=(o=o+Math.imul(I,ee)|0)+Math.imul(F,$)|0,i=i+Math.imul(F,ee)|0,n=n+Math.imul(M,re)|0,o=(o=o+Math.imul(M,ne)|0)+Math.imul(T,re)|0,i=i+Math.imul(T,ne)|0,n=n+Math.imul(k,ie)|0,o=(o=o+Math.imul(k,se)|0)+Math.imul(S,ie)|0,i=i+Math.imul(S,se)|0,n=n+Math.imul(A,ce)|0,o=(o=o+Math.imul(A,le)|0)+Math.imul(R,ce)|0,i=i+Math.imul(R,le)|0,n=n+Math.imul(w,de)|0,o=(o=o+Math.imul(w,he)|0)+Math.imul(x,de)|0,i=i+Math.imul(x,he)|0;var Se=(l+(n=n+Math.imul(y,pe)|0)|0)+((8191&(o=(o=o+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;l=((i=i+Math.imul(b,me)|0)+(o>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,q),o=(o=Math.imul(D,K))+Math.imul(B,q)|0,i=Math.imul(B,K),n=n+Math.imul(C,$)|0,o=(o=o+Math.imul(C,ee)|0)+Math.imul(j,$)|0,i=i+Math.imul(j,ee)|0,n=n+Math.imul(I,re)|0,o=(o=o+Math.imul(I,ne)|0)+Math.imul(F,re)|0,i=i+Math.imul(F,ne)|0,n=n+Math.imul(M,ie)|0,o=(o=o+Math.imul(M,se)|0)+Math.imul(T,ie)|0,i=i+Math.imul(T,se)|0,n=n+Math.imul(k,ce)|0,o=(o=o+Math.imul(k,le)|0)+Math.imul(S,ce)|0,i=i+Math.imul(S,le)|0,n=n+Math.imul(A,de)|0,o=(o=o+Math.imul(A,he)|0)+Math.imul(R,de)|0,i=i+Math.imul(R,he)|0;var Ne=(l+(n=n+Math.imul(w,pe)|0)|0)+((8191&(o=(o=o+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;l=((i=i+Math.imul(x,me)|0)+(o>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(D,$),o=(o=Math.imul(D,ee))+Math.imul(B,$)|0,i=Math.imul(B,ee),n=n+Math.imul(C,re)|0,o=(o=o+Math.imul(C,ne)|0)+Math.imul(j,re)|0,i=i+Math.imul(j,ne)|0,n=n+Math.imul(I,ie)|0,o=(o=o+Math.imul(I,se)|0)+Math.imul(F,ie)|0,i=i+Math.imul(F,se)|0,n=n+Math.imul(M,ce)|0,o=(o=o+Math.imul(M,le)|0)+Math.imul(T,ce)|0,i=i+Math.imul(T,le)|0,n=n+Math.imul(k,de)|0,o=(o=o+Math.imul(k,he)|0)+Math.imul(S,de)|0,i=i+Math.imul(S,he)|0;var Me=(l+(n=n+Math.imul(A,pe)|0)|0)+((8191&(o=(o=o+Math.imul(A,me)|0)+Math.imul(R,pe)|0))<<13)|0;l=((i=i+Math.imul(R,me)|0)+(o>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,re),o=(o=Math.imul(D,ne))+Math.imul(B,re)|0,i=Math.imul(B,ne),n=n+Math.imul(C,ie)|0,o=(o=o+Math.imul(C,se)|0)+Math.imul(j,ie)|0,i=i+Math.imul(j,se)|0,n=n+Math.imul(I,ce)|0,o=(o=o+Math.imul(I,le)|0)+Math.imul(F,ce)|0,i=i+Math.imul(F,le)|0,n=n+Math.imul(M,de)|0,o=(o=o+Math.imul(M,he)|0)+Math.imul(T,de)|0,i=i+Math.imul(T,he)|0;var Te=(l+(n=n+Math.imul(k,pe)|0)|0)+((8191&(o=(o=o+Math.imul(k,me)|0)+Math.imul(S,pe)|0))<<13)|0;l=((i=i+Math.imul(S,me)|0)+(o>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,ie),o=(o=Math.imul(D,se))+Math.imul(B,ie)|0,i=Math.imul(B,se),n=n+Math.imul(C,ce)|0,o=(o=o+Math.imul(C,le)|0)+Math.imul(j,ce)|0,i=i+Math.imul(j,le)|0,n=n+Math.imul(I,de)|0,o=(o=o+Math.imul(I,he)|0)+Math.imul(F,de)|0,i=i+Math.imul(F,he)|0;var Oe=(l+(n=n+Math.imul(M,pe)|0)|0)+((8191&(o=(o=o+Math.imul(M,me)|0)+Math.imul(T,pe)|0))<<13)|0;l=((i=i+Math.imul(T,me)|0)+(o>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,ce),o=(o=Math.imul(D,le))+Math.imul(B,ce)|0,i=Math.imul(B,le),n=n+Math.imul(C,de)|0,o=(o=o+Math.imul(C,he)|0)+Math.imul(j,de)|0,i=i+Math.imul(j,he)|0;var Ie=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(o=(o=o+Math.imul(I,me)|0)+Math.imul(F,pe)|0))<<13)|0;l=((i=i+Math.imul(F,me)|0)+(o>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,de),o=(o=Math.imul(D,he))+Math.imul(B,de)|0,i=Math.imul(B,he);var Fe=(l+(n=n+Math.imul(C,pe)|0)|0)+((8191&(o=(o=o+Math.imul(C,me)|0)+Math.imul(j,pe)|0))<<13)|0;l=((i=i+Math.imul(j,me)|0)+(o>>>13)|0)+(Fe>>>26)|0,Fe&=67108863;var We=(l+(n=Math.imul(D,pe))|0)+((8191&(o=(o=Math.imul(D,me))+Math.imul(B,pe)|0))<<13)|0;return l=((i=Math.imul(B,me))+(o>>>13)|0)+(We>>>26)|0,We&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=Ee,c[7]=Ae,c[8]=Re,c[9]=_e,c[10]=ke,c[11]=Se,c[12]=Ne,c[13]=Me,c[14]=Te,c[15]=Oe,c[16]=Ie,c[17]=Fe,c[18]=We,0!==l&&(c[19]=l,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,o=0,i=0;i<r.length-1;i++){var s=o;o=0;for(var a=67108863&n,c=Math.min(i,t.length-1),l=Math.max(0,i-e.length+1);l<=c;l++){var u=i-l,d=(0|e.words[u])*(0|t.words[l]),h=67108863&d;a=67108863&(h=h+a|0),o+=(s=(s=s+(d/67108864|0)|0)+(h>>>26)|0)>>>26,s&=67108863}r.words[i]=a,n=s,s=o}return 0!==n?r.words[i]=n:r.length--,r._strip()}function y(e,t,r){return g(e,t,r)}Math.imul||(m=p),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?p(this,e,t):r<1024?g(this,e,t):y(this,e,t)},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,o=0;o<this.length;o++){var i=(0|this.words[o])*e,s=(67108863&i)+(67108863&n);n>>=26,n+=i/67108864|0,n+=s>>>26,this.words[o]=67108863&s}return 0!==n&&(this.words[o]=n,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<t.length;r++){var n=r/26|0,o=r%26;t[r]=e.words[n]>>>o&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,o=(e-n)/26,i=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&i,c=(0|this.words[t])-a<<n;this.words[t]=c|s,s=a>>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==o){for(t=this.length-1;t>=0;t--)this.words[t+o]=this.words[t];for(t=0;t<o;t++)this.words[t]=0;this.length+=o}return this._strip()},o.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,n){var o;r("number"==typeof e&&e>=0),o=t?(t-t%26)/26:0;var i=e%26,s=Math.min((e-i)/26,this.length),a=67108863^67108863>>>i<<i,c=n;if(o-=s,o=Math.max(0,o),c){for(var l=0;l<s;l++)c.words[l]=this.words[l];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,l=0;l<this.length;l++)this.words[l]=this.words[l+s];else this.words[0]=0,this.length=1;var u=0;for(l=this.length-1;l>=0&&(0!==u||l>=o);l--){var d=0|this.words[l];this.words[l]=u<<26-i|d>>>i,u=d&a}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},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){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,o=1<<t;return!(this.length<=n||!(this.words[n]&o))},o.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var o=67108863^67108863>>>t<<t;this.words[this.length-1]&=o}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[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(r("number"==typeof e),r(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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,n){var o,i,s=e.length+n;this._expand(s);var a=0;for(o=0;o<e.length;o++){i=(0|this.words[o+n])+a;var c=(0|e.words[o])*t;a=((i-=67108863&c)>>26)-(c/67108864|0),this.words[o+n]=67108863&i}for(;o<this.length-n;o++)a=(i=(0|this.words[o+n])+a)>>26,this.words[o+n]=67108863&i;if(0===a)return this._strip();for(r(-1===a),a=0,o=0;o<this.length;o++)a=(i=-(0|this.words[o])+a)>>26,this.words[o]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var l=0;l<a.length;l++)a.words[l]=0}var u=n.clone()._ishlnsubmul(i,1,c);0===u.negative&&(n=u,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=h)}return a&&a._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):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,s,a},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),o=e.andln(1),i=r.cmp(n);return i<0||1===o&&0===i?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),r(e<=67108863);for(var n=(1<<26)%e,o=0,i=this.length-1;i>=0;i--)o=(n*o+(0|this.words[i]))%e;return t?-o:o},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,o=this.length-1;o>=0;o--){var i=(0|this.words[o])+67108864*n;this.words[o]=i/e|0,n=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),l=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++l;for(var u=n.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(u),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(u),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),i.isub(a),s.isub(c)):(n.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:n.iushln(l)}},o.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var l=0,u=1;0==(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,h=1;0==(n.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).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 o=t.cmp(r);if(o<0){var i=t;t=r,r=i}else if(0===o||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){r("number"==typeof e);var t=e%26,n=(e-t)/26,o=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=o,this;for(var i=o,s=n;0!==i&&s<this.length;s++){var a=0|this.words[s];i=(a+=i)>>>26,a&=67108863,this.words[s]=a}return 0!==i&&(this.words[s]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var o=0|this.words[0];t=o===e?0:o<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],o=0|e.words[r];if(n!==o){n<o?t=-1:n>o&&(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 R(e)},o.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var b={k256:null,p224:null,p192:null,p25519:null};function v(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 w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function _(e){R.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)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.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<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(w,v),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),o=0;o<n;o++)t.words[o]=e.words[o];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,o=10;o<e.length;o++){var s=0|e.words[o];e.words[o-10]=(s&r)<<4|i>>>22,i=s}i>>>=22,e.words[o-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(x,v),n(E,v),n(A,v),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,o=67108863&n;n>>>=26,e.words[r]=o,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(b[e])return b[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new x;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return b[e]=t,t},R.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},R.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},R.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},R.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},R.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)},R.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},R.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)},R.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},R.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},R.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},R.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},R.prototype.isqr=function(e){return this.imul(e,e.clone())},R.prototype.sqr=function(e){return this.mul(e,e)},R.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new o(1)).iushrn(2);return this.pow(e,n)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);r(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new o(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var d=this.pow(u,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var y=this.pow(d,new o(1).iushln(p-g-1));h=h.redMul(y),d=y.redSqr(),f=f.redMul(d),p=g}return h},R.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},R.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var l=t.words[n],u=c-1;u>=0;u--){var d=l>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===n&&0===u)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},R.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},R.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new _(e)},n(_,R),_.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},_.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},_.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),i=o;return o.cmp(this.m)>=0?i=o.isub(this.m):o.cmpn(0)<0&&(i=o.iadd(this.m)),i._forceRed(this)},_.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),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},_.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(nh,ce);var oh=nh.exports;function ih(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var sh=ah;function ah(e,t){if(!e)throw new Error(t||"Assertion failed")}ah.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var ch=ih((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var o=e.charCodeAt(n),i=o>>8,s=255&o;i?r.push(i,s):r.push(s)}return r},r.zero2=n,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}})),lh=ih((function(e,t){var r=t;r.assert=sh,r.toArray=ch.toArray,r.zero2=ch.zero2,r.toHex=ch.toHex,r.encode=ch.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var o=1<<t+1,i=e.clone(),s=0;s<n.length;s++){var a,c=i.andln(o-1);i.isOdd()?(a=c>(o>>1)-1?(o>>1)-c:c,i.isubn(a)):a=0,n[s]=a,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,o=0,i=0;e.cmpn(-o)>0||t.cmpn(-i)>0;){var s,a,c=e.andln(3)+o&3,l=t.andln(3)+i&3;3===c&&(c=-1),3===l&&(l=-1),s=0==(1&c)?0:3!==(n=e.andln(7)+o&7)&&5!==n||2!==l?c:-c,r[0].push(s),a=0==(1&l)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?l:-l,r[1].push(a),2*o===s+1&&(o=1-o),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new oh(e,"hex","le")}})),uh=lh.getNAF,dh=lh.getJSF,hh=lh.assert;function fh(e,t){this.type=e,this.p=new oh(t.p,16),this.red=t.prime?oh.red(t.prime):oh.mont(this.p),this.zero=new oh(0).toRed(this.red),this.one=new oh(1).toRed(this.red),this.two=new oh(2).toRed(this.red),this.n=t.n&&new oh(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ph=fh;function mh(e,t){this.curve=e,this.type=t,this.precomputed=null}fh.prototype.point=function(){throw new Error("Not implemented")},fh.prototype.validate=function(){throw new Error("Not implemented")},fh.prototype._fixedNafMul=function(e,t){hh(e.precomputed);var r=e._getDoubles(),n=uh(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var i,s,a=[];for(i=0;i<n.length;i+=r.step){s=0;for(var c=i+r.step-1;c>=i;c--)s=(s<<1)+n[c];a.push(s)}for(var l=this.jpoint(null,null,null),u=this.jpoint(null,null,null),d=o;d>0;d--){for(i=0;i<a.length;i++)(s=a[i])===d?u=u.mixedAdd(r.points[i]):s===-d&&(u=u.mixedAdd(r.points[i].neg()));l=l.add(u)}return l.toP()},fh.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,i=uh(t,r,this._bitLength),s=this.jpoint(null,null,null),a=i.length-1;a>=0;a--){for(var c=0;a>=0&&0===i[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var l=i[a];hh(0!==l),s="affine"===e.type?l>0?s.mixedAdd(o[l-1>>1]):s.mixedAdd(o[-l-1>>1].neg()):l>0?s.add(o[l-1>>1]):s.add(o[-l-1>>1].neg())}return"affine"===e.type?s.toP():s},fh.prototype._wnafMulAdd=function(e,t,r,n,o){var i,s,a,c=this._wnafT1,l=this._wnafT2,u=this._wnafT3,d=0;for(i=0;i<n;i++){var h=(a=t[i])._getNAFPoints(e);c[i]=h.wnd,l[i]=h.points}for(i=n-1;i>=1;i-=2){var f=i-1,p=i;if(1===c[f]&&1===c[p]){var m=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(m[1]=t[f].add(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].add(t[p].neg())):(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=dh(r[f],r[p]);for(d=Math.max(y[0].length,d),u[f]=new Array(d),u[p]=new Array(d),s=0;s<d;s++){var b=0|y[0][s],v=0|y[1][s];u[f][s]=g[3*(b+1)+(v+1)],u[p][s]=0,l[f]=m}}else u[f]=uh(r[f],c[f],this._bitLength),u[p]=uh(r[p],c[p],this._bitLength),d=Math.max(u[f].length,d),d=Math.max(u[p].length,d)}var w=this.jpoint(null,null,null),x=this._wnafT4;for(i=d;i>=0;i--){for(var E=0;i>=0;){var A=!0;for(s=0;s<n;s++)x[s]=0|u[s][i],0!==x[s]&&(A=!1);if(!A)break;E++,i--}if(i>=0&&E++,w=w.dblp(E),i<0)break;for(s=0;s<n;s++){var R=x[s];0!==R&&(R>0?a=l[s][R-1>>1]:R<0&&(a=l[s][-R-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(i=0;i<n;i++)l[i]=null;return o?w:w.toP()},fh.BasePoint=mh,mh.prototype.eq=function(){throw new Error("Not implemented")},mh.prototype.validate=function(){return this.curve.validate(this)},fh.prototype.decodePoint=function(e,t){e=lh.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?hh(e[e.length-1]%2==0):7===e[0]&&hh(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},mh.prototype.encodeCompressed=function(e){return this.encode(e,!0)},mh.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},mh.prototype.encode=function(e,t){return lh.encode(this._encode(t),e)},mh.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},mh.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},mh.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,o=0;o<t;o+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},mh.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),o=1;o<r;o++)t[o]=t[o-1].add(n);return{wnd:e,points:t}},mh.prototype._getBeta=function(){return null},mh.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var gh=ih((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),yh=lh.assert;function bh(e){ph.call(this,"short",e),this.a=new oh(e.a,16).toRed(this.red),this.b=new oh(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}gh(bh,ph);var vh=bh;function wh(e,t,r,n){ph.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new oh(t,16),this.y=new oh(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function xh(e,t,r,n){ph.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new oh(0)):(this.x=new oh(t,16),this.y=new oh(r,16),this.z=new oh(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}bh.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new oh(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new oh(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],yh(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new oh(e.a,16),b:new oh(e.b,16)}})):this._getEndoBasis(r)}}},bh.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:oh.mont(e),r=new oh(2).toRed(t).redInvm(),n=r.redNeg(),o=new oh(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},bh.prototype._getEndoBasis=function(e){for(var t,r,n,o,i,s,a,c,l,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),f=new oh(1),p=new oh(0),m=new oh(0),g=new oh(1),y=0;0!==d.cmpn(0);){var b=h.div(d);c=h.sub(b.mul(d)),l=m.sub(b.mul(f));var v=g.sub(b.mul(p));if(!n&&c.cmp(u)<0)t=a.neg(),r=f,n=c.neg(),o=l;else if(n&&2==++y)break;a=c,h=d,d=c,m=f,f=l,g=p,p=v}i=c.neg(),s=l;var w=n.sqr().add(o.sqr());return i.sqr().add(s.sqr()).cmp(w)>=0&&(i=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),i.negative&&(i=i.neg(),s=s.neg()),[{a:n,b:o},{a:i,b:s}]},bh.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],o=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),s=o.mul(r.a),a=i.mul(n.a),c=o.mul(r.b),l=i.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(l).neg()}},bh.prototype.pointFromX=function(e,t){(e=new oh(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},bh.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),o=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(o).cmpn(0)},bh.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,o=this._endoWnafT2,i=0;i<e.length;i++){var s=this._endoSplit(t[i]),a=e[i],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*i]=a,n[2*i+1]=c,o[2*i]=s.k1,o[2*i+1]=s.k2}for(var l=this._wnafMulAdd(1,n,o,2*i,r),u=0;u<2*i;u++)n[u]=null,o[u]=null;return l},gh(wh,ph.BasePoint),bh.prototype.point=function(e,t,r){return new wh(this,e,t,r)},bh.prototype.pointFromJSON=function(e,t){return wh.fromJSON(this,e,t)},wh.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},wh.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},wh.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function o(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(o))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(o))}},n},wh.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},wh.prototype.isInfinity=function(){return this.inf},wh.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},wh.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),o=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=o.redSqr().redISub(this.x.redAdd(this.x)),s=o.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},wh.prototype.getX=function(){return this.x.fromRed()},wh.prototype.getY=function(){return this.y.fromRed()},wh.prototype.mul=function(e){return e=new oh(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},wh.prototype.mulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o):this.curve._wnafMulAdd(1,n,o,2)},wh.prototype.jmulAdd=function(e,t,r){var n=[this,t],o=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,o,!0):this.curve._wnafMulAdd(1,n,o,2,!0)},wh.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},wh.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},wh.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},gh(xh,ph.BasePoint),bh.prototype.jpoint=function(e,t,r){return new xh(this,e,t,r)},xh.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},xh.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},xh.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),o=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(o),c=i.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),d=n.redMul(l),h=c.redSqr().redIAdd(u).redISub(d).redISub(d),f=c.redMul(d.redISub(h)).redISub(i.redMul(u)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(h,f,p)},xh.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),o=this.y,i=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=o.redSub(i);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),u=r.redMul(c),d=a.redSqr().redIAdd(l).redISub(u).redISub(u),h=a.redMul(u.redISub(d)).redISub(o.redMul(l)),f=this.z.redMul(s);return this.curve.jpoint(d,h,f)},xh.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,o=this.curve.tinv,i=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),l=s.redAdd(s);for(t=0;t<e;t++){var u=i.redSqr(),d=l.redSqr(),h=d.redSqr(),f=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(c)),p=i.redMul(d),m=f.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=f.redMul(g);y=y.redIAdd(y).redISub(h);var b=l.redMul(a);t+1<e&&(c=c.redMul(h)),i=m,a=b,l=y}return this.curve.jpoint(i,l.redMul(o),a)},xh.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},xh.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),l=i.redIAdd(i);l=(l=l.redIAdd(l)).redIAdd(l),e=c,t=a.redMul(s.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),f=this.x.redAdd(d).redSqr().redISub(u).redISub(h);f=f.redIAdd(f);var p=u.redAdd(u).redIAdd(u),m=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},xh.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),o=this.y.redSqr(),i=o.redSqr(),s=this.x.redAdd(o).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var l=i.redIAdd(i);l=(l=l.redIAdd(l)).redIAdd(l),t=a.redMul(s.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),f=this.x.redSub(u).redMul(this.x.redAdd(u));f=f.redAdd(f).redIAdd(f);var p=h.redIAdd(h),m=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(u);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=f.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},xh.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,o=n.redSqr().redSqr(),i=t.redSqr(),s=r.redSqr(),a=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(o)),c=t.redAdd(t),l=(c=c.redIAdd(c)).redMul(s),u=a.redSqr().redISub(l.redAdd(l)),d=l.redISub(u),h=s.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=a.redMul(d).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(u,f,p)},xh.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),o=e.redAdd(e).redIAdd(e),i=o.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var l=o.redIAdd(s).redSqr().redISub(i).redISub(a).redISub(c),u=t.redMul(l);u=(u=u.redIAdd(u)).redIAdd(u);var d=this.x.redMul(a).redISub(u);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(l.redMul(c.redISub(l)).redISub(s.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,h,f)},xh.prototype.mul=function(e,t){return e=new oh(e,t),this.curve._wnafMul(this,e)},xh.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),o=r.redMul(e.z);return 0===this.y.redMul(o).redISub(e.y.redMul(n)).cmpn(0)},xh.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),o=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(o),0===this.x.cmp(r))return!0}},xh.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},xh.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Eh=ih((function(e,t){var r=t;r.base=ph,r.short=vh,r.mont=null,r.edwards=null})),Ah=ih((function(e,t){var r,n=t,o=lh.assert;function i(e){"short"===e.type?this.curve=new Eh.short(e):"edwards"===e.type?this.curve=new Eh.edwards(e):this.curve=new Eh.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Ud.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Ud.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Ud.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Ud.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Ud.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ud.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ud.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Ud.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Rh(e){if(!(this instanceof Rh))return new Rh(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=ch.toArray(e.entropy,e.entropyEnc||"hex"),r=ch.toArray(e.nonce,e.nonceEnc||"hex"),n=ch.toArray(e.pers,e.persEnc||"hex");sh(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var _h=Rh;Rh.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Rh.prototype._hmac=function(){return new Ud.hmac(this.hash,this.K)},Rh.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Rh.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=ch.toArray(e,t),r=ch.toArray(r,n),sh(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Rh.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=ch.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var i=o.slice(0,e);return this._update(r),this._reseed++,ch.encode(i,t)};var kh=lh.assert;function Sh(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var Nh=Sh;Sh.fromPublic=function(e,t,r){return t instanceof Sh?t:new Sh(e,{pub:t,pubEnc:r})},Sh.fromPrivate=function(e,t,r){return t instanceof Sh?t:new Sh(e,{priv:t,privEnc:r})},Sh.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Sh.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},Sh.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Sh.prototype._importPrivate=function(e,t){this.priv=new oh(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Sh.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?kh(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||kh(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},Sh.prototype.derive=function(e){return e.validate()||kh(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Sh.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Sh.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Sh.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Mh=lh.assert;function Th(e,t){if(e instanceof Th)return e;this._importDER(e,t)||(Mh(e.r&&e.s,"Signature without r or s"),this.r=new oh(e.r,16),this.s=new oh(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Oh=Th;function Ih(){this.place=0}function Fh(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var o=0,i=0,s=t.place;i<n;i++,s++)o<<=8,o|=e[s],o>>>=0;return!(o<=127)&&(t.place=s,o)}function Wh(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function Ch(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Th.prototype._importDER=function(e,t){e=lh.toArray(e,t);var r=new Ih;if(48!==e[r.place++])return!1;var n=Fh(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=Fh(e,r);if(!1===o)return!1;var i=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var s=Fh(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===i[0]){if(!(128&i[1]))return!1;i=i.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new oh(i),this.s=new oh(a),this.recoveryParam=null,!0},Th.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Wh(t),r=Wh(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];Ch(n,t.length),(n=n.concat(t)).push(2),Ch(n,r.length);var o=n.concat(r),i=[48];return Ch(i,o.length),i=i.concat(o),lh.encode(i,e)};var jh=function(){throw new Error("unsupported")},Uh=lh.assert;function Dh(e){if(!(this instanceof Dh))return new Dh(e);"string"==typeof e&&(Uh(Object.prototype.hasOwnProperty.call(Ah,e),"Unknown curve "+e),e=Ah[e]),e instanceof Ah.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Bh=Dh;Dh.prototype.keyPair=function(e){return new Nh(this,e)},Dh.prototype.keyFromPrivate=function(e,t){return Nh.fromPrivate(this,e,t)},Dh.prototype.keyFromPublic=function(e,t){return Nh.fromPublic(this,e,t)},Dh.prototype.genKeyPair=function(e){e||(e={});for(var t=new _h({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||jh(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new oh(2));;){var o=new oh(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},Dh.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Dh.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new oh(e,16));for(var o=this.n.byteLength(),i=t.getPrivate().toArray("be",o),s=e.toArray("be",o),a=new _h({hash:this.hash,entropy:i,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new oh(1)),l=0;;l++){var u=n.k?n.k(l):new oh(a.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(c)>=0)){var d=this.g.mul(u);if(!d.isInfinity()){var h=d.getX(),f=h.umod(this.n);if(0!==f.cmpn(0)){var p=u.invm(this.n).mul(f.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==h.cmp(f)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new Oh({r:f,s:p,recoveryParam:m})}}}}}},Dh.prototype.verify=function(e,t,r,n){e=this._truncateToN(new oh(e,16)),r=this.keyFromPublic(r,n);var o=(t=new Oh(t,"hex")).r,i=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;var s,a=i.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},Dh.prototype.recoverPubKey=function(e,t,r,n){Uh((3&r)===r,"The recovery param is more than two bits"),t=new Oh(t,n);var o=this.n,i=new oh(e),s=t.r,a=t.s,c=1&r,l=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");s=l?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var u=t.r.invm(o),d=o.sub(i).mul(u).umod(o),h=a.mul(u).umod(o);return this.g.mulAdd(d,s,h)},Dh.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Oh(t,n)).recoveryParam)return t.recoveryParam;for(var o=0;o<4;o++){var i;try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw new Error("Unable to find valid recovery factor")};var Vh=ih((function(e,t){var r=t;r.version="6.5.4",r.utils=lh,r.rand=function(){throw new Error("unsupported")},r.curve=Eh,r.curves=Ah,r.ec=Bh,r.eddsa=null})).ec;const Ph=new qi("signing-key/5.7.0");let Zh=null;function zh(){return Zh||(Zh=new Vh("secp256k1")),Zh}class Lh{constructor(e){la(this,"curve","secp256k1"),la(this,"privateKey",as(e)),32!==cs(this.privateKey)&&Ph.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=zh().keyFromPrivate(ns(this.privateKey));la(this,"publicKey","0x"+t.getPublic(!1,"hex")),la(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),la(this,"_isSigningKey",!0)}_addPoint(e){const t=zh().keyFromPublic(ns(this.publicKey)),r=zh().keyFromPublic(ns(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=zh().keyFromPrivate(ns(this.privateKey)),r=ns(e);32!==r.length&&Ph.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return fs({recoveryParam:n.recoveryParam,r:hs("0x"+n.r.toString(16),32),s:hs("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=zh().keyFromPrivate(ns(this.privateKey)),r=zh().keyFromPublic(ns(Hh(e)));return hs("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Hh(e,t){const r=ns(e);if(32===r.length){const e=new Lh(r);return t?"0x"+zh().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?as(r):"0x"+zh().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+zh().keyFromPublic(r).getPublic(!0,"hex"):as(r):Ph.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Yh=new qi("transactions/5.7.0");var Xh;function Jh(e){return"0x"===e?null:Ms(e)}function Gh(e){return"0x"===e?ra:ne.from(e)}function qh(e,t){return function(e){return Ms(ls(gs(ls(Hh(e),1)),12))}(function(e,t){const r=fs(t),n={r:ns(r.r),s:ns(r.s)};return"0x"+zh().recoverPubKey(ns(e),n,r.recoveryParam).encode("hex",!1)}(ns(e),t))}function Kh(e,t){const r=is(ne.from(e).toHexString());return r.length>32&&Yh.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Qh(e,t){return{address:Ms(e),storageKeys:(t||[]).map(((t,r)=>(32!==cs(t)&&Yh.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function $h(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&Yh.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Qh(e[0],e[1])):Qh(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Qh(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function ef(e){return $h(e).map((e=>[e.address,e.storageKeys]))}function tf(e,t){if(null!=e.gasPrice){const t=ne.from(e.gasPrice),r=ne.from(e.maxFeePerGas||0);t.eq(r)||Yh.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Kh(e.chainId||0,"chainId"),Kh(e.nonce||0,"nonce"),Kh(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Kh(e.maxFeePerGas||0,"maxFeePerGas"),Kh(e.gasLimit||0,"gasLimit"),null!=e.to?Ms(e.to):"0x",Kh(e.value||0,"value"),e.data||"0x",ef(e.accessList||[])];if(t){const e=fs(t);r.push(Kh(e.recoveryParam,"recoveryParam")),r.push(is(e.r)),r.push(is(e.s))}return us(["0x02",xs(r)])}function rf(e,t){const r=[Kh(e.chainId||0,"chainId"),Kh(e.nonce||0,"nonce"),Kh(e.gasPrice||0,"gasPrice"),Kh(e.gasLimit||0,"gasLimit"),null!=e.to?Ms(e.to):"0x",Kh(e.value||0,"value"),e.data||"0x",ef(e.accessList||[])];if(t){const e=fs(t);r.push(Kh(e.recoveryParam,"recoveryParam")),r.push(is(e.r)),r.push(is(e.s))}return us(["0x01",xs(r)])}function nf(e,t,r){try{const r=Gh(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){Yh.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=hs(t[1],32),e.s=hs(t[2],32);try{const t=gs(r(e));e.from=qh(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function of(e){const t=ns(e);if(t[0]>127)return function(e){const t=Rs(e);9!==t.length&&6!==t.length&&Yh.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Gh(t[0]).toNumber(),gasPrice:Gh(t[1]),gasLimit:Gh(t[2]),to:Jh(t[3]),value:Gh(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=ne.from(t[6]).toNumber()}catch(e){return r}if(r.r=hs(t[7],32),r.s=hs(t[8],32),ne.from(r.r).isZero()&&ne.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const o=t.slice(0,6);0!==r.chainId&&(o.push(as(r.chainId)),o.push("0x"),o.push("0x"),n-=2*r.chainId+8);const i=gs(xs(o));try{r.from=qh(i,{r:as(r.r),s:as(r.s),recoveryParam:n})}catch(e){}r.hash=gs(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=Rs(e.slice(1));8!==t.length&&11!==t.length&&Yh.throwArgumentError("invalid component count for transaction type: 1","payload",as(e));const r={type:1,chainId:Gh(t[0]).toNumber(),nonce:Gh(t[1]).toNumber(),gasPrice:Gh(t[2]),gasLimit:Gh(t[3]),to:Jh(t[4]),value:Gh(t[5]),data:t[6],accessList:$h(t[7])};return 8===t.length||(r.hash=gs(e),nf(r,t.slice(8),rf)),r}(t);case 2:return function(e){const t=Rs(e.slice(1));9!==t.length&&12!==t.length&&Yh.throwArgumentError("invalid component count for transaction type: 2","payload",as(e));const r=Gh(t[2]),n=Gh(t[3]),o={type:2,chainId:Gh(t[0]).toNumber(),nonce:Gh(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Gh(t[4]),to:Jh(t[5]),value:Gh(t[6]),data:t[7],accessList:$h(t[8])};return 9===t.length||(o.hash=gs(e),nf(o,t.slice(9),tf)),o}(t)}return Yh.throwError(`unsupported transaction type: ${t[0]}`,qi.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Xh||(Xh={}));const sf=new qi(rh);class af{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),o=this.data.bind(this),i=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:i,type:c,accessList:af.allowNull(this.accessList.bind(this),null),blockHash:af.allowNull(i,null),blockNumber:af.allowNull(a,null),transactionIndex:af.allowNull(a,null),confirmations:af.allowNull(a,null),from:t,gasPrice:af.allowNull(r),maxPriorityFeePerGas:af.allowNull(r),maxFeePerGas:af.allowNull(r),gasLimit:r,to:af.allowNull(t,null),value:r,nonce:a,data:o,r:af.allowNull(this.uint256),s:af.allowNull(this.uint256),v:af.allowNull(a),creates:af.allowNull(t,null),raw:af.allowNull(o)},e.transactionRequest={from:af.allowNull(t),nonce:af.allowNull(a),gasLimit:af.allowNull(r),gasPrice:af.allowNull(r),maxPriorityFeePerGas:af.allowNull(r),maxFeePerGas:af.allowNull(r),to:af.allowNull(t),value:af.allowNull(r),data:af.allowNull((e=>this.data(e,!0))),type:af.allowNull(a),accessList:af.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:i,address:t,topics:af.arrayOf(i),data:o,logIndex:a,blockHash:i},e.receipt={to:af.allowNull(this.address,null),from:af.allowNull(this.address,null),contractAddress:af.allowNull(t,null),transactionIndex:a,root:af.allowNull(s),gasUsed:r,logsBloom:af.allowNull(o),blockHash:i,transactionHash:i,logs:af.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:af.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:af.allowNull(r),status:af.allowNull(a),type:c},e.block={hash:af.allowNull(i),parentHash:i,number:a,timestamp:a,nonce:af.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:af.allowNull(t),extraData:o,transactions:af.allowNull(af.arrayOf(i)),baseFeePerGas:af.allowNull(r)},e.blockWithTransactions=ha(e.block),e.blockWithTransactions.transactions=af.allowNull(af.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:af.allowNull(n,void 0),toBlock:af.allowNull(n,void 0),blockHash:af.allowNull(i,void 0),address:af.allowNull(t,void 0),topics:af.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:af.allowNull(a),blockHash:af.allowNull(i),transactionIndex:a,removed:af.allowNull(this.boolean.bind(this)),address:t,data:af.allowFalsish(o,"0x"),topics:af.arrayOf(i),transactionHash:i,logIndex:a},e}accessList(e){return $h(e||[])}number(e){return"0x"===e?0:ne.from(e).toNumber()}type(e){return"0x"===e||null==e?0:ne.from(e).toNumber()}bigNumber(e){return ne.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),ss(e))?e.toLowerCase():sf.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return Ms(e)}callAddress(e){if(!ss(e,32))return null;const t=Ms(ls(e,12));return t===ea?null:t}contractAddress(e){return function(e){let t=null;try{t=Ms(e.from)}catch(t){_s.throwArgumentError("missing from address","transaction",e)}return Ms(ls(gs(xs([t,is(ns(ne.from(e.nonce).toHexString()))])),12))}(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||ss(e))return ds(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==cs(r)?sf.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=ne.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!ss(e))throw new Error("invalid uint256");return hs(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=af.check(t,e);return n._difficulty=null==r?null:ne.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return af.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&ne.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=af.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;ss(r)&&(r=ne.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),ss(r)&&(r=ne.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return of(e)}receiptLog(e){return af.check(this.formats.receiptLog,e)}receipt(e){const t=af.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=ne.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&sf.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):sf.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&sf.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return af.check(this.formats.filter,e)}filterLog(e){return af.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const o=e[n](t[n]);void 0!==o&&(r[n]=o)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var cf=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const lf=new qi(rh);function uf(e){return null==e?"null":(32!==cs(e)&&lf.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function df(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[uf(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return uf(e)})).join("&")}function hf(e){if("string"==typeof e){if(32===cs(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+df(e);if(_l.isForkEvent(e))throw lf.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+df(e.topics||[])}throw new Error("invalid event - "+e)}function ff(){return(new Date).getTime()}function pf(e){return new Promise((t=>{setTimeout(t,e)}))}const mf=["block","network","pending","poll"];class gf{constructor(e,t,r){la(this,"tag",e),la(this,"listener",t),la(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const o={};return r.length>0&&(o.topics=r),t&&"*"!==t&&(o.address=t),o}pollable(){return this.tag.indexOf(":")>=0||mf.indexOf(this.tag)>=0}}const yf={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 bf(e){return hs(ne.from(e).toHexString(),32)}function vf(e){return Cl.encode(os([e,ls(Dd(Dd(e)),0,4)]))}const wf=new RegExp("^(ipfs)://(.*)$","i"),xf=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),wf,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Ef(e,t){try{return uc(Af(e,t))}catch(e){}return null}function Af(e,t){if("0x"===e)return null;const r=ne.from(ls(e,t,t+32)).toNumber(),n=ne.from(ls(e,r,r+32)).toNumber();return ls(e,r+32,r+32+n)}function Rf(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):lf.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function _f(e){const t=ns(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function kf(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Sf(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const o=ns(e[n]);t[n]=_f(r),t.push(_f(o.length)),t.push(kf(o)),r+=32+32*Math.ceil(o.length/32)}return us(t)}class Nf{constructor(e,t,r,n){la(this,"provider",e),la(this,"name",r),la(this,"address",e.formatter.address(t)),la(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>ne.from(e).eq(1))).catch((e=>{if(e.code===qi.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return cf(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:us([e,zc(this.name),t||"0x"])};let n=!1;var o;(yield this.supportsWildcard())&&(n=!0,r.data=us(["0x9061b923",Sf([(o=this.name,as(os(Zc(o).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),r.data])]));try{let e=yield this.provider.call(r);return ns(e).length%32==4&&lf.throwError("resolver threw error",qi.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Af(e,0)),e}catch(e){if(e.code===qi.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return cf(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Af(r,0):null}))}_getAddress(e,t){const r=yf[String(e)];if(null==r&&lf.throwError(`unsupported coin type: ${e}`,qi.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=ns(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return vf(os([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return vf(os([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=th.toWords(n.slice(2));return e.unshift(t),th.encode(r.prefix,e)}}return null}getAddress(e){return cf(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===qi.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",bf(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&lf.throwError("invalid or unsupported coin data",qi.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return cf(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<xf.length;r++){const n=t.match(xf[r]);if(null==n)continue;const o=n[1].toLowerCase();switch(o){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:Rf(t)};case"erc721":case"erc1155":{const r="erc721"===o?"0xc87b56dd":"0x0e89341c";e.push({type:o,content:t});const i=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),c=hs(ne.from(s[1]).toHexString(),32);if("erc721"===o){const t=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:us(["0x6352211e",c])}));if(i!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===o){const t=ne.from(yield this.provider.call({to:a,data:us(["0x00fdd58e",hs(i,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const l={to:this.provider.formatter.address(s[0]),data:us([r,c])};let u=Ef(yield this.provider.call(l),0);if(null==u)return null;e.push({type:"metadata-url-base",content:u}),"erc1155"===o&&(u=u.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:u})),u.match(/^ipfs:/i)&&(u=Rf(u)),e.push({type:"metadata-url",content:u});const d=yield Hd(u);if(!d)return null;e.push({type:"metadata",content:JSON.stringify(d)});let h=d.image;if("string"!=typeof h)return null;if(h.match(/^(https:\/\/|data:)/i));else{if(null==h.match(wf))return null;e.push({type:"url-ipfs",content:h}),h=Rf(h)}return e.push({type:"url",content:h}),{linkage:e,url:h}}}}}catch(e){}return null}))}getContentHash(){return cf(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+Cl.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+Cl.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const o=e.match(/^0x90b2c605([0-9a-f]*)$/);if(o&&68===o[1].length){const e={"=":"","+":"-","/":"_"};return"sia://"+vc("0x"+o[1]).replace(/[=+\/]/g,(t=>e[t]))}return lf.throwError("invalid or unsupported content hash data",qi.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return cf(this,void 0,void 0,(function*(){let t=lc(e);t=os([bf(64),bf(t.length),t]),t.length%32!=0&&(t=os([t,hs("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",as(t));return null==r||"0x"===r?null:uc(r)}))}}let Mf=null,Tf=1;class Of extends kl{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),la(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=ua(new.target,"getNetwork")(e);t?(la(this,"_network",t),this.emit("network",t,null)):lf.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return cf(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||lf.throwError("no network detected",qi.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:la(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Yd((()=>this._ready().then((e=>e),(e=>{if(e.code!==qi.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Mf&&(Mf=new af),Mf}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in Fl){const r=Fl[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=Fl[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=Fl[e.name];if(!t)return"number"!=typeof e.chainId&&Sl.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&Sl.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return cf(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),o=t.toLowerCase(),i=[];for(let e=0;e<r.length;e++){const t=r[e],s=t.replace("{sender}",n).replace("{data}",o),a=t.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:n}),c=yield Hd({url:s,errorPassThrough:!0},a,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const l=c.message||"unknown error";if(c.status>=400&&c.status<500)return lf.throwError(`response not found during CCIP fetch: ${l}`,qi.errors.SERVER_ERROR,{url:t,errorMessage:l});i.push(l)}return lf.throwError(`error encountered during CCIP fetch: ${i.map((e=>JSON.stringify(e))).join(", ")}`,qi.errors.SERVER_ERROR,{urls:r,errorMessages:i})}))}_getInternalBlockNumber(e){return cf(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(ff()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=ff(),r=da({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const o=ff();return(e=ne.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:o}}));return this._internalBlockNumber=r,r.catch((e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return cf(this,void 0,void 0,(function*(){const e=Tf++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)lf.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",lf.makeError("network block skew detected",qi.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const o=n.toBlock-this._maxFilterBlockRange;o>n.fromBlock&&(n.fromBlock=o),n.fromBlock<0&&(n.fromBlock=0);const i=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(i)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return cf(this,void 0,void 0,(function*(){return lf.throwError("provider does not support network detection",qi.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return cf(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,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",t,e),yield pf(0),this._network;const r=lf.makeError("underlying network changed",qi.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){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((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=ff();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=ff(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return cf(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return cf(this,void 0,void 0,(function*(){const o=yield this.getTransactionReceipt(e);return(o?o.confirmations:0)>=t?o:new Promise(((o,i)=>{const s=[];let a=!1;const c=function(){return!!a||(a=!0,s.forEach((e=>{e()})),!1)},l=e=>{e.confirmations<t||c()||o(e)};if(this.on(e,l),s.push((()=>{this.removeListener(e,l)})),n){let r=n.startBlock,o=null;const l=s=>cf(this,void 0,void 0,(function*(){a||(yield pf(1e3),this.getTransactionCount(n.from).then((u=>cf(this,void 0,void 0,(function*(){if(!a){if(u<=n.nonce)r=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==o&&(o=r-3,o<n.startBlock&&(o=n.startBlock));o<=s;){if(a)return;const r=yield this.getBlockWithTransactions(o);for(let o=0;o<r.transactions.length;o++){const s=r.transactions[o];if(s.hash===e)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,t);if(c())return;let o="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?o="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(o="cancelled"),void i(lf.makeError("transaction was replaced",qi.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===o||"cancelled"===o,reason:o,replacement:this._wrapTransaction(s),hash:e,receipt:r}))}}o++}}a||this.once("block",l)}}))),(e=>{a||this.once("block",l)})))}));if(a)return;this.once("block",l),s.push((()=>{this.removeListener("block",l)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||i(lf.makeError("timeout exceeded",qi.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),s.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return cf(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return ne.from(e)}catch(t){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield da({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return ne.from(n)}catch(e){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield da({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return ne.from(n).toNumber()}catch(e){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield da({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return as(n)}catch(e){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield da({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>ds(e)))}),o=yield this.perform("getStorageAt",n);try{return as(o)}catch(e){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:o,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==cs(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&lf.throwError("Transaction hash mismatch from Provider.sendTransaction.",qi.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>cf(this,void 0,void 0,(function*(){let o;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const i=yield this._waitForTransaction(e.hash,t,n,o);return null==i&&0===t?null:(this._emitted["t:"+e.hash]=i.blockNumber,0===i.status&&lf.throwError("transaction failed",qi.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:i}),i)})),n}sendTransaction(e){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>as(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return cf(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?ne.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?as(e):null)))})),this.formatter.transactionRequest(yield da(r))}))}_getFilter(e){return cf(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield da(t))}))}_call(e,t,r){return cf(this,void 0,void 0,(function*(){r>=10&&lf.throwError("CCIP read exceeded maximum redirections",qi.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,o=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===o.substring(0,10)&&cs(o)%32==4)try{const i=ls(o,4),s=ls(i,0,32);ne.from(s).eq(n)||lf.throwError("CCIP Read sender did not match",qi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const a=[],c=ne.from(ls(i,32,64)).toNumber(),l=ne.from(ls(i,c,c+32)).toNumber(),u=ls(i,c+32);for(let t=0;t<l;t++){const r=Ef(u,32*t);null==r&&lf.throwError("CCIP Read contained corrupt URL string",qi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),a.push(r)}const d=Af(i,64);ne.from(ls(i,100,128)).isZero()||lf.throwError("CCIP Read callback selector included junk",qi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const h=ls(i,96,100),f=Af(i,128),p=yield this.ccipReadFetch(e,d,a);null==p&&lf.throwError("CCIP Read disabled or provided no URLs",qi.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o});const m={to:n,data:us([h,Sf([p,f])])};return this._call(m,t,r+1)}catch(e){if(e.code===qi.errors.SERVER_ERROR)throw e}try{return as(o)}catch(r){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:o,error:r})}}))}call(e,t){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield da({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(e){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield da({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return ne.from(r)}catch(e){return lf.throwError("bad result from backend",qi.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return cf(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&lf.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&lf.throwError("ENS name not configured",qi.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return cf(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if(ss(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),ss(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){lf.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return Yd((()=>cf(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;r<e.transactions.length;r++){const n=e.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map((e=>this._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return cf(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Yd((()=>cf(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return cf(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Yd((()=>cf(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return cf(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield da({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),af.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return cf(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return cf(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&lf.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return cf(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new Nf(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return cf(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||lf.throwError("network does not support ENS",qi.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+zc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return cf(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(ss(e))throw t}"string"!=typeof e&&lf.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return cf(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=Ef(yield this.call({to:r,data:"0x691f3431"+zc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return cf(this,void 0,void 0,(function*(){let t=null;if(ss(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new Nf(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==qi.errors.CALL_EXCEPTION)throw e}try{const e=Ef(yield this.call({to:n,data:"0x691f3431"+zc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==qi.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return lf.throwError(e+" not implemented",qi.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new gf(hf(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],o=hf(e);return this._events=this._events.filter((e=>e.tag!==o||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=hf(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=hf(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,o=hf(e);return this._events=this._events.filter((e=>e.tag!==o||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=hf(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var If=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Ff=new qi("abstract-signer/5.7.0"),Wf=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Cf=[qi.errors.INSUFFICIENT_FUNDS,qi.errors.NONCE_EXPIRED,qi.errors.REPLACEMENT_UNDERPRICED];class jf{constructor(){Ff.checkAbstract(new.target,jf),la(this,"_isSigner",!0)}getBalance(e){return If(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return If(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return If(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield da(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return If(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield da(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return If(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return If(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return If(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return If(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return If(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===Wf.indexOf(t)&&Ff.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=ha(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Ff.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return If(this,void 0,void 0,(function*(){const t=yield da(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>If(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Ff.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||Ff.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Ff.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&Ff.throwError("network does not support EIP-1559",qi.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Ff.throwError("failed to get consistent fee data",qi.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(Cf.indexOf(e.code)>=0)throw e;return Ff.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",qi.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Ff.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield da(t)}))}_checkProvider(e){this.provider||Ff.throwError("missing provider",qi.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}var Uf=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Df=new qi(rh),Bf=["call","estimateGas"];function Vf(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=ss(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=Vf(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return Vf(JSON.parse(e),t)}catch(e){}return null}function Pf(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=Vf(t,!0);if(e)return e.data;Df.throwError("missing revert data in call exception; Transaction reverted without a reason string",qi.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=Vf(t.body,!1);null==r&&(r=Vf(t,!1)),r&&Df.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",qi.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let o=t.message;throw t.code===qi.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?o=t.error.message:"string"==typeof t.body?o=t.body:"string"==typeof t.responseText&&(o=t.responseText),o=(o||"").toLowerCase(),o.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Df.throwError("insufficient funds for intrinsic transaction cost",qi.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),o.match(/nonce (is )?too low/i)&&Df.throwError("nonce has already been used",qi.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),o.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Df.throwError("replacement fee too low",qi.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),o.match(/only replay-protected/i)&&Df.throwError("legacy pre-eip-155 transactions not supported",qi.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),Bf.indexOf(e)>=0&&o.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Df.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",qi.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function Zf(e){return new Promise((function(t){setTimeout(t,e)}))}function zf(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Lf(e){return e?e.toLowerCase():e}const Hf={};class Yf extends jf{constructor(e,t,r){if(super(),e!==Hf)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");la(this,"provider",t),null==r&&(r=0),"string"==typeof r?(la(this,"_address",this.provider.formatter.address(r)),la(this,"_index",null)):"number"==typeof r?(la(this,"_index",r),la(this,"_address",null)):Df.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return Df.throwError("cannot alter JSON-RPC Signer connection",qi.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Xf(Hf,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&Df.throwError("unknown account #"+this._index,qi.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=ha(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=ha(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>Uf(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&Df.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),da({tx:da(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&Df.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&Df.throwError("user rejected transaction",qi.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),Pf("sendTransaction",e,n))))}))}signTransaction(e){return Df.throwError("signing transactions is unsupported",qi.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Uf(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Yd((()=>Uf(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return Uf(this,void 0,void 0,(function*(){const t="string"==typeof e?lc(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[as(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&Df.throwError("user rejected signing",qi.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return Uf(this,void 0,void 0,(function*(){const t="string"==typeof e?lc(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),as(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&Df.throwError("user rejected signing",qi.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return Uf(this,void 0,void 0,(function*(){const n=yield il.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),o=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(il.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&Df.throwError("user rejected signing",qi.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return Uf(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Xf extends Yf{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Jf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Gf extends Of{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=ua(this.constructor,"defaultUrl")()),la(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(ha(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Uf(this,void 0,void 0,(function*(){yield Zf(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=ua(this.constructor,"getNetwork");try{return t(ne.from(e).toNumber())}catch(t){return Df.throwError("could not detect network",qi.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return Df.throwError("could not detect network",qi.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Yf(Hf,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:ga(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const o=Hd(this.connection,JSON.stringify(r),zf).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=o,setTimeout((()=>{this._cache[e]=null}),0)),o}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Lf(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Lf(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Lf(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Lf(t.address),hs(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",[ua(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[ua(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Lf(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return Uf(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&ne.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ha(t)).transaction=ha(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&Df.throwError(e+" not implemented",qi.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return Pf(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const 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;let 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 Zf(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=ha(Jf);if(t)for(const e in t)t[e]&&(r[e]=!0);var n,o;o=r,(n=e)&&"object"==typeof n||ca.throwArgumentError("invalid object","object",n),Object.keys(n).forEach((e=>{o[e]||ca.throwArgumentError("invalid object key - "+e,"transaction:"+e,n)}));const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=ds(ne.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=as(e[t]))})),e.accessList&&(i.accessList=$h(e.accessList)),i}}function qf(e){return Number.parseInt(e,16)}new qi(rh);class Kf extends ee{constructor(e,t){super(e),this.customProvider=t,t.on("connect",(({chainId:e})=>{this.actions.update({chainId:qf(e)})})).on("disconnect",(e=>{var t;null===(t=this.onError)||void 0===t||t.call(this,e),this.actions.resetState()})).on("chainChanged",(e=>{this.actions.update({chainId:qf(e)})})).on("accountsChanged",(e=>{this.actions.update({accounts:e})}))}activate(){return Bs(this,void 0,void 0,(function*(){this.actions.startActivation();const e=this.customProvider;try{const[{chainId:t},r]=yield Promise.all([e.getNetwork(),e.listAccounts()]);this.actions.update({chainId:t,accounts:r})}catch(e){throw this.actions.resetState(),e}}))}}function Qf([e,t]){return[e,t]}var $f;function ep(){return ep=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ep.apply(this,arguments)}var tp,rp;function np(){return np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},np.apply(this,arguments)}var op;!function(e){e.INTEGRATOR="integrator",e.METAMASK="metamask",e.WALLET_CONNECT="walletConnect"}(op||(op={}));const ip={[op.METAMASK]:{name:"MetaMask",type:op.METAMASK,icon:function(e){return l.createElement("svg",ep({height:355,viewBox:"0 0 397 355",width:397,xmlns:"http://www.w3.org/2000/svg"},e),$f||($f=l.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(-1 -1)"},l.createElement("path",{d:"m114.622644 327.195472 52.004717 13.810198v-18.05949l4.245283-4.249292h29.716982v21.246459 14.872523h-31.839624l-39.268868-16.997169z",fill:"#cdbdb2"}),l.createElement("path",{d:"m199.528305 327.195472 50.943397 13.810198v-18.05949l4.245283-4.249292h29.716981v21.246459 14.872523h-31.839623l-39.268868-16.997169z",fill:"#cdbdb2",transform:"matrix(-1 0 0 1 483.96227 0)"}),l.createElement("path",{d:"m170.872644 287.889523-4.245283 35.056657 5.306604-4.249292h55.18868l6.367925 4.249292-4.245284-35.056657-8.490565-5.311615-42.452832 1.062323z",fill:"#393939"}),l.createElement("path",{d:"m142.216984 50.9915022 25.471698 59.4900858 11.674528 173.158643h41.391511l12.735849-173.158643 23.349056-59.4900858z",fill:"#f89c35"}),l.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),l.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),l.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),l.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),l.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 56.25-39.305949z",fill:"#eb8f35"}),l.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),l.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),l.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),l.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),l.createElement("path",{d:"m114.622644 327.195472 56.25-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3"}),l.createElement("path",{d:"m229.245286 327.195472 55.18868-39.305949-4.245283 33.994334v19.121813l-38.207548-7.43626z",fill:"#dfcec3",transform:"matrix(-1 0 0 1 513.679252 0)"}),l.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),l.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),l.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"}),l.createElement("g",{transform:"matrix(-1 0 0 1 399.056611 0)"},l.createElement("path",{d:"m30.7783023 181.657226-29.71698153 86.048161 74.29245393-4.249293h47.7594343v-37.181303l-2.122641-76.487253-10.613208 8.498583z",fill:"#f89d35"}),l.createElement("path",{d:"m87.0283032 191.218134 87.0283028 2.124646-9.551886 44.617563-41.391511-10.623229z",fill:"#d87c30"}),l.createElement("path",{d:"m87.0283032 192.280457 36.0849058 33.994334v33.994334z",fill:"#ea8d3a"}),l.createElement("path",{d:"m123.113209 227.337114 42.452831 10.623229 13.79717 45.679888-9.551886 5.311615-46.698115-27.620398z",fill:"#f89d35"}),l.createElement("path",{d:"m123.113209 261.331448-8.490565 65.864024 55.18868-38.243626z",fill:"#eb8f35"}),l.createElement("path",{d:"m174.056606 193.34278 5.306604 90.297451-15.919812-46.211049z",fill:"#ea8e3a"}),l.createElement("path",{d:"m74.2924539 262.393771 48.8207551-1.062323-8.490565 65.864024z",fill:"#d87c30"}),l.createElement("path",{d:"m24.4103777 355.878193 90.2122663-28.682721-40.3301901-64.801701-73.23113313 5.311616z",fill:"#eb8f35"}),l.createElement("path",{d:"m167.688682 110.481588-45.636793 38.243627-35.0235858 42.492919 87.0283028 3.186969z",fill:"#e8821e"}),l.createElement("path",{d:"m132.665096 212.464593-11.674528 24.433427 41.39151-10.623229z",fill:"#393939",transform:"matrix(-1 0 0 1 283.372646 0)"}),l.createElement("path",{d:"m23.349057 1.06232296 144.339625 109.41926504-24.410378-59.4900858z",fill:"#e88f35"}),l.createElement("path",{d:"m23.349057 1.06232296-19.10377392 58.42776294 10.61320772 63.7393781-7.42924541 4.249292 10.61320771 9.560906-8.49056617 7.436261 11.67452847 10.623229-7.4292454 6.373938 16.9811323 21.246459 79.5990577-24.433428c38.915096-31.161473 58.018869-47.096318 57.311322-47.804533-.707548-.708215-48.820756-37.1813036-144.339625-109.41926504z",fill:"#8e5a30"})))))},link:"https://metamask.io"},[op.WALLET_CONNECT]:{name:"WalletConnect",type:op.WALLET_CONNECT,icon:function(e){return l.createElement("svg",np({height:512,viewBox:"0 0 512 512",width:512,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),tp||(tp=l.createElement("radialGradient",{id:"a",cx:"0%",cy:"50%",r:"100%"},l.createElement("stop",{offset:0,stopColor:"#5d9df6"}),l.createElement("stop",{offset:1,stopColor:"#006fff"}))),rp||(rp=l.createElement("g",{fill:"none",fillRule:"evenodd"},l.createElement("path",{d:"m256 0c141.384896 0 256 114.615104 256 256s-114.615104 256-256 256-256-114.615104-256-256 114.615104-256 256-256z",fill:"url(#a)"}),l.createElement("path",{d:"m64.6917558 37.7088298c51.5328072-50.2784397 135.0839942-50.2784397 186.6167992 0l6.202057 6.0510906c2.57664 2.5139218 2.57664 6.5897948 0 9.1037177l-21.215998 20.6995759c-1.288321 1.2569619-3.3771 1.2569619-4.665421 0l-8.534766-8.3270205c-35.950573-35.0754962-94.237969-35.0754962-130.188544 0l-9.1400282 8.9175519c-1.2883217 1.2569609-3.3771016 1.2569609-4.6654208 0l-21.2159973-20.6995759c-2.5766403-2.5139229-2.5766403-6.5897958 0-9.1037177zm230.4934852 42.8089117 18.882279 18.4227262c2.576627 2.5139103 2.576642 6.5897593.000032 9.1036863l-85.141498 83.070358c-2.576623 2.513941-6.754182 2.513969-9.33084.000066-.00001-.00001-.000023-.000023-.000033-.000034l-60.428256-58.957451c-.64416-.628481-1.68855-.628481-2.33271 0-.000004.000004-.000008.000007-.000012.000011l-60.4269683 58.957408c-2.5766141 2.513947-6.7541746 2.51399-9.3308408.000092-.0000151-.000014-.0000309-.000029-.0000467-.000046l-85.14386774-83.071463c-2.57663928-2.513921-2.57663928-6.589795 0-9.1037163l18.88231264-18.4226955c2.5766393-2.5139222 6.7541993-2.5139222 9.3308397 0l60.4291347 58.9582758c.6441608.62848 1.6885495.62848 2.3327103 0 .0000095-.000009.0000182-.000018.0000277-.000025l60.4261065-58.9582508c2.576581-2.51398 6.754142-2.5140743 9.33084-.0002103.000037.0000354.000072.0000709.000107.0001063l60.429056 58.9583548c.644159.628479 1.688549.628479 2.332709 0l60.428079-58.9571925c2.57664-2.5139231 6.754199-2.5139231 9.330839 0z",fill:"#fff",fillRule:"nonzero",transform:"translate(98 160)"}))))}}},sp={};function ap({provider:e,jsonRpcUrlMap:t,defaultChainId:r}){const n=console.error,o=y((()=>function(e,t){if(t){if(Gf.isProvider(t))return Qf(Y((e=>new Kf(e,t))));if(Gf.isProvider(t.provider))throw new Error("Eip1193Bridge is experimental: pass your ethers Provider directly");return Qf(Y((r=>new K({actions:r,provider:t,onError:e}))))}}(n,e)),[n,e]),i=y((()=>function(e){return Qf(Y((t=>new $({actions:t,onError:e}))))}(n)),[n]),s=y((()=>t?Object.assign(Object.assign({},Fs),t):Fs),[t]),a=y((()=>function(e,t,r,n){return Qf(Y((o=>new Q({actions:o,options:{rpc:t,qrcode:e},onError:n,defaultChainId:r}))))}(!0,s,r,n)),[s,r,n]);return o&&(sp[op.INTEGRATOR]=o),sp[op.METAMASK]=i,sp[op.WALLET_CONNECT]=a,Object.values(sp)}function cp(){const{chainId:e}=H(),t=Z(qs);return y((()=>e||t||1),[e,t])}var lp={};function up(e){e&&(e.value=!0)}function dp(){}function hp(e){return void 0===e.size&&(e.size=e.__iterate(pp)),e.size}function fp(e,t){if("number"!=typeof t){var r=t>>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?hp(e)+t:t}function pp(){return!0}function mp(e,t,r){return(0===e&&!vp(e)||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function gp(e,t){return bp(e,t,0)}function yp(e,t){return bp(e,t,t)}function bp(e,t,r){return void 0===e?r:vp(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function vp(e){return e<0||0===e&&1/e==-1/0}function wp(e){return Boolean(e&&e["@@__IMMUTABLE_ITERABLE__@@"])}function xp(e){return Boolean(e&&e["@@__IMMUTABLE_KEYED__@@"])}function Ep(e){return Boolean(e&&e["@@__IMMUTABLE_INDEXED__@@"])}function Ap(e){return xp(e)||Ep(e)}var Rp=function(e){return wp(e)?e:Lp(e)},_p=function(e){function t(e){return xp(e)?e:Hp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Rp),kp=function(e){function t(e){return Ep(e)?e:Yp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Rp),Sp=function(e){function t(e){return wp(e)&&!Ap(e)?e:Xp(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Rp);Rp.Keyed=_p,Rp.Indexed=kp,Rp.Set=Sp;function Np(e){return Boolean(e&&e["@@__IMMUTABLE_SEQ__@@"])}function Mp(e){return Boolean(e&&e["@@__IMMUTABLE_RECORD__@@"])}function Tp(e){return wp(e)||Mp(e)}var Op="@@__IMMUTABLE_ORDERED__@@";function Ip(e){return Boolean(e&&e[Op])}var Fp="function"==typeof Symbol&&Symbol.iterator,Wp=Fp||"@@iterator",Cp=function(e){this.next=e};function jp(e,t,r,n){var o=0===e?t:1===e?r:[t,r];return n?n.value=o:n={value:o,done:!1},n}function Up(){return{value:void 0,done:!0}}function Dp(e){return!!Array.isArray(e)||!!Pp(e)}function Bp(e){return e&&"function"==typeof e.next}function Vp(e){var t=Pp(e);return t&&t.call(e)}function Pp(e){var t=e&&(Fp&&e[Fp]||e["@@iterator"]);if("function"==typeof t)return t}Cp.prototype.toString=function(){return"[Iterator]"},Cp.KEYS=0,Cp.VALUES=1,Cp.ENTRIES=2,Cp.prototype.inspect=Cp.prototype.toSource=function(){return this.toString()},Cp.prototype[Wp]=function(){return this};var Zp=Object.prototype.hasOwnProperty;function zp(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var Lp=function(e){function t(e){return null==e?Qp():Tp(e)?e.toSeq():function(e){var t=tm(e);if(t)return(n=Pp(r=e))&&n===r.entries?t.fromEntrySeq():function(e){var t=Pp(e);return t&&t===e.keys}(e)?t.toSetSeq():t;var r,n;if("object"==typeof e)return new Gp(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var r=this._cache;if(r){for(var n=r.length,o=0;o!==n;){var i=r[t?n-++o:o++];if(!1===e(i[1],i[0],this))break}return o}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var r=this._cache;if(r){var n=r.length,o=0;return new Cp((function(){if(o===n)return{value:void 0,done:!0};var i=r[t?n-++o:o++];return jp(e,i[0],i[1])}))}return this.__iteratorUncached(e,t)},t}(Rp),Hp=function(e){function t(e){return null==e?Qp().toKeyedSeq():wp(e)?xp(e)?e.toSeq():e.fromEntrySeq():Mp(e)?e.toSeq():$p(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(Lp),Yp=function(e){function t(e){return null==e?Qp():wp(e)?xp(e)?e.entrySeq():e.toIndexedSeq():Mp(e)?e.toSeq().entrySeq():em(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(Lp),Xp=function(e){function t(e){return(wp(e)&&!Ap(e)?e:Yp(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(Lp);Lp.isSeq=Np,Lp.Keyed=Hp,Lp.Set=Xp,Lp.Indexed=Yp,Lp.prototype["@@__IMMUTABLE_SEQ__@@"]=!0;var Jp=function(e){function t(e){this._array=e,this.size=e.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[fp(this,e)]:t},t.prototype.__iterate=function(e,t){for(var r=this._array,n=r.length,o=0;o!==n;){var i=t?n-++o:o++;if(!1===e(r[i],i,this))break}return o},t.prototype.__iterator=function(e,t){var r=this._array,n=r.length,o=0;return new Cp((function(){if(o===n)return{value:void 0,done:!0};var i=t?n-++o:o++;return jp(e,i,r[i])}))},t}(Yp),Gp=function(e){function t(e){var t=Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]);this._object=e,this._keys=t,this.size=t.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return Zp.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,o=n.length,i=0;i!==o;){var s=n[t?o-++i:i++];if(!1===e(r[s],s,this))break}return i},t.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,o=n.length,i=0;return new Cp((function(){if(i===o)return{value:void 0,done:!0};var s=n[t?o-++i:i++];return jp(e,s,r[s])}))},t}(Hp);Gp.prototype[Op]=!0;var qp,Kp=function(e){function t(e){this._collection=e,this.size=e.length||e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=Vp(this._collection),n=0;if(Bp(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,n++,this););return n},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=Vp(this._collection);if(!Bp(r))return new Cp(Up);var n=0;return new Cp((function(){var t=r.next();return t.done?t:jp(e,n++,t.value)}))},t}(Yp);function Qp(){return qp||(qp=new Jp([]))}function $p(e){var t=tm(e);if(t)return t.fromEntrySeq();if("object"==typeof e)return new Gp(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function em(e){var t=tm(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function tm(e){return zp(e)?new Jp(e):Dp(e)?new Kp(e):void 0}function rm(e){return Boolean(e&&e["@@__IMMUTABLE_MAP__@@"])}function nm(e){return rm(e)&&Ip(e)}function om(e){return Boolean(e&&"function"==typeof e.equals&&"function"==typeof e.hashCode)}function im(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(om(e)&&om(t)&&e.equals(t))}var sm="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function am(e){return e>>>1&1073741824|3221225471&e}var cm=Object.prototype.valueOf;function lm(e){if(null==e)return um(e);if("function"==typeof e.hashCode)return am(e.hashCode(e));var t,r=(t=e).valueOf!==cm&&"function"==typeof t.valueOf?t.valueOf(t):t;if(null==r)return um(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;t!==e&&(t^=4294967295*e);for(;e>4294967295;)t^=e/=4294967295;return am(t)}(r);case"string":return r.length>wm?function(e){var t=Am[e];void 0===t&&(t=dm(e),Em===xm&&(Em=0,Am={}),Em++,Am[e]=t);return t}(r):dm(r);case"object":case"function":return function(e){var t;if(gm&&void 0!==(t=mm.get(e)))return t;if(void 0!==(t=e[vm]))return t;if(!fm){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[vm]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=pm(),gm)mm.set(e,t);else{if(void 0!==hm&&!1===hm(e))throw new Error("Non-extensible objects are not allowed as keys.");if(fm)Object.defineProperty(e,vm,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[vm]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[vm]=t}}return t}(r);case"symbol":return function(e){var t=ym[e];if(void 0!==t)return t;return t=pm(),ym[e]=t,t}(r);default:if("function"==typeof r.toString)return dm(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function um(e){return null===e?1108378658:1108378659}function dm(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return am(t)}var hm=Object.isExtensible,fm=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}();function pm(){var e=++bm;return 1073741824&bm&&(bm=0),e}var mm,gm="function"==typeof WeakMap;gm&&(mm=new WeakMap);var ym=Object.create(null),bm=0,vm="__immutablehash__";"function"==typeof Symbol&&(vm=Symbol(vm));var wm=16,xm=255,Em=0,Am={},Rm=function(e){function t(e,t){this._iter=e,this._useKeys=t,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this._iter.get(e,t)},t.prototype.has=function(e){return this._iter.has(e)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var e=this,t=Tm(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},t.prototype.map=function(e,t){var r=this,n=Mm(this,e,t);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(e,t)}),n},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t,n){return e(t,n,r)}),t)},t.prototype.__iterator=function(e,t){return this._iter.__iterator(e,t)},t}(Hp);Rm.prototype[Op]=!0;var _m=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this,n=0;return t&&hp(this),this._iter.__iterate((function(o){return e(o,t?r.size-++n:n++,r)}),t)},t.prototype.__iterator=function(e,t){var r=this,n=this._iter.__iterator(1,t),o=0;return t&&hp(this),new Cp((function(){var i=n.next();return i.done?i:jp(e,t?r.size-++o:o++,i.value,i)}))},t}(Yp),km=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(e){return this._iter.includes(e)},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new Cp((function(){var t=r.next();return t.done?t:jp(e,t.value,t.value,t)}))},t}(Xp),Sm=function(e){function t(e){this._iter=e,this.size=e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){if(t){Pm(t);var n=wp(t);return e(n?t.get(1):t[1],n?t.get(0):t[0],r)}}),t)},t.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new Cp((function(){for(;;){var t=r.next();if(t.done)return t;var n=t.value;if(n){Pm(n);var o=wp(n);return jp(e,o?n.get(0):n[0],o?n.get(1):n[1],t)}}}))},t}(Hp);function Nm(e){var t=zm(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Lm,t.__iterateUncached=function(t,r){var n=this;return e.__iterate((function(e,r){return!1!==t(r,e,n)}),r)},t.__iteratorUncached=function(t,r){if(2===t){var n=e.__iterator(t,r);return new Cp((function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,r)},t}function Mm(e,t,r){var n=zm(e);return n.size=e.size,n.has=function(t){return e.has(t)},n.get=function(n,o){var i=e.get(n,lp);return i===lp?o:t.call(r,i,n,e)},n.__iterateUncached=function(n,o){var i=this;return e.__iterate((function(e,o,s){return!1!==n(t.call(r,e,o,s),o,i)}),o)},n.__iteratorUncached=function(n,o){var i=e.__iterator(2,o);return new Cp((function(){var o=i.next();if(o.done)return o;var s=o.value,a=s[0];return jp(n,a,t.call(r,s[1],a,e),o)}))},n}function Tm(e,t){var r=this,n=zm(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=Nm(e);return t.reverse=function(){return e.flip()},t}),n.get=function(r,n){return e.get(t?r:-1-r,n)},n.has=function(r){return e.has(t?r:-1-r)},n.includes=function(t){return e.includes(t)},n.cacheResult=Lm,n.__iterate=function(r,n){var o=this,i=0;return n&&hp(e),e.__iterate((function(e,s){return r(e,t?s:n?o.size-++i:i++,o)}),!n)},n.__iterator=function(n,o){var i=0;o&&hp(e);var s=e.__iterator(2,!o);return new Cp((function(){var e=s.next();if(e.done)return e;var a=e.value;return jp(n,t?a[0]:o?r.size-++i:i++,a[1],e)}))},n}function Om(e,t,r,n){var o=zm(e);return n&&(o.has=function(n){var o=e.get(n,lp);return o!==lp&&!!t.call(r,o,n,e)},o.get=function(n,o){var i=e.get(n,lp);return i!==lp&&t.call(r,i,n,e)?i:o}),o.__iterateUncached=function(o,i){var s=this,a=0;return e.__iterate((function(e,i,c){if(t.call(r,e,i,c))return a++,o(e,n?i:a-1,s)}),i),a},o.__iteratorUncached=function(o,i){var s=e.__iterator(2,i),a=0;return new Cp((function(){for(;;){var i=s.next();if(i.done)return i;var c=i.value,l=c[0],u=c[1];if(t.call(r,u,l,e))return jp(o,n?l:a++,u,i)}}))},o}function Im(e,t,r,n){var o=e.size;if(mp(t,r,o))return e;var i=gp(t,o),s=yp(r,o);if(i!=i||s!=s)return Im(e.toSeq().cacheResult(),t,r,n);var a,c=s-i;c==c&&(a=c<0?0:c);var l=zm(e);return l.size=0===a?a:e.size&&a||void 0,!n&&Np(e)&&a>=0&&(l.get=function(t,r){return(t=fp(this,t))>=0&&t<a?e.get(t+i,r):r}),l.__iterateUncached=function(t,r){var o=this;if(0===a)return 0;if(r)return this.cacheResult().__iterate(t,r);var s=0,c=!0,l=0;return e.__iterate((function(e,r){if(!c||!(c=s++<i))return l++,!1!==t(e,n?r:l-1,o)&&l!==a})),l},l.__iteratorUncached=function(t,r){if(0!==a&&r)return this.cacheResult().__iterator(t,r);if(0===a)return new Cp(Up);var o=e.__iterator(t,r),s=0,c=0;return new Cp((function(){for(;s++<i;)o.next();if(++c>a)return{value:void 0,done:!0};var e=o.next();return n||1===t||e.done?e:jp(t,c-1,0===t?void 0:e.value[1],e)}))},l}function Fm(e,t,r,n){var o=zm(e);return o.__iterateUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterate(o,i);var a=!0,c=0;return e.__iterate((function(e,i,l){if(!a||!(a=t.call(r,e,i,l)))return c++,o(e,n?i:c-1,s)})),c},o.__iteratorUncached=function(o,i){var s=this;if(i)return this.cacheResult().__iterator(o,i);var a=e.__iterator(2,i),c=!0,l=0;return new Cp((function(){var e,i,u;do{if((e=a.next()).done)return n||1===o?e:jp(o,l++,0===o?void 0:e.value[1],e);var d=e.value;i=d[0],u=d[1],c&&(c=t.call(r,u,i,s))}while(c);return 2===o?e:jp(o,i,u,e)}))},o}function Wm(e,t){var r=xp(e),n=[e].concat(t).map((function(e){return wp(e)?r&&(e=_p(e)):e=r?$p(e):em(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===n.length)return e;if(1===n.length){var o=n[0];if(o===e||r&&xp(o)||Ep(e)&&Ep(o))return o}var i=new Jp(n);return r?i=i.toKeyedSeq():Ep(e)||(i=i.toSetSeq()),(i=i.flatten(!0)).size=n.reduce((function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}}),0),i}function Cm(e,t,r){var n=zm(e);return n.__iterateUncached=function(o,i){if(i)return this.cacheResult().__iterate(o,i);var s=0,a=!1;return function e(c,l){c.__iterate((function(i,c){return(!t||l<t)&&wp(i)?e(i,l+1):(s++,!1===o(i,r?c:s-1,n)&&(a=!0)),!a}),i)}(e,0),s},n.__iteratorUncached=function(n,o){if(o)return this.cacheResult().__iterator(n,o);var i=e.__iterator(n,o),s=[],a=0;return new Cp((function(){for(;i;){var e=i.next();if(!1===e.done){var c=e.value;if(2===n&&(c=c[1]),t&&!(s.length<t)||!wp(c))return r?e:jp(n,a++,c,e);s.push(i),i=c.__iterator(n,o)}else i=s.pop()}return{value:void 0,done:!0}}))},n}function jm(e,t,r){t||(t=Hm);var n=xp(e),o=0,i=e.toSeq().map((function(t,n){return[n,t,o++,r?r(t,n,e):t]})).valueSeq().toArray();return i.sort((function(e,r){return t(e[3],r[3])||e[2]-r[2]})).forEach(n?function(e,t){i[t].length=2}:function(e,t){i[t]=e[1]}),n?Hp(i):Ep(e)?Yp(i):Xp(i)}function Um(e,t,r){if(t||(t=Hm),r){var n=e.toSeq().map((function(t,n){return[t,r(t,n,e)]})).reduce((function(e,r){return Dm(t,e[1],r[1])?r:e}));return n&&n[0]}return e.reduce((function(e,r){return Dm(t,e,r)?r:e}))}function Dm(e,t,r){var n=e(r,t);return 0===n&&r!==t&&(null==r||r!=r)||n>0}function Bm(e,t,r,n){var o=zm(e),i=new Jp(r).map((function(e){return e.size}));return o.size=n?i.max():i.min(),o.__iterate=function(e,t){for(var r,n=this.__iterator(1,t),o=0;!(r=n.next()).done&&!1!==e(r.value,o++,this););return o},o.__iteratorUncached=function(e,o){var i=r.map((function(e){return e=Rp(e),Vp(o?e.reverse():e)})),s=0,a=!1;return new Cp((function(){var r;return a||(r=i.map((function(e){return e.next()})),a=n?r.every((function(e){return e.done})):r.some((function(e){return e.done}))),a?{value:void 0,done:!0}:jp(e,s++,t.apply(null,r.map((function(e){return e.value}))))}))},o}function Vm(e,t){return e===t?e:Np(e)?t:e.constructor(t)}function Pm(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Zm(e){return xp(e)?_p:Ep(e)?kp:Sp}function zm(e){return Object.create((xp(e)?Hp:Ep(e)?Yp:Xp).prototype)}function Lm(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Lp.prototype.cacheResult.call(this)}function Hm(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e<t?-1:0}function Ym(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),o=0;o<r;o++)n[o]=e[o+t];return n}function Xm(e,t){if(!e)throw new Error(t)}function Jm(e){Xm(e!==1/0,"Cannot perform this action with an infinite size.")}function Gm(e){if(zp(e)&&"string"!=typeof e)return e;if(Ip(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}_m.prototype.cacheResult=Rm.prototype.cacheResult=km.prototype.cacheResult=Sm.prototype.cacheResult=Lm;var qm=Object.prototype.toString;function Km(e){return"object"==typeof e&&(Tp(e)||Array.isArray(e)||function(e){if(!e||"object"!=typeof e||"[object Object]"!==qm.call(e))return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var r=t,n=Object.getPrototypeOf(t);null!==n;)r=n,n=Object.getPrototypeOf(r);return r===t}(e))}function Qm(e){try{return"string"==typeof e?JSON.stringify(e):String(e)}catch(t){return JSON.stringify(e)}}function $m(e,t,r){return Tp(e)?e.get(t,r):function(e,t){return Tp(e)?e.has(t):Km(e)&&Zp.call(e,t)}(e,t)?"function"==typeof e.get?e.get(t):e[t]:r}function eg(e){if(Array.isArray(e))return Ym(e);var t={};for(var r in e)Zp.call(e,r)&&(t[r]=e[r]);return t}function tg(e,t,r,n){n||(n=r,r=void 0);var o=rg(Tp(e),e,Gm(t),0,r,n);return o===lp?r:o}function rg(e,t,r,n,o,i){var s=t===lp;if(n===r.length){var a=s?o:t,c=i(a);return c===a?t:c}if(!s&&!Km(t))throw new TypeError("Cannot update within non-data-structure value in path ["+r.slice(0,n).map(Qm)+"]: "+t);var l=r[n],u=s?lp:$m(t,l,lp),d=rg(u===lp?e:Tp(u),u,r,n+1,o,i);return d===u?t:d===lp?function(e,t){if(!Km(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Tp(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!Zp.call(e,t))return e;var r=eg(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}(t,l):function(e,t,r){if(!Km(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Tp(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(Zp.call(e,t)&&r===e[t])return e;var n=eg(e);return n[t]=r,n}(s?e?Fg():{}:t,l,d)}function ng(e,t){return function(e,t,r){return tg(e,t,lp,(function(){return r}))}(this,e,t)}function og(e){return function(e,t){return tg(e,t,(function(){return lp}))}(this,e)}function ig(e,t,r,n){return tg(e,[t],r,n)}function sg(e,t,r){return 1===arguments.length?e(this):ig(this,e,t,r)}function ag(e,t,r){return tg(this,e,t,r)}function cg(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return ug(this,e)}function lg(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return ug(this,t,e)}function ug(e,t,r){for(var n=[],o=0;o<t.length;o++){var i=_p(t[o]);0!==i.size&&n.push(i)}return 0===n.length?e:0!==e.toSeq().size||e.__ownerID||1!==n.length?e.withMutations((function(e){for(var t=r?function(t,n){ig(e,n,lp,(function(e){return e===lp?t:r(e,t,n)}))}:function(t,r){e.set(r,t)},o=0;o<n.length;o++)n[o].forEach(t)})):e.constructor(n[0])}function dg(e,t,r){return hg(e,t,function(e){function t(r,n,o){return Km(r)&&Km(n)&&(i=n,s=Lp(r),a=Lp(i),Ep(s)===Ep(a)&&xp(s)===xp(a))?hg(r,[n],t):e?e(r,n,o):n;var i,s,a}return t}(r))}function hg(e,t,r){if(!Km(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(Tp(e))return"function"==typeof r&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),o=e,i=n?kp:_p,s=n?function(t){o===e&&(o=eg(o)),o.push(t)}:function(t,n){var i=Zp.call(o,n),s=i&&r?r(o[n],t,n):t;i&&s===o[n]||(o===e&&(o=eg(o)),o[n]=s)},a=0;a<t.length;a++)i(t[a]).forEach(s);return o}function fg(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return dg(this,e)}function pg(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return dg(this,t,e)}function mg(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return tg(this,e,Fg(),(function(e){return hg(e,t)}))}function gg(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return tg(this,e,Fg(),(function(e){return dg(e,t)}))}function yg(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function bg(){return this.__ownerID?this:this.__ensureOwner(new dp)}function vg(){return this.__ensureOwner()}function wg(){return this.__altered}var xg=function(e){function t(t){return null==t?Fg():rm(t)&&!Ip(t)?t:Fg().withMutations((function(r){var n=e(t);Jm(n.size),n.forEach((function(e,t){return r.set(t,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Fg().withMutations((function(t){for(var r=0;r<e.length;r+=2){if(r+1>=e.length)throw new Error("Missing value for key: "+e[r]);t.set(e[r],e[r+1])}}))},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return Wg(this,e,t)},t.prototype.remove=function(e){return Wg(this,e,lp)},t.prototype.deleteAll=function(e){var t=Rp(e);return 0===t.size?this:this.withMutations((function(e){t.forEach((function(t){return e.remove(t)}))}))},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Fg()},t.prototype.sort=function(e){return oy(jm(this,e))},t.prototype.sortBy=function(e,t){return oy(jm(this,t,e))},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){n.forEach((function(o,i){n.set(i,e.call(t,o,i,r))}))}))},t.prototype.__iterator=function(e,t){return new Mg(this,e,t)},t.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate((function(t){return n++,e(t[1],t[0],r)}),t),n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ig(this.size,this._root,e,this.__hash):0===this.size?Fg():(this.__ownerID=e,this.__altered=!1,this)},t}(_p);xg.isMap=rm;var Eg=xg.prototype;Eg["@@__IMMUTABLE_MAP__@@"]=!0,Eg.delete=Eg.remove,Eg.removeAll=Eg.deleteAll,Eg.setIn=ng,Eg.removeIn=Eg.deleteIn=og,Eg.update=sg,Eg.updateIn=ag,Eg.merge=Eg.concat=cg,Eg.mergeWith=lg,Eg.mergeDeep=fg,Eg.mergeDeepWith=pg,Eg.mergeIn=mg,Eg.mergeDeepIn=gg,Eg.withMutations=yg,Eg.wasAltered=wg,Eg.asImmutable=vg,Eg["@@transducer/init"]=Eg.asMutable=bg,Eg["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},Eg["@@transducer/result"]=function(e){return e.asImmutable()};var Ag=function(e,t){this.ownerID=e,this.entries=t};Ag.prototype.get=function(e,t,r,n){for(var o=this.entries,i=0,s=o.length;i<s;i++)if(im(r,o[i][0]))return o[i][1];return n},Ag.prototype.update=function(e,t,r,n,o,i,s){for(var a=o===lp,c=this.entries,l=0,u=c.length;l<u&&!im(n,c[l][0]);l++);var d=l<u;if(d?c[l][1]===o:a)return this;if(up(s),(a||!d)&&up(i),!a||1!==c.length){if(!d&&!a&&c.length>=Vg)return function(e,t,r,n){e||(e=new dp);for(var o=new Sg(e,lm(r),[r,n]),i=0;i<t.length;i++){var s=t[i];o=o.update(e,0,void 0,s[0],s[1])}return o}(e,c,n,o);var h=e&&e===this.ownerID,f=h?c:Ym(c);return d?a?l===u-1?f.pop():f[l]=f.pop():f[l]=[n,o]:f.push([n,o]),h?(this.entries=f,this):new Ag(e,f)}};var Rg=function(e,t,r){this.ownerID=e,this.bitmap=t,this.nodes=r};Rg.prototype.get=function(e,t,r,n){void 0===t&&(t=lm(r));var o=1<<(31&(0===e?t:t>>>e)),i=this.bitmap;return 0==(i&o)?n:this.nodes[Dg(i&o-1)].get(e+5,t,r,n)},Rg.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=lm(n));var a=31&(0===t?r:r>>>t),c=1<<a,l=this.bitmap,u=0!=(l&c);if(!u&&o===lp)return this;var d=Dg(l&c-1),h=this.nodes,f=u?h[d]:void 0,p=Cg(f,e,t+5,r,n,o,i,s);if(p===f)return this;if(!u&&p&&h.length>=Pg)return function(e,t,r,n,o){for(var i=0,s=new Array(32),a=0;0!==r;a++,r>>>=1)s[a]=1&r?t[i++]:void 0;return s[n]=o,new _g(e,i+1,s)}(e,h,l,a,p);if(u&&!p&&2===h.length&&jg(h[1^d]))return h[1^d];if(u&&p&&1===h.length&&jg(p))return p;var m=e&&e===this.ownerID,g=u?p?l:l^c:l|c,y=u?p?Bg(h,d,p,m):function(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var o=new Array(n),i=0,s=0;s<n;s++)s===t&&(i=1),o[s]=e[s+i];return o}(h,d,m):function(e,t,r,n){var o=e.length+1;if(n&&t+1===o)return e[t]=r,e;for(var i=new Array(o),s=0,a=0;a<o;a++)a===t?(i[a]=r,s=-1):i[a]=e[a+s];return i}(h,d,p,m);return m?(this.bitmap=g,this.nodes=y,this):new Rg(e,g,y)};var _g=function(e,t,r){this.ownerID=e,this.count=t,this.nodes=r};_g.prototype.get=function(e,t,r,n){void 0===t&&(t=lm(r));var o=31&(0===e?t:t>>>e),i=this.nodes[o];return i?i.get(e+5,t,r,n):n},_g.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=lm(n));var a=31&(0===t?r:r>>>t),c=o===lp,l=this.nodes,u=l[a];if(c&&!u)return this;var d=Cg(u,e,t+5,r,n,o,i,s);if(d===u)return this;var h=this.count;if(u){if(!d&&--h<Zg)return function(e,t,r,n){for(var o=0,i=0,s=new Array(r),a=0,c=1,l=t.length;a<l;a++,c<<=1){var u=t[a];void 0!==u&&a!==n&&(o|=c,s[i++]=u)}return new Rg(e,o,s)}(e,l,h,a)}else h++;var f=e&&e===this.ownerID,p=Bg(l,a,d,f);return f?(this.count=h,this.nodes=p,this):new _g(e,h,p)};var kg=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entries=r};kg.prototype.get=function(e,t,r,n){for(var o=this.entries,i=0,s=o.length;i<s;i++)if(im(r,o[i][0]))return o[i][1];return n},kg.prototype.update=function(e,t,r,n,o,i,s){void 0===r&&(r=lm(n));var a=o===lp;if(r!==this.keyHash)return a?this:(up(s),up(i),Ug(this,e,t,r,[n,o]));for(var c=this.entries,l=0,u=c.length;l<u&&!im(n,c[l][0]);l++);var d=l<u;if(d?c[l][1]===o:a)return this;if(up(s),(a||!d)&&up(i),a&&2===u)return new Sg(e,this.keyHash,c[1^l]);var h=e&&e===this.ownerID,f=h?c:Ym(c);return d?a?l===u-1?f.pop():f[l]=f.pop():f[l]=[n,o]:f.push([n,o]),h?(this.entries=f,this):new kg(e,this.keyHash,f)};var Sg=function(e,t,r){this.ownerID=e,this.keyHash=t,this.entry=r};Sg.prototype.get=function(e,t,r,n){return im(r,this.entry[0])?this.entry[1]:n},Sg.prototype.update=function(e,t,r,n,o,i,s){var a=o===lp,c=im(n,this.entry[0]);return(c?o===this.entry[1]:a)?this:(up(s),a?void up(i):c?e&&e===this.ownerID?(this.entry[1]=o,this):new Sg(e,this.keyHash,[n,o]):(up(i),Ug(this,e,t,lm(n),[n,o])))},Ag.prototype.iterate=kg.prototype.iterate=function(e,t){for(var r=this.entries,n=0,o=r.length-1;n<=o;n++)if(!1===e(r[t?o-n:n]))return!1},Rg.prototype.iterate=_g.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,o=r.length-1;n<=o;n++){var i=r[t?o-n:n];if(i&&!1===i.iterate(e,t))return!1}},Sg.prototype.iterate=function(e,t){return e(this.entry)};var Ng,Mg=function(e){function t(e,t,r){this._type=t,this._reverse=r,this._stack=e._root&&Og(e._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var r=t.node,n=t.index++,o=void 0;if(r.entry){if(0===n)return Tg(e,r.entry)}else if(r.entries){if(n<=(o=r.entries.length-1))return Tg(e,r.entries[this._reverse?o-n:n])}else if(n<=(o=r.nodes.length-1)){var i=r.nodes[this._reverse?o-n:n];if(i){if(i.entry)return Tg(e,i.entry);t=this._stack=Og(i,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}},t}(Cp);function Tg(e,t){return jp(e,t[0],t[1])}function Og(e,t){return{node:e,index:0,__prev:t}}function Ig(e,t,r,n){var o=Object.create(Eg);return o.size=e,o._root=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Fg(){return Ng||(Ng=Ig(0))}function Wg(e,t,r){var n,o;if(e._root){var i={value:!1},s={value:!1};if(n=Cg(e._root,e.__ownerID,0,void 0,t,r,i,s),!s.value)return e;o=e.size+(i.value?r===lp?-1:1:0)}else{if(r===lp)return e;o=1,n=new Ag(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=o,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?Ig(o,n):Fg()}function Cg(e,t,r,n,o,i,s,a){return e?e.update(t,r,n,o,i,s,a):i===lp?e:(up(a),up(s),new Sg(t,n,[o,i]))}function jg(e){return e.constructor===Sg||e.constructor===kg}function Ug(e,t,r,n,o){if(e.keyHash===n)return new kg(t,n,[e.entry,o]);var i,s=31&(0===r?e.keyHash:e.keyHash>>>r),a=31&(0===r?n:n>>>r),c=s===a?[Ug(e,t,r+5,n,o)]:(i=new Sg(t,n,o),s<a?[e,i]:[i,e]);return new Rg(t,1<<s|1<<a,c)}function Dg(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Bg(e,t,r,n){var o=n?e:Ym(e);return o[t]=r,o}var Vg=8,Pg=16,Zg=8;function zg(e){return Boolean(e&&e["@@__IMMUTABLE_LIST__@@"])}var Lg=function(e){function t(t){var r=Kg();if(null==t)return r;if(zg(t))return t;var n=e(t),o=n.size;return 0===o?r:(Jm(o),o>0&&o<32?qg(0,o,5,null,new Yg(n.toArray())):r.withMutations((function(e){e.setSize(o),n.forEach((function(t,r){return e.set(r,t)}))})))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(e,t){if((e=fp(this,e))>=0&&e<this.size){var r=ey(this,e+=this._origin);return r&&r.array[31&e]}return t},t.prototype.set=function(e,t){return function(e,t,r){if((t=fp(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?ty(e,t).set(0,r):ty(e,0,t+1).set(t,r)}));t+=e._origin;var n=e._tail,o=e._root,i={value:!1};t>=ry(e._capacity)?n=Qg(n,e.__ownerID,0,t,r,i):o=Qg(o,e.__ownerID,e._level,t,r,i);if(!i.value)return e;if(e.__ownerID)return e._root=o,e._tail=n,e.__hash=void 0,e.__altered=!0,e;return qg(e._origin,e._capacity,e._level,o,n)}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):Kg()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(r){ty(r,0,t+e.length);for(var n=0;n<e.length;n++)r.set(t+n,e[n])}))},t.prototype.pop=function(){return ty(this,0,-1)},t.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){ty(t,-e.length);for(var r=0;r<e.length;r++)t.set(r,e[r])}))},t.prototype.shift=function(){return ty(this,1)},t.prototype.concat=function(){for(var t=arguments,r=[],n=0;n<arguments.length;n++){var o=t[n],i=e("string"!=typeof o&&Dp(o)?o:[o]);0!==i.size&&r.push(i)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations((function(e){r.forEach((function(t){return t.forEach((function(t){return e.push(t)}))}))})):this.constructor(r[0])},t.prototype.setSize=function(e){return ty(this,0,e)},t.prototype.map=function(e,t){var r=this;return this.withMutations((function(n){for(var o=0;o<r.size;o++)n.set(o,e.call(t,n.get(o),o,r))}))},t.prototype.slice=function(e,t){var r=this.size;return mp(e,t,r)?this:ty(this,gp(e,r),yp(t,r))},t.prototype.__iterator=function(e,t){var r=t?this.size:0,n=Gg(this,t);return new Cp((function(){var o=n();return o===Jg?{value:void 0,done:!0}:jp(e,t?--r:r++,o)}))},t.prototype.__iterate=function(e,t){for(var r,n=t?this.size:0,o=Gg(this,t);(r=o())!==Jg&&!1!==e(r,t?--n:n++,this););return n},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?qg(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):0===this.size?Kg():(this.__ownerID=e,this.__altered=!1,this)},t}(kp);Lg.isList=zg;var Hg=Lg.prototype;Hg["@@__IMMUTABLE_LIST__@@"]=!0,Hg.delete=Hg.remove,Hg.merge=Hg.concat,Hg.setIn=ng,Hg.deleteIn=Hg.removeIn=og,Hg.update=sg,Hg.updateIn=ag,Hg.mergeIn=mg,Hg.mergeDeepIn=gg,Hg.withMutations=yg,Hg.wasAltered=wg,Hg.asImmutable=vg,Hg["@@transducer/init"]=Hg.asMutable=bg,Hg["@@transducer/step"]=function(e,t){return e.push(t)},Hg["@@transducer/result"]=function(e){return e.asImmutable()};var Yg=function(e,t){this.array=e,this.ownerID=t};Yg.prototype.removeBefore=function(e,t,r){if(r===t?1<<t:0===this.array.length)return this;var n=r>>>t&31;if(n>=this.array.length)return new Yg([],e);var o,i=0===n;if(t>0){var s=this.array[n];if((o=s&&s.removeBefore(e,t-5,r))===s&&i)return this}if(i&&!o)return this;var a=$g(this,e);if(!i)for(var c=0;c<n;c++)a.array[c]=void 0;return o&&(a.array[n]=o),a},Yg.prototype.removeAfter=function(e,t,r){if(r===(t?1<<t:0)||0===this.array.length)return this;var n,o=r-1>>>t&31;if(o>=this.array.length)return this;if(t>0){var i=this.array[o];if((n=i&&i.removeAfter(e,t-5,r))===i&&o===this.array.length-1)return this}var s=$g(this,e);return s.array.splice(o+1),n&&(s.array[o]=n),s};var Xg,Jg={};function Gg(e,t){var r=e._origin,n=e._capacity,o=ry(n),i=e._tail;return s(e._root,e._level,0);function s(e,a,c){return 0===a?function(e,s){var a=s===o?i&&i.array:e&&e.array,c=s>r?0:r-s,l=n-s;l>32&&(l=32);return function(){if(c===l)return Jg;var e=t?--l:c++;return a&&a[e]}}(e,c):function(e,o,i){var a,c=e&&e.array,l=i>r?0:r-i>>o,u=1+(n-i>>o);u>32&&(u=32);return function(){for(;;){if(a){var e=a();if(e!==Jg)return e;a=null}if(l===u)return Jg;var r=t?--u:l++;a=s(c&&c[r],o-5,i+(r<<o))}}}(e,a,c)}}function qg(e,t,r,n,o,i,s){var a=Object.create(Hg);return a.size=t-e,a._origin=e,a._capacity=t,a._level=r,a._root=n,a._tail=o,a.__ownerID=i,a.__hash=s,a.__altered=!1,a}function Kg(){return Xg||(Xg=qg(0,0,5))}function Qg(e,t,r,n,o,i){var s,a=n>>>r&31,c=e&&a<e.array.length;if(!c&&void 0===o)return e;if(r>0){var l=e&&e.array[a],u=Qg(l,t,r-5,n,o,i);return u===l?e:((s=$g(e,t)).array[a]=u,s)}return c&&e.array[a]===o?e:(i&&up(i),s=$g(e,t),void 0===o&&a===s.array.length-1?s.array.pop():s.array[a]=o,s)}function $g(e,t){return t&&e&&t===e.ownerID?e:new Yg(e?e.array.slice():[],t)}function ey(e,t){if(t>=ry(e._capacity))return e._tail;if(t<1<<e._level+5){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&31],n-=5;return r}}function ty(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new dp,o=e._origin,i=e._capacity,s=o+t,a=void 0===r?i:r<0?i+r:o+r;if(s===o&&a===i)return e;if(s>=a)return e.clear();for(var c=e._level,l=e._root,u=0;s+u<0;)l=new Yg(l&&l.array.length?[void 0,l]:[],n),u+=1<<(c+=5);u&&(s+=u,o+=u,a+=u,i+=u);for(var d=ry(i),h=ry(a);h>=1<<c+5;)l=new Yg(l&&l.array.length?[l]:[],n),c+=5;var f=e._tail,p=h<d?ey(e,a-1):h>d?new Yg([],n):f;if(f&&h>d&&s<i&&f.array.length){for(var m=l=$g(l,n),g=c;g>5;g-=5){var y=d>>>g&31;m=m.array[y]=$g(m.array[y],n)}m.array[d>>>5&31]=f}if(a<i&&(p=p&&p.removeAfter(n,0,a)),s>=h)s-=h,a-=h,c=5,l=null,p=p&&p.removeBefore(n,0,s);else if(s>o||h<d){for(u=0;l;){var b=s>>>c&31;if(b!==h>>>c&31)break;b&&(u+=(1<<c)*b),c-=5,l=l.array[b]}l&&s>o&&(l=l.removeBefore(n,c,s-u)),l&&h<d&&(l=l.removeAfter(n,c,h-u)),u&&(s-=u,a-=u)}return e.__ownerID?(e.size=a-s,e._origin=s,e._capacity=a,e._level=c,e._root=l,e._tail=p,e.__hash=void 0,e.__altered=!0,e):qg(s,a,c,l,p)}function ry(e){return e<32?0:e-1>>>5<<5}var ny,oy=function(e){function t(e){return null==e?sy():nm(e)?e:sy().withMutations((function(t){var r=_p(e);Jm(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(e,t){var r=this._map.get(e);return void 0!==r?this._list.get(r)[1]:t},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):sy()},t.prototype.set=function(e,t){return ay(this,e,t)},t.prototype.remove=function(e){return ay(this,e,lp)},t.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],r)}),t)},t.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),r=this._list.__ensureOwner(e);return e?iy(t,r,e,this.__hash):0===this.size?sy():(this.__ownerID=e,this.__altered=!1,this._map=t,this._list=r,this)},t}(xg);function iy(e,t,r,n){var o=Object.create(oy.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function sy(){return ny||(ny=iy(Fg(),Kg()))}function ay(e,t,r){var n,o,i=e._map,s=e._list,a=i.get(t),c=void 0!==a;if(r===lp){if(!c)return e;s.size>=32&&s.size>=2*i.size?(n=(o=s.filter((function(e,t){return void 0!==e&&a!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(n.__ownerID=o.__ownerID=e.__ownerID)):(n=i.remove(t),o=a===s.size-1?s.pop():s.set(a,void 0))}else if(c){if(r===s.get(a)[1])return e;n=i,o=s.set(a,[t,r])}else n=i.set(t,s.size),o=s.set(s.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=o,e.__hash=void 0,e.__altered=!0,e):iy(n,o)}oy.isOrderedMap=nm,oy.prototype[Op]=!0,oy.prototype.delete=oy.prototype.remove;function cy(e){return Boolean(e&&e["@@__IMMUTABLE_STACK__@@"])}var ly=function(e){function t(e){return null==e?fy():cy(e)?e:fy().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var r=this._head;for(e=fp(this,e);r&&e--;)r=r.next;return r?r.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:e[n],next:r};return this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):hy(t,r)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&cy(t))return t;Jm(t.size);var r=this.size,n=this._head;return t.__iterate((function(e){r++,n={value:e,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):hy(r,n)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):fy()},t.prototype.slice=function(t,r){if(mp(t,r,this.size))return this;var n=gp(t,this.size);if(yp(r,this.size)!==this.size)return e.prototype.slice.call(this,t,r);for(var o=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):hy(o,i)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?hy(this.size,this._head,e,this.__hash):0===this.size?fy():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var r=this;if(t)return new Jp(this.toArray()).__iterate((function(t,n){return e(t,n,r)}),t);for(var n=0,o=this._head;o&&!1!==e(o.value,n++,this);)o=o.next;return n},t.prototype.__iterator=function(e,t){if(t)return new Jp(this.toArray()).__iterator(e,t);var r=0,n=this._head;return new Cp((function(){if(n){var t=n.value;return n=n.next,jp(e,r++,t)}return{value:void 0,done:!0}}))},t}(kp);ly.isStack=cy;var uy,dy=ly.prototype;function hy(e,t,r,n){var o=Object.create(dy);return o.size=e,o._head=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function fy(){return uy||(uy=hy(0))}dy["@@__IMMUTABLE_STACK__@@"]=!0,dy.shift=dy.pop,dy.unshift=dy.push,dy.unshiftAll=dy.pushAll,dy.withMutations=yg,dy.wasAltered=wg,dy.asImmutable=vg,dy["@@transducer/init"]=dy.asMutable=bg,dy["@@transducer/step"]=function(e,t){return e.unshift(t)},dy["@@transducer/result"]=function(e){return e.asImmutable()};function py(e){return Boolean(e&&e["@@__IMMUTABLE_SET__@@"])}function my(e){return py(e)&&Ip(e)}function gy(e,t){if(e===t)return!0;if(!wp(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||xp(e)!==xp(t)||Ep(e)!==Ep(t)||Ip(e)!==Ip(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!Ap(e);if(Ip(e)){var n=e.entries();return t.every((function(e,t){var o=n.next().value;return o&&im(o[1],e)&&(r||im(o[0],t))}))&&n.next().done}var o=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var s=!0,a=t.__iterate((function(t,n){if(r?!e.has(t):o?!im(t,e.get(n,lp)):!im(e.get(n,lp),t))return s=!1,!1}));return s&&e.size===a}function yy(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function by(e){if(!e||"object"!=typeof e)return e;if(!wp(e)){if(!Km(e))return e;e=Lp(e)}if(xp(e)){var t={};return e.__iterate((function(e,r){t[r]=by(e)})),t}var r=[];return e.__iterate((function(e){r.push(by(e))})),r}var vy=function(e){function t(t){return null==t?Ry():py(t)&&!Ip(t)?t:Ry().withMutations((function(r){var n=e(t);Jm(n.size),n.forEach((function(e){return r.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(_p(e).keySeq())},t.intersect=function(e){return(e=Rp(e).toArray()).length?xy.intersect.apply(t(e.pop()),e):Ry()},t.union=function(e){return(e=Rp(e).toArray()).length?xy.union.apply(t(e.pop()),e):Ry()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(e){return this._map.has(e)},t.prototype.add=function(e){return Ey(this,this._map.set(e,e))},t.prototype.remove=function(e){return Ey(this,this._map.remove(e))},t.prototype.clear=function(){return Ey(this,this._map.clear())},t.prototype.map=function(e,t){var r=this,n=!1,o=Ey(this,this._map.mapEntries((function(o){var i=o[1],s=e.call(t,i,i,r);return s!==i&&(n=!0),[s,s]}),t));return n?o:this},t.prototype.union=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return t=t.filter((function(e){return 0!==e.size})),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(r){for(var n=0;n<t.length;n++)e(t[n]).forEach((function(e){return r.add(e)}))})):this.constructor(t[0])},t.prototype.intersect=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.every((function(t){return t.includes(e)}))||n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.subtract=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(0===t.length)return this;t=t.map((function(t){return e(t)}));var n=[];return this.forEach((function(e){t.some((function(t){return t.includes(e)}))&&n.push(e)})),this.withMutations((function(e){n.forEach((function(t){e.remove(t)}))}))},t.prototype.sort=function(e){return Zy(jm(this,e))},t.prototype.sortBy=function(e,t){return Zy(jm(this,t,e))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate((function(t){return e(t,t,r)}),t)},t.prototype.__iterator=function(e,t){return this._map.__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):0===this.size?this.__empty():(this.__ownerID=e,this._map=t,this)},t}(Sp);vy.isSet=py;var wy,xy=vy.prototype;function Ey(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function Ay(e,t){var r=Object.create(xy);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function Ry(){return wy||(wy=Ay(Fg()))}xy["@@__IMMUTABLE_SET__@@"]=!0,xy.delete=xy.remove,xy.merge=xy.concat=xy.union,xy.withMutations=yg,xy.asImmutable=vg,xy["@@transducer/init"]=xy.asMutable=bg,xy["@@transducer/step"]=function(e,t){return e.add(t)},xy["@@transducer/result"]=function(e){return e.asImmutable()},xy.__empty=Ry,xy.__make=Ay;var _y,ky=function(e){function t(e,r,n){if(!(this instanceof t))return new t(e,r,n);if(Xm(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===r&&(r=1/0),n=void 0===n?1:Math.abs(n),r<e&&(n=-n),this._start=e,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-e)/n-1)+1),0===this.size){if(_y)return _y;_y=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},t.prototype.get=function(e,t){return this.has(e)?this._start+fp(this,e)*this._step:t},t.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},t.prototype.slice=function(e,r){return mp(e,r,this.size)?this:(e=gp(e,this.size),(r=yp(r,this.size))<=e?new t(0,0):new t(this.get(e,this._end),this.get(r,this._end),this._step))},t.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var r=t/this._step;if(r>=0&&r<this.size)return r}return-1},t.prototype.lastIndexOf=function(e){return this.indexOf(e)},t.prototype.__iterate=function(e,t){for(var r=this.size,n=this._step,o=t?this._start+(r-1)*n:this._start,i=0;i!==r&&!1!==e(o,t?r-++i:i++,this);)o+=t?-n:n;return i},t.prototype.__iterator=function(e,t){var r=this.size,n=this._step,o=t?this._start+(r-1)*n:this._start,i=0;return new Cp((function(){if(i===r)return{value:void 0,done:!0};var s=o;return o+=t?-n:n,jp(e,t?r-++i:i++,s)}))},t.prototype.equals=function(e){return e instanceof t?this._start===e._start&&this._end===e._end&&this._step===e._step:gy(this,e)},t}(Yp);function Sy(e,t,r){for(var n=Gm(t),o=0;o!==n.length;)if((e=$m(e,n[o++],lp))===lp)return r;return e}function Ny(e,t){return Sy(this,e,t)}function My(){Jm(this.size);var e={};return this.__iterate((function(t,r){e[r]=t})),e}Rp.isIterable=wp,Rp.isKeyed=xp,Rp.isIndexed=Ep,Rp.isAssociative=Ap,Rp.isOrdered=Ip,Rp.Iterator=Cp,yy(Rp,{toArray:function(){Jm(this.size);var e=new Array(this.size||0),t=xp(this),r=0;return this.__iterate((function(n,o){e[r++]=t?[o,n]:n})),e},toIndexedSeq:function(){return new _m(this)},toJS:function(){return by(this)},toKeyedSeq:function(){return new Rm(this,!0)},toMap:function(){return xg(this.toKeyedSeq())},toObject:My,toOrderedMap:function(){return oy(this.toKeyedSeq())},toOrderedSet:function(){return Zy(xp(this)?this.valueSeq():this)},toSet:function(){return vy(xp(this)?this.valueSeq():this)},toSetSeq:function(){return new km(this)},toSeq:function(){return Ep(this)?this.toIndexedSeq():xp(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return ly(xp(this)?this.valueSeq():this)},toList:function(){return Lg(xp(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Vm(this,Wm(this,e))},includes:function(e){return this.some((function(t){return im(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){Jm(this.size);var r=!0;return this.__iterate((function(n,o,i){if(!e.call(t,n,o,i))return r=!1,!1})),r},filter:function(e,t){return Vm(this,Om(this,e,t,!0))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return Jm(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Jm(this.size),e=void 0!==e?""+e:",";var t="",r=!0;return this.__iterate((function(n){r?r=!1:t+=e,t+=null!=n?n.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return Vm(this,Mm(this,e,t))},reduce:function(e,t,r){return Wy(this,e,t,r,arguments.length<2,!1)},reduceRight:function(e,t,r){return Wy(this,e,t,r,arguments.length<2,!0)},reverse:function(){return Vm(this,Tm(this,!0))},slice:function(e,t){return Vm(this,Im(this,e,t,!0))},some:function(e,t){return!this.every(Uy(e),t)},sort:function(e){return Vm(this,jm(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return hp(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,r){var n=xg().asMutable();return e.__iterate((function(o,i){n.update(t.call(r,o,i,e),0,(function(e){return e+1}))})),n.asImmutable()}(this,e,t)},equals:function(e){return gy(this,e)},entrySeq:function(){var e=this;if(e._cache)return new Jp(e._cache);var t=e.toSeq().map(jy).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Uy(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate((function(r,o,i){if(e.call(t,r,o,i))return n=[o,r],!1})),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(e){return this.find(pp,null,e)},flatMap:function(e,t){return Vm(this,function(e,t,r){var n=Zm(e);return e.toSeq().map((function(o,i){return n(t.call(r,o,i,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Vm(this,Cm(this,e,!0))},fromEntrySeq:function(){return new Sm(this)},get:function(e,t){return this.find((function(t,r){return im(r,e)}),void 0,t)},getIn:Ny,groupBy:function(e,t){return function(e,t,r){var n=xp(e),o=(Ip(e)?oy():xg()).asMutable();e.__iterate((function(i,s){o.update(t.call(r,i,s,e),(function(e){return(e=e||[]).push(n?[s,i]:i),e}))}));var i=Zm(e);return o.map((function(t){return Vm(e,i(t))})).asImmutable()}(this,e,t)},has:function(e){return this.get(e,lp)!==lp},hasIn:function(e){return Sy(this,e,lp)!==lp},isSubset:function(e){return e="function"==typeof e.includes?e:Rp(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:Rp(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return im(t,e)}))},keySeq:function(){return this.toSeq().map(Cy).toIndexedSeq()},last:function(e){return this.toSeq().reverse().first(e)},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Um(this,e)},maxBy:function(e,t){return Um(this,t,e)},min:function(e){return Um(this,e?Dy(e):Vy)},minBy:function(e,t){return Um(this,t?Dy(t):Vy,e)},rest:function(){return this.slice(1)},skip:function(e){return 0===e?this:this.slice(Math.max(0,e))},skipLast:function(e){return 0===e?this:this.slice(0,-Math.max(0,e))},skipWhile:function(e,t){return Vm(this,Fm(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Uy(e),t)},sortBy:function(e,t){return Vm(this,jm(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return this.slice(-Math.max(0,e))},takeWhile:function(e,t){return Vm(this,function(e,t,r){var n=zm(e);return n.__iterateUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterate(n,o);var s=0;return e.__iterate((function(e,o,a){return t.call(r,e,o,a)&&++s&&n(e,o,i)})),s},n.__iteratorUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterator(n,o);var s=e.__iterator(2,o),a=!0;return new Cp((function(){if(!a)return{value:void 0,done:!0};var e=s.next();if(e.done)return e;var o=e.value,c=o[0],l=o[1];return t.call(r,l,c,i)?2===n?e:jp(n,c,l,e):(a=!1,{value:void 0,done:!0})}))},n}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Uy(e),t)},update:function(e){return e(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=Ip(e),r=xp(e),n=t?1:0,o=e.__iterate(r?t?function(e,t){n=31*n+Py(lm(e),lm(t))|0}:function(e,t){n=n+Py(lm(e),lm(t))|0}:t?function(e){n=31*n+lm(e)|0}:function(e){n=n+lm(e)|0});return function(e,t){return t=sm(t,3432918353),t=sm(t<<15|t>>>-15,461845907),t=sm(t<<13|t>>>-13,5),t=sm((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=am((t=sm(t^t>>>13,3266489909))^t>>>16)}(o,n)}(this))}});var Ty=Rp.prototype;Ty["@@__IMMUTABLE_ITERABLE__@@"]=!0,Ty[Wp]=Ty.values,Ty.toJSON=Ty.toArray,Ty.__toStringMapper=Qm,Ty.inspect=Ty.toSource=function(){return this.toString()},Ty.chain=Ty.flatMap,Ty.contains=Ty.includes,yy(_p,{flip:function(){return Vm(this,Nm(this))},mapEntries:function(e,t){var r=this,n=0;return Vm(this,this.toSeq().map((function(o,i){return e.call(t,[i,o],n++,r)})).fromEntrySeq())},mapKeys:function(e,t){var r=this;return Vm(this,this.toSeq().flip().map((function(n,o){return e.call(t,n,o,r)})).flip())}});var Oy=_p.prototype;Oy["@@__IMMUTABLE_KEYED__@@"]=!0,Oy[Wp]=Ty.entries,Oy.toJSON=My,Oy.__toStringMapper=function(e,t){return Qm(t)+": "+Qm(e)},yy(kp,{toKeyedSeq:function(){return new Rm(this,!1)},filter:function(e,t){return Vm(this,Om(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Vm(this,Tm(this,!1))},slice:function(e,t){return Vm(this,Im(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(t||0,0),0===r||2===r&&!t)return this;e=gp(e,e<0?this.count():this.size);var n=this.slice(0,e);return Vm(this,1===r?n:n.concat(Ym(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return Vm(this,Cm(this,e,!1))},get:function(e,t){return(e=fp(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,r){return r===e}),void 0,t)},has:function(e){return(e=fp(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Vm(this,function(e,t){var r=zm(e);return r.size=e.size&&2*e.size-1,r.__iterateUncached=function(r,n){var o=this,i=0;return e.__iterate((function(e){return(!i||!1!==r(t,i++,o))&&!1!==r(e,i++,o)}),n),i},r.__iteratorUncached=function(r,n){var o,i=e.__iterator(1,n),s=0;return new Cp((function(){return(!o||s%2)&&(o=i.next()).done?o:s%2?jp(r,s++,t):jp(r,s++,o.value,o)}))},r}(this,e))},interleave:function(){var e=[this].concat(Ym(arguments)),t=Bm(this.toSeq(),Yp.of,e),r=t.flatten(!0);return t.size&&(r.size=t.size*e.length),Vm(this,r)},keySeq:function(){return ky(0,this.size)},last:function(e){return this.get(-1,e)},skipWhile:function(e,t){return Vm(this,Fm(this,e,t,!1))},zip:function(){var e=[this].concat(Ym(arguments));return Vm(this,Bm(this,By,e))},zipAll:function(){var e=[this].concat(Ym(arguments));return Vm(this,Bm(this,By,e,!0))},zipWith:function(e){var t=Ym(arguments);return t[0]=this,Vm(this,Bm(this,e,t))}});var Iy=kp.prototype;Iy["@@__IMMUTABLE_INDEXED__@@"]=!0,Iy[Op]=!0,yy(Sp,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}});var Fy=Sp.prototype;function Wy(e,t,r,n,o,i){return Jm(e.size),e.__iterate((function(e,i,s){o?(o=!1,r=e):r=t.call(n,r,e,i,s)}),i),r}function Cy(e,t){return t}function jy(e,t){return[t,e]}function Uy(e){return function(){return!e.apply(this,arguments)}}function Dy(e){return function(){return-e.apply(this,arguments)}}function By(){return Ym(arguments)}function Vy(e,t){return e<t?1:e>t?-1:0}function Py(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}Fy.has=Ty.includes,Fy.contains=Fy.includes,Fy.keys=Fy.values,yy(Hp,Oy),yy(Yp,Iy),yy(Xp,Fy);var Zy=function(e){function t(e){return null==e?Yy():my(e)?e:Yy().withMutations((function(t){var r=Sp(e);Jm(r.size),r.forEach((function(e){return t.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(_p(e).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(vy);Zy.isOrderedSet=my;var zy,Ly=Zy.prototype;function Hy(e,t){var r=Object.create(Ly);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function Yy(){return zy||(zy=Hy(sy()))}Ly[Op]=!0,Ly.zip=Iy.zip,Ly.zipWith=Iy.zipWith,Ly.zipAll=Iy.zipAll,Ly.__empty=Yy,Ly.__make=Hy;var Xy=function(e,t){var r;!function(e){if(Mp(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Tp(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===e||"object"!=typeof e)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(e);var n=function(i){var s=this;if(i instanceof n)return i;if(!(this instanceof n))return new n(i);if(!r){r=!0;var a=Object.keys(e),c=o._indices={};o._name=t,o._keys=a,o._defaultValues=e;for(var l=0;l<a.length;l++){var u=a[l];c[u]=l,o[u]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+qy(this)+' with property "'+u+'" since that property name is part of the Record API.'):Qy(o,u)}}return this.__ownerID=void 0,this._values=Lg().withMutations((function(e){e.setSize(s._keys.length),_p(i).forEach((function(t,r){e.set(s._indices[r],t===s._defaultValues[r]?void 0:t)}))})),this},o=n.prototype=Object.create(Jy);return o.constructor=n,t&&(n.displayName=t),n};Xy.prototype.toString=function(){for(var e,t=qy(this)+" { ",r=this._keys,n=0,o=r.length;n!==o;n++)t+=(n?", ":"")+(e=r[n])+": "+Qm(this.get(e));return t+" }"},Xy.prototype.equals=function(e){return this===e||Mp(e)&&Ky(this).equals(Ky(e))},Xy.prototype.hashCode=function(){return Ky(this).hashCode()},Xy.prototype.has=function(e){return this._indices.hasOwnProperty(e)},Xy.prototype.get=function(e,t){if(!this.has(e))return t;var r=this._indices[e],n=this._values.get(r);return void 0===n?this._defaultValues[e]:n},Xy.prototype.set=function(e,t){if(this.has(e)){var r=this._values.set(this._indices[e],t===this._defaultValues[e]?void 0:t);if(r!==this._values&&!this.__ownerID)return Gy(this,r)}return this},Xy.prototype.remove=function(e){return this.set(e)},Xy.prototype.clear=function(){var e=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:Gy(this,e)},Xy.prototype.wasAltered=function(){return this._values.wasAltered()},Xy.prototype.toSeq=function(){return Ky(this)},Xy.prototype.toJS=function(){return by(this)},Xy.prototype.entries=function(){return this.__iterator(2)},Xy.prototype.__iterator=function(e,t){return Ky(this).__iterator(e,t)},Xy.prototype.__iterate=function(e,t){return Ky(this).__iterate(e,t)},Xy.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._values.__ensureOwner(e);return e?Gy(this,t,e):(this.__ownerID=e,this._values=t,this)},Xy.isRecord=Mp,Xy.getDescriptiveName=qy;var Jy=Xy.prototype;function Gy(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function qy(e){return e.constructor.displayName||e.constructor.name||"Record"}function Ky(e){return $p(e._keys.map((function(t){return[t,e.get(t)]})))}function Qy(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){Xm(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}catch(e){}}Jy["@@__IMMUTABLE_RECORD__@@"]=!0,Jy.delete=Jy.remove,Jy.deleteIn=Jy.removeIn=og,Jy.getIn=Ny,Jy.hasIn=Ty.hasIn,Jy.merge=cg,Jy.mergeWith=lg,Jy.mergeIn=mg,Jy.mergeDeep=fg,Jy.mergeDeepWith=pg,Jy.mergeDeepIn=gg,Jy.setIn=ng,Jy.update=sg,Jy.updateIn=ag,Jy.withMutations=yg,Jy.asMutable=bg,Jy.asImmutable=vg,Jy[Wp]=Jy.entries,Jy.toJSON=Jy.toObject=Ty.toObject,Jy.inspect=Jy.toSource=function(){return this.toString()};var $y;function eb(){const e=cp(),[t,r]=f($y.Initial),[n,o]=f(Lg([])),i=g((()=>Bs(this,void 0,void 0,(function*(){try{r($y.Loading);const t=(e=>({[Is.ARBITRUM_ONE]:"https://tokens.coingecko.com/arbitrum-one/all.json",[Is.AURORA]:"https://tokens.coingecko.com/aurora/all.json",[Is.BSC]:"https://tokens.coingecko.com/binance-smart-chain/all.json"}[e]||"https://tokens.coingecko.com/uniswap/all.json"))(e),n=yield te.get(t);n&&n.data&&n.data.tokens&&o(Lg(n.data.tokens)),r($y.Success)}catch(e){r($y.Failed),console.error(e)}}))),[e]);return p((()=>{e&&i()}),[e]),{cgTokenList:n,loading:t===$y.Loading,refetch:i}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}($y||($y={}));var tb=[{chainId:1,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/prKmKP8yDTuPMHTCZ_DcxG8BqsuHNO8w5KDmJWmPodg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOUVaWU1ER2ZVN3g2N3ZBZThqWkUxZzA0RExUaFhaV0JIb09wZFhpeXhHRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTVRBeU4xOHhNekkyTjJGbE5EY3dMbkJ1WncucG5n.webp"},{chainId:1,address:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:1,address:"0x4Fabb145d64652a948d72533023f6E7A623C7C53",name:"Binance USD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/xZmadzpVOnpuq2jNG_5EGKeqMET0LU_gmfnp4VxkcxI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSHQwWXZKMGNnU0lGTFM0aHExTV9jOXVITV9fMHpXaHBKSGVOQU5neTBuby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMkoxYzJSZk4ySTJOalJpWWpReVpDOWlkWE5rWHpkaU5qWTBZbUkwTW1RdWNHNW4ucG5n.webp"},{chainId:1,address:"0x6b175474e89094c44da98b954eedeac495271d0f",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/h2lbKBfBJ2LNSTNCuwjsBkshT4eXzDDmAV0lhWS0llA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUnVJNWt2eHBwalI4TTZsenFZZVAyTTB4eVFMUGJ0S1hONDdWVTN1dUszZy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWmpBNU5qUmpPVFUxT1M1d2JtYy5wbmc.webp"},{chainId:1,address:"0x43dfc4159d86f3a37a5a4b3d4580b888ad7d4ddd",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/PGIGjN4ix9pInoESO_mCmajbMpygApWZyGKaE6vyJFk/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8veFJDQ0hnQXBuaENRTFZNUXAwdTdwd0pSQzIxRHJ4cFY0b2Z0bndaYnRmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5UaGxZelEyTlRFelpTOUVUMFJQWHpVNFpXTTBOalV4TTJVdWMzWm4uc3Zn.webp"},{chainId:1,address:"0xdac17f958d2ee523a2206206994597c13d831ec7",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:1,address:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:1,address:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/mI69kq-S-tNT1W57qYizPd5r2WNFzpAq5y6NhOcrTkY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVEZhSVNLVVZIWThLTVhyTkVmZDRXRUJmMGJoSHRweHY3Q1hDT0dKbGY2by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmT0dVeFpEaG1PVEEyWlM1d2JtYy5wbmc.webp"},{chainId:4,address:"0x99cf6999fc481663fb10be55827f3584e3c25f3c",name:"LINE",decimals:18,symbol:"LINE",logoURI:""},{chainId:4,address:"0xeaa70c2a40820dF9D38149C84dd943CFcB562587",name:"DODO",decimals:18,symbol:"DODO",logoURI:""},{chainId:4,address:"0xB26c0d8Be2960c70641A95A9195BE1f59Ac83aC0",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:""},{chainId:4,address:"0xab0733588776B8881F7712f6AbCa98F510e6B63D",name:"USDC",decimals:6,symbol:"USDC",logoURI:""},{chainId:4,address:"0x0aDCBAE18580120667f7Ff6c6451A426B13c67B7",name:"USDT Token",decimals:6,symbol:"USDT",logoURI:""},{chainId:4,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,symbol:"ETH",logoURI:""},{chainId:5,symbol:"USDC",address:"0xC4106029d03c33731Ca01Ba59b5A6368c660E596",name:"USDC",decimals:6,logoURI:""},{chainId:5,symbol:"USDT",address:"0xed8a325D87D3b6edED04FB992A1482231647EE5e",name:"USDT Token",decimals:6,logoURI:""},{chainId:5,symbol:"WETH",address:"0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",name:"Wrapped Ether",decimals:18,logoURI:""},{chainId:5,symbol:"ETH",address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ether",decimals:18,logoURI:""},{chainId:56,address:"0xe9e7cea3dedca5984780bafc599bd69add087d56",name:"BUSD Token",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/BvxyffA5gsLB4bLmlOVkfu7AVami78-VcW_6_i8I6kc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vbC1Sa25meFB3ZXlCOGVYSWJ2b04wdHczLTlzckZOckxfRHdTTnRLSHVRRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDJOa2JsOXRaV1JwWVY5a2IyUnZaWGhmYVc5ZlluVnpaRjgyTXpsbFlqZzNZV0V4WDJKMWMyUmZOak01WldJNE4yRmhNVjlsT1dVMVlXRTBOemxtTG5OMlp3LnN2Zw.webp"},{chainId:56,address:"0x55d398326f99059ff775485246999027b3197955",name:"Tether USD",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/QOl7CvP_WSmTUOMthbxQsNKjDj0s5kSjup69dW_-UeA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTjdQU3RXV2ZGaGNTVzM1QlE2TEJIaF9keVROUEJqa1RLTXRwTll5cEhSWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDJOa2JsOXRaV1JwWVY5a2IyUnZaWGhmYVc5ZmRYTmtkRjh4TlRZME1XWmpaRFF3WDNWelpIUmZNVFUyTkRGbVkyUTBNRjlqWmpJMVpUYzVZVE5qTG5OMlp3LnN2Zw.webp"},{chainId:56,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"BNB",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:56,address:"0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c",name:"BTCB Token",decimals:18,symbol:"BTCB",logoURI:"https://cmp.dodoex.io/fZG0z_RZ1U73_LuuC3RGrrZvNR-bgrCUjkwvaro-PCY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZ1NXN0RuYWNkMnc2YWxSQnFmcENqTHNDZWJhc2VtQTc0dDJlTEdDZjhfNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWmpJNVlXRmpZamxoTVM1d2JtYy5wbmc.webp"},{chainId:56,address:"0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3",name:"Dai Token",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/bhz9Vtma8hPb_-GnhwqQkhfTQ5PwKcR1Qbzn7aBKlfs/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZW04OHB4YXNDdEg0Nl9BcjhVandzZWR2SFBFUUtjVWVkc0FmV2lvenB2Yy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmWVRoaFptSmxaRFppWkM1d2JtYy5wbmc.webp"},{chainId:56,address:"0x67ee3Cb086F8a16f34beE3ca72FAD36F7Db929e2",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/PGIGjN4ix9pInoESO_mCmajbMpygApWZyGKaE6vyJFk/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8veFJDQ0hnQXBuaENRTFZNUXAwdTdwd0pSQzIxRHJ4cFY0b2Z0bndaYnRmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5UaGxZelEyTlRFelpTOUVUMFJQWHpVNFpXTTBOalV4TTJVdWMzWm4uc3Zn.webp"},{chainId:56,address:"0x2170ed0880ac9a755fd29b2688956bd959f933f8",name:"Ethereum Token",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:56,address:"0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",name:"Binance-Peg USD Coin",decimals:18,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:56,address:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",name:"Wrapped BNB",decimals:18,symbol:"WBNB",logoURI:"https://cmp.dodoex.io/-Pua5rc9k9iW4yuF5ajLVKzMkRhBq06D8HiEZ5gjezA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMDZOWTdBTmdOYWdFOHpXYUMtX2IzYXVPOUxsTEp6QlpLTUR3VlM5eW9DQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyeHZaMjlmT1dRellXTmtZMlEzTnk1d2JtYy5wbmc.webp"},{chainId:128,address:"0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f",name:"Wrapped HT",decimals:18,symbol:"WHT",logoURI:"https://cmp.dodoex.io/6EZiEnx7kuHSxfpDGIpuE4z8LW4wNE1ck8fZrc5zRaQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vR010ZUtqTkRTN1ZRT1Jpd0k3TU9OWE1zcFdEc0VYYmxjX1hheXc4cTVEay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTWpVd01sOHpaRGt5TjJWaE4yVTVMbkJ1WncucG5n.webp"},{chainId:128,address:"0x0298c2b32eae4da002a15f36fdf7615bea3da047",name:"Heco-Peg HUSD Token",decimals:8,symbol:"HUSD",logoURI:"https://cmp.dodoex.io/LiOyD0GGt0t4bk4xz3RWAxvqFPyYCqfM4z0AqneT3xM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVXRWWnNCVUxTREZNR002SUM0OGI0VV9UV05oYUU4MzFkdnh1Y1hkLTE2by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTkRjM09WODFZbU0yWVdFek9EUTRMbkJ1WncucG5n.webp"},{chainId:128,address:"0x3d760a45d0887dfd89a2f5385a236b29cb46ed2a",name:"Heco-Peg DAIHECO Token",decimals:18,symbol:"DAI-HECO",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:128,address:"0x64ff637fb478863b7468bc97d30a5bf3a428a1fd",name:"Heco-Peg ETH Token",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/prKmKP8yDTuPMHTCZ_DcxG8BqsuHNO8w5KDmJWmPodg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOUVaWU1ER2ZVN3g2N3ZBZThqWkUxZzA0RExUaFhaV0JIb09wZFhpeXhHRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTVRBeU4xOHhNekkyTjJGbE5EY3dMbkJ1WncucG5n.webp"},{chainId:128,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"HT",decimals:18,symbol:"HT",logoURI:"https://cmp.dodoex.io/6EZiEnx7kuHSxfpDGIpuE4z8LW4wNE1ck8fZrc5zRaQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vR010ZUtqTkRTN1ZRT1Jpd0k3TU9OWE1zcFdEc0VYYmxjX1hheXc4cTVEay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNNeVgyTnZhVzV0WVhKclpYUmpZWEJmWTI5dFgzTjBZWFJwWTE5cGJXZGZZMjlwYm5OZk5qUjROalJmTWpVd01sOHpaRGt5TjJWaE4yVTVMbkJ1WncucG5n.webp"},{chainId:128,address:"0x9362bbef4b8313a8aa9f0c9808b80577aa26b73b",name:"Heco-Peg USDCHECO Token",decimals:6,symbol:"USDC-HECO",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:128,address:"0xa71edc38d189767582c38a3145b5873052c3e47a",name:"Heco-Peg USDTHECO Token",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:137,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"MATIC",decimals:18,symbol:"MATIC",logoURI:"https://cmp.dodoex.io/cQFrEB6yGIqMkh_6Pie8VR3kIStL58IS-y8FbroHVwA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vc2VNUUk2dkpoaXljeldrczJaWWdGdk8zSEoxSWFIa053LXZYeXFneER4US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMekZmTWpkbE56TXlNRE13TWk4eFh6STNaVGN6TWpBek1ESXVjRzVuLnBuZw.webp"},{chainId:137,address:"0xe4bf2864ebec7b7fdf6eeca9bacae7cdfdaffe78",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/KEPetVp3nQkB6BZ_cb05trEfBbGxFEg92UnF8NZsEzM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVE5wTlRseEJGbFRDalM1ZFh3SWJ3Mm1hZ3NPUFFkZ3Z1UEhuZDZrNWdyMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk4yUTBaamxtTldOaU15OUVUMFJQWHpka05HWTVaalZqWWpNdWNHNW4ucG5n.webp"},{chainId:137,address:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/hdRkGay_hj0t1OzN5C3c30cmch26tJhHUSroffg7ciY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOHd3UndQOG9DTTdBcF9NOW11bGVOQWRqYjhBOXpvX2FYUE5pVTNBYUtzYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhnMlgwSXhOelUwTnpSZlJUZzVNRGswWDBNME5GOUVZVGs0WWprMU5GOUZaV1JsWDBGRFh6UTVOVEkzTVdRd1gwWmZiRzluYjE4MFpXSXdNVE0zTVRZeExuQnVady5wbmc.webp"},{chainId:137,address:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",name:"Ether",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:137,address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/er3iAGv39hCC7F8AydW_AteD3hnZj9HI2XcAaruHeqA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vVE9WUWtzN3JQWU5OZWdmNTRuNC1Za1NGTFYyLXVGZmlJRFVYem85aVMzOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlFUQmlPRFk1T1RGak5qSXhPR0l6Tm1NeFpERTVYMFEwWVRKbE9WOUZZakJqWDBVek5qQTJaVjlDTkRoZmJHOW5iMTlpTmpGbE5EVmtNbVF6TG5CdVp3LnBuZw.webp"},{chainId:137,address:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/WeK6L9_RjWUfAsnMuOAdyXIZVE3JK_H3lZU5vk2m7Tg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTFJ0aEt6X2VrSXdmTEh6NnAycW5rSkRFeUk1RXZrODlXQ0J2VW43MUJLNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoa1gwRkRYekUzWDBZNU5UaGZSREpsWlRVeU0yRXlNakEyTWpBMk9UazBOVGszWDBNeE0xOUVPRE14WldNM1gyeHZaMjlmWXpCbU9XVTFaamxoTmk1d2JtYy5wbmc.webp"},{chainId:137,address:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/_KjvB9pCVqbIIv_UnQvRWpjySBHiFnuHNSXUm_52UZM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDQ4OVYzTW1NMi1qaFJueEQ2Y3MyY1gydXdGS2tkRHpiRGZsbkZhTTJxOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhneU1qWXdYMFpCUTE4MVgwVTFOVFF5WVRjM00xOUJZVFEwWmw5Q1gwTm1aVjlFWmpkZlF6RTVNMkpqTWw5RE5UazVYMnh2WjI5Zk5HTmpORE0zTlRneFppNXdibWMucG5n.webp"},{chainId:137,address:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",name:"Wrapped MATIC",decimals:18,symbol:"WMATIC",logoURI:"https://cmp.dodoex.io/HfZVSaAES3QRplSybW2uoKmYf6pVTRaxufn95_Qto_A/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMERhZEZTUUVFX0d4YlBoMHY3Wk1Hb1FwaWtOQm1vaWFyZTFlaFdJbU44dy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjFoZEdsalgyVmlOekZtTkdFMU9XRXZiV0YwYVdOZlpXSTNNV1kwWVRVNVlTNTNaV0p3LndlYnA.webp"},{chainId:42161,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"ETH",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:42161,address:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/6VmZGvbENd4TM1VK0rsYrfznRtG-GwxP-zCy2qyc9bM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWnJZUDB0ZHVTLUdDNE5FTThmRmV1RHhVWklPNUZpWnpqdkdBc0lfNlBQMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh5TW1GbU4yVTVOVFJpTDFkRlZFaGZhV052Ymw4eU1tRm1OMlU1TlRSaUxuQnVady5wbmc.webp"},{chainId:42161,address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:42161,address:"0x69Eb4FA4a2fbd498C257C57Ea8b7655a2559A581",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/6U51l5aajoRrCaO6cpbrclQ2olWNDzuShggOCfoktCA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8va3RkSlhwQ3dsQVZtZXNPb1dvQV95SG9IazBnV3UxUExienBKa1AxYnlJdy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk5tTmtPVEV4WXprNE15OUVUMFJQWHpaalpEa3hNV001T0RNdWNHNW4ucG5n.webp"},{chainId:42161,address:"0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",name:"USD Coin (Arb1)",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:42161,address:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:42161,address:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:1285,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"MOVR",decimals:18,symbol:"MOVR",logoURI:"https://cmp.dodoex.io/Clhd0YhBfsWh48Ej4taGHcJ7dfKiCbtdMgyhNU7QAJg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZlBFT3c5LVdpQWhDVDJteGRmQ2gtb2hnQU1aaXBvWnllUl9TcVNpa3R4NC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMemt5T0RWZk4yWTVNREF5T1dNMU1pODVNamcxWHpkbU9UQXdNamxqTlRJdWQyVmljQS53ZWJw.webp"},{chainId:1285,address:"0x98878b06940ae243284ca214f92bb71a2b032b8a",name:"Wrapped MOVR",decimals:18,symbol:"WMOVR",logoURI:"https://cmp.dodoex.io/oXW0_VSLU29rbyQK3LtaHymbMfdv6F_ri20EeyMVBEU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMDVYMDFLd21zZXFRNFB6SGxJdEdvN3dveHVaUkFVbmQ5bDhCNU5VQ2N6by9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMGhmVG1OdmRWOUlNSGhmTkRBd2VEUXdNRjlrTlRBNFpHSmxNVE0yTDBoZlRtTnZkVjlJTUhoZk5EQXdlRFF3TUY5a05UQTRaR0psTVRNMkxtcHdady5qcGc.webp"},{chainId:1285,address:"0x5D9ab5522c64E1F6ef5e3627ECCc093f56167818",name:"Binance USD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/SKu1xTvsm3q0RZC9CdiGw0zkq9k1P2ygK4TMenBYNC8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQVMtWEpUX3pncF9MSlFxdFJiaE1Fd3lTZlNBMWp0MUhHbUFGYV9QQUdTdy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5aWRYTmtYems0TjJNd1lUUmtNRGt1YW5Cbi5qcGc.webp"},{chainId:1285,address:"0x80A16016cC4A2E6a2CACA8a4a498b1699fF0f844",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:1285,address:"0xE9460BD2FFB12b668fA32919C785C239f974D37C",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/onw4bpUWC5-GPBwFMHLE3BcRaQ1S_hqlUxW-8H3l5g0/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTi1ITXhGVWtxUU9fR3cxRFl1empZblgwejFzQ1pIMG1nMWRlOG5Qdmk2NC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zll6SXdZVEl4WTJFNU5pOUVUMFJQWDJNeU1HRXlNV05oT1RZdWNHNW4ucG5n.webp"},{chainId:1285,address:"0xE3F5a90F9cb311505cd691a46596599aA1A0AD7D",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/sQ5dF3FkjjQUsmfqFFE5cKq-cthh4u0wUooBE5Epf-k/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDlEVElLa2dONG5mRkNTSF9GMUdXU3JiZkJDa2JZRTkwbmFDS0dIWnRsby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkdOZlpXVTFNbUV4WldReVlpOTFjMlJqWDJWbE5USmhNV1ZrTW1JdWNHNW4ucG5n.webp"},{chainId:1285,address:"0xB44a9B6905aF7c801311e8F4E76932ee959c663C",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/LyxjB8w94UjDhRuXa9xNlg7YcMuOC6akWBPCtgbq_Qw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vLXNSOWJzZTlrLTFIY1VUeUE3WE9KZWplQkRRS2ZtSFpRV2I3RE1iemlHMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMM1Z6WkhSZk1UVTJOREZtWTJRME1DOTFjMlIwWHpFMU5qUXhabU5rTkRBdWMzWm4uc3Zn.webp"},{chainId:1285,address:"0x2bF9b864cdc97b08B6D79ad4663e71B8aB65c45c",name:"WBNB Token",decimals:18,symbol:"WBNB",logoURI:"https://cmp.dodoex.io/HSdBZz6OV3HFUq1RqW8hdavA1cfhjWEfqP12BINZppw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUTAzVVlDM3hSN0J2SHo5UmgtcHZ0WWctRGdPNlF1b2xKUmE0QjBHaWlmMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5aWJtSmZNalE0TmpZeFpHTXhaaTVxY0djLmpwZw.webp"},{chainId:1285,address:"0x6aB6d61428fde76768D7b45D8BFeec19c6eF91A8",name:"Wrapped Bitcoin",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/6qiR9e_WPVs0u8U4DgdGMcaKFzJzypJqME5wUNe7XsY/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMUMxeHZaUVJ4b0NlTW1sNXg0eUMzTGcySmhNXzYwcHpMMlk3elBwSGJFQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMnh2WjI5Zk4ySXpNMlU0TW1WbFlTOXNiMmR2WHpkaU16TmxPREpsWldFdWNHNW4ucG5n.webp"},{chainId:1285,address:"0x639A647fbe20b6c8ac19E48E2de44ea792c62c5C",name:"Wrapped Ether",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:66,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"OKT",decimals:18,symbol:"OKT",logoURI:"https://cmp.dodoex.io/pcltGNcIp7DP33nj3YxxBpuFEekNcOW3pwq9tjSrpY4/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTzJHSDJYTndRancwbXMzQXNidG5xNzRkVEROVld3QWFOU1dXU2ZnU01QTS9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RTVOalF5T1RCZk1qQXlNakExTWpBd056STNORFl3TWpJdWMzWm4uc3Zn.webp"},{chainId:66,address:"0x382bB369d343125BfB2117af9c149795C6C65C50",name:"USDT",decimals:18,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:66,address:"0x218c3c3D49d0E7B37aff0D8bB079de36Ae61A4c0",name:"BNB",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:66,address:"0x54e4622DC504176b3BB432dCCAf504569699a7fF",name:"BTCK",decimals:18,symbol:"BTCK",logoURI:"https://cmp.dodoex.io/L3kcNUKg94qnX8OPFlEvHKqWybnJD8SA9HTne3PW-Rg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vNU1MQTB3Q3V6eEs4Q3ZMV0RqempuOVhzalBTWE1zbUpWZ0RRN1RPMG9FWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpVUTB0Zk1HWmlaRGRsTWpnNU5pOUNWRU5MWHpCbVltUTNaVEk0T1RZdWNHNW4ucG5n.webp"},{chainId:66,address:"0x332730a4F6E03D9C55829435f10360E13cfA41Ff",name:"BUSD",decimals:18,symbol:"BUSD",logoURI:"https://cmp.dodoex.io/-aEkA13gC6lOFoRyGeSy2BotE5YY3WUmcSlPa9Rpddc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaXVmSjhaNHFJYzlMMDgtNHpxRUMxWl94WVlqRkEtT3BqS1FJbmQyeHpHUS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpWVTBSZk1XTTJNRFpqTjJZeE55OUNWVk5FWHpGak5qQTJZemRtTVRjdWNHNW4ucG5n.webp"},{chainId:66,address:"0x21cDE7E32a6CAF4742d00d44B07279e7596d26B9",name:"DAIK",decimals:18,symbol:"DAIK",logoURI:"https://cmp.dodoex.io/LOb-sXupURNN9HA0zBSfLfpZlx52N9qRSDUyzk3cg0A/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vck5pZzMtWU5TOUl4T3ZHX19taTFRSU9WYTZsczdZNXViRVhGcTJJVGplby9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJCU1V0Zk5ESTVNV1l4WlRoa1pTOUVRVWxMWHpReU9URm1NV1U0WkdVdWNHNW4ucG5n.webp"},{chainId:66,address:"0xEF71CA2EE68F45B9Ad6F72fbdb33d707b872315C",name:"ETHK",decimals:18,symbol:"ETHK",logoURI:"https://cmp.dodoex.io/IwBclhMMQLOo79RdRo6-HnUiXxshO_hSi02YK3L6MFI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcFBSd192aEx2MHh3WkRHU2k3eGYyYVJiQjlocVhfU2tacUdGc3RJR0pYRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFZVU0V0Zk1UQTVNamMzTW1VMU9DOUZWRWhMWHpFd09USTNOekpsTlRndWNHNW4ucG5n.webp"},{chainId:66,address:"0xc946DAf81b08146B1C7A8Da2A851Ddf2B3EAaf85",name:"USDC",decimals:18,symbol:"USDC",logoURI:"https://cmp.dodoex.io/bXLFjIP5_obFZS9jvWA1bZc2b2Vsw4-tqcvj10aPUpU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcXhZT0hTcDYzemNTaDVHRVV1SFlya3JGS2s1MW9zLVUycG42bjNXV2pYay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZk1UTTFZak13TkRkaVpDOVZVMFJEWHpFek5XSXpNRFEzWW1RdWNHNW4ucG5n.webp"},{chainId:66,address:"0xdCAC52E001f5bd413aa6ea83956438F29098166b",name:"USDK",decimals:18,symbol:"USDK",logoURI:"https://cmp.dodoex.io/X-_D75ZOpI-yC70WjdgC8wiqcssfRIALEv0eUfD3HiE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vd290dHEzaWdkTDVzQlhSR2VFZkhQLTNpZHhDZzV0V3VGQmE3YjNrNUZITS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkV0Zk56aGpZekV6TW1OaVpDOVZVMFJMWHpjNFkyTXhNekpqWW1RdWNHNW4ucG5n.webp"},{chainId:66,address:"0x506f731F7656e2FB34b587B912808f2a7aB640BD",name:"WBTCK",decimals:18,symbol:"WBTCK",logoURI:"https://cmp.dodoex.io/7Gb1gYkvjWESf9ungWe4YKOrr5GY5UILmTwU_U95kCA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vOTQ4NWZpU2NmUzBNc2V1YVZXWXo2Z1RuNVVidXJvZkxmN1VGSWhMdndjTS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOTFgyVXlZamRpWVRJNU16TXZWMEpVUTB0ZlpUSmlOMkpoTWprek15NXdibWMucG5n.webp"},{chainId:288,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ethereum",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:288,address:"0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:288,address:"0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b",name:"Binance",decimals:18,symbol:"BNB",logoURI:"https://cmp.dodoex.io/BWNSMMqu68bSFJsr9vsiCV09IonH3yuAkR9gQxaipBw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZDhvazF4akd3bU9GUXUtMVdzNEVRLVBNRnJYMW9DLXlmYTc3OGJUUkx0US9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpPUWw5alpEUTVNalE0TXpJMkwwSk9RbDlqWkRRNU1qUTRNekkyTG5CdVp3LnBuZw.webp"},{chainId:288,address:"0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7",name:"Boba Token",decimals:18,symbol:"BOBA",logoURI:"https://cmp.dodoex.io/p7--p24wKrXpF7IGh6Q_RT6J0ZGS2_FURnXxeyMDvO4/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQlVsWE9GWS1wUTIxbTJJOTdIRFN2VHlvMzR2MGJWQllYU1ByczFwaWNuYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpQUWtGZk16SmtZamczT1dJMk1TOUNUMEpCWHpNeVpHSTROemxpTmpFdWNHNW4ucG5n.webp"},{chainId:288,address:"0xf74195Bb8a5cf652411867c5C2C5b8C2a402be35",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:288,address:"0x572c5B5BF34f75FB62c39b9BFE9A75bb0bb47984",name:"DODO bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/8CGANX_wy00isVg8PgA_A-IKbfIn55Yu9ZujzUukXlQ/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vTDJhLVNEOFJvWDlGaW9IUVNzSkh2WkZzNlBpbVlNTWxTZGhZalJmMXVVQS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMFJQUkU5Zk1tRm1NMll4WkRZd055OUVUMFJQWHpKaFpqTm1NV1EyTURjdWNHNW4ucG5n.webp"},{chainId:288,address:"0x5DE1677344D3Cb0D7D465c10b72A8f60699C062d",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:288,address:"0xdc0486f8bf31DF57a952bcd3c1d3e166e3d9eC8b",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:288,address:"0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000",name:"Wrapped Ethereum",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Ethereum",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/WAobi4MZtLSxB59wgpyNlXLI44ZwlBh55qiGS2wLSGU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vSUVnUUx3TjRMU2dKRDJTM3RmSFlHcmxZbFZQNGlJeFcxeEZVOUwwUExRNC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmZEhKMWMzUjNZV3hzWlhSZllYTnpaWFJ6WDIxaGMzUmxjbDlpYkc5amEyTm9ZV2x1YzE5bGRHaGxjbVYxYlY5aGMzTmxkSE5mTUhoZlF6QXlZV0ZmUVRNNVlqSXlNMTlHUlY4NFgwUXdYMEV3WlRWZlF6UmZSakkzWlY5QlJGODVNRGd6WDBNM05UWmZRMk15WDJ4dloyOWZZelk0WXprelpHRXlNQzV3Ym1jLnBuZw.webp"},{chainId:1313161554,address:"0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB",name:"Wrapped Ethereum",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0x8BEc47865aDe3B172A928df8f990Bc7f2A3b9f79",name:"Aurora",decimals:18,symbol:"Aurora",logoURI:"https://cmp.dodoex.io/2C2jfpO2-VYuwlga3SdtP5I6eJNJXIYq3LvPU4aFuiU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcHFWVWlJOEQ4VU5iUEZYRElvUnA3cFhEZFc4dmx4dWEtTmxubmxlam1PMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMkYxY205eVlWOHlOVEprWlRFeE56YzBMMkYxY205eVlWOHlOVEprWlRFeE56YzBMbmRsWW5BLndlYnA.webp"},{chainId:1313161554,address:"0xe3520349F477A5F6EB06107066048508498A291b",name:"Dai Stablecoin",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:1313161554,address:"0xe301eD8C7630C9678c39E4E45193D1e7Dfb914f7",name:"DODO Bird",decimals:18,symbol:"DODO",logoURI:"https://cmp.dodoex.io/SEcMDWMmtHb3GFW5l7fTKYurpTqALHdZI3D6qzad1rs/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vQXRNMzllUjhRQzhYTl8tem5HU0pSLS1lV0tPUW91V3p2ci0zQ014WlJTSS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMekl3TUhneU1EQmZNVjh3WWpReFl6VTJZV1UxTHpJd01IZ3lNREJmTVY4d1lqUXhZelUyWVdVMUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",name:"USD Coin",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/EaCi6KUTS-dinU-wGdG2IcundJ0fJfsOw97FRI2vaB8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdEVMaUx0Y1FaTVlBb3hkeExLdnRrZ2ltdVB5dmZRdUQ5U1BxU1c1bDZsMC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZmFXTnZibDh5WlRFeU5tSTRaRFV5TDFWVFJFTmZhV052Ymw4eVpURXlObUk0WkRVeUxuQnVady5wbmc.webp"},{chainId:1313161554,address:"0x4988a896b1227218e4A686fdE5EabdcAbd91571f",name:"Tether USD",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:1313161554,address:"0xF4eB217Ba2454613b15dBdea6e5f22276410e89e",name:"Wrapped BTC",decimals:8,symbol:"WBTC",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:43114,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"Avalanche",decimals:18,symbol:"AVAX",logoURI:"https://cmp.dodoex.io/yBkeC0v6hqQP-wNBxAq_C_D6JTYUc4Q86Wh6WIciESI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcmpNamFFdHJ5WUZxNks3TkpxYkRWczlEZF80aHp4ZUo3YnB0eGgtVERDYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjEzWDI1ZlRqaHRNRjgwTURCNE5EQXdYems0WlRKaU5EQm1PRGN2YlhkZmJsOU9PRzB3WHpRd01IZzBNREJmT1RobE1tSTBNR1k0Tnk1cWNHYy5qcGc.webp"},{chainId:43114,address:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",name:"Wrapped AVAX",decimals:18,symbol:"WAVAX",logoURI:"https://cmp.dodoex.io/yBkeC0v6hqQP-wNBxAq_C_D6JTYUc4Q86Wh6WIciESI/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcmpNamFFdHJ5WUZxNks3TkpxYkRWczlEZF80aHp4ZUo3YnB0eGgtVERDYy9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMjEzWDI1ZlRqaHRNRjgwTURCNE5EQXdYems0WlRKaU5EQm1PRGN2YlhkZmJsOU9PRzB3WHpRd01IZzBNREJmT1RobE1tSTBNR1k0Tnk1cWNHYy5qcGc.webp"},{chainId:43114,address:"0x19860CCB0A68fd4213aB9D8266F7bBf05A8dDe98",name:"Binance USD",decimals:18,symbol:"BUSD.e",logoURI:"https://cmp.dodoex.io/-aEkA13gC6lOFoRyGeSy2BotE5YY3WUmcSlPa9Rpddc/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaXVmSjhaNHFJYzlMMDgtNHpxRUMxWl94WVlqRkEtT3BqS1FJbmQyeHpHUS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMEpWVTBSZk1XTTJNRFpqTjJZeE55OUNWVk5FWHpGak5qQTJZemRtTVRjdWNHNW4ucG5n.webp"},{chainId:43114,address:"0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",name:"Dai Stablecoin",decimals:18,symbol:"DAI.e",logoURI:"https://cmp.dodoex.io/XNbyKKzPthXfYOku9oXt5xzqM1JOWzxmbTLq2kkSvaU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vWHprMUxKSzJ2V1BYVmN3TmVvVDRfR3NNdnBOVXFmTmliXzgybFZSVUNkWS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMlZ5WXpJd0wyaDBkSEJ6WDNKaGQxOW5hWFJvZFdKMWMyVnlZMjl1ZEdWdWRGOWpiMjFmYzNWemFHbHpkMkZ3WDJsamIyNXpYMjFoYzNSbGNsOTBiMnRsYmw5a1lXbGZPRGhrT0dNeE5HRTBZaTVxY0djLmpwZw.webp"},{chainId:43114,address:"0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664",name:"USD Coin",decimals:6,symbol:"USDC.e",logoURI:"https://cmp.dodoex.io/bXLFjIP5_obFZS9jvWA1bZc2b2Vsw4-tqcvj10aPUpU/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vcXhZT0hTcDYzemNTaDVHRVV1SFlya3JGS2s1MW9zLVUycG42bjNXV2pYay9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkVOZk1UTTFZak13TkRkaVpDOVZVMFJEWHpFek5XSXpNRFEzWW1RdWNHNW4ucG5n.webp"},{chainId:43114,address:"0xc7198437980c041c805A1EDcbA50c1Ce5db95118",name:"Tether USD",decimals:6,symbol:"USDT.e ",logoURI:"https://cmp.dodoex.io/MGklrG5AImwUllGWDPMAHY0qLfdJQn4bj3iPFWSeohA/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vUEM3a3JPb252bWl4U3VRaFEwY29pVy1sczFYN25WS1lLNVluekQ2R2lxRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMVZUUkZSZlpUaGlOekZpTldZeU9TOVZVMFJVWDJVNFlqY3hZalZtTWprdWNHNW4ucG5n.webp"},{chainId:43114,address:"0x50b7545627a5162F82A992c33b87aDc75187B218",name:"Wrapped BTC",decimals:8,symbol:"WBTC.e",logoURI:"https://cmp.dodoex.io/n4n7ccBom2tgcZNN0jBv9YiTq5qGMjX6PHO0YGlpzZo/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vMElrSkQzVEc2SkFQdG1DV24tNnhfa0ozS3lXYXlVVHRhZ19PQmF0TFEwRS9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRDVkVOZmFXTnZibDgzWW1JelpUQTRaak14TDFkQ1ZFTmZhV052Ymw4M1ltSXpaVEE0WmpNeExuQnVady5wbmc.webp"},{chainId:43114,address:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",name:"Wrapped Ether",decimals:18,symbol:"WETH.e",logoURI:"https://cmp.dodoex.io/KWYmKxU_OCS1PmzuEO0xjdr1Yn08SjGBkyqSI8hxlpE/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vdkkyZF9rdFdyUzQyM0FqZlBLbkxRYloyRGVzTkpacmNTSlZNb1dYRnkyOC9hSFIwY0hNNkx5OWpaRzR0YldWa2FXRXVaRzlrYjJWNExtbHZMMWRGVkVoZmFXTnZibDh6TVRjd1pqTTBORGcxTDFkRlZFaGZhV052Ymw4ek1UY3daak0wTkRnMUxuQnVady5wbmc.webp"},{chainId:25,address:"0x66e428c3f67a68878562e79A0234c1F83c208770",name:"USDT",decimals:6,symbol:"USDT",logoURI:"https://cmp.dodoex.io/p_nSk7MW-bCcwp-tgtWC8az4e4Q0YMirg6rv6yVjC-I/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vODVNVlpTTllrTFlySWdlX2VQemNVOUpydkNKeFpDM2JhaGV0NnN5S0d5WS9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RTJPREl3TWpoZk1qQXlNakExTVRjd016STVNakV6TURjdWQyVmljQS53ZWJw.webp"},{chainId:25,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"CRO",decimals:1,symbol:"CRO",logoURI:"https://cmp.dodoex.io/HYsQIOyyuC6P1Ik_Rs5a6ws2CKMzJbajJewE77C0rf8/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vZzc2UURUMEIwbHJjc3VTSTlodTZTTnlqMEp3WWNtUEFRWV9qWDV0VVBhMC9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6YzRNRGc0TkRkZk1qQXlNakExTVRjd056UXdNekExTWpFdWNHNW4ucG5n.webp"},{chainId:10,address:"0x4200000000000000000000000000000000000006",name:"WETH",decimals:18,symbol:"WETH",logoURI:"https://cmp.dodoex.io/f9SbZq39ynUZS5ueKvAwzLmKUfcZvYpKDaysT3dkcvM/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vc2NkVzJUWjladmRiX3BVSjZ3b2YzeHRvYk94YUw3bEV5RmhhemhJUFhlMC9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6RXdNamd3TkRaZk1qQXlNakEwTWpJd01UQXpORGc1TURVdWNHNW4ucG5n.webp"},{chainId:10,address:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",name:"DAI",decimals:18,symbol:"DAI",logoURI:"https://cmp.dodoex.io/04gwZiu2K_9fdb2zLwzsX1nONCbBWrZOvTyOoEFhx3g/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaDJCcmdhUmZxUzBLZDBEOVpZbEUteEtNMVdzeFFtRzBEWVpKOGJCaWN4US9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6SXlNRFUwTVRsZk1qQXlNakEwTWpJd01UQTBNak00TlRVdWFuQm4uanBn.webp"},{chainId:10,address:"0x7F5c764cBc14f9669B88837ca1490cCa17c31607",name:"USDC",decimals:6,symbol:"USDC",logoURI:"https://cmp.dodoex.io/XbtxsPIscM6p5ClHbLO0JumFHA9U23eON8-MDh-Plkg/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vaG1nM3hRa1BUTUtkcUNFVnd0LXU4S2lwTW5od1JCdGhLYWxENW9vSWlTZy9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6UXlNRFEyTkRaZk1qQXlNakEwTWpJd01UQTFNekF4TmpVdWNHNW4ucG5n.webp"},{chainId:10,address:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",name:"ETH",decimals:18,symbol:"ETH",logoURI:"https://cmp.dodoex.io/bcyoORJ04NyP1HhYUZ9RrTZ-MEOFeNnMcrr__JZ6Ruw/rs:fit:96:96:0/g:no/aHR0cHM6Ly9pbWFnZS1wcm94eS5kb2RvZXguaW8vV1lHaU9IVFVnVWs4Q3Z3WmNyN0hWX2w4SlNrQjRVQUh1UXpzaWd4U3Nmay9hSFIwY0hNNkx5OXpkRzl5WVdkbExtZHZiMmRzWldGd2FYTXVZMjl0TDJSdlpHOHRiV1ZrYVdFdGMzUmhaMmx1Wnk5MWNHeHZZV1JmYVcxblh6VTVPREk0T1Y4eU1ESXlNRFF5TWpBeU1qTTBNelk0TlM1d2JtYy5wbmc.webp"}];function rb({tokenList:e,popularTokenList:t}){const n=P(),[o,i]=f([]),{account:c}=H(),l=cp(),{cgTokenList:u}=eb(),d=Z(Ks),h=y((()=>(null==tb?void 0:tb.filter((e=>e.chainId===l)))||[]),[tb,l]),m=y((()=>(null==t?void 0:t.filter((e=>e.chainId===l)))||[]),[t,l]);!function({tokenList:e,addresses:t,blockNumber:n}){const{account:o}=H(),i=P(),s=y((()=>[...(null==e?void 0:e.map((e=>e.address)))||[],...t||[]].map((e=>e.toLocaleLowerCase()))),[e,JSON.stringify(t)]),{getContract:a,contractConfig:c,call:l}=yl(),[u,d]=f(),h=y((()=>{if(!o||!s.length||!c)return;const{DODO_APPROVE:e,ERC20_HELPER:t}=c,n=a(t,bl);if(!n)return;let l={};const u=s.map((i=>(l[i]=!0,{callData:{data:n.interface.encodeFunctionData("isERC20",[i,o,e]),to:t},processor:e=>{const t=new fl(bl).decodeFunctionResult("isERC20",e),{balance:n,isOk:o}=t,s=parseInt(t.decimals),a=new r(10).pow(s),c=new r(t.allownance.toString()).div(a);return o?{address:i,decimals:s,symbol:t.symbol,name:t.name,balance:new r(n.toString()).div(a),allowance:c}:{address:i,balance:new r(0),allowance:new r(0)}}})));return i($s(l)),u}),[o,a,JSON.stringify(s)]);p((()=>{(()=>{Bs(this,void 0,void 0,(function*(){if(!h)return;const e=yield l(h),t={};e&&(e.forEach((e=>{e.address.toLocaleLowerCase()!=="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE".toLocaleLowerCase()&&(t[e.address.toLocaleLowerCase()]={tokenBalances:e.balance,tokenAllowances:e.allowance})})),i(Qs(t))),d(e);let r={};s.forEach((e=>{r[e]=!1})),i($s(r))}))})()}),[h,n])}({addresses:y((()=>{const e=o.map((({address:e})=>e));return null==t||t.forEach((({address:t})=>{e.includes(t)||e.push(t)})),e}),[o,t]),blockNumber:d}),p((()=>{(()=>{Bs(this,void 0,void 0,(function*(){let t=[];if(s(e))t=e;else if(e===xl.Coingecko||e===xl.All){const e=h.concat(u.toArray());t=a(m,e,(e=>e.address.toLowerCase()))}else t=a(m,h,(e=>e.address.toLowerCase()));const r=l,o=t.filter((e=>e.chainId===r));i(o),n((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_TOKEN_LIST",payload:e})})))(o))}))})()}),[e,n,l,u,m,h]),p((()=>{n(Qs({}))}),[c,l]),p((()=>{n((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_POPULAR_TOKEN_LIST",payload:e})})))(m))}),[m,n])}const nb=e=>(null!=e?e:Gs.getState()).token.tokenList,ob=e=>(null!=e?e:Gs.getState()).token.accountBalances,ib=e=>(null!=e?e:Gs.getState()).token.ethBalance||new r(NaN),sb=e=>(null!=e?e:Gs.getState()).token.defaultFromToken,ab=e=>(null!=e?e:Gs.getState()).token.defaultToToken,cb=e=>(null!=e?e:Gs.getState()).token.balanceLoadings;function lb(){const{account:e,chainId:t}=H(),r=Z(ob),n=Z(ib),o=y((()=>Cs[t||1]),[t]),i=g((t=>{var i;if(!e)return null;if(t.symbol===o.symbol&&Ts(t.address,o.address))return!n||(null==n?void 0:n.isNaN())?null:n;const s=null===(i=r[t.address.toLocaleLowerCase()])||void 0===i?void 0:i.tokenBalances;return!s||(null==s?void 0:s.isNaN())?null:s}),[r,n,e]);return i}var ub;function db(e,t,r,n=0){if(r&&(e=e.toLocaleLowerCase(),t=t.toLocaleLowerCase()),e===t)return ub.fully+n;const o=e.indexOf(t);return 0===o?ub.prefix+n:o>0?ub.other+n:ub.none}!function(e){e[e.fully=1]="fully",e[e.prefix=2]="prefix",e[e.other=3]="other",e[e.none=0]="none"}(ub||(ub={}));function hb({value:e,onChange:t,occupiedAddrs:n,hiddenAddrs:o,showAddrs:i,side:s}){const[a,c]=f(""),l=Z(nb),u=cp(),d=lb(),h=Z((e=>((e,t)=>(null!=t?t:Gs.getState()).token.popularTokenList.filter((({chainId:t})=>e===t)))(u,e))),p=y((()=>(null==tb?void 0:tb.filter((e=>e.chainId===u)))||[]),[tb,u]),m=y((()=>new Set(o?o.map((e=>e.toLowerCase())):void 0)),[o]),b=y((()=>i?new Set(i.map((e=>e.toLowerCase()))):void 0),[i]),v=g((e=>e.filter((e=>{if(e.chainId!==u)return!1;let t=!0;return t=b?b.has(e.address.toLowerCase()):!m.has(e.address.toLowerCase()),t&&s&&(t=!e.side||e.side===s),t}))),[b,u,m]),w=y((()=>v(h)),[h,v]),x=g((t=>{if(null===t)return null;const o=[];a?t.forEach((e=>{const t=((e,t,{matchAddress:r}={})=>{if(!t)return 0;const n=t.toLocaleLowerCase();let o=0;r&&e.address.toLocaleLowerCase()===n&&(o=1),o||(o=db(e.symbol.toLocaleLowerCase(),n,!1,1));if(o)e.name.toLocaleLowerCase()===n&&(o=ub.fully+1);else{let t=db(e.name.toLocaleLowerCase(),n,!1,10);t=t===ub.fully+10?ub.fully+1:t,o=t}return o})(e,a,{matchAddress:!0});t&&o.push({sort:t,token:e})})):t.forEach((e=>{o.push({sort:0,token:e})}));const i=[];return o.sort(((t,o)=>{const i=t.token,s=o.token;if(e){if(i.address===e.address)return-1;if(s.address===e.address)return 1}if(null==n?void 0:n.includes(i.address))return-1;if(null==n?void 0:n.includes(s.address))return 1;const a=d&&d(i)||new r(0),c=d&&d(s)||new r(0);if(!a.eq(c))return a.gt(c)?-1:1;if(t.sort!==o.sort)return t.sort>o.sort?1:-1;const l=w.map((e=>e.address));if(null==l?void 0:l.includes(i.address))return-1;if(null==l?void 0:l.includes(s.address))return 1;const u=p.map((e=>e.address));return(null==u?void 0:u.includes(i.address))?-1:(null==u?void 0:u.includes(s.address))?1:i.symbol.localeCompare(s.symbol)})).some((e=>!!(a&&i.length>21)||(i.push(e.token),!1))),i}),[a,d,n,e,w,p]),E=g((e=>{const r=e.address.toLowerCase();t(e,!!(null==n?void 0:n.some((e=>e.toLowerCase()===r))))}),[t,n]),A=y((()=>{const e=v(l);return x(e)||[]}),[l,v,x]);return{filter:a,setFilter:c,showTokenList:A,onSelectToken:E,popularTokenList:w}}function fb({width:e=24,height:t=24,marginRight:r=8,url:n,zIndex:o,cross:i,address:s,token:a,sx:c}){const[l,u]=f(!1),[d,h]=f(""),[m,b]=f(""),[v,w]=f(!1),x=g((()=>u(!0)),[]);let E=function(e){const t=Z(nb),{chainId:r}=H();return y((()=>{if(!e)return;let n=t.find((({address:t,chainId:n})=>n===r&&t===e));return n||(n=t.find((({address:t})=>t===e))),n}),[e,t,r])}(s);a&&(E=a);const A=s||(null==E?void 0:E.address),R=null==E?void 0:E.symbol,_=null==R?void 0:R.charAt(0).toUpperCase(),k=y((()=>{const e=null==E?void 0:E.logoURI;return n||e||""}),[n,E]);return p((()=>{w(!1)}),[A,k]),p((()=>{i&&(k?function(e,t){const r=new XMLHttpRequest;let n;r.onload=function(){const e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(r.response)},r.onerror=function(){t()};try{n=new URL(e)}catch(e){}finally{r.open("GET",n||e),r.responseType="blob",r.send()}}(k,(e=>{h(e)})):h(""))}),[k,i]),p((()=>{try{let t=A;if(t&&t.length<15&&(t=t.padEnd(15,"0")),t){const r=new L(t,{size:e,format:"svg",margin:.2,background:[255,234,4,255]}).toString();b(`data:image/svg+xml;base64,${r}`)}}catch(e){console.error("generate Identicon error: ",e)}}),[A,e]),Ie.exports.jsxs(Kr,{sx:Object.assign({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",minWidth:e,width:e,height:t,marginRight:r,zIndex:o},c||{}),style:{width:e,height:t},children:[!l&&Ie.exports.jsx(Kr,{sx:{typography:"ht",height:"100%",width:"100%",borderRadius:"50%",border:"transparent 2px solid",borderColor:"text.primary",color:"text.primary",display:"flex",alignItems:"center",justifyContent:"center"},children:_}),Ie.exports.jsx(Kr,{component:"img",src:!(i?d:k)||v?m:i?d:k,onLoad:x,onError:e=>{const t=e.target;A&&m&&w(!0),t.onerror=null},sx:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",borderRadius:"50%",overflow:"hidden",width:"100%",height:"100%"}})]})}function pb({token:t,onClick:r}){var n,o;const i=Jr();return Ie.exports.jsxs(Kr,{component:zn,sx:{display:"flex",alignItems:"center",color:i.palette.text.primary,typography:"h5",fontWeight:600},onClick:e=>{r&&r(e)},"data-testid":"swap-select-token-btn",children:[(null==t?void 0:t.address)?Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(fb,{url:null==t?void 0:t.logoURI,address:null!==(n=null==t?void 0:t.address)&&void 0!==n?n:"",marginRight:6}),Ie.exports.jsx(Kr,{children:null!==(o=null==t?void 0:t.symbol)&&void 0!==o?o:"-"})]}):Ie.exports.jsx(e,{id:"SELECT TOKEN"}),Ie.exports.jsx(Kr,{sx:{ml:7,width:12,transform:"rotateX(180deg)"},component:k})]})}function mb({onClick:t,balance:r,decimals:n,address:o,showMaxBtn:i}){const{palette:s}=Jr();return Ie.exports.jsxs(Kr,{sx:{display:"flex",typography:"body2",color:s.text.secondary},children:[Ie.exports.jsx(e,{id:"Balance:"})," ",o?Ui({input:r,decimals:Math.min(n||4,4)}):"-",i&&r&&r.gt(0)&&Ie.exports.jsx(Kr,{component:zn,sx:{ml:6,color:(null==r?void 0:r.gt(0))?s.primary.main:s.text.disabled,cursor:o&&t?"pointer":"unset"},onClick:()=>t&&t(r?r.toString():""),children:Ie.exports.jsx(e,{id:"Max"})})]})}function gb({readOnly:e,sx:t,value:r,decimals:n,onChange:o,suffix:i,withClear:s,onFocus:a,placeholder:c}){const l=Jr(),u=y((()=>i||(s&&r&&o?Ie.exports.jsx(Kr,{component:zn,sx:{ml:5,width:18,height:18,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{o&&o("")},children:Ie.exports.jsx(Kr,{component:_,sx:{width:12,color:"text.primary"}})}):void 0)),[o,i,l.palette.text.primary,r,s]);return Ie.exports.jsxs(Kr,{sx:Object.assign({mt:12,display:"flex",justifyContent:"space-between",alignItems:"center"},t),"data-testid":"number-input-wrapper",children:[Ie.exports.jsx(eo,{fullWidth:!0,value:r,readOnly:e,placeholder:c||"0.00",onFocus:a,onChange:e=>{const t=e.target.value,r=0===t.length?"":Vi(t,n);o&&o(r)},sx:{width:"inherit",border:"none","& .MuiInput-input":{fontSize:24,border:"none",outline:"none",height:24,padding:0,color:"text.primary","&::placeholder":{fontSize:24,color:"text.disabled"}}}}),!e&&r&&u]})}function yb({open:e,onClose:t,afterClose:r,title:n,rightSlot:o,canBack:i=!0,children:s,height:a,testId:c}){return Ie.exports.jsxs(Kr,{sx:{position:"absolute",top:e?0:"100%",transition:"top 300ms",zIndex:1,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",borderRadius:16,height:a},"data-testid":c,"data-active":e?"1":"0",children:[n?Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",p:20},children:[Ie.exports.jsx(Kr,{sx:{display:"flex",alignItems:"center",typography:"caption"},children:n}),o,!o&&i&&Ie.exports.jsx(Kr,{component:_,sx:{color:"text.secondary",cursor:"pointer"},onClick:()=>{t&&t(),setTimeout((()=>r&&r()),300)}})]}):"",s]})}const bb=e=>(null!=e?e:Gs.getState()).globals;function vb({token:e,disabled:t,onClick:r}){return Ie.exports.jsxs(Kr,{sx:Object.assign({display:"inline-flex",alignItems:"center",p:8,border:"solid 1px",typography:"body2",borderRadius:8},t?{borderColor:"transparent",backgroundColor:"border.disabled",cursor:"auto"}:{borderColor:"border.main",cursor:"pointer","&:hover":{backgroundColor:"hover.default"}}),onClick:()=>{t||r()},children:[Ie.exports.jsx(fb,{token:e}),e.symbol]})}function wb({token:e,disabled:t,style:n,onClick:o}){const i=Jr(),s=lb(),{account:a}=H(),c=s(e),l=c?ji({input:c}):"";return Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",typography:"body2",px:6,py:5,borderRadius:8,cursor:t?"auto":"pointer",opacity:t?.5:1,"&:hover":{backgroundColor:"hover.default"}},style:n,onClick:()=>{t||o()},"data-testid":"token-picker-item",children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(fb,{token:e}),Ie.exports.jsxs(Kr,{children:[Ie.exports.jsx(Kr,{sx:{fontWeight:600,textAlign:"left"},children:e.symbol}),a&&Ie.exports.jsx(Kr,{sx:{mt:4,textAlign:"left"},children:new r(l).gte(0)?l:Ie.exports.jsx(Kr,{component:E,width:18,sx:{"& path":{fill:i.palette.text.disabled},animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}}})})]})]}),Ie.exports.jsx(Kr,{sx:{color:"text.secondary",textAlign:"right"},children:e.name})]})}function xb({value:e,onChange:t,occupiedAddrs:r,hiddenAddrs:n,showAddrs:o,visible:i,side:s}){const{showTokenList:a,filter:c,setFilter:l,onSelectToken:u,popularTokenList:d}=hb({value:e,onChange:t,occupiedAddrs:r,hiddenAddrs:n,showAddrs:o,side:s}),m=h(null),[y,b]=f(0);p((()=>{i&&m.current&&b(m.current.offsetHeight-34)}),[m,i]);const v=g((({key:t,index:r,style:n})=>{const o=!!(null==d?void 0:d.length);if(0===r&&o)return Ie.exports.jsx(Kr,{sx:{position:"relative",display:"flex",gap:8,flexWrap:"wrap",pb:32,"&::after":{content:'""',position:"absolute",bottom:16,left:0,right:0,height:"1px",backgroundColor:"border.main"}},style:Object.assign(Object.assign({},n),{visibility:n.height?"visible":"hidden",height:n.height?n.height:"auto"}),children:d.map((t=>Ie.exports.jsx(vb,{token:t,disabled:(null==e?void 0:e.address)===t.address,onClick:()=>u(t)},t.address)))},t);const i=a[o?r-1:r];return Ie.exports.jsx(wb,{token:i,disabled:!!e&&e.address===i.address,style:n,onClick:()=>u(i)},t)}),[a,d,e]),w=g((e=>{if(0===e&&(null==d?void 0:d.length)){return 74+51*Math.floor(d.length/3)}return 52}),[d]);return Ie.exports.jsxs(Kr,{sx:{display:"flex",flexDirection:"column",px:20,flex:1},children:[Ie.exports.jsx(ao,{fullWidth:!0,height:48,value:c,onChange:e=>l(e.target.value),clearValue:()=>l(""),placeholder:ie._("Enter the token symbol or address")}),Ie.exports.jsx(Kr,{sx:{mt:16,pb:16,flex:1,minHeight:64},ref:m,children:Ie.exports.jsx(se,{height:y,itemCount:a.length+((null==d?void 0:d.length)?1:0),itemSize:w,width:"100%",className:"token-list",children:v},d.length)})]})}function Eb({open:t,value:r,onClose:n,occupiedAddrs:o,onTokenChange:i,side:s}){const{height:a}=Z(bb);return Ie.exports.jsx(yb,{height:a,open:t,onClose:n,title:Ie.exports.jsx(e,{id:"Select a token"}),testId:"token-picker-wrapper",children:Ie.exports.jsx(xb,{value:r,visible:t,onChange:i,occupiedAddrs:o,side:s})})}function Ab({sx:e,amt:t,token:r,readOnly:n,showMaxBtn:o,onMaxClick:i,fiatPriceTxt:s,occupiedAddrs:a,onInputFocus:c,onTokenClick:l,onInputChange:u,onTokenChange:d,side:h}){const p=Jr(),m=lb(),[g,y]=f(!1),b=r?m(r):null;return Ie.exports.jsxs(Kr,{sx:Object.assign({width:"100%",minHeight:133,padding:20,borderRadius:12,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",backgroundColor:p.palette.background.input},e),children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[Ie.exports.jsx(pb,{token:r,onClick:()=>y(!0)}),Ie.exports.jsx(mb,{balance:b,onClick:i,showMaxBtn:o,address:null==r?void 0:r.address,decimals:null==r?void 0:r.decimals})]}),Ie.exports.jsx(gb,{value:t,onFocus:c,onChange:u,readOnly:n,withClear:!0}),Ie.exports.jsx(Kr,{sx:{mt:4,typography:"body2",color:p.palette.text.secondary},children:s}),Ie.exports.jsx(Eb,{value:r,open:g,side:h,occupiedAddrs:a,onClose:()=>{y(!1),l&&l()},onTokenChange:(e,t)=>{y(!1),setTimeout((()=>d(e,t)),300)}})]})}const Rb=(e,t)=>{const r=String(e).split("."),n=!r[1],o=Number(r[0])==e,i=o&&r[0].slice(-1),s=o&&r[0].slice(-2);return t?1==i&&11!=s?"one":2==i&&12!=s?"two":3==i&&13!=s?"few":"other":1==e&&n?"one":"other"},_b={"en-US":Rb,"zh-CN":(e,t)=>"other",pseudo:Rb};function kb({locale:e,children:r}){return p((()=>{(()=>{Bs(this,void 0,void 0,(function*(){yield function(e="en-US"){return Bs(this,void 0,void 0,(function*(){ie.loadLocaleData(e,{plurals:()=>_b[e]});try{const t=yield import(`./locales/${e}.js`);ie.load(e,t.messages||t.default.messages)}catch(e){}ie.activate(e)}))}(e)}))})()}),[e]),Ie.exports.jsx(t,{i18n:ie,children:r})}var Sb,Nb,Mb;!function(e){e[e.Running=0]="Running",e[e.Success=1]="Success",e[e.Failed=2]="Failed",e[e.Warning=3]="Warning"}(Sb||(Sb={})),function(e){e.Canceled="canceled",e.Failed="failed",e.Success="success",e.Submitted="submitted"}(Nb||(Nb={})),function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success"}(Mb||(Mb={}));var Tb,Ob=[{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"guy",type:"address"},{name:"wad",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];!function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.Warning=2]="Warning"}(Tb||(Tb={}));const Ib=(e,t)=>Bs(void 0,void 0,void 0,(function*(){const{value:r,from:n,to:o,data:i}=e,s={from:n,to:o,value:r,data:i};r&&!/^0x0*$/.test(r)||delete s.value;try{return(yield t.estimateGas(s)).add(5e4)}catch(e){t.call(s).then((e=>{if("test"!==process.env.NODE_ENV)throw new Error("Unexpected issue with estimating the gas. Please try again.")})).catch((e=>{if("test"!==process.env.NODE_ENV)throw e}))}return null})),Fb=(e,t)=>Bs(void 0,void 0,void 0,(function*(){try{return yield t.getSigner().sendTransaction(e)}catch(e){throw 4001===(null==e?void 0:e.code)?new Error(ie._("Transaction rejected.")):e}}));var Wb,Cb;!function(e){e.Approval="APPROVAL",e.TX="TX",e.TypedSign="TypedSign"}(Wb||(Wb={})),function(e){e.Normal="Normal",e.Privacy="Privacy",e.LimitOrder="LimitOrder",e.RFQ="RFQ"}(Cb||(Cb={}));const jb=new r(2).pow(256).minus(1),Ub=e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_GLOBAL_PROPS",payload:e})}));function Db({onTxFail:e,onTxSubmit:t,onTxSuccess:n}={}){const{account:o,provider:i}=H(),s=cp(),[a,c]=f(!1),[l,u]=f(new Map),d=P(),[h,p]=f(null),[m,b]=f(""),[v,w]=f(null),[x,E]=f(!1),[A,R]=f(),{updateBlockNumber:_}=wl(),k=g(((a,l,h,f=!1,m,g,y,v)=>Bs(this,void 0,void 0,(function*(){if(b(""),p(""),!o||!i)throw new Error("Submission: Cannot execute step when the wallet is disconnected");let x,A,k;R((()=>y)),c(!1);try{if(c(!0),l.opcode===Wb.Approval)k=yield((e,t,n,o,i,s)=>Bs(void 0,void 0,void 0,(function*(){const a=gl(e,Ob,i,s).interface.encodeFunctionData("approve",[n,o.toFixed()]),c={from:t,to:e,data:a,value:`0x${new r("0").toString(16)}`,gasLimit:void 0},l=yield Ib(c,i);return l&&(c.gasLimit=l),yield Fb(c,i)})))(l.token.address,o,l.contract,l.amt||jb,i,o),x=k.hash,b(x);else{if(l.opcode!==Wb.TX)throw new Error(`Op ${l.opcode} not implemented!`);if(""===l.to)throw new Error("Submission: malformed to");if(0===l.data.length)throw new Error("Submission: malformed data");if(0===l.data.indexOf("0x")&&l.data.length<=2)throw new Error("Submission: malformed data");if(A={value:l.value,data:l.data,to:l.to,gasLimit:l.gasLimit,from:o,chainId:s},!A.gasLimit)try{const e=yield Ib(A,i);e&&(A.gasLimit=e)}catch(e){console.debug(e)}if(k=yield Fb(A,i),x=k.hash,b(x),!x)throw new Error(`Unexpected tx: ${x}`)}}catch(t){if(c(!1),w({spec:l,brief:a,subtitle:h}),console.error(t),t.message){d(Ub({contractStatus:Hs.Failed}));const r={error:t.message,brief:a};g&&Object.assign(r,g),e&&e(t,g),p(function(e,t){var r;const n=null===(r=Cs[e])||void 0===r?void 0:r.symbol,o=[{error:"insufficient",msg:ie._("Insufficient funds - Please retry after depositing more {EtherTokenSymbol} into your wallet",{EtherTokenSymbol:n})},{error:["External Swap execution Failed","Return amount is not enough"],msg:ie._("Price impact exceeds the slippage tolerance you set. Try increasing the slippage tolerance.")},{error:"SafeERC20: low-level call failed",msg:ie._("SafeERC20: low-level call failed. Please contact the DODO team.")},{error:["User denied","cancel","User rejected","user rejected"],msg:ie._("User denied transaction signature.")},{error:["Cannot set properties of undefined (setting 'loadingDefauIts'){\"originalError\":{",'[ethjs-query]while formatting outputs from RPC\'["value":["code":-32000,"message":"header not found"))'],msg:ie._("RPC node data exception")},{error:['execution reverted:FORCESTOP ["originalError"'],msg:ie._("ForceStop exception")},{error:["replacement transaction underpriced","Gasprice too low","transaction underprice"],msg:ie._("Gas price is too low, please adjust in your wallet and try again")},{error:["MINT_INVALID"],msg:ie._("No ForceStop access")},{error:["NOT_PHASE_EXE"],msg:ie._("Unable to SETTLE during the cooling-off period")},{error:["params specify an EIP-1559transaction but the currentnetwork does not support"],msg:ie._("Wallet incompatibility")},{error:["ALREADY_SETTLED"],msg:ie._("This CP has been settled by other addrs")},{error:["create RFQ order failed]:LESS_THAN_FEE_LIMIT"],msg:ie._("Service update, please wait and try again")}];let i="";return o.some((e=>Array.isArray(e.error)?e.error.some((r=>t.indexOf(r)>-1&&(i=e.msg,!0))):t.indexOf(e.error)>-1&&(i=e.msg,!0))),i||t}(s,t.message))}return Nb.Failed}w({spec:l,brief:a,subtitle:h}),E(!1),c(!1);const S=Object.assign(Object.assign(Object.assign(Object.assign({brief:a},l),A),{tx:x,subtitle:h}),g);d(Ub({contractStatus:Hs.Pending})),t&&t(x,S),m&&m();const N={brief:a,spec:l,tx:x,subtitle:h};if(u((e=>e.set(x,[N,Sb.Running]))),f)return Nb.Submitted;if(m&&m(),null==k?void 0:k.wait){const e=yield k.wait(1);if(E(!0),e.status===Mb.Success)return"TX"===S.opcode&&d(Ub({contractStatus:Hs.TxSuccess})),"APPROVAL"===S.opcode&&d(Ub({contractStatus:Hs.ApproveSuccess})),v&&v(x),n&&n(x,S),yield _(),u((e=>e.set(x,[N,Sb.Success]))),Nb.Success}return yield _(),E(!0),u((e=>e.set(x,[N,Sb.Failed]))),Nb.Failed}))),[o,s,c,i,_]),S=y((()=>({execute:k,requests:l,setShowing:w,waitingSubmit:a})),[k,l,w]),N=g((()=>{w(null),A&&(A(),R(void 0))}),[A]);return{showing:v,showingDone:x,transactionTx:m,errorMessage:h,setErrorMessage:p,closeShowing:N,ctxVal:S,requests:l}}function Bb(){const{requests:e}=Pb(),t=[];return null==e||e.forEach((function([e,r]){r===Sb.Running&&t.push(e)})),{runningRequests:t,isInflight:t.length>0}}const Vb=v({execute:()=>Promise.resolve(Nb.Canceled),requests:void 0,waitingSubmit:!1});function Pb(){return b(Vb)}var Zb;function zb(){return zb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zb.apply(this,arguments)}var Lb=function(e){return l.createElement("svg",zb({width:"33px",height:"33px",viewBox:"0 0 33 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),Zb||(Zb=l.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},l.createElement("g",{transform:"translate(-186.000000, -375.000000)",stroke:"currentColor",strokeWidth:4},l.createElement("g",{transform:"translate(18.000000, 291.000000)"},l.createElement("g",{transform:"translate(40.000000, 83.000000)"},l.createElement("path",{d:"M159,32 C159,15.9837423 146.016258,3 130,3"})))))))};function Hb({showingDone:e,errorMessage:t}){return t?Ie.exports.jsx(Kr,{component:S,sx:{width:64,height:64,color:"error.main"}}):e?Ie.exports.jsx(Kr,{component:N,sx:{width:64,height:64,color:"success.main"}}):Ie.exports.jsx(Kr,{sx:{mx:"auto",border:e=>{var t;return`6px solid ${null===(t=e.palette)||void 0===t?void 0:t.background.input}`},borderRadius:"50%",width:"64px",height:"64px",position:"relative",animation:"loadingRotate 1.1s infinite linear","@keyframes loadingRotate":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(359deg)"}}},children:Ie.exports.jsx(Kr,{component:Lb,sx:{position:"absolute",top:"-6px",right:"-6px",color:"primary.main"}})})}function Yb({showingDone:e,showing:t}){return Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",flexDirection:"column"},children:[Ie.exports.jsx(Kr,{sx:{mt:60},children:e?ie._("{0} confirmed",{0:null==t?void 0:t.brief}):ie._("{0} pending",{0:null==t?void 0:t.brief})}),(null==t?void 0:t.subtitle)?Ie.exports.jsx(Kr,{sx:{mt:20,typography:"body2"},children:null==t?void 0:t.subtitle}):""]})}function Xb({isStarted:t,isEnded:r,tx:n}){const[o,i]=f(0),{chainId:s}=H(),a=y((()=>`https://${Us[s||1]}/tx/${n}`),[n,s]),c=y((()=>{const e=Math.floor(o/60),t=o%60;return e?`${e}m ${t}s`:`${t}s`}),[o]),l=h();return p((()=>(t&&(i(0),clearInterval(l.current),l.current=setInterval((()=>{i((e=>e+1))}),1e3)),()=>{clearInterval(l.current)})),[t]),p((()=>{clearInterval(l.current)}),[r]),Ie.exports.jsxs(Kr,{sx:{mt:20,pt:20,display:"flex",justifyContent:"space-between",alignItems:"center",typography:"body2",color:"text.secondary",border:"solid 1px transparent",borderTopColor:"border.main"},children:[Ie.exports.jsxs(Kr,{children:[Ie.exports.jsx(e,{id:"Transaction Time:"}),c]}),Ie.exports.jsxs(so,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},component:"a",href:a,target:"_blank",rel:"noopener noreferrer",children:[Ie.exports.jsx(e,{id:"Tx"}),Ie.exports.jsx(Kr,{component:M,sx:{width:16,height:16,ml:6}})]})]})}function Jb(t){var{children:r}=t,n=Ds(t,["children"]);const{ctxVal:o,showing:i,closeShowing:s,showingDone:a,errorMessage:c,transactionTx:l}=Db(n),u=P();return Ie.exports.jsxs(Vb.Provider,{value:o,children:[r,Ie.exports.jsx(yb,{open:!!i,onClose:s,children:Ie.exports.jsxs(Kr,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",px:20,pb:20,flex:1,overflowY:"auto"},children:[Ie.exports.jsxs(Kr,{children:[Ie.exports.jsx(Kr,{sx:{textAlign:"center",pt:60},children:Ie.exports.jsx(Hb,{showingDone:a,errorMessage:c})}),c?Ie.exports.jsxs(Kr,{sx:{textAlign:"center",mt:60},children:[Ie.exports.jsx(Kr,{children:Ie.exports.jsx(e,{id:"Something went wrong."})}),Ie.exports.jsx(Kr,{sx:{color:"text.secondary",mt:12,typography:"body2",wordBreak:"break-all"},children:c})]}):Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(Yb,{showingDone:a,showing:i}),Ie.exports.jsx(Xb,{isStarted:!!i,isEnded:a,tx:l})]})]}),Ie.exports.jsx(Bn,{fullWidth:!0,size:Bn.Size.big,onClick:()=>{u(Ub({contractStatus:Hs.Initial})),s()},sx:{mt:20},children:c?Ie.exports.jsx(e,{id:"Dismiss"}):Ie.exports.jsx(e,{id:"Close"})})]})})]})}function Gb({token:e,fiatPrice:t}){return{marginAmount:y((()=>{var o;const i=null!==(o=null==e?void 0:e.decimals)&&void 0!==o?o:6,s=((e,t,r)=>{const o=new n(e).times(new n(10).pow(t));return r?o:o.dp(0)})(null!=t?new r(500).div(t):new r(0),i);return(s.lt(new r(1).times(new r(10).pow(i-3)))?new r(0):s).toString(10)}),[null==e?void 0:e.decimals,t])}}function qb({width:e,height:t,feeRate:r,rebateTo:n,colorMode:o,apikey:i,defaultChainId:s,defaultToToken:a,defaultFromToken:c}){const l=P();p((()=>{o&&l((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_COLOR_MODE",payload:e})})))(o))}),[o]),p((()=>{var e;s&&l((e=s,t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_CHAIN_ID",payload:e})}))))}),[s]),p((()=>{l(Ub({height:t}))}),[t]),p((()=>{l(Ub({width:e}))}),[e]),p((()=>{i&&l(Ub({apikey:i}))}),[i]),p((()=>{r&&l(Ub({feeRate:r}))}),[r]),p((()=>{n&&l(Ub({rebateTo:n}))}),[n]),p((()=>{c&&l((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_FROM_TOKEN",payload:e})})))(c))}),[c]),p((()=>{a&&l((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_DEFAULT_TO_TOKEN",payload:e})})))(a))}),[a])}function Kb({refetch:e,interval:t}){let r;p((()=>(e(),clearTimeout(r),r=setInterval((()=>{e()}),null!=t?t:15e3),()=>clearTimeout(r))),[e])}function Qb({fromToken:e,toToken:t,chainId:r}){const[n,o]=f(!1),{apikey:i}=Z(bb),[s,a]=f(""),[c,l]=f(""),u=g((()=>{if(!r||!e||!t)return;o(!0);const n=[e,t];te.post("https://api.dodoex.io/frontend-price-api/current/batch",{networks:n.map((()=>(e=>js[e]||js[Is.MAINNET])(r))),addresses:n.map((e=>e.address)),symbols:n.map((e=>e.symbol)),isCache:!0},{headers:{apikey:i}}).then((r=>{var n;o(!1);const i=null===(n=r.data)||void 0===n?void 0:n.data;i&&(a(i.find((t=>t.address===e.address)).price),l(i.find((e=>e.address===t.address)).price))})).catch((e=>{o(!1),console.error(e)}))}),[r,e,t,i]);return Kb({refetch:u}),{loading:n,refetch:u,toFiatPrice:c,fromFiatPrice:s}}const $b=e=>(null!=e?e:Gs.getState()).settings.slippage,ev=e=>(null!=e?e:Gs.getState()).settings.ddl;var tv;function rv({toToken:e,fromToken:t,fromAmount:r,toAmount:n,marginAmount:o}){const{account:i,chainId:s,provider:a}=H(),c=Z(qs),l=y((()=>s||c),[s,c]),u=Z($b)||3,d=Z(ev)||20,{feeRate:h,rebateTo:p,apikey:m,isReverseRouting:b}=Z(bb),v=y((()=>Math.floor(Date.now()/1e3)+60*d),[d]),[w,x]=f(tv.Initial),[E,A]=f(null),[R,_]=f(""),[k,S]=f(null),[N,M]=f(null),[T,O]=f(null),[I,F]=f(ne.from(0)),[W,C]=f(null),[j,U]=f(null),[D,B]=f(""),[V,P]=f(""),[z,L]=f(""),[Y,X]=f(0),J=g((()=>Bs(this,void 0,void 0,(function*(){if(!l||!t||!e)return;if(!b&&!r)return;if(b&&!n)return;x(tv.Loading);const o={chainId:l,deadLine:v,apikey:m,slippage:u,source:"dodoV2AndMixWasm",toTokenAddress:e.address,toTokenDecimals:e.decimals,fromTokenAddress:t.address,fromTokenDecimals:t.decimals,userAddr:i||"0x0000000000000000000000000000000000000000"};b?o.toAmount=oe(String(n||1),e.decimals).toString():o.fromAmount=oe(String(r||1),t.decimals).toString(),p&&h&&(o.rebateTo=p,o.fee=h);try{const e=(yield te.get("https://api.dodoex.io/route-service/v2/widget/getdodoroute",{params:o})).data.data;if((null==e?void 0:e.resAmount)?(x(tv.Success),A(e.resAmount),O(e.priceImpact),C(e.resPricePerFromToken),U(e.resPricePerToToken),S(e.baseFeeAmount),M(e.additionalFeeAmount),B(e.to),P(e.data),_(e.value),L(e.useSource),X(e.duration)):x(tv.Failed),!i||!a)return;const t=yield Ib({from:i,to:e.to,value:e.value,data:e.data},a);t&&F(t)}catch(e){x(tv.Failed),console.error(e)}}))),[v,i,l,e,h,u,p,t,a,r,n,m,b]);Kb({refetch:J});const G=y((()=>{const e=b?n:r;return w!==tv.Loading&&e?E:null}),[w,b,n,r,E]),q=function(){const{chainId:e,account:t}=H(),r=Pb(),n=g((({to:e,data:n,useSource:o,duration:i,ddl:s,gasLimit:a,subtitle:c,value:l})=>{const u=60*s,d=l;o&&"weth"!==o.toLowerCase()&&a&&a.lt(3e4)&&console.debug("Warning: GasLimit less than the minimum!");const h={from:t,to:e,data:n,value:d,route:o,duration:i,ddlSecRel:u,gasLimit:a};r.execute(ie._("Swap"),Object.assign({opcode:Wb.TX},h),c)}),[t,e]);return n}(),K=g((e=>{t&&(b?E:r)&&q({to:D,data:V,useSource:z,duration:Y,ddl:d,value:R,subtitle:e})}),[D,d,V,Y,z,t,r,I,E,R,b]);return{status:w,refetch:J,priceImpact:T,executeSwap:K,baseFeeAmount:k,resAmount:G,additionalFeeAmount:N,resPricePerToToken:j,resPricePerFromToken:W}}!function(e){e.Initial="Initial",e.Loading="Loading",e.Failed="Failed",e.Success="Success"}(tv||(tv={}));function nv(e){rb(e),vl(),wl();const{provider:t,connector:r}=H();p((()=>{const t=e.defaultChainId||1;(null==r?void 0:r.connectEagerly)?r.connectEagerly(t):r.activate(t)}),[r]),p((()=>{const e=null==t?void 0:t.provider;e&&e.once&&e.once("chainChanged",(()=>{setTimeout((()=>{window.location.reload()}),200||100)}))}),[t]);const n=e.width||375,o=e.height||494;return qb(Object.assign(Object.assign({},e),{width:n,height:o})),Ie.exports.jsx(Kr,{sx:{width:n,height:o,overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",minWidth:335,minHeight:494,borderRadius:16,backgroundColor:"background.paper"},className:"dodo-widget-container",children:Ie.exports.jsx(Jb,{...e,children:e.children})})}function ov(e){const t=function(e){for(var t=void 0===e?{}:e,r=t.mode,n=void 0===r?"light":r,i=t.lang,s=t.theme,a=[],c=1;c<arguments.length;c++)a[c-1]=arguments[c];var l=xn(n,s,i);return Vr(l=a.reduce((function(e,t){return o(e,t)}),l))}({mode:e.colorMode,theme:e.theme,lang:e.locale||"en-US"}),r=y((()=>e.defaultChainId||1),[e.defaultChainId]),n=ap({provider:e.provider,jsonRpcUrlMap:e.jsonRpcUrlMap,defaultChainId:r}),i=`${n.length}+${e.jsonRpcUrlMap?Object.entries(e.jsonRpcUrlMap):""}+${e.defaultChainId}+${r}`;return Ie.exports.jsx(z,{store:Gs,children:Ie.exports.jsx(kb,{locale:e.locale,children:Ie.exports.jsx(pn,{theme:t,children:Ie.exports.jsxs(X,{connectors:n,children:[Ie.exports.jsx(_n,{container:".dodo-widget-container"}),Ie.exports.jsx(nv,{...e})]},i)})})})}function iv(e){const{width:t}=Z(bb),r=y((()=>{let e="";return"number"==typeof t?e=`${t}px`:t&&(e=t),e?`calc(${e} - 40px)`:"auto"}),[t]);return Ie.exports.jsx(Ci,{container:document.querySelector(".dodo-widget-container"),maxWidth:r,...e})}function sv({onClick:e}){const t=Jr();return Ie.exports.jsx(so,{sx:{width:"100%",position:"relative"},onClick:e,children:Ie.exports.jsx(Kr,{component:zn,sx:{width:36,height:36,borderRadius:"50%",backgroundColor:t.palette.background.input,border:`4px solid ${t.palette.background.paper}`,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%) rotate(-90deg)"},children:Ie.exports.jsx(Kr,{component:T,sx:{width:18,color:"text.secondary"}})})})}function av({open:t,execute:n,onClose:o,toToken:i,fromToken:s,fromAmount:a,toAmount:c,priceImpact:l,clearFromAmt:u,clearToAmt:d,baseFeeAmount:h,curToFiatPrice:m,curFromFiatPrice:g,pricePerFromToken:b,additionalFeeAmount:v}){var w,x;const E=Jr(),A=Z($b),R=P(),{contractStatus:_}=Z(bb),S=y((()=>new r(l).gt(15)),[l]),[N,M]=f(!1),[T,W]=f(!1);return p((()=>{_!==Hs.Pending&&o(),_===Hs.TxSuccess&&(d(),u())}),[_]),p((()=>{M(!1)}),[m]),Ie.exports.jsx(yb,{open:t,onClose:()=>{R(Ub({contractStatus:Hs.Initial})),o()},title:Ie.exports.jsx(e,{id:"Swap summary"}),children:Ie.exports.jsxs(Kr,{sx:{margin:20,display:"flex",height:"100%",flexDirection:"column",borderTop:`1px solid ${E.palette.border.main}`},children:[Ie.exports.jsxs(Kr,{sx:{py:20,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexDirection:"column",borderBottom:`1px solid ${E.palette.border.main}`},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsxs(Kr,{children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[Ie.exports.jsx(fb,{width:16,height:16,url:null==s?void 0:s.logoURI,address:null!==(w=null==s?void 0:s.address)&&void 0!==w?w:"",marginRight:6}),Ie.exports.jsx(Kr,{children:`${Ui({input:a,decimals:null==s?void 0:s.decimals})} ${null==s?void 0:s.symbol}`})]}),Ie.exports.jsx(Kr,{sx:{mt:4,typography:"h6",color:E.palette.text.secondary},children:g?`$${ji({input:g,showDecimals:1})}`:"-"})]}),Ie.exports.jsx(Kr,{sx:{width:16,mx:16},component:O}),Ie.exports.jsxs(Kr,{children:[Ie.exports.jsxs(Kr,{sx:{display:"flex"},children:[Ie.exports.jsx(fb,{width:16,height:16,marginRight:6,url:null==i?void 0:i.logoURI,address:null!==(x=null==i?void 0:i.address)&&void 0!==x?x:""}),Ie.exports.jsx(Kr,{children:`${Ui({input:c,decimals:null==i?void 0:i.decimals})} ${null==i?void 0:i.symbol}`})]}),Ie.exports.jsx(Kr,{sx:{typography:"h6",mt:4,color:E.palette.text.secondary},children:m?`$${ji({input:m,showDecimals:1})}(${l}%)`:"-"})]})]}),Ie.exports.jsx(Kr,{sx:{mt:12,typography:"h6"},children:`1 ${null==s?void 0:s.symbol} = ${Ui({input:new r(c).dividedBy(new r(a)),decimals:null==i?void 0:i.decimals})} ${null==i?void 0:i.symbol}`})]}),Ie.exports.jsxs(Kr,{sx:{py:15,typography:"body2",borderBottom:`1px solid ${E.palette.border.main}`},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",color:E.palette.text.secondary},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(Kr,{sx:{width:16,mr:7},component:I}),Ie.exports.jsx(e,{id:"Swap Detail"})]}),Ie.exports.jsx(Kr,{component:zn,children:Ie.exports.jsx(Kr,{onClick:()=>W(!T),sx:{width:10,color:"text.secondary",transform:T?"rotateX(0deg)":"rotateX(180deg)"},component:k})})]}),Ie.exports.jsxs(Kr,{sx:{mt:16,display:T?"initial":"none"},children:[Ie.exports.jsxs(Kr,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Basic Fee"}),Ie.exports.jsx(iv,{title:Ie.exports.jsx(e,{id:"Estimated service provider fees"}),ml:5})]}),Ie.exports.jsx(Kr,{children:`${Ui({input:h,decimals:null==i?void 0:i.decimals})} ${null==i?void 0:i.symbol}`})]}),Ie.exports.jsxs(Kr,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Additional Fee"}),Ie.exports.jsx(iv,{title:Ie.exports.jsx(e,{id:"Additional routing fees set by the Widget user"}),ml:5})]}),Ie.exports.jsx(Kr,{children:`${Ui({input:v,decimals:null==i?void 0:i.decimals})} ${null==i?void 0:i.symbol}`})]}),Ie.exports.jsxs(Kr,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Price Impact"}),Ie.exports.jsx(iv,{title:Ie.exports.jsx(e,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),ml:5})]}),Ie.exports.jsx(Kr,{children:`${l}%`})]}),Ie.exports.jsxs(Kr,{sx:{mt:8,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Slippage"}),Ie.exports.jsx(iv,{title:Ie.exports.jsx(e,{id:"High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:5})]}),Ie.exports.jsx(Kr,{children:A})]})]})]}),Ie.exports.jsx(Kr,{sx:{flex:1}}),S&&Ie.exports.jsxs(Kr,{sx:{mb:14,display:"flex",cursor:"pointer",justifyContent:"center",alignItems:"center",typography:"h6"},onClick:()=>M(!N),children:[Ie.exports.jsx(Kr,{sx:{mr:4,width:18,height:18,alignItems:"center"},children:N?Ie.exports.jsx(Kr,{sx:{width:"100%",height:"100%",borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"secondary.main"},children:Ie.exports.jsx(Kr,{component:F,sx:{width:14,color:"#1a1a1b"}})}):Ie.exports.jsx(Kr,{sx:{width:"100%",height:"100%",borderRadius:4,border:`1px solid ${E.palette.text.secondary}`}})}),Ie.exports.jsx(Kr,{children:Ie.exports.jsx(e,{components:{0:Ie.exports.jsx(Kr,{component:"span",sx:{color:"error.main"}})},values:{priceImpact:l},id:"Price impact reaches <0>{priceImpact}</0>%, accept the quote"})})]}),Ie.exports.jsx(Bn,{isLoading:_==Hs.Pending,disabled:S&&!N,fullWidth:!0,onClick:()=>{n(),R(Ub({contractStatus:Hs.Pending}))},children:_==Hs.Pending?Ie.exports.jsx(e,{id:"Confirming"}):Ie.exports.jsx(e,{id:"Confirm swap"})})]})})}function cv(e){var{sx:t,maxVal:r,decimals:o=2,onInputChange:i}=e,s=Ds(e,["sx","maxVal","decimals","onInputChange"]);return Jr(),Ie.exports.jsx(eo,{...s,onChange:e=>{const t=0===e.target.value.length?null:Vi(e.target.value,o),s=r&&t&&new n(t).gt(r)?r.toString():t;console.log("finalVal:",s),i&&i(s)}})}function lv({open:t,onClose:r}){const n=Jr(),o=P(),i=Z($b),s=Z(ev),a=y((()=>Number(i)>=50),[i]);return Ie.exports.jsx(yb,{open:t,onClose:r,title:Ie.exports.jsx(e,{id:"Settings"}),children:Ie.exports.jsxs(Kr,{sx:{mx:20},children:[Ie.exports.jsxs(Kr,{sx:{py:20,borderTop:`1px solid ${n.palette.border.main}`},children:[Ie.exports.jsxs(Kr,{sx:{mb:16,display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Slippage Tolerance"}),Ie.exports.jsx(iv,{title:Ie.exports.jsx(e,{id:"Attention: High slippage tolerance will increase the success rate of transaction, but might not get the best quote."}),ml:7})]}),Ie.exports.jsxs(Kr,{sx:{display:"flex",flexDirection:"column"},children:[Ie.exports.jsx(cv,{fullWidth:!0,maxVal:100,value:i,placeholder:3..toString(),onInputChange:e=>{o((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_SLIPPAGE",payload:e})})))(e))},suffix:Ie.exports.jsx(Kr,{sx:{color:"text.disabled"},children:"%"}),height:36}),a&&Ie.exports.jsx(Kr,{sx:{typography:"h6",mt:6,color:"error.main"},children:Ie.exports.jsx(e,{id:"Maximum slippage do not exceed 50%"})})]})]}),Ie.exports.jsxs(Kr,{sx:{py:20,borderTop:`1px solid ${n.palette.border.main}`},children:[Ie.exports.jsxs(Kr,{sx:{mb:16,display:"flex",alignItems:"center"},children:[Ie.exports.jsx(e,{id:"Transaction Deadline"}),Ie.exports.jsx(iv,{title:Ie.exports.jsx(e,{id:"If your transaction time exceeds the deadline, your transaction will be rescinded."}),ml:7})]}),Ie.exports.jsx(cv,{value:s,fullWidth:!0,height:36,placeholder:ie._("{DEFAULT_SWAP_DDL} minutes",{DEFAULT_SWAP_DDL:20}),onInputChange:e=>{o((e=>t=>Bs(void 0,void 0,void 0,(function*(){t({type:"SET_TRANSACTION_DDL",payload:e})})))(e?Math.max(Number(e),1):""))}})]})]})})}function uv({toToken:t,fromToken:r,priceStatus:n,pricePerToToken:o,pricePerFromToken:i}){const[s,a]=f("-"),[c,l]=f(null),[u,d]=f("-"),[h,m]=f(null);p((()=>{a(null==r?void 0:r.symbol),d(null==t?void 0:t.symbol),l(o),m(i)}),[r,t,o,i]);const y=g((()=>{a(u),d(s),l(h),m(c)}),[s,c,u,h]);return Ie.exports.jsx(Kr,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:{[tv.Initial]:"-",[tv.Loading]:Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(co,{sx:{mr:5}}),Ie.exports.jsx(e,{id:"Fetching best price..."})]}),[tv.Failed]:Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(Kr,{component:W,sx:{width:15,mr:5,color:"warning.main"}}),Ie.exports.jsx(e,{id:"Quote not available"})]}),[tv.Success]:Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(Kr,{sx:{typography:"body2"},children:`1 ${s} = ${ji({input:h,showDecimals:4})} ${u}`}),Ie.exports.jsx(Kr,{component:zn,sx:{width:18,height:18,ml:6,borderRadius:"50%",backgroundColor:"border.main",display:"flex",justifyContent:"center",alignItems:"center"},children:Ie.exports.jsx(Kr,{sx:{width:16,color:"text.secondary"},onClick:y,component:C})})]})}[n]})}function dv({open:t,onClose:r}){const n=Z(qs);return Ie.exports.jsx(yb,{title:Ie.exports.jsx(e,{id:"Connect to your wallet"}),open:t,onClose:r,children:Ie.exports.jsx(Kr,{sx:{mx:20,pb:20,border:"1px solid transparent",borderTopColor:"border.main"},children:Object.values(ip).map((t=>Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center",flexDirection:"column",mt:20,p:20,backgroundColor:"background.tag",borderRadius:12,cursor:"pointer","&:hover":{backgroundColor:"hover.default"}},onClick:()=>{!function(e,t,r){var n;const o=sp[e];if(!o)throw new Error(`Unknown wallet type: ${e}`);const[i]=o;null===(n=i.activate(t))||void 0===n||n.catch((e=>{4001!==e.code?r(e):i.connectEagerly?i.connectEagerly(t):i.activate(t)}))}(t.type,n,(e=>{console.error(e)}))},children:[Ie.exports.jsx(Kr,{component:t.icon,sx:{width:32,height:32}}),Ie.exports.jsx(Kr,{sx:{mt:8,typography:"caption"},children:t.name}),Ie.exports.jsx(Kr,{sx:{mt:4,typography:"body2",color:"text.secondary"},children:Ie.exports.jsx(e,{id:"Connect to your {0} Wallet",values:{0:t.name}})})]},t.type)))})})}function hv(){const{connector:t}=H(),[r,n]=f(!1);return Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(Bn,{size:Bn.Size.big,fullWidth:!0,onClick:()=>{t.deactivate?t.deactivate():t.resetState(),n(!0)},"data-testid":"connect-wallet-btn",children:Ie.exports.jsx(e,{id:"Connect to a wallet"})}),Ie.exports.jsx(dv,{open:r,onClose:()=>n(!1)})]})}const fv=({account:e,chainId:t,offset:n,contractAddress:o})=>{var i;const s=Z(qs),a=y((()=>{var e;return sa[null!==(e=t)&&void 0!==e?e:s]}),[t]),{isETH:c}=y((()=>Os(t)),[t]),{DODO_APPROVE:l}=a||{},u=null!==(i=null!=o?o:l)&&void 0!==i?i:null,d=function(e){const{account:t}=H(),n=Z(qs),o=Z(ob),i=y((()=>Cs[n]),[n]),s=g((n=>{var s;if(!t||!e)return null;if(n.symbol===i.symbol&&Ts(n.address,i.address))return new r(jb);const a=null===(s=null==o?void 0:o[n.address.toLowerCase()])||void 0===s?void 0:s.tokenAllowances;return null!=a?a:null}),[t,e,i.symbol,i.address,o]);return s}(u),h=lb(),{runningRequests:f}=Bb(),p=Z(cb),m=y((()=>{var e;return null===(e=Cs[null!=t?t:s])||void 0===e?void 0:e.address}),[t]),b=g(((t,o,i)=>{if(!t)return El.Loading;const s=!!(null==f?void 0:f.find((e=>e.spec.opcode===Wb.Approval&&e.spec.token.address===(null==t?void 0:t.address)))),a=null!=i?i:t?h(t):null,c=t?d(t):null,l=new r(null!=o?o:0);if(!e)return El.Unchecked;if(!a||l.minus(null!=n?n:0).gt(a))return El.Unchecked;if(l.isZero())return El.Unchecked;return t.address===m?El.Sufficient:s?El.Approving:c&&l.minus(null!=n?n:0).gt(c)?El.Insufficient:El.Sufficient}),[h,d,e,n,u,t,p,f,m]),v=g((e=>{const t=e?d(e):null;return("USDT"===(null==e?void 0:e.symbol)||(null==e?void 0:e.address.toLowerCase())==="0x6426e6017968377529487E0ef0aA4E7759724e05".toLowerCase())&&null!==t&&t.gt(0)}),[d]),w=Pb(),x=P(),E=g(((t,n)=>Bs(void 0,void 0,void 0,(function*(){if(!u||!e||!t)return;const o=(e=>{let t=e.symbol;return t.indexOf("DLP_")>-1&&(t=t.replace("DLP_","")),t.indexOf("DLP")>-1&&(t=t.replace("DLP","LP")),t})(t),i=n?new r(0):void 0,s=n?ie._("Reset"):ie._("Approve");var a;(yield w.execute(`${s} ${o}`,{opcode:Wb.Approval,token:t,contract:u,amt:i}))===Nb.Success&&x((a=null!=i?i:jb,e=>Bs(void 0,void 0,void 0,(function*(){e({type:"SET_ACCOUNT_ALLOWANCES",payload:a})}))))}))),[u,e,t,w,x]),A=g((e=>{const t=new r(0);if(!e)return t.toString();const n=h(e);if(!n)return t.toString();let o=n;const i=c?.1:.02;return m===(null==e?void 0:e.address)&&(o=n.gt(i)?n.minus(i):t),o.toString()}),[t,h,c]);return{getApprovalState:b,getPendingRest:v,getMaxBalance:A,submitApprove:E}};function pv(){var t,n;const o=Jr(),{isInflight:i}=Bb(),{chainId:s,account:a}=H(),l=P(),{isReverseRouting:u}=Z(bb),d=Z(qs),h=Z(ab),m=Z(sb),{isETH:b}=y((()=>Os(s)),[s]),v=y((()=>{var e;return null===(e=Cs[null!=s?s:d])||void 0===e?void 0:e.address}),[s]),[w,x]=f(""),[E,A]=f(""),[R,_]=f(""),[k,S]=f(""),N=y((()=>c((e=>_(e)),1e3)),[]),M=y((()=>c((e=>S(e)),1e3)),[]),[T,I]=f(null),[F,C]=f(null),[D,B]=f(!1),[V,z]=f(!1),{toFiatPrice:L,fromFiatPrice:Y}=Qb({chainId:s,toToken:F,fromToken:T}),X=lb(),J=y((()=>T?X(T):null),[T,X]);y((()=>F?X(F):null),[F,X]);const{getApprovalState:G,submitApprove:q,getPendingRest:K,getMaxBalance:Q}=fv({account:a,chainId:s}),$=y((()=>K(u?F:T)),[null==T?void 0:T.address,null==F?void 0:F.address,K,u]),{marginAmount:ee}=Gb({token:u?F:T,fiatPrice:u?L:Y}),{resAmount:te,priceImpact:re,executeSwap:ne,baseFeeAmount:oe,additionalFeeAmount:ie,resPricePerToToken:se,resPricePerFromToken:ae,status:ce}=rv({toToken:F,fromToken:T,marginAmount:ee,fromAmount:R,toAmount:k}),le=g((e=>{const t=e.toString();x(t),N(t)}),[x,N]),ue=g((e=>{const t=e.toString();A(t),M(t)}),[A,M]),de=Z(nb),he=()=>{let e=null;T||m&&m.chainId===s||de.some((t=>!(t.chainId!==s||t.side&&"from"!==t.side)&&(e=t,I(t),!0))),F||h&&h.chainId===s||de.some((t=>!(t.chainId!==s||e&&e.address===t.address||t.side&&"to"!==t.side)&&(C(t),!0)))};p((()=>{s&&(C(null),I(null),u?ue(""):le("")),m&&m.chainId===s&&(I(m),m.amount&&(l(Ub({isReverseRouting:!1})),le(m.amount))),h&&h.chainId===s&&(C(h),h.amount&&m&&!m.amount&&(l(Ub({isReverseRouting:!0})),ue(h.amount))),he()}),[h,m,s,le,ue]),p((()=>{he()}),[de]);const fe=g((()=>{le(""),ue(""),I(F),C(T)}),[I,F,C,T,le,ue]),pe=g((e=>u?ue(Q(F)):le(Q(T))),[le,ue,Q,T,F,u]),me=y((()=>(100*Number(re)).toFixed(2)),[re]),ge=y((()=>{const e=u?te:R;return e&&Y?new r(Y).multipliedBy(e):null}),[Y,R,u,te]),ye=y((()=>{const e=u?k:te;return e&&L?new r(L).multipliedBy(e):null}),[L,k,u,te]),be=y((()=>Ie.exports.jsxs(Kr,{sx:{display:"flex",fontWeight:600,typography:"body2",alignItems:"center",justifyContent:"center"},children:[Ie.exports.jsx(iv,{title:Ie.exports.jsx(e,{id:"Due to the market condition, market price and estimated price may have a slight difference"}),mr:8}),Ie.exports.jsxs(Kr,{sx:{display:"flex"},children:[Ie.exports.jsx(e,{id:"Current price impact"}),Ie.exports.jsxs(Kr,{sx:{color:o.palette.error.main,ml:4},children:[me,"%"]})]})]})),[me]),ve=y((()=>Ie.exports.jsx(uv,{toToken:F,fromToken:T,priceStatus:ce,pricePerToToken:se,pricePerFromToken:ae})),[F,T,ce,se,ae]),we=y((()=>!Is[s||1]),[s]),xe=y((()=>ce===tv.Loading?Ie.exports.jsx(Kr,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(co,{sx:{mr:5}}),Ie.exports.jsx(e,{id:"Fetching best price..."})]})}):we?Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsx(Kr,{component:W,sx:{mr:6,width:16,color:"warning.main"}}),Ie.exports.jsx(e,{id:"Unsupported network - switch to trade"})]}):w&&new r(me).gt(15)?be:ve),[ce,ve,w,be,me,we]),Ee=y((()=>u?new r(E).gt(0)?Ui({input:te,decimals:null==T?void 0:T.decimals}):"-":w),[w,E,te,T,u]),Ae=y((()=>u?E:new r(w).gt(0)?Ui({input:te,decimals:null==F?void 0:F.decimals}):"-"),[w,E,te,F,u]),Re=y((()=>{const t=G(T,u?te||0:R),n=t===El.Approving,o=t===El.Insufficient&&!$,s=b?.1:.02,c=v===(null==T?void 0:T.address),l=new r(J||0);return a?i?Ie.exports.jsx(Bn,{fullWidth:!0,isLoading:!0,disabled:!0,children:Ie.exports.jsx(e,{id:"Transaction Pending"})}):T&&F?o?Ie.exports.jsx(Bn,{fullWidth:!0,disabled:n,onClick:()=>q(T),children:n?Ie.exports.jsx(e,{id:"Approving"}):Ie.exports.jsx(e,{id:"Approve"})}):new r(u?k:R).gt(0)?ce===tv.Loading?Ie.exports.jsx(Bn,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-fetch-price-btn",children:Ie.exports.jsx(e,{id:"Fetching Price..."})}):te&&ce!==tv.Failed?l.lt(u?te:R)||c&&l.lte(s)?Ie.exports.jsx(Bn,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-insufficient-balance-btn",children:Ie.exports.jsx(e,{id:"Insufficient balance"})}):Ie.exports.jsx(Bn,{fullWidth:!0,onClick:()=>B(!0),"data-testid":"swap-review-btn",children:Ie.exports.jsx(e,{id:"Review Swap"})}):Ie.exports.jsx(Bn,{fullWidth:!0,disabled:!0,children:Ie.exports.jsx(e,{id:"Quote not available"})}):Ie.exports.jsx(Bn,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-enter-amount-btn",children:Ie.exports.jsx(e,{id:"Enter an amount"})}):Ie.exports.jsx(Bn,{fullWidth:!0,disabled:!0,"data-testid":"swap-alert-select-token-btn",children:Ie.exports.jsx(e,{id:"Select Tokens"})}):Ie.exports.jsx(hv,{})}),[b,a,k,R,F,te,T,i,ne,$,q,ce,J,G,v,u]),_e=y((()=>T&&F?Ie.exports.jsxs(Kr,{sx:{display:"flex",alignItems:"center"},children:[Ie.exports.jsx(fb,{token:T,sx:{width:16,height:16,mr:6}}),`${Ui({input:u?te:R,decimals:null==T?void 0:T.decimals})} ${null==T?void 0:T.symbol}`,Ie.exports.jsx(Kr,{component:O,sx:{width:12,height:12,mx:16}}),Ie.exports.jsx(fb,{token:F,sx:{width:16,height:16,mr:6}}),`${Ui({input:u?k:te,decimals:null==F?void 0:F.decimals})} ${null==F?void 0:F.symbol}`]}):Ie.exports.jsx(Kr,{})),[T,F,R,k,te,u]);return Ie.exports.jsxs(Ie.exports.Fragment,{children:[Ie.exports.jsxs(Kr,{sx:{display:"flex",justifyContent:"space-between",typography:"caption",margin:20},children:[Ie.exports.jsx(e,{id:"Swap"}),Ie.exports.jsx(Kr,{component:zn,children:Ie.exports.jsx(Kr,{component:j,onClick:()=>z(!0),sx:{width:19,height:19,color:"text.primary",cursor:"pointer"}})})]}),Ie.exports.jsxs(Kr,{sx:{flex:1,padding:"0 20px 20px",overflowY:"auto"},children:[Ie.exports.jsxs(Kr,{children:[Ie.exports.jsx(Ab,{sx:{mb:4},token:T,side:"from",amt:Ee,onMaxClick:pe,onInputChange:le,onInputFocus:()=>{u&&le(""),l(Ub({isReverseRouting:!1}))},showMaxBtn:!u&&!w,occupiedAddrs:[null!==(t=null==F?void 0:F.address)&&void 0!==t?t:""],fiatPriceTxt:ge?`$${ji({input:ge,showDecimals:1})}`:"-",onTokenChange:(e,t)=>{if(t)return fe();le(""),ue(""),I(e)},readOnly:u}),Ie.exports.jsx(sv,{onClick:fe}),Ie.exports.jsx(Ab,{token:F,side:"to",amt:Ae,onInputChange:ue,onInputFocus:()=>{u||ue(""),l(Ub({isReverseRouting:!0}))},occupiedAddrs:[null!==(n=null==T?void 0:T.address)&&void 0!==n?n:""],fiatPriceTxt:ye?`$${ji({input:ye,showDecimals:1})}(${me}%)`:"-",onTokenChange:(e,t)=>{if(t)return fe();le(""),ue(""),C(e)},readOnly:!u}),Ie.exports.jsx(Kr,{sx:{py:12,display:"flex",typography:"body2",alignItems:"center",justifyContent:"center",flexWrap:"wrap"},children:xe})]}),Re,Ie.exports.jsxs(Kr,{sx:{mt:13,display:"flex",typography:"h6",cursor:"pointer",justifyContent:"center",alignItems:"center",color:o.palette.text.disabled},onClick:()=>window.open("https://app.dodoex.io"),children:[Ie.exports.jsx(Kr,{sx:{width:24,typography:"body2",transform:"translate(1px, 2px)","& path":{fill:o.palette.text.disabled}},component:U}),Ie.exports.jsx(e,{id:"Powered by DODO protocol"})]})]}),Ie.exports.jsx(av,{toToken:F,fromToken:T,fromAmount:u?te:R,toAmount:u?k:te,open:D,baseFeeAmount:oe,priceImpact:me,additionalFeeAmount:ie,curToFiatPrice:ye,execute:()=>ne(_e),clearFromAmt:()=>le(""),clearToAmt:()=>ue(""),curFromFiatPrice:ge,pricePerFromToken:ae,onClose:()=>B(!1)}),Ie.exports.jsx(lv,{open:V,onClose:()=>z(!1)})]})}var mv,gv=V;if("production"===process.env.NODE_ENV)mv=gv.createRoot,gv.hydrateRoot;else{var yv=gv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;mv=function(e,t){yv.usingClientEntryPoint=!0;try{return gv.createRoot(e,t)}finally{yv.usingClientEntryPoint=!1}}}function bv(e){return Ie.exports.jsx(ov,{...e,children:Ie.exports.jsx(pv,{})})}function vv(e){const t=document.getElementById("dodo-swap-widget");mv(t).render(Ie.exports.jsx(ov,{...e,children:Ie.exports.jsx(pv,{})}))}export{vv as InitSwapWidget,bv as SwapWidget};
|