@dcl/vesting-dashboard 3.2.1-10994005036.commit-371a9b8 → 3.3.0

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.
@@ -1,4 +1,4 @@
1
- import{p as ri,g as S1,c as X3,r as Z3,a as Ie,B as ua,e as Di,b as Bl,d as Xi,W as Ll,o as hd,_ as t6}from"./index-9b8a6048.js";var ld=globalThis&&globalThis.__spreadArray||function(r,t,e){if(e||arguments.length===2)for(var i=0,s=t.length,a;i<s;i++)(a||!(i in t))&&(a||(a=Array.prototype.slice.call(t,0,i)),a[i]=t[i]);return r.concat(a||Array.prototype.slice.call(t))},e6=function(){function r(t,e,i){this.name=t,this.version=e,this.os=i,this.type="browser"}return r}(),r6=function(){function r(t){this.version=t,this.type="node",this.name="node",this.os=ri.platform}return r}(),i6=function(){function r(t,e,i,s){this.name=t,this.version=e,this.os=i,this.bot=s,this.type="bot-device"}return r}(),n6=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),s6=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),o6=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,a6=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,fd=3,c6=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",o6]],dd=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function u6(r){return r?pd(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new s6:typeof navigator<"u"?pd(navigator.userAgent):f6()}function h6(r){return r!==""&&c6.reduce(function(t,e){var i=e[0],s=e[1];if(t)return t;var a=s.exec(r);return!!a&&[i,a]},!1)}function pd(r){var t=h6(r);if(!t)return null;var e=t[0],i=t[1];if(e==="searchbot")return new n6;var s=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);s?s.length<fd&&(s=ld(ld([],s,!0),d6(fd-s.length),!0)):s=[];var a=s.join("."),u=l6(r),l=a6.exec(r);return l&&l[1]?new i6(e,a,u,l[1]):new e6(e,a,u)}function l6(r){for(var t=0,e=dd.length;t<e;t++){var i=dd[t],s=i[0],a=i[1],u=a.exec(r);if(u)return s}return null}function f6(){var r=typeof ri<"u"&&ri.version;return r?new r6(ri.version.slice(1)):null}function d6(r){for(var t=[],e=0;e<r;e++)t.push("0");return t}var bt={};/*! *****************************************************************************
1
+ import{p as ri,g as S1,c as X3,r as Z3,a as Ie,B as ua,e as Di,b as Bl,d as Xi,W as Ll,o as hd,_ as t6}from"./index-6f7d51ea.js";var ld=globalThis&&globalThis.__spreadArray||function(r,t,e){if(e||arguments.length===2)for(var i=0,s=t.length,a;i<s;i++)(a||!(i in t))&&(a||(a=Array.prototype.slice.call(t,0,i)),a[i]=t[i]);return r.concat(a||Array.prototype.slice.call(t))},e6=function(){function r(t,e,i){this.name=t,this.version=e,this.os=i,this.type="browser"}return r}(),r6=function(){function r(t){this.version=t,this.type="node",this.name="node",this.os=ri.platform}return r}(),i6=function(){function r(t,e,i,s){this.name=t,this.version=e,this.os=i,this.bot=s,this.type="bot-device"}return r}(),n6=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),s6=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),o6=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,a6=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,fd=3,c6=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",o6]],dd=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function u6(r){return r?pd(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new s6:typeof navigator<"u"?pd(navigator.userAgent):f6()}function h6(r){return r!==""&&c6.reduce(function(t,e){var i=e[0],s=e[1];if(t)return t;var a=s.exec(r);return!!a&&[i,a]},!1)}function pd(r){var t=h6(r);if(!t)return null;var e=t[0],i=t[1];if(e==="searchbot")return new n6;var s=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);s?s.length<fd&&(s=ld(ld([],s,!0),d6(fd-s.length),!0)):s=[];var a=s.join("."),u=l6(r),l=a6.exec(r);return l&&l[1]?new i6(e,a,u,l[1]):new e6(e,a,u)}function l6(r){for(var t=0,e=dd.length;t<e;t++){var i=dd[t],s=i[0],a=i[1],u=a.exec(r);if(u)return s}return null}function f6(){var r=typeof ri<"u"&&ri.version;return r?new r6(ri.version.slice(1)):null}function d6(r){for(var t=[],e=0;e<r;e++)t.push("0");return t}var bt={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -53,4 +53,4 @@ __p += '`),be&&(dt+=`' +
53
53
  function print() { __p += __j.call(arguments, '') }
54
54
  `:`;
55
55
  `)+dt+`return __p
56
- }`;var ue=ad(function(){return Se(O,Ft+"return "+dt).apply(e,H)});if(ue.source=dt,vh(ue))throw ue;return ue}function s3(n){return Me(n).toLowerCase()}function o3(n){return Me(n).toUpperCase()}function a3(n,o,c){if(n=Me(n),n&&(c||o===e))return mf(n);if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=Ci(o),O=vf(m,A),H=yf(m,A)+1;return jn(m,O,H).join("")}function c3(n,o,c){if(n=Me(n),n&&(c||o===e))return n.slice(0,bf(n)+1);if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=yf(m,Ci(o))+1;return jn(m,0,A).join("")}function u3(n,o,c){if(n=Me(n),n&&(c||o===e))return n.replace(Yt,"");if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=vf(m,Ci(o));return jn(m,A).join("")}function h3(n,o){var c=ft,m=pt;if(Ge(o)){var A="separator"in o?o.separator:A;c="length"in o?ae(o.length):c,m="omission"in o?Qr(o.omission):m}n=Me(n);var O=n.length;if(Ls(n)){var H=Ci(n);O=H.length}if(c>=O)return n;var W=c-qs(m);if(W<1)return m;var X=H?jn(H,0,W).join(""):n.slice(0,W);if(A===e)return X+m;if(H&&(W+=X.length-W),yh(A)){if(n.slice(W).search(A)){var ot,ct=X;for(A.global||(A=Tu(A.source,Me(le.exec(A))+"g")),A.lastIndex=0;ot=A.exec(ct);)var dt=ot.index;X=X.slice(0,dt===e?W:dt)}}else if(n.indexOf(Qr(A),W)!=W){var vt=X.lastIndexOf(A);vt>-1&&(X=X.slice(0,vt))}return X+m}function l3(n){return n=Me(n),n&&Gt.test(n)?n.replace(_e,jm):n}var f3=Vs(function(n,o,c){return n+(c?" ":"")+o.toUpperCase()}),_h=c0("toUpperCase");function od(n,o,c){return n=Me(n),o=c?e:o,o===e?Fm(n)?km(n):Dm(n):n.match(o)||[]}var ad=he(function(n,o){try{return cr(n,e,o)}catch(c){return vh(c)?c:new ee(c)}}),d3=gn(function(n,o){return fi(o,function(c){c=Vi(c),dn(n,c,gh(n[c],n))}),n});function p3(n){var o=n==null?0:n.length,c=jt();return n=o?ke(n,function(m){if(typeof m[1]!="function")throw new di(u);return[c(m[0]),m[1]]}):[],he(function(m){for(var A=-1;++A<o;){var O=n[A];if(cr(O[0],this,m))return cr(O[1],this,m)}})}function g3(n){return jv(gi(n,E))}function Eh(n){return function(){return n}}function m3(n,o){return n==null||n!==n?o:n}var v3=h0(),y3=h0(!0);function qr(n){return n}function Ah(n){return jf(typeof n=="function"?n:gi(n,E))}function w3(n){return zf(gi(n,E))}function b3(n,o){return kf(n,gi(o,E))}var _3=he(function(n,o){return function(c){return Ro(c,n,o)}}),E3=he(function(n,o){return function(c){return Ro(n,c,o)}});function Sh(n,o,c){var m=ur(o),A=nc(o,m);c==null&&!(Ge(o)&&(A.length||!m.length))&&(c=o,o=n,n=this,A=nc(o,ur(o)));var O=!(Ge(c)&&"chain"in c)||!!c.chain,H=vn(n);return fi(A,function(W){var X=o[W];n[W]=X,H&&(n.prototype[W]=function(){var ot=this.__chain__;if(O||ot){var ct=n(this.__wrapped__),dt=ct.__actions__=Ur(this.__actions__);return dt.push({func:X,args:arguments,thisArg:n}),ct.__chain__=ot,ct}return X.apply(n,Tn([this.value()],arguments))})}),n}function A3(){return we._===this&&(we._=Ym),this}function Ih(){}function S3(n){return n=ae(n),he(function(o){return Hf(o,n)})}var I3=rh(ke),D3=rh(lf),x3=rh(xu);function cd(n){return uh(n)?Mu(Vi(n)):iy(n)}function M3(n){return function(o){return n==null?e:ps(n,o)}}var C3=f0(),P3=f0(!0);function Dh(){return[]}function xh(){return!1}function O3(){return{}}function N3(){return""}function R3(){return!0}function T3(n,o){if(n=ae(n),n<1||n>R)return[];var c=g,m=yr(n,g);o=jt(o),n-=g;for(var A=Ou(m,o);++c<n;)o(c);return A}function F3(n){return ie(n)?ke(n,Vi):Jr(n)?[n]:Ur(M0(Me(n)))}function U3(n){var o=++Gm;return Me(n)+o}var B3=hc(function(n,o){return n+o},0),L3=ih("ceil"),q3=hc(function(n,o){return n/o},1),j3=ih("floor");function $3(n){return n&&n.length?ic(n,qr,zu):e}function z3(n,o){return n&&n.length?ic(n,jt(o,2),zu):e}function k3(n){return pf(n,qr)}function H3(n,o){return pf(n,jt(o,2))}function K3(n){return n&&n.length?ic(n,qr,Vu):e}function V3(n,o){return n&&n.length?ic(n,jt(o,2),Vu):e}var G3=hc(function(n,o){return n*o},1),W3=ih("round"),Y3=hc(function(n,o){return n-o},0);function Q3(n){return n&&n.length?Pu(n,qr):0}function J3(n,o){return n&&n.length?Pu(n,jt(o,2)):0}return x.after=wb,x.ary=q0,x.assign=o2,x.assignIn=Z0,x.assignInWith=Ac,x.assignWith=a2,x.at=c2,x.before=j0,x.bind=gh,x.bindAll=d3,x.bindKey=$0,x.castArray=Ob,x.chain=U0,x.chunk=jy,x.compact=$y,x.concat=zy,x.cond=p3,x.conforms=g3,x.constant=Eh,x.countBy=Qw,x.create=u2,x.curry=z0,x.curryRight=k0,x.debounce=H0,x.defaults=h2,x.defaultsDeep=l2,x.defer=bb,x.delay=_b,x.difference=ky,x.differenceBy=Hy,x.differenceWith=Ky,x.drop=Vy,x.dropRight=Gy,x.dropRightWhile=Wy,x.dropWhile=Yy,x.fill=Qy,x.filter=Xw,x.flatMap=eb,x.flatMapDeep=rb,x.flatMapDepth=ib,x.flatten=N0,x.flattenDeep=Jy,x.flattenDepth=Xy,x.flip=Eb,x.flow=v3,x.flowRight=y3,x.fromPairs=Zy,x.functions=y2,x.functionsIn=w2,x.groupBy=nb,x.initial=ew,x.intersection=rw,x.intersectionBy=iw,x.intersectionWith=nw,x.invert=_2,x.invertBy=E2,x.invokeMap=ob,x.iteratee=Ah,x.keyBy=ab,x.keys=ur,x.keysIn=Lr,x.map=vc,x.mapKeys=S2,x.mapValues=I2,x.matches=w3,x.matchesProperty=b3,x.memoize=wc,x.merge=D2,x.mergeWith=td,x.method=_3,x.methodOf=E3,x.mixin=Sh,x.negate=bc,x.nthArg=S3,x.omit=x2,x.omitBy=M2,x.once=Ab,x.orderBy=cb,x.over=I3,x.overArgs=Sb,x.overEvery=D3,x.overSome=x3,x.partial=mh,x.partialRight=K0,x.partition=ub,x.pick=C2,x.pickBy=ed,x.property=cd,x.propertyOf=M3,x.pull=cw,x.pullAll=T0,x.pullAllBy=uw,x.pullAllWith=hw,x.pullAt=lw,x.range=C3,x.rangeRight=P3,x.rearg=Ib,x.reject=fb,x.remove=fw,x.rest=Db,x.reverse=dh,x.sampleSize=pb,x.set=O2,x.setWith=N2,x.shuffle=gb,x.slice=dw,x.sortBy=yb,x.sortedUniq=bw,x.sortedUniqBy=_w,x.split=e3,x.spread=xb,x.tail=Ew,x.take=Aw,x.takeRight=Sw,x.takeRightWhile=Iw,x.takeWhile=Dw,x.tap=$w,x.throttle=Mb,x.thru=mc,x.toArray=Q0,x.toPairs=rd,x.toPairsIn=id,x.toPath=F3,x.toPlainObject=X0,x.transform=R2,x.unary=Cb,x.union=xw,x.unionBy=Mw,x.unionWith=Cw,x.uniq=Pw,x.uniqBy=Ow,x.uniqWith=Nw,x.unset=T2,x.unzip=ph,x.unzipWith=F0,x.update=F2,x.updateWith=U2,x.values=Ys,x.valuesIn=B2,x.without=Rw,x.words=od,x.wrap=Pb,x.xor=Tw,x.xorBy=Fw,x.xorWith=Uw,x.zip=Bw,x.zipObject=Lw,x.zipObjectDeep=qw,x.zipWith=jw,x.entries=rd,x.entriesIn=id,x.extend=Z0,x.extendWith=Ac,Sh(x,x),x.add=B3,x.attempt=ad,x.camelCase=$2,x.capitalize=nd,x.ceil=L3,x.clamp=L2,x.clone=Nb,x.cloneDeep=Tb,x.cloneDeepWith=Fb,x.cloneWith=Rb,x.conformsTo=Ub,x.deburr=sd,x.defaultTo=m3,x.divide=q3,x.endsWith=z2,x.eq=Oi,x.escape=k2,x.escapeRegExp=H2,x.every=Jw,x.find=Zw,x.findIndex=P0,x.findKey=f2,x.findLast=tb,x.findLastIndex=O0,x.findLastKey=d2,x.floor=j3,x.forEach=B0,x.forEachRight=L0,x.forIn=p2,x.forInRight=g2,x.forOwn=m2,x.forOwnRight=v2,x.get=wh,x.gt=Bb,x.gte=Lb,x.has=b2,x.hasIn=bh,x.head=R0,x.identity=qr,x.includes=sb,x.indexOf=tw,x.inRange=q2,x.invoke=A2,x.isArguments=vs,x.isArray=ie,x.isArrayBuffer=qb,x.isArrayLike=Br,x.isArrayLikeObject=Je,x.isBoolean=jb,x.isBuffer=$n,x.isDate=$b,x.isElement=zb,x.isEmpty=kb,x.isEqual=Hb,x.isEqualWith=Kb,x.isError=vh,x.isFinite=Vb,x.isFunction=vn,x.isInteger=V0,x.isLength=_c,x.isMap=G0,x.isMatch=Gb,x.isMatchWith=Wb,x.isNaN=Yb,x.isNative=Qb,x.isNil=Xb,x.isNull=Jb,x.isNumber=W0,x.isObject=Ge,x.isObjectLike=We,x.isPlainObject=qo,x.isRegExp=yh,x.isSafeInteger=Zb,x.isSet=Y0,x.isString=Ec,x.isSymbol=Jr,x.isTypedArray=Ws,x.isUndefined=t2,x.isWeakMap=e2,x.isWeakSet=r2,x.join=sw,x.kebabCase=K2,x.last=vi,x.lastIndexOf=ow,x.lowerCase=V2,x.lowerFirst=G2,x.lt=i2,x.lte=n2,x.max=$3,x.maxBy=z3,x.mean=k3,x.meanBy=H3,x.min=K3,x.minBy=V3,x.stubArray=Dh,x.stubFalse=xh,x.stubObject=O3,x.stubString=N3,x.stubTrue=R3,x.multiply=G3,x.nth=aw,x.noConflict=A3,x.noop=Ih,x.now=yc,x.pad=W2,x.padEnd=Y2,x.padStart=Q2,x.parseInt=J2,x.random=j2,x.reduce=hb,x.reduceRight=lb,x.repeat=X2,x.replace=Z2,x.result=P2,x.round=W3,x.runInContext=J,x.sample=db,x.size=mb,x.snakeCase=t3,x.some=vb,x.sortedIndex=pw,x.sortedIndexBy=gw,x.sortedIndexOf=mw,x.sortedLastIndex=vw,x.sortedLastIndexBy=yw,x.sortedLastIndexOf=ww,x.startCase=r3,x.startsWith=i3,x.subtract=Y3,x.sum=Q3,x.sumBy=J3,x.template=n3,x.times=T3,x.toFinite=yn,x.toInteger=ae,x.toLength=J0,x.toLower=s3,x.toNumber=yi,x.toSafeInteger=s2,x.toString=Me,x.toUpper=o3,x.trim=a3,x.trimEnd=c3,x.trimStart=u3,x.truncate=h3,x.unescape=l3,x.uniqueId=U3,x.upperCase=f3,x.upperFirst=_h,x.each=B0,x.eachRight=L0,x.first=R0,Sh(x,function(){var n={};return Hi(x,function(o,c){Ne.call(x.prototype,c)||(n[c]=o)}),n}(),{chain:!1}),x.VERSION=i,fi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){x[n].placeholder=x}),fi(["drop","take"],function(n,o){ge.prototype[n]=function(c){c=c===e?1:nr(ae(c),0);var m=this.__filtered__&&!o?new ge(this):this.clone();return m.__filtered__?m.__takeCount__=yr(c,m.__takeCount__):m.__views__.push({size:yr(c,g),type:n+(m.__dir__<0?"Right":"")}),m},ge.prototype[n+"Right"]=function(c){return this.reverse()[n](c).reverse()}}),fi(["filter","map","takeWhile"],function(n,o){var c=o+1,m=c==y||c==M;ge.prototype[n]=function(A){var O=this.clone();return O.__iteratees__.push({iteratee:jt(A,3),type:c}),O.__filtered__=O.__filtered__||m,O}}),fi(["head","last"],function(n,o){var c="take"+(o?"Right":"");ge.prototype[n]=function(){return this[c](1).value()[0]}}),fi(["initial","tail"],function(n,o){var c="drop"+(o?"":"Right");ge.prototype[n]=function(){return this.__filtered__?new ge(this):this[c](1)}}),ge.prototype.compact=function(){return this.filter(qr)},ge.prototype.find=function(n){return this.filter(n).head()},ge.prototype.findLast=function(n){return this.reverse().find(n)},ge.prototype.invokeMap=he(function(n,o){return typeof n=="function"?new ge(this):this.map(function(c){return Ro(c,n,o)})}),ge.prototype.reject=function(n){return this.filter(bc(jt(n)))},ge.prototype.slice=function(n,o){n=ae(n);var c=this;return c.__filtered__&&(n>0||o<0)?new ge(c):(n<0?c=c.takeRight(-n):n&&(c=c.drop(n)),o!==e&&(o=ae(o),c=o<0?c.dropRight(-o):c.take(o-n)),c)},ge.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},ge.prototype.toArray=function(){return this.take(g)},Hi(ge.prototype,function(n,o){var c=/^(?:filter|find|map|reject)|While$/.test(o),m=/^(?:head|last)$/.test(o),A=x[m?"take"+(o=="last"?"Right":""):o],O=m||/^find/.test(o);A&&(x.prototype[o]=function(){var H=this.__wrapped__,W=m?[1]:arguments,X=H instanceof ge,ot=W[0],ct=X||ie(H),dt=function(fe){var be=A.apply(x,Tn([fe],W));return m&&vt?be[0]:be};ct&&c&&typeof ot=="function"&&ot.length!=1&&(X=ct=!1);var vt=this.__chain__,Ft=!!this.__actions__.length,kt=O&&!vt,ue=X&&!Ft;if(!O&&ct){H=ue?H:new ge(this);var Ht=n.apply(H,W);return Ht.__actions__.push({func:mc,args:[dt],thisArg:e}),new pi(Ht,vt)}return kt&&ue?n.apply(this,W):(Ht=this.thru(dt),kt?m?Ht.value()[0]:Ht.value():Ht)})}),fi(["pop","push","shift","sort","splice","unshift"],function(n){var o=za[n],c=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",m=/^(?:pop|shift)$/.test(n);x.prototype[n]=function(){var A=arguments;if(m&&!this.__chain__){var O=this.value();return o.apply(ie(O)?O:[],A)}return this[c](function(H){return o.apply(ie(H)?H:[],A)})}}),Hi(ge.prototype,function(n,o){var c=x[o];if(c){var m=c.name+"";Ne.call(ks,m)||(ks[m]=[]),ks[m].push({name:o,func:c})}}),ks[uc(e,tt).name]=[{name:"wrapper",func:e}],ge.prototype.clone=lv,ge.prototype.reverse=fv,ge.prototype.value=dv,x.prototype.at=zw,x.prototype.chain=kw,x.prototype.commit=Hw,x.prototype.next=Kw,x.prototype.plant=Gw,x.prototype.reverse=Ww,x.prototype.toJSON=x.prototype.valueOf=x.prototype.value=Yw,x.prototype.first=x.prototype.head,Do&&(x.prototype[Do]=Vw),x},js=Hm();Qe?((Qe.exports=js)._=js,Le._=js):we._=js}).call(Wo)})(Tl,Tl.exports);var w9=Object.defineProperty,b9=Object.defineProperties,_9=Object.getOwnPropertyDescriptors,m1=Object.getOwnPropertySymbols,E9=Object.prototype.hasOwnProperty,A9=Object.prototype.propertyIsEnumerable,v1=(r,t,e)=>t in r?w9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Nc=(r,t)=>{for(var e in t||(t={}))E9.call(t,e)&&v1(r,e,t[e]);if(m1)for(var e of m1(t))A9.call(t,e)&&v1(r,e,t[e]);return r},S9=(r,t)=>b9(r,_9(t));function Yn(r,t,e){var i;const s=Fc(r);return((i=t.rpcMap)==null?void 0:i[s.reference])||`${y9}?chainId=${s.namespace}:${s.reference}&projectId=${e}`}function Ns(r){return r.includes(":")?r.split(":")[1]:r}function wm(r){return r.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function I9(r,t){const e=Object.keys(t.namespaces).filter(s=>s.includes(r));if(!e.length)return[];const i=[];return e.forEach(s=>{const a=t.namespaces[s].accounts;i.push(...a)}),i}function nl(r={},t={}){const e=y1(r),i=y1(t);return Tl.exports.merge(e,i)}function y1(r){var t,e,i,s;const a={};if(!oa(r))return a;for(const[u,l]of Object.entries(r)){const d=Zl(u)?[u]:l.chains,f=l.methods||[],w=l.events||[],E=l.rpcMap||{},I=Jo(u);a[I]=S9(Nc(Nc({},a[I]),l),{chains:Uc(d,(t=a[I])==null?void 0:t.chains),methods:Uc(f,(e=a[I])==null?void 0:e.methods),events:Uc(w,(i=a[I])==null?void 0:i.events),rpcMap:Nc(Nc({},E),(s=a[I])==null?void 0:s.rpcMap)})}return a}function D9(r){return r.includes(":")?r.split(":")[2]:r}function w1(r){const t={};for(const[e,i]of Object.entries(r)){const s=i.methods||[],a=i.events||[],u=i.accounts||[],l=Zl(e)?[e]:i.chains?i.chains:wm(i.accounts);t[e]={chains:l,methods:s,events:a,accounts:u}}return t}function sl(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const bm={},He=r=>bm[r],ol=(r,t)=>{bm[r]=t};class x9{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class M9{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(parseInt(t),e),this.chainId=parseInt(t),this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,e){const i=e||Yn(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=parseInt(Ns(e));t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}async handleSwitchChain(t){var e,i;let s=t.request.params?(e=t.request.params[0])==null?void 0:e.chainId:"0x0";s=s.startsWith("0x")?s:`0x${s}`;const a=parseInt(s,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:s}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}}class C9{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class P9{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class O9{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{const i=this.getCardanoRPCUrl(e),s=Ns(e);t[s]=this.createHttpProvider(s,i)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}getCardanoRPCUrl(t){const e=this.namespace.rpcMap;if(e)return e[t]}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||this.getCardanoRPCUrl(t);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class N9{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class R9{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class T9{constructor(t){this.name="near",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){if(this.chainId=t,!this.httpProviders[t]){const i=e||Yn(`${this.name}:${t}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,i)}this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;t[e]=this.createHttpProvider(e,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace);return typeof i>"u"?void 0:new Mn(new Jn(i,He("disableProviderPing")))}}var F9=Object.defineProperty,U9=Object.defineProperties,B9=Object.getOwnPropertyDescriptors,b1=Object.getOwnPropertySymbols,L9=Object.prototype.hasOwnProperty,q9=Object.prototype.propertyIsEnumerable,_1=(r,t,e)=>t in r?F9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Rc=(r,t)=>{for(var e in t||(t={}))L9.call(t,e)&&_1(r,e,t[e]);if(b1)for(var e of b1(t))q9.call(t,e)&&_1(r,e,t[e]);return r},al=(r,t)=>U9(r,B9(t));class uf{constructor(t){this.events=new Ll,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:wa(du({level:(t==null?void 0:t.logger)||p1})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const e=new uf(t);return await e.initialize(),e}async request(t,e,i){const[s,a]=this.validateChain(e);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:Rc({},t),chainId:`${s}:${a}`,topic:this.session.topic,expiry:i})}sendAsync(t,e,i,s){const a=new Date().getTime();this.request(t,i,s).then(u=>e(null,pu(a,u))).catch(u=>e(u,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:Re("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}async authenticate(t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(t),await this.cleanupPendingPairings();const{uri:e,response:i}=await this.client.authenticate(t);e&&(this.uri=e,this.events.emit("display_uri",e));const s=await i();if(this.session=s.session,this.session){const a=w1(this.session.namespaces);this.namespaces=nl(this.namespaces,a),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}removeListener(t,e){this.events.removeListener(t,e)}off(t,e){this.events.off(t,e)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let e=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(e>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:s}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await s().then(a=>{this.session=a;const u=w1(a.namespaces);this.namespaces=nl(this.namespaces,u),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==ym)throw a;e++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,e){try{if(!this.session)return;const[i,s]=this.validateChain(t);this.getProvider(i).setDefaultChain(s,e)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const e=this.client.pairing.getAll();if(cn(e)){for(const i of e)t.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${e.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await cf.init({logger:this.providerOpts.logger||p1,relayUrl:this.providerOpts.relayUrl||g9,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(e=>Jo(e)))];ol("client",this.client),ol("events",this.events),ol("disableProviderPing",this.disableProviderPing),t.forEach(e=>{if(!this.session)return;const i=I9(e,this.session),s=wm(i),a=nl(this.namespaces,this.optionalNamespaces),u=al(Rc({},a[e]),{accounts:i,chains:s});switch(e){case"eip155":this.rpcProviders[e]=new M9({namespace:u});break;case"solana":this.rpcProviders[e]=new C9({namespace:u});break;case"cosmos":this.rpcProviders[e]=new P9({namespace:u});break;case"polkadot":this.rpcProviders[e]=new x9({namespace:u});break;case"cip34":this.rpcProviders[e]=new O9({namespace:u});break;case"elrond":this.rpcProviders[e]=new N9({namespace:u});break;case"multiversx":this.rpcProviders[e]=new R9({namespace:u});break;case"near":this.rpcProviders[e]=new T9({namespace:u});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:e}=t,{event:i}=e;if(i.name==="accountsChanged"){const s=i.data;s&&cn(s)&&this.events.emit("accountsChanged",s.map(D9))}else if(i.name==="chainChanged"){const s=e.chainId,a=e.event.data,u=Jo(s),l=sl(s)!==sl(a)?`${u}:${sl(a)}`:s;this.onChainChanged(l)}else this.events.emit(i.name,i.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:e})=>{var i;const{namespaces:s}=e,a=(i=this.client)==null?void 0:i.session.get(t);this.session=al(Rc({},a),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:e})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",al(Rc({},Re("USER_DISCONNECTED")),{data:t.topic}))}),this.on(Cn.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var e;this.getProvider(t).updateNamespace((e=this.session)==null?void 0:e.namespaces[t])})}setNamespaces(t){const{namespaces:e,optionalNamespaces:i,sessionProperties:s}=t;e&&Object.keys(e).length&&(this.namespaces=e),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=s,this.persist("namespaces",e),this.persist("optionalNamespaces",i)}validateChain(t){const[e,i]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[e,i];if(e&&!Object.keys(this.namespaces||{}).map(u=>Jo(u)).includes(e))throw new Error(`Namespace '${e}' is not configured. Please call connect() first with namespace config.`);if(e&&i)return[e,i];const s=Jo(Object.keys(this.namespaces)[0]),a=this.rpcProviders[s].getDefaultChain();return[s,a]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,e=!1){if(!this.namespaces)return;const[i,s]=this.validateChain(t);s&&(e||this.getProvider(i).setDefaultChain(s),this.namespaces[i]?this.namespaces[i].defaultChain=s:this.namespaces[`${i}:${s}`]?this.namespaces[`${i}:${s}`].defaultChain=s:this.namespaces[`${i}:${s}`]={defaultChain:s},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,e){this.client.core.storage.setItem(`${g1}/${t}`,e)}async getFromStore(t){return await this.client.core.storage.getItem(`${g1}/${t}`)}}const j9=uf,$9="wc",z9="ethereum_provider",k9=`${$9}@2:${z9}:`,H9="https://rpc.walletconnect.com/v1/",Fl=["eth_sendTransaction","personal_sign"],K9=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],Ul=["chainChanged","accountsChanged"],V9=["chainChanged","accountsChanged","message","disconnect","connect"];var G9=Object.defineProperty,W9=Object.defineProperties,Y9=Object.getOwnPropertyDescriptors,E1=Object.getOwnPropertySymbols,Q9=Object.prototype.hasOwnProperty,J9=Object.prototype.propertyIsEnumerable,A1=(r,t,e)=>t in r?G9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,ro=(r,t)=>{for(var e in t||(t={}))Q9.call(t,e)&&A1(r,e,t[e]);if(E1)for(var e of E1(t))J9.call(t,e)&&A1(r,e,t[e]);return r},cl=(r,t)=>W9(r,Y9(t));function nu(r){return Number(r[0].split(":")[1])}function Tc(r){return`0x${r.toString(16)}`}function X9(r){const{chains:t,optionalChains:e,methods:i,optionalMethods:s,events:a,optionalEvents:u,rpcMap:l}=r;if(!cn(t))throw new Error("Invalid chains");const d={chains:t,methods:i||Fl,events:a||Ul,rpcMap:ro({},t.length?{[nu(t)]:l[nu(t)]}:{})},f=a==null?void 0:a.filter(D=>!Ul.includes(D)),w=i==null?void 0:i.filter(D=>!Fl.includes(D));if(!e&&!u&&!s&&!(f!=null&&f.length)&&!(w!=null&&w.length))return{required:t.length?d:void 0};const E=(f==null?void 0:f.length)&&(w==null?void 0:w.length)||!e,I={chains:[...new Set(E?d.chains.concat(e||[]):e)],methods:[...new Set(d.methods.concat(s!=null&&s.length?s:K9))],events:[...new Set(d.events.concat(u!=null&&u.length?u:V9))],rpcMap:l};return{required:t.length?d:void 0,optional:e.length?I:void 0}}class hf{constructor(){this.events=new Di.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=k9,this.on=(t,e)=>(this.events.on(t,e),this),this.once=(t,e)=>(this.events.once(t,e),this),this.removeListener=(t,e)=>(this.events.removeListener(t,e),this),this.off=(t,e)=>(this.events.off(t,e),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const e=new hf;return await e.initialize(t),e}async request(t,e){return await this.signer.request(t,this.formatChainId(this.chainId),e)}sendAsync(t,e,i){this.signer.sendAsync(t,e,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:e,optional:i}=X9(this.rpc);try{const s=await new Promise(async(u,l)=>{var d;this.rpc.showQrModal&&((d=this.modal)==null||d.subscribeModal(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(cl(ro({namespaces:ro({},e&&{[this.namespace]:e})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(f=>{u(f)}).catch(f=>{l(new Error(f.message))})});if(!s)return;const a=Nd(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Tc(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{this.modal&&this.modal.closeModal()}}async authenticate(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:t==null?void 0:t.chains});try{const e=await new Promise(async(s,a)=>{var u;this.rpc.showQrModal&&((u=this.modal)==null||u.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(cl(ro({},t),{chains:this.rpc.chains})).then(l=>{s(l)}).catch(l=>{a(new Error(l.message))})}),i=e.session;if(i){const s=Nd(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Tc(this.chainId)})}return e}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:e}=t,{event:i}=e;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const e=parseInt(t);this.chainId=e,this.events.emit("chainChanged",Tc(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",cl(ro({},Re("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var e,i;this.rpc.showQrModal&&((e=this.modal)==null||e.closeModal(),(i=this.modal)==null||i.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const e=t.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));e.length&&(this.chainId=e[0],this.events.emit("chainChanged",Tc(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const e=this.parseChainId(t);this.chainId=e,this.switchEthereumChain(e)}}parseAccountId(t){const[e,i,s]=t.split(":");return{chainId:`${e}:${i}`,address:s}}setAccounts(t){this.accounts=t.filter(e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId).map(e=>this.parseAccountId(e).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var e,i;const s=(e=t==null?void 0:t.chains)!=null?e:[],a=(i=t==null?void 0:t.optionalChains)!=null?i:[],u=s.concat(a);if(!u.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=s.length?(t==null?void 0:t.methods)||Fl:[],d=s.length?(t==null?void 0:t.events)||Ul:[],f=(t==null?void 0:t.optionalMethods)||[],w=(t==null?void 0:t.optionalEvents)||[],E=(t==null?void 0:t.rpcMap)||this.buildRpcMap(u,t.projectId),I=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:s==null?void 0:s.map(D=>this.formatChainId(D)),optionalChains:a.map(D=>this.formatChainId(D)),methods:l,events:d,optionalMethods:f,optionalEvents:w,rpcMap:E,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:I,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,e){const i={};return t.forEach(s=>{i[s]=this.getRpcUrl(s,e)}),i}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?nu(this.rpc.chains):nu(this.rpc.optionalChains),this.signer=await j9.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{const{WalletConnectModal:i}=await t6(()=>import("./index-bdd52a72.js").then(s=>s.i),["assets/index-bdd52a72.js","assets/index-9b8a6048.js","assets/index-94a0e6a0.css"]);e=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(e)try{this.modal=new e(ro({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:e,optionalChains:i,rpcMap:s}=t;e&&cn(e)&&(this.rpc.chains=e.map(a=>this.formatChainId(a)),e.forEach(a=>{this.rpc.rpcMap[a]=(s==null?void 0:s[a])||this.getRpcUrl(a)})),i&&cn(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(a=>this.formatChainId(a)),i.forEach(a=>{this.rpc.rpcMap[a]=(s==null?void 0:s[a])||this.getRpcUrl(a)}))}getRpcUrl(t,e){var i;return((i=this.rpc.rpcMap)==null?void 0:i[t])||`${H9}?chainId=eip155:${t}&projectId=${e||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),e=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:e==null?void 0:e.accounts),this.setAccounts(e==null?void 0:e.accounts)}catch(t){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(t),await this.disconnect().catch(e=>this.signer.logger.warn(e))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(e=>this.parseAccount(e))}}const IM=hf;export{IM as EthereumProvider,V9 as OPTIONAL_EVENTS,K9 as OPTIONAL_METHODS,Ul as REQUIRED_EVENTS,Fl as REQUIRED_METHODS,hf as default};
56
+ }`;var ue=ad(function(){return Se(O,Ft+"return "+dt).apply(e,H)});if(ue.source=dt,vh(ue))throw ue;return ue}function s3(n){return Me(n).toLowerCase()}function o3(n){return Me(n).toUpperCase()}function a3(n,o,c){if(n=Me(n),n&&(c||o===e))return mf(n);if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=Ci(o),O=vf(m,A),H=yf(m,A)+1;return jn(m,O,H).join("")}function c3(n,o,c){if(n=Me(n),n&&(c||o===e))return n.slice(0,bf(n)+1);if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=yf(m,Ci(o))+1;return jn(m,0,A).join("")}function u3(n,o,c){if(n=Me(n),n&&(c||o===e))return n.replace(Yt,"");if(!n||!(o=Qr(o)))return n;var m=Ci(n),A=vf(m,Ci(o));return jn(m,A).join("")}function h3(n,o){var c=ft,m=pt;if(Ge(o)){var A="separator"in o?o.separator:A;c="length"in o?ae(o.length):c,m="omission"in o?Qr(o.omission):m}n=Me(n);var O=n.length;if(Ls(n)){var H=Ci(n);O=H.length}if(c>=O)return n;var W=c-qs(m);if(W<1)return m;var X=H?jn(H,0,W).join(""):n.slice(0,W);if(A===e)return X+m;if(H&&(W+=X.length-W),yh(A)){if(n.slice(W).search(A)){var ot,ct=X;for(A.global||(A=Tu(A.source,Me(le.exec(A))+"g")),A.lastIndex=0;ot=A.exec(ct);)var dt=ot.index;X=X.slice(0,dt===e?W:dt)}}else if(n.indexOf(Qr(A),W)!=W){var vt=X.lastIndexOf(A);vt>-1&&(X=X.slice(0,vt))}return X+m}function l3(n){return n=Me(n),n&&Gt.test(n)?n.replace(_e,jm):n}var f3=Vs(function(n,o,c){return n+(c?" ":"")+o.toUpperCase()}),_h=c0("toUpperCase");function od(n,o,c){return n=Me(n),o=c?e:o,o===e?Fm(n)?km(n):Dm(n):n.match(o)||[]}var ad=he(function(n,o){try{return cr(n,e,o)}catch(c){return vh(c)?c:new ee(c)}}),d3=gn(function(n,o){return fi(o,function(c){c=Vi(c),dn(n,c,gh(n[c],n))}),n});function p3(n){var o=n==null?0:n.length,c=jt();return n=o?ke(n,function(m){if(typeof m[1]!="function")throw new di(u);return[c(m[0]),m[1]]}):[],he(function(m){for(var A=-1;++A<o;){var O=n[A];if(cr(O[0],this,m))return cr(O[1],this,m)}})}function g3(n){return jv(gi(n,E))}function Eh(n){return function(){return n}}function m3(n,o){return n==null||n!==n?o:n}var v3=h0(),y3=h0(!0);function qr(n){return n}function Ah(n){return jf(typeof n=="function"?n:gi(n,E))}function w3(n){return zf(gi(n,E))}function b3(n,o){return kf(n,gi(o,E))}var _3=he(function(n,o){return function(c){return Ro(c,n,o)}}),E3=he(function(n,o){return function(c){return Ro(n,c,o)}});function Sh(n,o,c){var m=ur(o),A=nc(o,m);c==null&&!(Ge(o)&&(A.length||!m.length))&&(c=o,o=n,n=this,A=nc(o,ur(o)));var O=!(Ge(c)&&"chain"in c)||!!c.chain,H=vn(n);return fi(A,function(W){var X=o[W];n[W]=X,H&&(n.prototype[W]=function(){var ot=this.__chain__;if(O||ot){var ct=n(this.__wrapped__),dt=ct.__actions__=Ur(this.__actions__);return dt.push({func:X,args:arguments,thisArg:n}),ct.__chain__=ot,ct}return X.apply(n,Tn([this.value()],arguments))})}),n}function A3(){return we._===this&&(we._=Ym),this}function Ih(){}function S3(n){return n=ae(n),he(function(o){return Hf(o,n)})}var I3=rh(ke),D3=rh(lf),x3=rh(xu);function cd(n){return uh(n)?Mu(Vi(n)):iy(n)}function M3(n){return function(o){return n==null?e:ps(n,o)}}var C3=f0(),P3=f0(!0);function Dh(){return[]}function xh(){return!1}function O3(){return{}}function N3(){return""}function R3(){return!0}function T3(n,o){if(n=ae(n),n<1||n>R)return[];var c=g,m=yr(n,g);o=jt(o),n-=g;for(var A=Ou(m,o);++c<n;)o(c);return A}function F3(n){return ie(n)?ke(n,Vi):Jr(n)?[n]:Ur(M0(Me(n)))}function U3(n){var o=++Gm;return Me(n)+o}var B3=hc(function(n,o){return n+o},0),L3=ih("ceil"),q3=hc(function(n,o){return n/o},1),j3=ih("floor");function $3(n){return n&&n.length?ic(n,qr,zu):e}function z3(n,o){return n&&n.length?ic(n,jt(o,2),zu):e}function k3(n){return pf(n,qr)}function H3(n,o){return pf(n,jt(o,2))}function K3(n){return n&&n.length?ic(n,qr,Vu):e}function V3(n,o){return n&&n.length?ic(n,jt(o,2),Vu):e}var G3=hc(function(n,o){return n*o},1),W3=ih("round"),Y3=hc(function(n,o){return n-o},0);function Q3(n){return n&&n.length?Pu(n,qr):0}function J3(n,o){return n&&n.length?Pu(n,jt(o,2)):0}return x.after=wb,x.ary=q0,x.assign=o2,x.assignIn=Z0,x.assignInWith=Ac,x.assignWith=a2,x.at=c2,x.before=j0,x.bind=gh,x.bindAll=d3,x.bindKey=$0,x.castArray=Ob,x.chain=U0,x.chunk=jy,x.compact=$y,x.concat=zy,x.cond=p3,x.conforms=g3,x.constant=Eh,x.countBy=Qw,x.create=u2,x.curry=z0,x.curryRight=k0,x.debounce=H0,x.defaults=h2,x.defaultsDeep=l2,x.defer=bb,x.delay=_b,x.difference=ky,x.differenceBy=Hy,x.differenceWith=Ky,x.drop=Vy,x.dropRight=Gy,x.dropRightWhile=Wy,x.dropWhile=Yy,x.fill=Qy,x.filter=Xw,x.flatMap=eb,x.flatMapDeep=rb,x.flatMapDepth=ib,x.flatten=N0,x.flattenDeep=Jy,x.flattenDepth=Xy,x.flip=Eb,x.flow=v3,x.flowRight=y3,x.fromPairs=Zy,x.functions=y2,x.functionsIn=w2,x.groupBy=nb,x.initial=ew,x.intersection=rw,x.intersectionBy=iw,x.intersectionWith=nw,x.invert=_2,x.invertBy=E2,x.invokeMap=ob,x.iteratee=Ah,x.keyBy=ab,x.keys=ur,x.keysIn=Lr,x.map=vc,x.mapKeys=S2,x.mapValues=I2,x.matches=w3,x.matchesProperty=b3,x.memoize=wc,x.merge=D2,x.mergeWith=td,x.method=_3,x.methodOf=E3,x.mixin=Sh,x.negate=bc,x.nthArg=S3,x.omit=x2,x.omitBy=M2,x.once=Ab,x.orderBy=cb,x.over=I3,x.overArgs=Sb,x.overEvery=D3,x.overSome=x3,x.partial=mh,x.partialRight=K0,x.partition=ub,x.pick=C2,x.pickBy=ed,x.property=cd,x.propertyOf=M3,x.pull=cw,x.pullAll=T0,x.pullAllBy=uw,x.pullAllWith=hw,x.pullAt=lw,x.range=C3,x.rangeRight=P3,x.rearg=Ib,x.reject=fb,x.remove=fw,x.rest=Db,x.reverse=dh,x.sampleSize=pb,x.set=O2,x.setWith=N2,x.shuffle=gb,x.slice=dw,x.sortBy=yb,x.sortedUniq=bw,x.sortedUniqBy=_w,x.split=e3,x.spread=xb,x.tail=Ew,x.take=Aw,x.takeRight=Sw,x.takeRightWhile=Iw,x.takeWhile=Dw,x.tap=$w,x.throttle=Mb,x.thru=mc,x.toArray=Q0,x.toPairs=rd,x.toPairsIn=id,x.toPath=F3,x.toPlainObject=X0,x.transform=R2,x.unary=Cb,x.union=xw,x.unionBy=Mw,x.unionWith=Cw,x.uniq=Pw,x.uniqBy=Ow,x.uniqWith=Nw,x.unset=T2,x.unzip=ph,x.unzipWith=F0,x.update=F2,x.updateWith=U2,x.values=Ys,x.valuesIn=B2,x.without=Rw,x.words=od,x.wrap=Pb,x.xor=Tw,x.xorBy=Fw,x.xorWith=Uw,x.zip=Bw,x.zipObject=Lw,x.zipObjectDeep=qw,x.zipWith=jw,x.entries=rd,x.entriesIn=id,x.extend=Z0,x.extendWith=Ac,Sh(x,x),x.add=B3,x.attempt=ad,x.camelCase=$2,x.capitalize=nd,x.ceil=L3,x.clamp=L2,x.clone=Nb,x.cloneDeep=Tb,x.cloneDeepWith=Fb,x.cloneWith=Rb,x.conformsTo=Ub,x.deburr=sd,x.defaultTo=m3,x.divide=q3,x.endsWith=z2,x.eq=Oi,x.escape=k2,x.escapeRegExp=H2,x.every=Jw,x.find=Zw,x.findIndex=P0,x.findKey=f2,x.findLast=tb,x.findLastIndex=O0,x.findLastKey=d2,x.floor=j3,x.forEach=B0,x.forEachRight=L0,x.forIn=p2,x.forInRight=g2,x.forOwn=m2,x.forOwnRight=v2,x.get=wh,x.gt=Bb,x.gte=Lb,x.has=b2,x.hasIn=bh,x.head=R0,x.identity=qr,x.includes=sb,x.indexOf=tw,x.inRange=q2,x.invoke=A2,x.isArguments=vs,x.isArray=ie,x.isArrayBuffer=qb,x.isArrayLike=Br,x.isArrayLikeObject=Je,x.isBoolean=jb,x.isBuffer=$n,x.isDate=$b,x.isElement=zb,x.isEmpty=kb,x.isEqual=Hb,x.isEqualWith=Kb,x.isError=vh,x.isFinite=Vb,x.isFunction=vn,x.isInteger=V0,x.isLength=_c,x.isMap=G0,x.isMatch=Gb,x.isMatchWith=Wb,x.isNaN=Yb,x.isNative=Qb,x.isNil=Xb,x.isNull=Jb,x.isNumber=W0,x.isObject=Ge,x.isObjectLike=We,x.isPlainObject=qo,x.isRegExp=yh,x.isSafeInteger=Zb,x.isSet=Y0,x.isString=Ec,x.isSymbol=Jr,x.isTypedArray=Ws,x.isUndefined=t2,x.isWeakMap=e2,x.isWeakSet=r2,x.join=sw,x.kebabCase=K2,x.last=vi,x.lastIndexOf=ow,x.lowerCase=V2,x.lowerFirst=G2,x.lt=i2,x.lte=n2,x.max=$3,x.maxBy=z3,x.mean=k3,x.meanBy=H3,x.min=K3,x.minBy=V3,x.stubArray=Dh,x.stubFalse=xh,x.stubObject=O3,x.stubString=N3,x.stubTrue=R3,x.multiply=G3,x.nth=aw,x.noConflict=A3,x.noop=Ih,x.now=yc,x.pad=W2,x.padEnd=Y2,x.padStart=Q2,x.parseInt=J2,x.random=j2,x.reduce=hb,x.reduceRight=lb,x.repeat=X2,x.replace=Z2,x.result=P2,x.round=W3,x.runInContext=J,x.sample=db,x.size=mb,x.snakeCase=t3,x.some=vb,x.sortedIndex=pw,x.sortedIndexBy=gw,x.sortedIndexOf=mw,x.sortedLastIndex=vw,x.sortedLastIndexBy=yw,x.sortedLastIndexOf=ww,x.startCase=r3,x.startsWith=i3,x.subtract=Y3,x.sum=Q3,x.sumBy=J3,x.template=n3,x.times=T3,x.toFinite=yn,x.toInteger=ae,x.toLength=J0,x.toLower=s3,x.toNumber=yi,x.toSafeInteger=s2,x.toString=Me,x.toUpper=o3,x.trim=a3,x.trimEnd=c3,x.trimStart=u3,x.truncate=h3,x.unescape=l3,x.uniqueId=U3,x.upperCase=f3,x.upperFirst=_h,x.each=B0,x.eachRight=L0,x.first=R0,Sh(x,function(){var n={};return Hi(x,function(o,c){Ne.call(x.prototype,c)||(n[c]=o)}),n}(),{chain:!1}),x.VERSION=i,fi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){x[n].placeholder=x}),fi(["drop","take"],function(n,o){ge.prototype[n]=function(c){c=c===e?1:nr(ae(c),0);var m=this.__filtered__&&!o?new ge(this):this.clone();return m.__filtered__?m.__takeCount__=yr(c,m.__takeCount__):m.__views__.push({size:yr(c,g),type:n+(m.__dir__<0?"Right":"")}),m},ge.prototype[n+"Right"]=function(c){return this.reverse()[n](c).reverse()}}),fi(["filter","map","takeWhile"],function(n,o){var c=o+1,m=c==y||c==M;ge.prototype[n]=function(A){var O=this.clone();return O.__iteratees__.push({iteratee:jt(A,3),type:c}),O.__filtered__=O.__filtered__||m,O}}),fi(["head","last"],function(n,o){var c="take"+(o?"Right":"");ge.prototype[n]=function(){return this[c](1).value()[0]}}),fi(["initial","tail"],function(n,o){var c="drop"+(o?"":"Right");ge.prototype[n]=function(){return this.__filtered__?new ge(this):this[c](1)}}),ge.prototype.compact=function(){return this.filter(qr)},ge.prototype.find=function(n){return this.filter(n).head()},ge.prototype.findLast=function(n){return this.reverse().find(n)},ge.prototype.invokeMap=he(function(n,o){return typeof n=="function"?new ge(this):this.map(function(c){return Ro(c,n,o)})}),ge.prototype.reject=function(n){return this.filter(bc(jt(n)))},ge.prototype.slice=function(n,o){n=ae(n);var c=this;return c.__filtered__&&(n>0||o<0)?new ge(c):(n<0?c=c.takeRight(-n):n&&(c=c.drop(n)),o!==e&&(o=ae(o),c=o<0?c.dropRight(-o):c.take(o-n)),c)},ge.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},ge.prototype.toArray=function(){return this.take(g)},Hi(ge.prototype,function(n,o){var c=/^(?:filter|find|map|reject)|While$/.test(o),m=/^(?:head|last)$/.test(o),A=x[m?"take"+(o=="last"?"Right":""):o],O=m||/^find/.test(o);A&&(x.prototype[o]=function(){var H=this.__wrapped__,W=m?[1]:arguments,X=H instanceof ge,ot=W[0],ct=X||ie(H),dt=function(fe){var be=A.apply(x,Tn([fe],W));return m&&vt?be[0]:be};ct&&c&&typeof ot=="function"&&ot.length!=1&&(X=ct=!1);var vt=this.__chain__,Ft=!!this.__actions__.length,kt=O&&!vt,ue=X&&!Ft;if(!O&&ct){H=ue?H:new ge(this);var Ht=n.apply(H,W);return Ht.__actions__.push({func:mc,args:[dt],thisArg:e}),new pi(Ht,vt)}return kt&&ue?n.apply(this,W):(Ht=this.thru(dt),kt?m?Ht.value()[0]:Ht.value():Ht)})}),fi(["pop","push","shift","sort","splice","unshift"],function(n){var o=za[n],c=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",m=/^(?:pop|shift)$/.test(n);x.prototype[n]=function(){var A=arguments;if(m&&!this.__chain__){var O=this.value();return o.apply(ie(O)?O:[],A)}return this[c](function(H){return o.apply(ie(H)?H:[],A)})}}),Hi(ge.prototype,function(n,o){var c=x[o];if(c){var m=c.name+"";Ne.call(ks,m)||(ks[m]=[]),ks[m].push({name:o,func:c})}}),ks[uc(e,tt).name]=[{name:"wrapper",func:e}],ge.prototype.clone=lv,ge.prototype.reverse=fv,ge.prototype.value=dv,x.prototype.at=zw,x.prototype.chain=kw,x.prototype.commit=Hw,x.prototype.next=Kw,x.prototype.plant=Gw,x.prototype.reverse=Ww,x.prototype.toJSON=x.prototype.valueOf=x.prototype.value=Yw,x.prototype.first=x.prototype.head,Do&&(x.prototype[Do]=Vw),x},js=Hm();Qe?((Qe.exports=js)._=js,Le._=js):we._=js}).call(Wo)})(Tl,Tl.exports);var w9=Object.defineProperty,b9=Object.defineProperties,_9=Object.getOwnPropertyDescriptors,m1=Object.getOwnPropertySymbols,E9=Object.prototype.hasOwnProperty,A9=Object.prototype.propertyIsEnumerable,v1=(r,t,e)=>t in r?w9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Nc=(r,t)=>{for(var e in t||(t={}))E9.call(t,e)&&v1(r,e,t[e]);if(m1)for(var e of m1(t))A9.call(t,e)&&v1(r,e,t[e]);return r},S9=(r,t)=>b9(r,_9(t));function Yn(r,t,e){var i;const s=Fc(r);return((i=t.rpcMap)==null?void 0:i[s.reference])||`${y9}?chainId=${s.namespace}:${s.reference}&projectId=${e}`}function Ns(r){return r.includes(":")?r.split(":")[1]:r}function wm(r){return r.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function I9(r,t){const e=Object.keys(t.namespaces).filter(s=>s.includes(r));if(!e.length)return[];const i=[];return e.forEach(s=>{const a=t.namespaces[s].accounts;i.push(...a)}),i}function nl(r={},t={}){const e=y1(r),i=y1(t);return Tl.exports.merge(e,i)}function y1(r){var t,e,i,s;const a={};if(!oa(r))return a;for(const[u,l]of Object.entries(r)){const d=Zl(u)?[u]:l.chains,f=l.methods||[],w=l.events||[],E=l.rpcMap||{},I=Jo(u);a[I]=S9(Nc(Nc({},a[I]),l),{chains:Uc(d,(t=a[I])==null?void 0:t.chains),methods:Uc(f,(e=a[I])==null?void 0:e.methods),events:Uc(w,(i=a[I])==null?void 0:i.events),rpcMap:Nc(Nc({},E),(s=a[I])==null?void 0:s.rpcMap)})}return a}function D9(r){return r.includes(":")?r.split(":")[2]:r}function w1(r){const t={};for(const[e,i]of Object.entries(r)){const s=i.methods||[],a=i.events||[],u=i.accounts||[],l=Zl(e)?[e]:i.chains?i.chains:wm(i.accounts);t[e]={chains:l,methods:s,events:a,accounts:u}}return t}function sl(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const bm={},He=r=>bm[r],ol=(r,t)=>{bm[r]=t};class x9{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class M9{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(parseInt(t),e),this.chainId=parseInt(t),this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,e){const i=e||Yn(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=parseInt(Ns(e));t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}async handleSwitchChain(t){var e,i;let s=t.request.params?(e=t.request.params[0])==null?void 0:e.chainId:"0x0";s=s.startsWith("0x")?s:`0x${s}`;const a=parseInt(s,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:s}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}}class C9{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class P9{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class O9{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{const i=this.getCardanoRPCUrl(e),s=Ns(e);t[s]=this.createHttpProvider(s,i)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}getCardanoRPCUrl(t){const e=this.namespace.rpcMap;if(e)return e[t]}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||this.getCardanoRPCUrl(t);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class N9{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class R9{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){this.httpProviders[t]||this.setHttpProvider(t,e),this.chainId=t,this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;const s=Ns(e);t[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);return new Mn(new Jn(i,He("disableProviderPing")))}}class T9{constructor(t){this.name="near",this.namespace=t.namespace,this.events=He("events"),this.client=He("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,e){if(this.chainId=t,!this.httpProviders[t]){const i=e||Yn(`${this.name}:${t}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,i)}this.events.emit(Cn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(e=>{var i;t[e]=this.createHttpProvider(e,(i=this.namespace.rpcMap)==null?void 0:i[e])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,e=this.httpProviders[t];if(typeof e>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return e}setHttpProvider(t,e){const i=this.createHttpProvider(t,e);i&&(this.httpProviders[t]=i)}createHttpProvider(t,e){const i=e||Yn(t,this.namespace);return typeof i>"u"?void 0:new Mn(new Jn(i,He("disableProviderPing")))}}var F9=Object.defineProperty,U9=Object.defineProperties,B9=Object.getOwnPropertyDescriptors,b1=Object.getOwnPropertySymbols,L9=Object.prototype.hasOwnProperty,q9=Object.prototype.propertyIsEnumerable,_1=(r,t,e)=>t in r?F9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,Rc=(r,t)=>{for(var e in t||(t={}))L9.call(t,e)&&_1(r,e,t[e]);if(b1)for(var e of b1(t))q9.call(t,e)&&_1(r,e,t[e]);return r},al=(r,t)=>U9(r,B9(t));class uf{constructor(t){this.events=new Ll,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:wa(du({level:(t==null?void 0:t.logger)||p1})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const e=new uf(t);return await e.initialize(),e}async request(t,e,i){const[s,a]=this.validateChain(e);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:Rc({},t),chainId:`${s}:${a}`,topic:this.session.topic,expiry:i})}sendAsync(t,e,i,s){const a=new Date().getTime();this.request(t,i,s).then(u=>e(null,pu(a,u))).catch(u=>e(u,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:Re("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}async authenticate(t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(t),await this.cleanupPendingPairings();const{uri:e,response:i}=await this.client.authenticate(t);e&&(this.uri=e,this.events.emit("display_uri",e));const s=await i();if(this.session=s.session,this.session){const a=w1(this.session.namespaces);this.namespaces=nl(this.namespaces,a),this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(t,e){this.events.on(t,e)}once(t,e){this.events.once(t,e)}removeListener(t,e){this.events.removeListener(t,e)}off(t,e){this.events.off(t,e)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let e=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(e>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:s}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await s().then(a=>{this.session=a;const u=w1(a.namespaces);this.namespaces=nl(this.namespaces,u),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==ym)throw a;e++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,e){try{if(!this.session)return;const[i,s]=this.validateChain(t);this.getProvider(i).setDefaultChain(s,e)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const e=this.client.pairing.getAll();if(cn(e)){for(const i of e)t.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${e.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await cf.init({logger:this.providerOpts.logger||p1,relayUrl:this.providerOpts.relayUrl||g9,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(e=>Jo(e)))];ol("client",this.client),ol("events",this.events),ol("disableProviderPing",this.disableProviderPing),t.forEach(e=>{if(!this.session)return;const i=I9(e,this.session),s=wm(i),a=nl(this.namespaces,this.optionalNamespaces),u=al(Rc({},a[e]),{accounts:i,chains:s});switch(e){case"eip155":this.rpcProviders[e]=new M9({namespace:u});break;case"solana":this.rpcProviders[e]=new C9({namespace:u});break;case"cosmos":this.rpcProviders[e]=new P9({namespace:u});break;case"polkadot":this.rpcProviders[e]=new x9({namespace:u});break;case"cip34":this.rpcProviders[e]=new O9({namespace:u});break;case"elrond":this.rpcProviders[e]=new N9({namespace:u});break;case"multiversx":this.rpcProviders[e]=new R9({namespace:u});break;case"near":this.rpcProviders[e]=new T9({namespace:u});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:e}=t,{event:i}=e;if(i.name==="accountsChanged"){const s=i.data;s&&cn(s)&&this.events.emit("accountsChanged",s.map(D9))}else if(i.name==="chainChanged"){const s=e.chainId,a=e.event.data,u=Jo(s),l=sl(s)!==sl(a)?`${u}:${sl(a)}`:s;this.onChainChanged(l)}else this.events.emit(i.name,i.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:e})=>{var i;const{namespaces:s}=e,a=(i=this.client)==null?void 0:i.session.get(t);this.session=al(Rc({},a),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:e})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",al(Rc({},Re("USER_DISCONNECTED")),{data:t.topic}))}),this.on(Cn.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var e;this.getProvider(t).updateNamespace((e=this.session)==null?void 0:e.namespaces[t])})}setNamespaces(t){const{namespaces:e,optionalNamespaces:i,sessionProperties:s}=t;e&&Object.keys(e).length&&(this.namespaces=e),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=s,this.persist("namespaces",e),this.persist("optionalNamespaces",i)}validateChain(t){const[e,i]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[e,i];if(e&&!Object.keys(this.namespaces||{}).map(u=>Jo(u)).includes(e))throw new Error(`Namespace '${e}' is not configured. Please call connect() first with namespace config.`);if(e&&i)return[e,i];const s=Jo(Object.keys(this.namespaces)[0]),a=this.rpcProviders[s].getDefaultChain();return[s,a]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,e=!1){if(!this.namespaces)return;const[i,s]=this.validateChain(t);s&&(e||this.getProvider(i).setDefaultChain(s),this.namespaces[i]?this.namespaces[i].defaultChain=s:this.namespaces[`${i}:${s}`]?this.namespaces[`${i}:${s}`].defaultChain=s:this.namespaces[`${i}:${s}`]={defaultChain:s},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,e){this.client.core.storage.setItem(`${g1}/${t}`,e)}async getFromStore(t){return await this.client.core.storage.getItem(`${g1}/${t}`)}}const j9=uf,$9="wc",z9="ethereum_provider",k9=`${$9}@2:${z9}:`,H9="https://rpc.walletconnect.com/v1/",Fl=["eth_sendTransaction","personal_sign"],K9=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],Ul=["chainChanged","accountsChanged"],V9=["chainChanged","accountsChanged","message","disconnect","connect"];var G9=Object.defineProperty,W9=Object.defineProperties,Y9=Object.getOwnPropertyDescriptors,E1=Object.getOwnPropertySymbols,Q9=Object.prototype.hasOwnProperty,J9=Object.prototype.propertyIsEnumerable,A1=(r,t,e)=>t in r?G9(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,ro=(r,t)=>{for(var e in t||(t={}))Q9.call(t,e)&&A1(r,e,t[e]);if(E1)for(var e of E1(t))J9.call(t,e)&&A1(r,e,t[e]);return r},cl=(r,t)=>W9(r,Y9(t));function nu(r){return Number(r[0].split(":")[1])}function Tc(r){return`0x${r.toString(16)}`}function X9(r){const{chains:t,optionalChains:e,methods:i,optionalMethods:s,events:a,optionalEvents:u,rpcMap:l}=r;if(!cn(t))throw new Error("Invalid chains");const d={chains:t,methods:i||Fl,events:a||Ul,rpcMap:ro({},t.length?{[nu(t)]:l[nu(t)]}:{})},f=a==null?void 0:a.filter(D=>!Ul.includes(D)),w=i==null?void 0:i.filter(D=>!Fl.includes(D));if(!e&&!u&&!s&&!(f!=null&&f.length)&&!(w!=null&&w.length))return{required:t.length?d:void 0};const E=(f==null?void 0:f.length)&&(w==null?void 0:w.length)||!e,I={chains:[...new Set(E?d.chains.concat(e||[]):e)],methods:[...new Set(d.methods.concat(s!=null&&s.length?s:K9))],events:[...new Set(d.events.concat(u!=null&&u.length?u:V9))],rpcMap:l};return{required:t.length?d:void 0,optional:e.length?I:void 0}}class hf{constructor(){this.events=new Di.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=k9,this.on=(t,e)=>(this.events.on(t,e),this),this.once=(t,e)=>(this.events.once(t,e),this),this.removeListener=(t,e)=>(this.events.removeListener(t,e),this),this.off=(t,e)=>(this.events.off(t,e),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const e=new hf;return await e.initialize(t),e}async request(t,e){return await this.signer.request(t,this.formatChainId(this.chainId),e)}sendAsync(t,e,i){this.signer.sendAsync(t,e,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:e,optional:i}=X9(this.rpc);try{const s=await new Promise(async(u,l)=>{var d;this.rpc.showQrModal&&((d=this.modal)==null||d.subscribeModal(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(cl(ro({namespaces:ro({},e&&{[this.namespace]:e})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(f=>{u(f)}).catch(f=>{l(new Error(f.message))})});if(!s)return;const a=Nd(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Tc(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{this.modal&&this.modal.closeModal()}}async authenticate(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:t==null?void 0:t.chains});try{const e=await new Promise(async(s,a)=>{var u;this.rpc.showQrModal&&((u=this.modal)==null||u.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(cl(ro({},t),{chains:this.rpc.chains})).then(l=>{s(l)}).catch(l=>{a(new Error(l.message))})}),i=e.session;if(i){const s=Nd(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Tc(this.chainId)})}return e}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:e}=t,{event:i}=e;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const e=parseInt(t);this.chainId=e,this.events.emit("chainChanged",Tc(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",cl(ro({},Re("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var e,i;this.rpc.showQrModal&&((e=this.modal)==null||e.closeModal(),(i=this.modal)==null||i.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const e=t.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));e.length&&(this.chainId=e[0],this.events.emit("chainChanged",Tc(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const e=this.parseChainId(t);this.chainId=e,this.switchEthereumChain(e)}}parseAccountId(t){const[e,i,s]=t.split(":");return{chainId:`${e}:${i}`,address:s}}setAccounts(t){this.accounts=t.filter(e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId).map(e=>this.parseAccountId(e).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var e,i;const s=(e=t==null?void 0:t.chains)!=null?e:[],a=(i=t==null?void 0:t.optionalChains)!=null?i:[],u=s.concat(a);if(!u.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=s.length?(t==null?void 0:t.methods)||Fl:[],d=s.length?(t==null?void 0:t.events)||Ul:[],f=(t==null?void 0:t.optionalMethods)||[],w=(t==null?void 0:t.optionalEvents)||[],E=(t==null?void 0:t.rpcMap)||this.buildRpcMap(u,t.projectId),I=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:s==null?void 0:s.map(D=>this.formatChainId(D)),optionalChains:a.map(D=>this.formatChainId(D)),methods:l,events:d,optionalMethods:f,optionalEvents:w,rpcMap:E,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:I,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,e){const i={};return t.forEach(s=>{i[s]=this.getRpcUrl(s,e)}),i}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?nu(this.rpc.chains):nu(this.rpc.optionalChains),this.signer=await j9.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{const{WalletConnectModal:i}=await t6(()=>import("./index-9dead77a.js").then(s=>s.i),["assets/index-9dead77a.js","assets/index-6f7d51ea.js","assets/index-811eeb1a.css"]);e=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(e)try{this.modal=new e(ro({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:e,optionalChains:i,rpcMap:s}=t;e&&cn(e)&&(this.rpc.chains=e.map(a=>this.formatChainId(a)),e.forEach(a=>{this.rpc.rpcMap[a]=(s==null?void 0:s[a])||this.getRpcUrl(a)})),i&&cn(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(a=>this.formatChainId(a)),i.forEach(a=>{this.rpc.rpcMap[a]=(s==null?void 0:s[a])||this.getRpcUrl(a)}))}getRpcUrl(t,e){var i;return((i=this.rpc.rpcMap)==null?void 0:i[t])||`${H9}?chainId=eip155:${t}&projectId=${e||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),e=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:e==null?void 0:e.accounts),this.setAccounts(e==null?void 0:e.accounts)}catch(t){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(t),await this.disconnect().catch(e=>this.signer.logger.warn(e))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(e=>this.parseAccount(e))}}const IM=hf;export{IM as EthereumProvider,V9 as OPTIONAL_EVENTS,K9 as OPTIONAL_METHODS,Ul as REQUIRED_EVENTS,Fl as REQUIRED_METHODS,hf as default};
package/index.html CHANGED
@@ -6,11 +6,11 @@
6
6
  <meta name="theme-color" content="#000000" />
7
7
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400" rel="stylesheet" />
8
8
  <script defer src="https://use.fontawesome.com/releases/v5.0.1/js/all.js"></script>
9
- <link rel="manifest" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.2.1-10994005036.commit-371a9b8/manifest.json" />
10
- <link rel="shortcut icon" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.2.1-10994005036.commit-371a9b8/favicon.ico" />
9
+ <link rel="manifest" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.3.0/manifest.json" />
10
+ <link rel="shortcut icon" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.3.0/favicon.ico" />
11
11
  <title>Decentraland's Vesting Dashboard</title>
12
- <script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.2.1-10994005036.commit-371a9b8/assets/index-9b8a6048.js"></script>
13
- <link rel="stylesheet" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.2.1-10994005036.commit-371a9b8/assets/index-94a0e6a0.css">
12
+ <script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.3.0/assets/index-6f7d51ea.js"></script>
13
+ <link rel="stylesheet" href="https://cdn.decentraland.org/@dcl/vesting-dashboard/3.3.0/assets/index-811eeb1a.css">
14
14
  </head>
15
15
 
16
16
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/vesting-dashboard",
3
- "version": "3.2.1-10994005036.commit-371a9b8",
3
+ "version": "3.3.0",
4
4
  "description": "Static website for the vesting dashboard",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17,6 +17,6 @@
17
17
  "type": "git",
18
18
  "url": "https://github.com/decentraland/vesting-dashboard.git"
19
19
  },
20
- "homepage": "https://cdn.decentraland.org/@dcl/vesting-dashboard/3.2.1-10994005036.commit-371a9b8",
20
+ "homepage": "https://cdn.decentraland.org/@dcl/vesting-dashboard/3.3.0",
21
21
  "commit": "371a9b82ffee2e41968570007a50bde54ef0ec08"
22
22
  }