(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[141],{53185:function(e,t,n){var r;r=function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n.",eQ="String expected.",eJ=[],eZ="__dbnames",e0="readonly",e1="readwrite";function e6(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var e2={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function e3(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=j(t))[e],t}}function e8(){throw G.Type()}function e4(e,t){try{var n=e5(e),r=e5(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return tu+a&&n(u+d)})})})(0).then(function(){if(0i(e[s],n[s])?e.substr(0,s)+n[s]+n.substr(s+1):0>i(e[s],r[s])?e.substr(0,s)+r[s]+n.substr(s+1):0<=a?e.substr(0,a)+t[a]+n.substr(a+1):null;0>i(e[s],c)&&(a=s)}return u=i(e[0],e[1])}))return tm(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",G.InvalidArgument);var s,c=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,f=i;function h(e,t){return f(e[0],t[0])}try{(s=e.reduce(function(e,t){for(var n=0,i=e.length;nr(t[0],o[1])&&0e4(n,e.from))return i?t2(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},t5(e);if(0e4(t,e.from)&&(e.from=t,e.l=null,e.d=r?r.d+1:1),0=e4(a.from,i.to)&&0<=e4(a.to,i.from))return!0;0>e4(i.from,a.from)?i=(r=n.next(a.from)).value:a=(u=o.next(i.from)).value}return!1}function t4(e){var t=t1(e)?null:{s:0,n:e};return{next:function(e){for(var n=0e4(e,t.n.from);)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||0>=e4(e,t.n.to))return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function t5(e){var n,r,i=((null===(n=e.r)||void 0===n?void 0:n.d)||0)-((null===(r=e.l)||void 0===r?void 0:r.d)||0),o=1e4(e,t.upper):0>=e4(e,t.upper)))}function nw(e,t,n,r,i,o){if(!n||0===n.length)return e;var a=t.query.index,s=a.multiEntry,c=t.query.range,l=r.schema.primaryKey.extractKey,f=a.extractKey,h=(a.lowLevelIndex||a).extractKey,n=n.reduce(function(e,n){var r=e,i="add"===n.type||"put"===n.type?n.values.filter(function(e){return e=f(e),s&&u(e)?e.some(function(e){return ng(e,c)}):ng(e,c)}).map(function(e){return e=j(e),o&&Object.freeze(e),e}):[];switch(n.type){case"add":r=e.concat(t.values?i:i.map(function(e){return l(e)}));break;case"put":var a=(new t6).addKeys(n.values.map(function(e){return l(e)})),r=e.filter(function(e){return!t8(new t6(e=t.values?l(e):e),a)}).concat(t.values?i:i.map(function(e){return l(e)}));break;case"delete":var h=(new t6).addKeys(n.keys);r=e.filter(function(e){return!t8(new t6(e=t.values?l(e):e),h)});break;case"deleteRange":var d=n.range;r=e.filter(function(e){return!ng(l(e),d)})}return r},e);return n===e?e:(n.sort(function(e,t){return e4(h(e),h(t))||e4(l(e),l(t))}),t.limit&&t.limit<1/0&&(n.length>t.limit?n.length=t.limit:e.length===t.limit&&n.length=r.limit&&(!r.values||e.req.values)&&(t=e.req.query.range,n=r.query.range,0>=function(e,t,n,r){if(void 0===e)return void 0!==t?-1:0;if(void 0===t)return 1;if(0===(t=e4(e,t))){if(n&&r)return 0;if(n)return 1;if(r)return -1}return t}(t.lower,n.lower,t.lowerOpen,n.lowerOpen)&&0<=function(e,t,n,r){if(void 0===e)return void 0!==t?1:0;if(void 0===t)return -1;if(0===(t=e4(e,t))){if(n&&r)return 0;if(n)return -1;if(r)return 1}return t}(t.upper,n.upper,t.upperOpen,n.upperOpen))}),!1,i,o];case"count":return[u=o.find(function(e){return n_(e.req.query.range,r.query.range)}),!!u,i,o]}}(n,r,"query",e),f=l[0],a=l[1],h=l[2],d=l[3];return f&&a?f.obsSet=e.obsSet:(a=i.query(e).then(function(e){var t=e.result;if(f&&(f.res=t),u){for(var n=0,r=t.length;n0x4000000000000000?0:r.oldVersion)<1,e.idbdb=d.result,u&&function(e,t){tV(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains("$meta")||t.db.createObjectStore("$meta").add(Math.ceil(t.db.version/10-1),"version");var n=tW(0,e.idbdb,t);tY(e,e._dbSchema,t);for(var r=0,i=tU(n,e._dbSchema).change;r=n})).length?(t.forEach(function(t){r.push(function(){var r=i,u=t._cfg.dbschema;tY(e,r,s),tY(e,u,s),i=e._dbSchema=u;var a=tU(r,u);a.add.forEach(function(e){tL(s,e[0],e[1].primKey,e[1].indexes)}),a.change.forEach(function(e){if(e.recreate)throw new G.Upgrade("Not yet support for changing primary key");var t=s.objectStore(e.name);e.add.forEach(function(e){return tG(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),tG(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var c=t._cfg.contentUpgrade;if(c&&t._cfg.version>n){tM(e,s),y._memoizedTables={};var l=k(u);a.del.forEach(function(e){l[e]=r[e]}),t$(e,[e.Transaction.prototype]),tF(e,[e.Transaction.prototype],o(l),l),y.schema=l;var f,h=D(c);return h&&eM(),a=eg.follow(function(){var e;(f=c(y))&&h&&(e=eF.bind(null,null),f.then(e,e))}),f&&"function"==typeof f.then?eg.resolve(f):a.then(function(){return f})}}),r.push(function(n){var r=t._cfg.dbschema;[].slice.call(n.db.objectStoreNames).forEach(function(e){return null==r[e]&&n.db.deleteObjectStore(e)}),t$(e,[e.Transaction.prototype]),tF(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),y.schema=e._dbSchema}),r.push(function(n){e.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(e.idbdb.version/10)===t._cfg.version?(e.idbdb.deleteObjectStore("$meta"),delete e._dbSchema.$meta,e._storeNames=e._storeNames.filter(function(e){return"$meta"!==e})):n.objectStore("$meta").put(t._cfg.version,"version"))})}),(function e(){return r.length?eg.resolve(r.shift()(y.idbtrans)).then(e):eg.resolve()})().then(function(){tV(i,s)})):eg.resolve()}).catch(v)):(o(p).forEach(function(e){tL(s,e,p[e].primKey,p[e].indexes)}),tM(e,s),void eg.follow(function(){return e.on.populate.fire(y)}).catch(v))}))},c),d.onsuccess=eC(function(){l=null;var n,a,c,p=e.idbdb=d.result,y=m(p.objectStoreNames);if(0e4(e,t)?e:t},this._IDBKeyRange=c._deps.IDBKeyRange,!this._IDBKeyRange)throw new G.MissingAPI})),this.on("versionchange",function(e){0=t||n<0||v&&r>=l}function w(){var e,n,r,o=i();if(g(o))return _(o);h=setTimeout(w,(e=o-d,n=o-p,r=t-e,v?a(r,l-n):r))}function _(e){return(h=void 0,m&&s)?b(e):(s=c=void 0,f)}function x(){var e,n=i(),r=g(n);if(s=arguments,c=this,d=n,r){if(void 0===h)return p=e=d,h=setTimeout(w,t),y?b(e):f;if(v)return clearTimeout(h),h=setTimeout(w,t),b(d)}return void 0===h&&(h=setTimeout(w,t)),f}return t=o(t)||0,r(n)&&(y=!!n.leading,l=(v="maxWait"in n)?u(o(n.maxWait)||0,t):l,m="trailing"in n?!!n.trailing:m),x.cancel=function(){void 0!==h&&clearTimeout(h),p=0,s=d=c=h=void 0},x.flush=function(){return void 0===h?f:_(i())},x}},63117:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},50561:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},41108:function(e,t,n){var r=n(12731),i=n(50561);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},49423:function(e,t,n){var r=n(2381);e.exports=function(){return r.Date.now()}},49666:function(e,t,n){var r=n(19334),i=n(63117),o=n(41108),u=0/0,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return u;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):a.test(e)?u:+e}},69893:function(e,t,n){"use strict";let r,i;n.d(t,{$3:function(){return T},P6:function(){return U},T:function(){return F},UG:function(){return z},Xx:function(){return D}});/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */let o=2n**255n-19n,u=2n**252n+0x14def9dea2f79cd65812631a5cf5d3edn,a={a:-1n,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,p:o,n:u,h:8,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},s=(e="")=>{throw Error(e)},c=e=>"string"==typeof e,l=e=>e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name,f=(e,t)=>!l(e)||"number"==typeof t&&t>0&&e.length!==t?s("Uint8Array of valid length expected"):e,h=e=>new Uint8Array(e),d=(e,t)=>f(c(e)?_(e):h(f(e)),t),p=(e,t=o)=>{let n=e%t;return n>=0n?n:t+n},y=e=>e instanceof v?e:s("Point expected");class v{constructor(e,t,n,r){this.ex=e,this.ey=t,this.ez=n,this.et=r}static fromAffine(e){return new v(e.x,e.y,1n,p(e.x*e.y))}static fromHex(e,t=!1){let{d:n}=a,r=(e=d(e,32)).slice(),i=e[31];r[31]=-129&i;let u=k(r);t&&!(0n<=u&&u<2n**256n)&&s("bad y coord 1"),t||0n<=u&&u0n;i=i.double(),e>>=1n)1n&e?n=n.add(i):t&&(r=r.add(i));return n}multiply(e){return this.mul(e)}clearCofactor(){return this.mul(BigInt(a.h),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.mul(u/2n,!1).double();return u%2n&&(e=e.add(this)),e.is0()}toAffine(){let{ex:e,ey:t,ez:n}=this;if(this.equals(b))return{x:0n,y:1n};let r=E(n);return 1n!==p(n*r)&&s("invalid inverse"),{x:p(e*r),y:p(t*r)}}toRawBytes(){let{x:e,y:t}=this.toAffine(),n=x(t);return n[31]|=1n&e?128:0,n}toHex(){return w(this.toRawBytes())}}v.BASE=new v(0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,0x6666666666666666666666666666666666666666666666666666666666666658n,1n,p(0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an*0x6666666666666666666666666666666666666666666666666666666666666658n)),v.ZERO=new v(0n,1n,1n,0n);let{BASE:m,ZERO:b}=v,g=(e,t)=>e.toString(16).padStart(t,"0"),w=e=>Array.from(e).map(e=>g(e,2)).join(""),_=e=>{let t=e.length;(!c(e)||t%2)&&s("hex invalid 1");let n=h(t/2);for(let t=0;t_(g(e,64)).reverse(),k=e=>BigInt("0x"+w(h(f(e)).reverse())),O=(...e)=>{let t=h(e.reduce((e,t)=>e+f(t).length,0)),n=0;return e.forEach(e=>{t.set(e,n),n+=e.length}),t},E=(e,t=o)=>{(0n===e||t<=0n)&&s("no inverse n="+e+" mod="+t);let n=p(e,t),r=t,i=0n,u=1n,a=1n,c=0n;for(;0n!==n;){let e=r/n,t=r%n,o=i-a*e,s=u-c*e;r=n,n=t,i=a,u=c,a=o,c=s}return 1n===r?p(i,t):s("no inverse")},P=(e,t)=>{let n=e;for(;t-- >0n;)n*=n,n%=o;return n},A=e=>{let t=e*e%o*e%o,n=P(t,2n)*t%o,r=P(n,1n)*e%o,i=P(r,5n)*r%o,u=P(i,10n)*i%o,a=P(u,20n)*u%o,s=P(a,40n)*a%o,c=P(s,80n)*s%o,l=P(c,80n)*s%o,f=P(l,10n)*i%o;return{pow_p_5_8:P(f,2n)*e%o,b2:t}},S=(e,t)=>{let n=p(t*t*t),r=A(e*p(n*n*t)).pow_p_5_8,i=p(e*n*r),o=p(t*i*i),u=i,a=p(0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n*i),s=o===e,c=o===p(-e),l=o===p(-(0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n*e));return s&&(i=u),(c||l)&&(i=a),(1n&p(i))===1n&&(i=p(-i)),{isValid:s||c,value:i}},j=e=>p(k(e),u),K=(...e)=>z.sha512Async(...e),C=(...e)=>"function"==typeof r?r(...e):s("etc.sha512Sync not set"),I=e=>{let t=e.slice(0,32);t[0]&=248,t[31]&=127,t[31]|=64;let n=e.slice(32,64),r=j(t),i=m.mul(r),o=i.toRawBytes();return{head:t,prefix:n,scalar:r,point:i,pointBytes:o}},B=e=>I(C(d(e,32))),T=e=>B(e).pointBytes;function q(e,t){return e?K(t.hashable).then(t.finish):t.finish(C(t.hashable))}let R=(e,t,n)=>{let{pointBytes:r,scalar:i}=e,o=j(t),a=m.mul(o).toRawBytes();return{hashable:O(a,r,n),finish:e=>f(O(a,x(p(o+j(e)*i,u))),64)}},D=(e,t)=>{let n=d(e),r=B(t),i=C(r.prefix,n);return q(!1,R(r,i,n))},N={zip215:!0},M=(e,t,n,r=N)=>{t=d(t),e=d(e,64);let{zip215:i}=r,o,u,a,s,c=new Uint8Array;try{o=v.fromHex(n,i),u=v.fromHex(e.slice(0,32),i),a=k(e.slice(32,64)),s=m.mul(a,!1),c=O(u.toRawBytes(),o.toRawBytes(),t)}catch(e){}return{hashable:c,finish:e=>{if(null==s||!i&&o.isSmallOrder())return!1;let t=j(e);return u.add(o.mul(t,!1)).add(s.negate()).clearCofactor().is0()}}},F=(e,t,n,r=N)=>q(!1,M(e,t,n,r)),$=()=>"object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,z={bytesToHex:w,hexToBytes:_,concatBytes:O,mod:p,invert:E,randomBytes:(e=32)=>{let t=$();return t&&t.getRandomValues||s("crypto.getRandomValues must be defined"),t.getRandomValues(h(e))},sha512Async:async(...e)=>{let t=$();t&&t.subtle||s("crypto.subtle or etc.sha512Async must be defined");let n=O(...e);return h(await t.subtle.digest("SHA-512",n.buffer))},sha512Sync:void 0};Object.defineProperties(z,{sha512Sync:{configurable:!1,get:()=>r,set(e){r||(r=e)}}});let U={getExtendedPublicKeyAsync:e=>K(d(e,32)).then(I),getExtendedPublicKey:B,randomPrivateKey:()=>z.randomBytes(32),precompute:(e=8,t=m)=>(t.multiply(3n),t)},L=()=>{let e=[],t=m,n=t;for(let r=0;r<33;r++){n=t,e.push(n);for(let r=1;r<128;r++)n=n.add(t),e.push(n);t=n.double()}return e},V=e=>{let t=i||(i=L()),n=(e,t)=>{let n=t.negate();return e?n:t},r=b,o=m,u=BigInt(255),a=BigInt(8);for(let i=0;i<33;i++){let s=128*i,c=Number(e&u);e>>=a,c>128&&(c-=256,e+=1n);let l=s+Math.abs(c)-1,f=i%2!=0,h=c<0;0===c?o=o.add(n(f,t[s])):r=r.add(n(h,t[l]))}return{p:r,f:o}}},14635:function(e,t,n){"use strict";var r=n(53185);let i=Symbol.for("Dexie"),o=globalThis[i]||(globalThis[i]=r);if(r.semVer!==o.semVer)throw Error(`Two different versions of Dexie loaded in the same app: ${r.semVer} and ${o.semVer}`);let{liveQuery:u,mergeRanges:a,rangesOverlap:s,RangeSet:c,cmp:l,Entity:f,PropModSymbol:h,PropModification:d,replacePrefix:p,add:y,remove:v}=o;t.ZP=o},51359:function(e,t,n){"use strict";n.d(t,{b:function(){return i}});var r=n(48926);class i extends r.G{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}},48926:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(94290);class i extends Error{constructor(e,t={}){super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:(0,r.bo)()});let n=t.cause instanceof i?t.cause.details:t.cause?.message?t.cause.message:t.details,o=t.cause instanceof i&&t.cause.docsPath||t.docsPath;this.message=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...o?[`Docs: https://viem.sh${o}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join("\n"),t.cause&&(this.cause=t.cause),this.details=n,this.docsPath=o,this.metaMessages=t.metaMessages,this.shortMessage=e}walk(e){return function e(t,n){return n?.(t)?t:t&&"object"==typeof t&&"cause"in t?e(t.cause,n):n?null:t}(this,e)}}},74188:function(e,t,n){"use strict";n.d(t,{J5:function(){return i},M6:function(){return o}});var r=n(48926);class i extends r.G{constructor({max:e,min:t,signed:n,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class o extends r.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}},94290:function(e,t,n){"use strict";n.d(t,{Gr:function(){return r},bo:function(){return i}});let r=e=>e,i=()=>"viem@2.13.8"},99112:function(e,t,n){"use strict";n.d(t,{K:function(){return l},x:function(){return c}});var r=n(51359),i=n(82361),o=n(45626),u=n(98992),a=n(64113);let s=new u.k(8192);function c(e,t){if(s.has(`${e}.${t}`))return s.get(`${e}.${t}`);let n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=(0,o.w)((0,i.qX)(n),"bytes"),u=(t?n.substring(`${t}0x`.length):n).split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&u[e]&&(u[e]=u[e].toUpperCase()),(15&r[e>>1])>=8&&u[e+1]&&(u[e+1]=u[e+1].toUpperCase());let a=`0x${u.join("")}`;return s.set(`${e}.${t}`,a),a}function l(e,t){if(!(0,a.U)(e,{strict:!1}))throw new r.b({address:e});return c(e,t)}},64113:function(e,t,n){"use strict";n.d(t,{U:function(){return a}});var r=n(98992),i=n(99112);let o=/^0x[a-fA-F0-9]{40}$/,u=new r.k(8192);function a(e,t){let{strict:n=!0}=t??{},r=`${e}.${n}`;if(u.has(r))return u.get(r);let a=!!o.test(e)&&(e.toLowerCase()===e||!n||(0,i.x)(e)===e);return u.set(r,a),a}},40369:function(e,t,n){"use strict";function r(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}n.d(t,{v:function(){return r}})},685:function(e,t,n){"use strict";n.d(t,{vk:function(){return o}});var r=n(48926);class i extends r.G{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}function o(e,{dir:t,size:n=32}={}){return"string"==typeof e?function(e,{dir:t,size:n=32}={}){if(null===n)return e;let r=e.replace("0x","");if(r.length>2*n)throw new i({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new i({size:e.length,targetSize:n,type:"bytes"});let r=new Uint8Array(n);for(let i=0;it)throw new r.M6({givenSize:o(e),maxSize:t})}function a(e,t={}){let{signed:n}=t;t.size&&u(e,{size:t.size});let r=BigInt(e);if(!n)return r;let i=(e.length-2)/2;return r<=(1n<<8n*BigInt(i)-1n)-1n?r:r-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function s(e,t={}){return Number(a(e,t))}},82361:function(e,t,n){"use strict";n.d(t,{O0:function(){return c},qX:function(){return d}});var r=n(48926),i=n(40369),o=n(685),u=n(88294),a=n(95046);let s=new TextEncoder;function c(e,t={}){return"number"==typeof e||"bigint"==typeof e?h((0,a.eC)(e,t)):"boolean"==typeof e?function(e,t={}){let n=new Uint8Array(1);return(n[0]=Number(e),"number"==typeof t.size)?((0,u.Yf)(n,{size:t.size}),(0,o.vk)(n,{size:t.size})):n}(e,t):(0,i.v)(e)?h(e,t):d(e,t)}let l={zero:48,nine:57,A:65,F:70,a:97,f:102};function f(e){return e>=l.zero&&e<=l.nine?e-l.zero:e>=l.A&&e<=l.F?e-(l.A-10):e>=l.a&&e<=l.f?e-(l.a-10):void 0}function h(e,t={}){let n=e;t.size&&((0,u.Yf)(n,{size:t.size}),n=(0,o.vk)(n,{dir:"right",size:t.size}));let i=n.slice(2);i.length%2&&(i=`0${i}`);let a=i.length/2,s=new Uint8Array(a);for(let e=0,t=0;et.toString(16).padStart(2,"0"));function a(e,t={}){return"number"==typeof e||"bigint"==typeof e?c(e,t):"string"==typeof e?f(e,t):"boolean"==typeof e?function(e,t={}){let n=`0x${Number(e)}`;return"number"==typeof t.size?((0,o.Yf)(n,{size:t.size}),(0,i.vk)(n,{size:t.size})):n}(e,t):s(e,t)}function s(e,t={}){let n="";for(let t=0;tn||ae<>>32-n,a=(e,t,n)=>t<>>32-n,s=(e,t,n)=>t<>>64-n,c=(e,t,n)=>e<>>64-n;var l=n(12403);let[f,h,d]=[[],[],[]],p=BigInt(0),y=BigInt(1),v=BigInt(2),m=BigInt(7),b=BigInt(256),g=BigInt(113);for(let e=0,t=y,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],f.push(2*(5*r+n)),h.push((e+1)*(e+2)/2%64);let i=p;for(let e=0;e<7;e++)(t=(t<>m)*g)%b)&v&&(i^=y<<(y<>o&i)}:{h:0|Number(e>>o&i),l:0|Number(e&i)}}(e[u],t);[n[u],r[u]]=[a,s]}return[n,r]}(d,!0),x=(e,t,n)=>n>32?s(e,t,n):u(e,t,n),k=(e,t,n)=>n>32?c(e,t,n):a(e,t,n);class O extends l.kb{constructor(e,t,n,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,r.Rx)(n),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,l.Jq)(this.state)}keccak(){!function(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,i=(t+2)%10,o=n[i],u=n[i+1],a=x(o,u,1)^n[r],s=k(o,u,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=a,e[t+n+1]^=s}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=h[n],o=x(t,i,r),u=k(t,i,r),a=f[n];t=e[a],i=e[a+1],e[a]=o,e[a+1]=u}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=w[r],e[1]^=_[r]}n.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,r.Gg)(this);let{blockLen:t,state:n}=this,i=(e=(0,l.O0)(e)).length;for(let r=0;r=n&&this.keccak();let o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,r.Rx)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,r.J8)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new O(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}let E=(0,l.hE)(()=>new O(136,1,32));var P=n(40369),A=n(82361),S=n(95046);function j(e,t){let n=E((0,P.v)(e,{strict:!1})?(0,A.O0)(e):e);return"bytes"===(t||"hex")?n:(0,S.NC)(n)}},98992:function(e,t,n){"use strict";n.d(t,{k:function(){return r}});class r extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,t){return super.set(e,t),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}},2342:function(e,t,n){"use strict";n.d(t,{k:function(){return h}});var r=n(82361),i=n(45626),o=n(99112),u=n(40369),a=n(88294),s=n(95046);async function c({hash:e,signature:t}){let r=(0,u.v)(e)?e:(0,s.NC)(e),{secp256k1:i}=await n.e(600).then(n.bind(n,35600)),o=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){let{r:e,s:n,v:r,yParity:o}=t,u=l(Number(o??r));return new i.Signature((0,a.y_)(e),(0,a.y_)(n)).addRecoveryBit(u)}let e=(0,u.v)(t)?t:(0,s.NC)(t),n=l((0,a.ly)(`0x${e.slice(130)}`));return i.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(n)})().recoverPublicKey(r.substring(2)).toHex(!1);return`0x${o}`}function l(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}async function f({hash:e,signature:t}){return function(e){let t=(0,i.w)(`0x${e.substring(4)}`).substring(26);return(0,o.x)(`0x${t}`)}(await c({hash:e,signature:t}))}async function h({message:e,signature:t}){return f({hash:function(e,t){var n;let o="string"==typeof e?(0,r.qX)(e):e.raw instanceof Uint8Array?e.raw:(0,r.O0)(e.raw),u=(0,r.qX)(`\x19Ethereum Signed Message: ${o.length}`);return(0,i.w)("string"==typeof(n=[u,o])[0]?`0x${n.reduce((e,t)=>e+t.replace("0x",""),"")}`:function(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}(n),void 0)}(e),signature:t})}},25645:function(e,t,n){"use strict";n.d(t,{n:function(){return a}});var r=n(99112),i=n(51359),o=n(64113),u=n(2342);async function a({address:e,message:t,signature:n}){return function(e,t){if(!(0,o.U)(e,{strict:!1}))throw new i.b({address:e});if(!(0,o.U)(t,{strict:!1}))throw new i.b({address:t});return e.toLowerCase()===t.toLowerCase()}((0,r.K)(e),await (0,u.k)({message:t,signature:n}))}},95861:function(e,t,n){"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function u(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let n=t.outputLen;if(e.lengthe instanceof Uint8Array,o=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),u=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a=(e,t)=>e<<32-t|e>>>t;if(68!==new Uint8Array(new Uint32Array([287454020]).buffer)[0])throw Error("Non little-endian hardware is not supported");function s(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}(e)),!i(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function c(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{if(!i(e))throw Error("Uint8Array expected");t.set(e,n),n+=e.length}),t}class l{clone(){return this._cloneInto()}}function f(e){let t=t=>e().update(s(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function h(e=32){if(r&&"function"==typeof r.getRandomValues)return r.getRandomValues(new Uint8Array(e));throw Error("crypto.getRandomValues must be defined")}}}]);