graz 0.0.44-alpha.2 → 0.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a as w,b as st,c as se}from"./chunk-HBC2VYPF.mjs";var gn=w((yu,fn)=>{"use strict";fn.exports=T;var M=null;try{M=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function T(t,e,n){this.low=t|0,this.high=e|0,this.unsigned=!!n}T.prototype.__isLong__;Object.defineProperty(T.prototype,"__isLong__",{value:!0});function k(t){return(t&&t.__isLong__)===!0}T.isLong=k;var sn={},on={};function oe(t,e){var n,r,s;return e?(t>>>=0,(s=0<=t&&t<256)&&(r=on[t],r)?r:(n=R(t,(t|0)<0?-1:0,!0),s&&(on[t]=n),n)):(t|=0,(s=-128<=t&&t<128)&&(r=sn[t],r)?r:(n=R(t,t<0?-1:0,!1),s&&(sn[t]=n),n))}T.fromInt=oe;function W(t,e){if(isNaN(t))return e?ie:z;if(e){if(t<0)return ie;if(t>=ln)return mn}else{if(t<=-cn)return U;if(t+1>=cn)return hn}return t<0?W(-t,e).neg():R(t%de|0,t/de|0,e)}T.fromNumber=W;function R(t,e,n){return new T(t,e,n)}T.fromBits=R;var Me=Math.pow;function ot(t,e,n){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return z;if(typeof e=="number"?(n=e,e=!1):e=!!e,n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return ot(t.substring(1),e,n).neg();for(var s=W(Me(n,8)),i=z,o=0;o<t.length;o+=8){var c=Math.min(8,t.length-o),a=parseInt(t.substring(o,o+c),n);if(c<8){var u=W(Me(n,c));i=i.mul(u).add(W(a))}else i=i.mul(s),i=i.add(W(a))}return i.unsigned=e,i}T.fromString=ot;function H(t,e){return typeof t=="number"?W(t,e):typeof t=="string"?ot(t,e):R(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}T.fromValue=H;var an=65536,ii=1<<24,de=an*an,ln=de*de,cn=ln/2,un=oe(ii),z=oe(0);T.ZERO=z;var ie=oe(0,!0);T.UZERO=ie;var ge=oe(1);T.ONE=ge;var pn=oe(1,!0);T.UONE=pn;var it=oe(-1);T.NEG_ONE=it;var hn=R(-1,2147483647,!1);T.MAX_VALUE=hn;var mn=R(-1,-1,!0);T.MAX_UNSIGNED_VALUE=mn;var U=R(0,-2147483648,!1);T.MIN_VALUE=U;var l=T.prototype;l.toInt=function(){return this.unsigned?this.low>>>0:this.low};l.toNumber=function(){return this.unsigned?(this.high>>>0)*de+(this.low>>>0):this.high*de+(this.low>>>0)};l.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(U)){var n=W(e),r=this.div(n),s=r.mul(n).sub(this);return r.toString(e)+s.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var i=W(Me(e,6),this.unsigned),o=this,c="";;){var a=o.div(i),u=o.sub(a.mul(i)).toInt()>>>0,p=u.toString(e);if(o=a,o.isZero())return p+c;for(;p.length<6;)p="0"+p;c=""+p+c}};l.getHighBits=function(){return this.high};l.getHighBitsUnsigned=function(){return this.high>>>0};l.getLowBits=function(){return this.low};l.getLowBitsUnsigned=function(){return this.low>>>0};l.getNumBitsAbs=function(){if(this.isNegative())return this.eq(U)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,n=31;n>0&&!(e&1<<n);n--);return this.high!=0?n+33:n+1};l.isZero=function(){return this.high===0&&this.low===0};l.eqz=l.isZero;l.isNegative=function(){return!this.unsigned&&this.high<0};l.isPositive=function(){return this.unsigned||this.high>=0};l.isOdd=function(){return(this.low&1)===1};l.isEven=function(){return(this.low&1)===0};l.equals=function(e){return k(e)||(e=H(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};l.eq=l.equals;l.notEquals=function(e){return!this.eq(e)};l.neq=l.notEquals;l.ne=l.notEquals;l.lessThan=function(e){return this.comp(e)<0};l.lt=l.lessThan;l.lessThanOrEqual=function(e){return this.comp(e)<=0};l.lte=l.lessThanOrEqual;l.le=l.lessThanOrEqual;l.greaterThan=function(e){return this.comp(e)>0};l.gt=l.greaterThan;l.greaterThanOrEqual=function(e){return this.comp(e)>=0};l.gte=l.greaterThanOrEqual;l.ge=l.greaterThanOrEqual;l.compare=function(e){if(k(e)||(e=H(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};l.comp=l.compare;l.negate=function(){return!this.unsigned&&this.eq(U)?U:this.not().add(ge)};l.neg=l.negate;l.add=function(e){k(e)||(e=H(e));var n=this.high>>>16,r=this.high&65535,s=this.low>>>16,i=this.low&65535,o=e.high>>>16,c=e.high&65535,a=e.low>>>16,u=e.low&65535,p=0,h=0,E=0,m=0;return m+=i+u,E+=m>>>16,m&=65535,E+=s+a,h+=E>>>16,E&=65535,h+=r+c,p+=h>>>16,h&=65535,p+=n+o,p&=65535,R(E<<16|m,p<<16|h,this.unsigned)};l.subtract=function(e){return k(e)||(e=H(e)),this.add(e.neg())};l.sub=l.subtract;l.multiply=function(e){if(this.isZero())return z;if(k(e)||(e=H(e)),M){var n=M.mul(this.low,this.high,e.low,e.high);return R(n,M.get_high(),this.unsigned)}if(e.isZero())return z;if(this.eq(U))return e.isOdd()?U:z;if(e.eq(U))return this.isOdd()?U:z;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(un)&&e.lt(un))return W(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,s=this.high&65535,i=this.low>>>16,o=this.low&65535,c=e.high>>>16,a=e.high&65535,u=e.low>>>16,p=e.low&65535,h=0,E=0,m=0,$=0;return $+=o*p,m+=$>>>16,$&=65535,m+=i*p,E+=m>>>16,m&=65535,m+=o*u,E+=m>>>16,m&=65535,E+=s*p,h+=E>>>16,E&=65535,E+=i*u,h+=E>>>16,E&=65535,E+=o*a,h+=E>>>16,E&=65535,h+=r*p+s*u+i*a+o*c,h&=65535,R(m<<16|$,h<<16|E,this.unsigned)};l.mul=l.multiply;l.divide=function(e){if(k(e)||(e=H(e)),e.isZero())throw Error("division by zero");if(M){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var n=(this.unsigned?M.div_u:M.div_s)(this.low,this.high,e.low,e.high);return R(n,M.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?ie:z;var r,s,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return ie;if(e.gt(this.shru(1)))return pn;i=ie}else{if(this.eq(U)){if(e.eq(ge)||e.eq(it))return U;if(e.eq(U))return ge;var o=this.shr(1);return r=o.div(e).shl(1),r.eq(z)?e.isNegative()?ge:it:(s=this.sub(e.mul(r)),i=r.add(s.div(e)),i)}else if(e.eq(U))return this.unsigned?ie:z;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=z}for(s=this;s.gte(e);){r=Math.max(1,Math.floor(s.toNumber()/e.toNumber()));for(var c=Math.ceil(Math.log(r)/Math.LN2),a=c<=48?1:Me(2,c-48),u=W(r),p=u.mul(e);p.isNegative()||p.gt(s);)r-=a,u=W(r,this.unsigned),p=u.mul(e);u.isZero()&&(u=ge),i=i.add(u),s=s.sub(p)}return i};l.div=l.divide;l.modulo=function(e){if(k(e)||(e=H(e)),M){var n=(this.unsigned?M.rem_u:M.rem_s)(this.low,this.high,e.low,e.high);return R(n,M.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};l.mod=l.modulo;l.rem=l.modulo;l.not=function(){return R(~this.low,~this.high,this.unsigned)};l.and=function(e){return k(e)||(e=H(e)),R(this.low&e.low,this.high&e.high,this.unsigned)};l.or=function(e){return k(e)||(e=H(e)),R(this.low|e.low,this.high|e.high,this.unsigned)};l.xor=function(e){return k(e)||(e=H(e)),R(this.low^e.low,this.high^e.high,this.unsigned)};l.shiftLeft=function(e){return k(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?R(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):R(0,this.low<<e-32,this.unsigned)};l.shl=l.shiftLeft;l.shiftRight=function(e){return k(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?R(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):R(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};l.shr=l.shiftRight;l.shiftRightUnsigned=function(e){if(k(e)&&(e=e.toInt()),e&=63,e===0)return this;var n=this.high;if(e<32){var r=this.low;return R(r>>>e|n<<32-e,n>>>e,this.unsigned)}else return e===32?R(n,0,this.unsigned):R(n>>>e-32,0,this.unsigned)};l.shru=l.shiftRightUnsigned;l.shr_u=l.shiftRightUnsigned;l.toSigned=function(){return this.unsigned?R(this.low,this.high,!1):this};l.toUnsigned=function(){return this.unsigned?this:R(this.low,this.high,!0)};l.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};l.toBytesLE=function(){var e=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};l.toBytesBE=function(){var e=this.high,n=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,n>>>24,n>>>16&255,n>>>8&255,n&255]};T.fromBytes=function(e,n,r){return r?T.fromBytesLE(e,n):T.fromBytesBE(e,n)};T.fromBytesLE=function(e,n){return new T(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)};T.fromBytesBE=function(e,n){return new T(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)}});var Te=w((kp,er)=>{"use strict";var to="2.0.0",no=Number.MAX_SAFE_INTEGER||9007199254740991,ro=16,so=["major","premajor","minor","preminor","patch","prepatch","prerelease"];er.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:ro,MAX_SAFE_INTEGER:no,RELEASE_TYPES:so,SEMVER_SPEC_VERSION:to,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Re=w((Bp,tr)=>{"use strict";var io=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};tr.exports=io});var Ee=w((re,nr)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:It}=Te(),oo=Re();re=nr.exports={};var ao=re.re=[],f=re.src=[],g=re.t={},co=0,A=(t,e,n)=>{let r=co++;oo(t,r,e),g[t]=r,f[r]=e,ao[r]=new RegExp(e,n?"g":void 0)};A("NUMERICIDENTIFIER","0|[1-9]\\d*");A("NUMERICIDENTIFIERLOOSE","[0-9]+");A("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");A("MAINVERSION",`(${f[g.NUMERICIDENTIFIER]})\\.(${f[g.NUMERICIDENTIFIER]})\\.(${f[g.NUMERICIDENTIFIER]})`);A("MAINVERSIONLOOSE",`(${f[g.NUMERICIDENTIFIERLOOSE]})\\.(${f[g.NUMERICIDENTIFIERLOOSE]})\\.(${f[g.NUMERICIDENTIFIERLOOSE]})`);A("PRERELEASEIDENTIFIER",`(?:${f[g.NUMERICIDENTIFIER]}|${f[g.NONNUMERICIDENTIFIER]})`);A("PRERELEASEIDENTIFIERLOOSE",`(?:${f[g.NUMERICIDENTIFIERLOOSE]}|${f[g.NONNUMERICIDENTIFIER]})`);A("PRERELEASE",`(?:-(${f[g.PRERELEASEIDENTIFIER]}(?:\\.${f[g.PRERELEASEIDENTIFIER]})*))`);A("PRERELEASELOOSE",`(?:-?(${f[g.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[g.PRERELEASEIDENTIFIERLOOSE]})*))`);A("BUILDIDENTIFIER","[0-9A-Za-z-]+");A("BUILD",`(?:\\+(${f[g.BUILDIDENTIFIER]}(?:\\.${f[g.BUILDIDENTIFIER]})*))`);A("FULLPLAIN",`v?${f[g.MAINVERSION]}${f[g.PRERELEASE]}?${f[g.BUILD]}?`);A("FULL",`^${f[g.FULLPLAIN]}$`);A("LOOSEPLAIN",`[v=\\s]*${f[g.MAINVERSIONLOOSE]}${f[g.PRERELEASELOOSE]}?${f[g.BUILD]}?`);A("LOOSE",`^${f[g.LOOSEPLAIN]}$`);A("GTLT","((?:<|>)?=?)");A("XRANGEIDENTIFIERLOOSE",`${f[g.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);A("XRANGEIDENTIFIER",`${f[g.NUMERICIDENTIFIER]}|x|X|\\*`);A("XRANGEPLAIN",`[v=\\s]*(${f[g.XRANGEIDENTIFIER]})(?:\\.(${f[g.XRANGEIDENTIFIER]})(?:\\.(${f[g.XRANGEIDENTIFIER]})(?:${f[g.PRERELEASE]})?${f[g.BUILD]}?)?)?`);A("XRANGEPLAINLOOSE",`[v=\\s]*(${f[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[g.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[g.XRANGEIDENTIFIERLOOSE]})(?:${f[g.PRERELEASELOOSE]})?${f[g.BUILD]}?)?)?`);A("XRANGE",`^${f[g.GTLT]}\\s*${f[g.XRANGEPLAIN]}$`);A("XRANGELOOSE",`^${f[g.GTLT]}\\s*${f[g.XRANGEPLAINLOOSE]}$`);A("COERCE",`(^|[^\\d])(\\d{1,${It}})(?:\\.(\\d{1,${It}}))?(?:\\.(\\d{1,${It}}))?(?:$|[^\\d])`);A("COERCERTL",f[g.COERCE],!0);A("LONETILDE","(?:~>?)");A("TILDETRIM",`(\\s*)${f[g.LONETILDE]}\\s+`,!0);re.tildeTrimReplace="$1~";A("TILDE",`^${f[g.LONETILDE]}${f[g.XRANGEPLAIN]}$`);A("TILDELOOSE",`^${f[g.LONETILDE]}${f[g.XRANGEPLAINLOOSE]}$`);A("LONECARET","(?:\\^)");A("CARETTRIM",`(\\s*)${f[g.LONECARET]}\\s+`,!0);re.caretTrimReplace="$1^";A("CARET",`^${f[g.LONECARET]}${f[g.XRANGEPLAIN]}$`);A("CARETLOOSE",`^${f[g.LONECARET]}${f[g.XRANGEPLAINLOOSE]}$`);A("COMPARATORLOOSE",`^${f[g.GTLT]}\\s*(${f[g.LOOSEPLAIN]})$|^$`);A("COMPARATOR",`^${f[g.GTLT]}\\s*(${f[g.FULLPLAIN]})$|^$`);A("COMPARATORTRIM",`(\\s*)${f[g.GTLT]}\\s*(${f[g.LOOSEPLAIN]}|${f[g.XRANGEPLAIN]})`,!0);re.comparatorTrimReplace="$1$2$3";A("HYPHENRANGE",`^\\s*(${f[g.XRANGEPLAIN]})\\s+-\\s+(${f[g.XRANGEPLAIN]})\\s*$`);A("HYPHENRANGELOOSE",`^\\s*(${f[g.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[g.XRANGEPLAINLOOSE]})\\s*$`);A("STAR","(<|>)?=?\\s*\\*");A("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");A("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ke=w((Mp,rr)=>{"use strict";var uo=Object.freeze({loose:!0}),lo=Object.freeze({}),po=t=>t?typeof t!="object"?uo:t:lo;rr.exports=po});var vt=w((Wp,or)=>{"use strict";var sr=/^[0-9]+$/,ir=(t,e)=>{let n=sr.test(t),r=sr.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},ho=(t,e)=>ir(e,t);or.exports={compareIdentifiers:ir,rcompareIdentifiers:ho}});var q=w((zp,lr)=>{"use strict";var Qe=Re(),{MAX_LENGTH:ar,MAX_SAFE_INTEGER:Ve}=Te(),{re:cr,t:ur}=Ee(),mo=Ke(),{compareIdentifiers:Se}=vt(),bt=class t{constructor(e,n){if(n=mo(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ar)throw new TypeError(`version is longer than ${ar} characters`);Qe("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?cr[ur.LOOSE]:cr[ur.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Ve||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ve||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ve||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let i=+s;if(i>=0&&i<Ve)return i}return s}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Qe("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),Se(this.major,e.major)||Se(this.minor,e.minor)||Se(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],s=e.prerelease[n];if(Qe("prerelease compare",n,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return Se(r,s)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],s=e.build[n];if(Qe("prerelease compare",n,r,s),r===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(r===void 0)return-1;if(r===s)continue;return Se(r,s)}while(++n)}inc(e,n,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(r)?1:0;if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[s];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(n){let i=[n,s];r===!1&&(i=[n]),Se(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};lr.exports=bt});var le=w((Kp,hr)=>{"use strict";var pr=q(),fo=(t,e,n=!1)=>{if(t instanceof pr)return t;try{return new pr(t,e)}catch(r){if(!n)return null;throw r}};hr.exports=fo});var fr=w((Qp,mr)=>{"use strict";var go=le(),yo=(t,e)=>{let n=go(t,e);return n?n.version:null};mr.exports=yo});var dr=w((Vp,gr)=>{"use strict";var Co=le(),Eo=(t,e)=>{let n=Co(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};gr.exports=Eo});var Er=w((Hp,Cr)=>{"use strict";var yr=q(),So=(t,e,n,r,s)=>{typeof n=="string"&&(s=r,r=n,n=void 0);try{return new yr(t instanceof yr?t.version:t,n).inc(e,r,s).version}catch{return null}};Cr.exports=So});var xr=w((Xp,wr)=>{"use strict";var Sr=le(),wo=(t,e)=>{let n=Sr(t,null,!0),r=Sr(e,null,!0),s=n.compare(r);if(s===0)return null;let i=s>0,o=i?n:r,c=i?r:n,a=!!o.prerelease.length,u=a?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":a?"prerelease":c.patch?"patch":c.minor?"minor":"major"};wr.exports=wo});var Ir=w((Yp,Ar)=>{"use strict";var xo=q(),Ao=(t,e)=>new xo(t,e).major;Ar.exports=Ao});var br=w((Zp,vr)=>{"use strict";var Io=q(),vo=(t,e)=>new Io(t,e).minor;vr.exports=vo});var Rr=w((Jp,Tr)=>{"use strict";var bo=q(),To=(t,e)=>new bo(t,e).patch;Tr.exports=To});var _r=w((eh,Or)=>{"use strict";var Ro=le(),Oo=(t,e)=>{let n=Ro(t,e);return n&&n.prerelease.length?n.prerelease:null};Or.exports=Oo});var K=w((th,Dr)=>{"use strict";var Nr=q(),_o=(t,e,n)=>new Nr(t,n).compare(new Nr(e,n));Dr.exports=_o});var qr=w((nh,Lr)=>{"use strict";var No=K(),Do=(t,e,n)=>No(e,t,n);Lr.exports=Do});var Pr=w((rh,jr)=>{"use strict";var Lo=K(),qo=(t,e)=>Lo(t,e,!0);jr.exports=qo});var He=w((sh,Fr)=>{"use strict";var $r=q(),jo=(t,e,n)=>{let r=new $r(t,n),s=new $r(e,n);return r.compare(s)||r.compareBuild(s)};Fr.exports=jo});var Ur=w((ih,Gr)=>{"use strict";var Po=He(),$o=(t,e)=>t.sort((n,r)=>Po(n,r,e));Gr.exports=$o});var Br=w((oh,kr)=>{"use strict";var Fo=He(),Go=(t,e)=>t.sort((n,r)=>Fo(r,n,e));kr.exports=Go});var Oe=w((ah,Mr)=>{"use strict";var Uo=K(),ko=(t,e,n)=>Uo(t,e,n)>0;Mr.exports=ko});var Xe=w((ch,Wr)=>{"use strict";var Bo=K(),Mo=(t,e,n)=>Bo(t,e,n)<0;Wr.exports=Mo});var Tt=w((uh,zr)=>{"use strict";var Wo=K(),zo=(t,e,n)=>Wo(t,e,n)===0;zr.exports=zo});var Rt=w((lh,Kr)=>{"use strict";var Ko=K(),Qo=(t,e,n)=>Ko(t,e,n)!==0;Kr.exports=Qo});var Ye=w((ph,Qr)=>{"use strict";var Vo=K(),Ho=(t,e,n)=>Vo(t,e,n)>=0;Qr.exports=Ho});var Ze=w((hh,Vr)=>{"use strict";var Xo=K(),Yo=(t,e,n)=>Xo(t,e,n)<=0;Vr.exports=Yo});var Ot=w((mh,Hr)=>{"use strict";var Zo=Tt(),Jo=Rt(),ea=Oe(),ta=Ye(),na=Xe(),ra=Ze(),sa=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Zo(t,n,r);case"!=":return Jo(t,n,r);case">":return ea(t,n,r);case">=":return ta(t,n,r);case"<":return na(t,n,r);case"<=":return ra(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};Hr.exports=sa});var Yr=w((fh,Xr)=>{"use strict";var ia=q(),oa=le(),{re:Je,t:et}=Ee(),aa=(t,e)=>{if(t instanceof ia)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(Je[et.COERCE]);else{let r;for(;(r=Je[et.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||r.index+r[0].length!==n.index+n[0].length)&&(n=r),Je[et.COERCERTL].lastIndex=r.index+r[1].length+r[2].length;Je[et.COERCERTL].lastIndex=-1}return n===null?null:oa(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,e)};Xr.exports=aa});var Jr=w((gh,Zr)=>{"use strict";Zr.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var ts=w((dh,es)=>{"use strict";es.exports=b;b.Node=pe;b.create=b;function b(t){var e=this;if(e instanceof b||(e=new b),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(s){e.push(s)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)e.push(arguments[n]);return e}b.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;return e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null,e};b.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};b.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};b.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)ua(this,arguments[t]);return this.length};b.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)la(this,arguments[t]);return this.length};b.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};b.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};b.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;n!==null;r++)t.call(e,n.value,r,this),n=n.next};b.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;n!==null;r--)t.call(e,n.value,r,this),n=n.prev};b.prototype.get=function(t){for(var e=0,n=this.head;n!==null&&e<t;e++)n=n.next;if(e===t&&n!==null)return n.value};b.prototype.getReverse=function(t){for(var e=0,n=this.tail;n!==null&&e<t;e++)n=n.prev;if(e===t&&n!==null)return n.value};b.prototype.map=function(t,e){e=e||this;for(var n=new b,r=this.head;r!==null;)n.push(t.call(e,r.value,this)),r=r.next;return n};b.prototype.mapReverse=function(t,e){e=e||this;for(var n=new b,r=this.tail;r!==null;)n.push(t.call(e,r.value,this)),r=r.prev;return n};b.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;r!==null;s++)n=t(n,r.value,s),r=r.next;return n};b.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;r!==null;s--)n=t(n,r.value,s),r=r.prev;return n};b.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;n!==null;e++)t[e]=n.value,n=n.next;return t};b.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;n!==null;e++)t[e]=n.value,n=n.prev;return t};b.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new b;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=0,s=this.head;s!==null&&r<t;r++)s=s.next;for(;s!==null&&r<e;r++,s=s.next)n.push(s.value);return n};b.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var n=new b;if(e<t||e<0)return n;t<0&&(t=0),e>this.length&&(e=this.length);for(var r=this.length,s=this.tail;s!==null&&r>e;r--)s=s.prev;for(;s!==null&&r>t;r--,s=s.prev)n.push(s.value);return n};b.prototype.splice=function(t,e,...n){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var r=0,s=this.head;s!==null&&r<t;r++)s=s.next;for(var i=[],r=0;s&&r<e;r++)i.push(s.value),s=this.removeNode(s);s===null&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(var r=0;r<n.length;r++)s=ca(this,s,n[r]);return i};b.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this};function ca(t,e,n){var r=e===t.head?new pe(n,null,e,t):new pe(n,e,e.next,t);return r.next===null&&(t.tail=r),r.prev===null&&(t.head=r),t.length++,r}function ua(t,e){t.tail=new pe(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function la(t,e){t.head=new pe(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function pe(t,e,n,r){if(!(this instanceof pe))return new pe(t,e,n,r);this.list=r,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{Jr()(b)}catch{}});var os=w((yh,is)=>{"use strict";var pa=ts(),he=Symbol("max"),te=Symbol("length"),we=Symbol("lengthCalculator"),Ne=Symbol("allowStale"),me=Symbol("maxAge"),ee=Symbol("dispose"),ns=Symbol("noDisposeOnSet"),D=Symbol("lruList"),X=Symbol("cache"),ss=Symbol("updateAgeOnGet"),_t=()=>1,Dt=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let n=this[he]=e.max||1/0,r=e.length||_t;if(this[we]=typeof r!="function"?_t:r,this[Ne]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[me]=e.maxAge||0,this[ee]=e.dispose,this[ns]=e.noDisposeOnSet||!1,this[ss]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[he]=e||1/0,_e(this)}get max(){return this[he]}set allowStale(e){this[Ne]=!!e}get allowStale(){return this[Ne]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[me]=e,_e(this)}get maxAge(){return this[me]}set lengthCalculator(e){typeof e!="function"&&(e=_t),e!==this[we]&&(this[we]=e,this[te]=0,this[D].forEach(n=>{n.length=this[we](n.value,n.key),this[te]+=n.length})),_e(this)}get lengthCalculator(){return this[we]}get length(){return this[te]}get itemCount(){return this[D].length}rforEach(e,n){n=n||this;for(let r=this[D].tail;r!==null;){let s=r.prev;rs(this,e,r,n),r=s}}forEach(e,n){n=n||this;for(let r=this[D].head;r!==null;){let s=r.next;rs(this,e,r,n),r=s}}keys(){return this[D].toArray().map(e=>e.key)}values(){return this[D].toArray().map(e=>e.value)}reset(){this[ee]&&this[D]&&this[D].length&&this[D].forEach(e=>this[ee](e.key,e.value)),this[X]=new Map,this[D]=new pa,this[te]=0}dump(){return this[D].map(e=>tt(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[D]}set(e,n,r){if(r=r||this[me],r&&typeof r!="number")throw new TypeError("maxAge must be a number");let s=r?Date.now():0,i=this[we](n,e);if(this[X].has(e)){if(i>this[he])return xe(this,this[X].get(e)),!1;let a=this[X].get(e).value;return this[ee]&&(this[ns]||this[ee](e,a.value)),a.now=s,a.maxAge=r,a.value=n,this[te]+=i-a.length,a.length=i,this.get(e),_e(this),!0}let o=new Lt(e,n,i,s,r);return o.length>this[he]?(this[ee]&&this[ee](e,n),!1):(this[te]+=o.length,this[D].unshift(o),this[X].set(e,this[D].head),_e(this),!0)}has(e){if(!this[X].has(e))return!1;let n=this[X].get(e).value;return!tt(this,n)}get(e){return Nt(this,e,!0)}peek(e){return Nt(this,e,!1)}pop(){let e=this[D].tail;return e?(xe(this,e),e.value):null}del(e){xe(this,this[X].get(e))}load(e){this.reset();let n=Date.now();for(let r=e.length-1;r>=0;r--){let s=e[r],i=s.e||0;if(i===0)this.set(s.k,s.v);else{let o=i-n;o>0&&this.set(s.k,s.v,o)}}}prune(){this[X].forEach((e,n)=>Nt(this,n,!1))}},Nt=(t,e,n)=>{let r=t[X].get(e);if(r){let s=r.value;if(tt(t,s)){if(xe(t,r),!t[Ne])return}else n&&(t[ss]&&(r.value.now=Date.now()),t[D].unshiftNode(r));return s.value}},tt=(t,e)=>{if(!e||!e.maxAge&&!t[me])return!1;let n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[me]&&n>t[me]},_e=t=>{if(t[te]>t[he])for(let e=t[D].tail;t[te]>t[he]&&e!==null;){let n=e.prev;xe(t,e),e=n}},xe=(t,e)=>{if(e){let n=e.value;t[ee]&&t[ee](n.key,n.value),t[te]-=n.length,t[X].delete(n.key),t[D].removeNode(e)}},Lt=class{constructor(e,n,r,s,i){this.key=e,this.value=n,this.length=r,this.now=s,this.maxAge=i||0}},rs=(t,e,n,r)=>{let s=n.value;tt(t,s)&&(xe(t,n),t[Ne]||(s=void 0)),s&&e.call(r,s.value,s.key,t)};is.exports=Dt});var Q=w((Ch,ls)=>{"use strict";var qt=class t{constructor(e,n){if(n=ma(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof jt)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e,this.set=e.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(s=>!cs(s[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&Sa(s[0])){this.set=[s];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();let r=((this.options.includePrerelease&&Ca)|(this.options.loose&&Ea))+":"+e,s=as.get(r);if(s)return s;let i=this.options.loose,o=i?B[j.HYPHENRANGELOOSE]:B[j.HYPHENRANGE];e=e.replace(o,_a(this.options.includePrerelease)),_("hyphen replace",e),e=e.replace(B[j.COMPARATORTRIM],ga),_("comparator trim",e),e=e.replace(B[j.TILDETRIM],da),e=e.replace(B[j.CARETTRIM],ya),e=e.split(/\s+/).join(" ");let c=e.split(" ").map(h=>wa(h,this.options)).join(" ").split(/\s+/).map(h=>Oa(h,this.options));i&&(c=c.filter(h=>(_("loose invalid filter",h,this.options),!!h.match(B[j.COMPARATORLOOSE])))),_("range list",c);let a=new Map,u=c.map(h=>new jt(h,this.options));for(let h of u){if(cs(h))return[h];a.set(h.value,h)}a.size>1&&a.has("")&&a.delete("");let p=[...a.values()];return as.set(r,p),p}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(r=>us(r,n)&&e.set.some(s=>us(s,n)&&r.every(i=>s.every(o=>i.intersects(o,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new fa(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(Na(this.set[n],e,this.options))return!0;return!1}};ls.exports=qt;var ha=os(),as=new ha({max:1e3}),ma=Ke(),jt=De(),_=Re(),fa=q(),{re:B,t:j,comparatorTrimReplace:ga,tildeTrimReplace:da,caretTrimReplace:ya}=Ee(),{FLAG_INCLUDE_PRERELEASE:Ca,FLAG_LOOSE:Ea}=Te(),cs=t=>t.value==="<0.0.0-0",Sa=t=>t.value==="",us=(t,e)=>{let n=!0,r=t.slice(),s=r.pop();for(;n&&r.length;)n=r.every(i=>s.intersects(i,e)),s=r.pop();return n},wa=(t,e)=>(_("comp",t,e),t=Ia(t,e),_("caret",t),t=xa(t,e),_("tildes",t),t=ba(t,e),_("xrange",t),t=Ra(t,e),_("stars",t),t),P=t=>!t||t.toLowerCase()==="x"||t==="*",xa=(t,e)=>t.trim().split(/\s+/).map(n=>Aa(n,e)).join(" "),Aa=(t,e)=>{let n=e.loose?B[j.TILDELOOSE]:B[j.TILDE];return t.replace(n,(r,s,i,o,c)=>{_("tilde",t,r,s,i,o,c);let a;return P(s)?a="":P(i)?a=`>=${s}.0.0 <${+s+1}.0.0-0`:P(o)?a=`>=${s}.${i}.0 <${s}.${+i+1}.0-0`:c?(_("replaceTilde pr",c),a=`>=${s}.${i}.${o}-${c} <${s}.${+i+1}.0-0`):a=`>=${s}.${i}.${o} <${s}.${+i+1}.0-0`,_("tilde return",a),a})},Ia=(t,e)=>t.trim().split(/\s+/).map(n=>va(n,e)).join(" "),va=(t,e)=>{_("caret",t,e);let n=e.loose?B[j.CARETLOOSE]:B[j.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(s,i,o,c,a)=>{_("caret",t,s,i,o,c,a);let u;return P(i)?u="":P(o)?u=`>=${i}.0.0${r} <${+i+1}.0.0-0`:P(c)?i==="0"?u=`>=${i}.${o}.0${r} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.0${r} <${+i+1}.0.0-0`:a?(_("replaceCaret pr",a),i==="0"?o==="0"?u=`>=${i}.${o}.${c}-${a} <${i}.${o}.${+c+1}-0`:u=`>=${i}.${o}.${c}-${a} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${c}-${a} <${+i+1}.0.0-0`):(_("no pr"),i==="0"?o==="0"?u=`>=${i}.${o}.${c}${r} <${i}.${o}.${+c+1}-0`:u=`>=${i}.${o}.${c}${r} <${i}.${+o+1}.0-0`:u=`>=${i}.${o}.${c} <${+i+1}.0.0-0`),_("caret return",u),u})},ba=(t,e)=>(_("replaceXRanges",t,e),t.split(/\s+/).map(n=>Ta(n,e)).join(" ")),Ta=(t,e)=>{t=t.trim();let n=e.loose?B[j.XRANGELOOSE]:B[j.XRANGE];return t.replace(n,(r,s,i,o,c,a)=>{_("xRange",t,r,s,i,o,c,a);let u=P(i),p=u||P(o),h=p||P(c),E=h;return s==="="&&E&&(s=""),a=e.includePrerelease?"-0":"",u?s===">"||s==="<"?r="<0.0.0-0":r="*":s&&E?(p&&(o=0),c=0,s===">"?(s=">=",p?(i=+i+1,o=0,c=0):(o=+o+1,c=0)):s==="<="&&(s="<",p?i=+i+1:o=+o+1),s==="<"&&(a="-0"),r=`${s+i}.${o}.${c}${a}`):p?r=`>=${i}.0.0${a} <${+i+1}.0.0-0`:h&&(r=`>=${i}.${o}.0${a} <${i}.${+o+1}.0-0`),_("xRange return",r),r})},Ra=(t,e)=>(_("replaceStars",t,e),t.trim().replace(B[j.STAR],"")),Oa=(t,e)=>(_("replaceGTE0",t,e),t.trim().replace(B[e.includePrerelease?j.GTE0PRE:j.GTE0],"")),_a=t=>(e,n,r,s,i,o,c,a,u,p,h,E,m)=>(P(r)?n="":P(s)?n=`>=${r}.0.0${t?"-0":""}`:P(i)?n=`>=${r}.${s}.0${t?"-0":""}`:o?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,P(u)?a="":P(p)?a=`<${+u+1}.0.0-0`:P(h)?a=`<${u}.${+p+1}.0-0`:E?a=`<=${u}.${p}.${h}-${E}`:t?a=`<${u}.${p}.${+h+1}-0`:a=`<=${a}`,`${n} ${a}`.trim()),Na=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let r=0;r<t.length;r++)if(_(t[r].semver),t[r].semver!==jt.ANY&&t[r].semver.prerelease.length>0){let s=t[r].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var De=w((Eh,ds)=>{"use strict";var Le=Symbol("SemVer ANY"),Ft=class t{static get ANY(){return Le}constructor(e,n){if(n=ps(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}$t("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===Le?this.value="":this.value=this.operator+this.semver.version,$t("comp",this)}parse(e){let n=this.options.loose?hs[ms.COMPARATORLOOSE]:hs[ms.COMPARATOR],r=e.match(n);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new fs(r[2],this.options.loose):this.semver=Le}toString(){return this.value}test(e){if($t("Comparator.test",e,this.options.loose),this.semver===Le||e===Le)return!0;if(typeof e=="string")try{e=new fs(e,this.options)}catch{return!1}return Pt(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new gs(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new gs(this.value,n).test(e.semver):(n=ps(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Pt(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Pt(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};ds.exports=Ft;var ps=Ke(),{re:hs,t:ms}=Ee(),Pt=Ot(),$t=Re(),fs=q(),gs=Q()});var qe=w((Sh,ys)=>{"use strict";var Da=Q(),La=(t,e,n)=>{try{e=new Da(e,n)}catch{return!1}return e.test(t)};ys.exports=La});var Es=w((wh,Cs)=>{"use strict";var qa=Q(),ja=(t,e)=>new qa(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));Cs.exports=ja});var ws=w((xh,Ss)=>{"use strict";var Pa=q(),$a=Q(),Fa=(t,e,n)=>{let r=null,s=null,i=null;try{i=new $a(e,n)}catch{return null}return t.forEach(o=>{i.test(o)&&(!r||s.compare(o)===-1)&&(r=o,s=new Pa(r,n))}),r};Ss.exports=Fa});var As=w((Ah,xs)=>{"use strict";var Ga=q(),Ua=Q(),ka=(t,e,n)=>{let r=null,s=null,i=null;try{i=new Ua(e,n)}catch{return null}return t.forEach(o=>{i.test(o)&&(!r||s.compare(o)===1)&&(r=o,s=new Ga(r,n))}),r};xs.exports=ka});var bs=w((Ih,vs)=>{"use strict";var Gt=q(),Ba=Q(),Is=Oe(),Ma=(t,e)=>{t=new Ba(t,e);let n=new Gt("0.0.0");if(t.test(n)||(n=new Gt("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){let s=t.set[r],i=null;s.forEach(o=>{let c=new Gt(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!i||Is(c,i))&&(i=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!n||Is(n,i))&&(n=i)}return n&&t.test(n)?n:null};vs.exports=Ma});var Rs=w((vh,Ts)=>{"use strict";var Wa=Q(),za=(t,e)=>{try{return new Wa(t,e).range||"*"}catch{return null}};Ts.exports=za});var nt=w((bh,Ds)=>{"use strict";var Ka=q(),Ns=De(),{ANY:Qa}=Ns,Va=Q(),Ha=qe(),Os=Oe(),_s=Xe(),Xa=Ze(),Ya=Ye(),Za=(t,e,n,r)=>{t=new Ka(t,r),e=new Va(e,r);let s,i,o,c,a;switch(n){case">":s=Os,i=Xa,o=_s,c=">",a=">=";break;case"<":s=_s,i=Ya,o=Os,c="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ha(t,e,r))return!1;for(let u=0;u<e.set.length;++u){let p=e.set[u],h=null,E=null;if(p.forEach(m=>{m.semver===Qa&&(m=new Ns(">=0.0.0")),h=h||m,E=E||m,s(m.semver,h.semver,r)?h=m:o(m.semver,E.semver,r)&&(E=m)}),h.operator===c||h.operator===a||(!E.operator||E.operator===c)&&i(t,E.semver))return!1;if(E.operator===a&&o(t,E.semver))return!1}return!0};Ds.exports=Za});var qs=w((Th,Ls)=>{"use strict";var Ja=nt(),ec=(t,e,n)=>Ja(t,e,">",n);Ls.exports=ec});var Ps=w((Rh,js)=>{"use strict";var tc=nt(),nc=(t,e,n)=>tc(t,e,"<",n);js.exports=nc});var Gs=w((Oh,Fs)=>{"use strict";var $s=Q(),rc=(t,e,n)=>(t=new $s(t,n),e=new $s(e,n),t.intersects(e,n));Fs.exports=rc});var ks=w((_h,Us)=>{"use strict";var sc=qe(),ic=K();Us.exports=(t,e,n)=>{let r=[],s=null,i=null,o=t.sort((p,h)=>ic(p,h,n));for(let p of o)sc(p,e,n)?(i=p,s||(s=p)):(i&&r.push([s,i]),i=null,s=null);s&&r.push([s,null]);let c=[];for(let[p,h]of r)p===h?c.push(p):!h&&p===o[0]?c.push("*"):h?p===o[0]?c.push(`<=${h}`):c.push(`${p} - ${h}`):c.push(`>=${p}`);let a=c.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return a.length<u.length?a:e}});var Qs=w((Nh,Ks)=>{"use strict";var Bs=Q(),kt=De(),{ANY:Ut}=kt,je=qe(),Bt=K(),oc=(t,e,n={})=>{if(t===e)return!0;t=new Bs(t,n),e=new Bs(e,n);let r=!1;e:for(let s of t.set){for(let i of e.set){let o=cc(s,i,n);if(r=r||o!==null,o)continue e}if(r)return!1}return!0},ac=[new kt(">=0.0.0-0")],Ms=[new kt(">=0.0.0")],cc=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ut){if(e.length===1&&e[0].semver===Ut)return!0;n.includePrerelease?t=ac:t=Ms}if(e.length===1&&e[0].semver===Ut){if(n.includePrerelease)return!0;e=Ms}let r=new Set,s,i;for(let m of t)m.operator===">"||m.operator===">="?s=Ws(s,m,n):m.operator==="<"||m.operator==="<="?i=zs(i,m,n):r.add(m.semver);if(r.size>1)return null;let o;if(s&&i){if(o=Bt(s.semver,i.semver,n),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(let m of r){if(s&&!je(m,String(s),n)||i&&!je(m,String(i),n))return null;for(let $ of e)if(!je(m,String($),n))return!1;return!0}let c,a,u,p,h=i&&!n.includePrerelease&&i.semver.prerelease.length?i.semver:!1,E=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;h&&h.prerelease.length===1&&i.operator==="<"&&h.prerelease[0]===0&&(h=!1);for(let m of e){if(p=p||m.operator===">"||m.operator===">=",u=u||m.operator==="<"||m.operator==="<=",s){if(E&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===E.major&&m.semver.minor===E.minor&&m.semver.patch===E.patch&&(E=!1),m.operator===">"||m.operator===">="){if(c=Ws(s,m,n),c===m&&c!==s)return!1}else if(s.operator===">="&&!je(s.semver,String(m),n))return!1}if(i){if(h&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===h.major&&m.semver.minor===h.minor&&m.semver.patch===h.patch&&(h=!1),m.operator==="<"||m.operator==="<="){if(a=zs(i,m,n),a===m&&a!==i)return!1}else if(i.operator==="<="&&!je(i.semver,String(m),n))return!1}if(!m.operator&&(i||s)&&o!==0)return!1}return!(s&&u&&!i&&o!==0||i&&p&&!s&&o!==0||E||h)},Ws=(t,e,n)=>{if(!t)return e;let r=Bt(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},zs=(t,e,n)=>{if(!t)return e;let r=Bt(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};Ks.exports=oc});var Wt=w((Dh,Xs)=>{"use strict";var Mt=Ee(),Vs=Te(),uc=q(),Hs=vt(),lc=le(),pc=fr(),hc=dr(),mc=Er(),fc=xr(),gc=Ir(),dc=br(),yc=Rr(),Cc=_r(),Ec=K(),Sc=qr(),wc=Pr(),xc=He(),Ac=Ur(),Ic=Br(),vc=Oe(),bc=Xe(),Tc=Tt(),Rc=Rt(),Oc=Ye(),_c=Ze(),Nc=Ot(),Dc=Yr(),Lc=De(),qc=Q(),jc=qe(),Pc=Es(),$c=ws(),Fc=As(),Gc=bs(),Uc=Rs(),kc=nt(),Bc=qs(),Mc=Ps(),Wc=Gs(),zc=ks(),Kc=Qs();Xs.exports={parse:lc,valid:pc,clean:hc,inc:mc,diff:fc,major:gc,minor:dc,patch:yc,prerelease:Cc,compare:Ec,rcompare:Sc,compareLoose:wc,compareBuild:xc,sort:Ac,rsort:Ic,gt:vc,lt:bc,eq:Tc,neq:Rc,gte:Oc,lte:_c,cmp:Nc,coerce:Dc,Comparator:Lc,Range:qc,satisfies:jc,toComparators:Pc,maxSatisfying:$c,minSatisfying:Fc,minVersion:Gc,validRange:Uc,outside:kc,gtr:Bc,ltr:Mc,intersects:Wc,simplifyRange:zc,subset:Kc,SemVer:uc,re:Mt.re,src:Mt.src,tokens:Mt.t,SEMVER_SPEC_VERSION:Vs.SEMVER_SPEC_VERSION,RELEASE_TYPES:Vs.RELEASE_TYPES,compareIdentifiers:Hs.compareIdentifiers,rcompareIdentifiers:Hs.rcompareIdentifiers}});import{GasPrice as hi}from"@cosmjs/stargate";import{create as Xt}from"zustand";import{createJSONStorage as Js}from"zustand/middleware";import{persist as Yt,subscribeWithSelector as Zt}from"zustand/middleware";var Vt=(c=>(c.KEPLR="keplr",c.LEAP="leap",c.COSMOSTATION="cosmostation",c.WALLETCONNECT="walletconnect",c.WC_KEPLR_MOBILE="wc_keplr_mobile",c.WC_LEAP_MOBILE="wc_leap_mobile",c.WC_COSMOSTATION_MOBILE="wc_cosmostation_mobile",c))(Vt||{}),Ht=["keplr","leap","cosmostation","walletconnect","wc_keplr_mobile","wc_leap_mobile","wc_cosmostation_mobile"];var ei={recentChain:null,defaultChain:null,defaultSigningClient:"stargate",walletType:"keplr",walletConnect:{options:null,web3Modal:null},_notFoundFn:()=>null,_onReconnectFailed:()=>null,_reconnect:!1,_reconnectConnector:null},Ie={account:null,activeChain:null,balances:null,clients:null,offlineSigner:null,offlineSignerAmino:null,offlineSignerAuto:null,signingClients:null,status:"disconnected",wcSignClient:null},ti={name:"graz-session",version:1,partialize:t=>({account:t.account,activeChain:t.activeChain}),storage:Js(()=>sessionStorage)},ni={name:"graz-internal",partialize:t=>({recentChain:t.recentChain,_reconnect:t._reconnect,_reconnectConnector:t._reconnectConnector}),version:1},C=Xt(Zt(Yt(()=>Ie,ti))),v=Xt(Zt(Yt(()=>ei,ni)));import{SigningCosmWasmClient as nn}from"@cosmjs/cosmwasm-stargate";import{SigningStargateClient as rn}from"@cosmjs/stargate";import{Tendermint34Client as si}from"@cosmjs/tendermint-rpc";import{QueryClient as ri}from"@cosmjs/stargate";import{assert as Jt,isNonNullObject as en}from"@cosmjs/utils";var tn=(...t)=>{let{tendermint:e}=C.getState().clients,n=new ri(e),r=t.map(s=>s(n));for(let s of r){Jt(en(s),"Extension must be a non-null object");for(let[i,o]of Object.entries(s)){Jt(en(o),`Module must be a non-null object. Found type ${typeof o} for module "${i}".`);let c=n[i]||{};n[i]={...c,...o}}}return n};var ke=async({rpc:t,rpcHeaders:e})=>{let n={url:t,headers:{...e||{}}},[r,s,i]=await Promise.all([nn.connect(n),rn.connect(n),si.connect(t)]);return{cosmWasm:r,stargate:s,tendermint:i}},Be=async t=>{let{rpc:e,rpcHeaders:n,offlineSignerAuto:r,cosmWasmSignerOptions:s={},stargateSignerOptions:i={}}=t,o={url:e,headers:{...n||{}}},[c,a]=await Promise.all([nn.connectWithSigner(o,r,s),rn.connectWithSigner(o,r,i)]);return{cosmWasm:c,stargate:a}};var Cn=st(gn());import{fromBech32 as oi}from"@cosmjs/encoding";import{SignClient as ai}from"@walletconnect/sign-client";import{getSdkError as ci}from"@walletconnect/utils";var ae=()=>typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1,dn=()=>ae()&&navigator.userAgent.toLowerCase().includes("android"),yn=()=>ae()&&(navigator.userAgent.toLowerCase().includes("iphone")||navigator.userAgent.toLowerCase().includes("ipad"));var at=(t,e,n=new Error("Promise timed out"))=>{let r=new Promise((s,i)=>{setTimeout(()=>{i(n)},e)});return Promise.race([t,r])};var ye=(t=v.getState().walletType)=>{try{return ve(t),!0}catch{return!1}},ce=()=>{window.sessionStorage.removeItem(se),C.setState(Ie)},ct=()=>{if(typeof window.keplr<"u"){let t=window.keplr;return Object.assign(t,{subscription:r=>(window.addEventListener("keplr_keystorechange",()=>{ce(),r()}),()=>{window.removeEventListener("keplr_keystorechange",()=>{ce(),r()})})})}throw v.getState()._notFoundFn(),new Error("window.keplr is not defined")},ut=()=>{if(typeof window.leap<"u"){let t=window.leap;return Object.assign(t,{subscription:r=>(window.addEventListener("leap_keystorechange",()=>{ce(),r()}),()=>{window.removeEventListener("leap_keystorechange",()=>{ce(),r()})})})}throw v.getState()._notFoundFn(),new Error("window.leap is not defined")},lt=()=>{if(typeof window.cosmostation.providers.keplr<"u"){let t=window.cosmostation.providers.keplr;return Object.assign(t,{subscription:r=>(window.cosmostation.cosmos.on("accountChanged",()=>{ce(),r()}),()=>{window.cosmostation.cosmos.off("accountChanged",()=>{ce(),r()})})})}throw v.getState()._notFoundFn(),new Error("window.cosmostation.providers.keplr is not defined")},Ce=t=>{var x,F,V;if(!((V=(F=(x=v.getState().walletConnect)==null?void 0:x.options)==null?void 0:F.projectId)!=null&&V.trim()))throw new Error("walletConnect.options.projectId is not defined");let e=(t==null?void 0:t.encoding)||"base64",n=y=>{if(!t)return;let{appUrl:d,formatNativeUrl:S}=t;if(ae()){if(dn())if(!y)window.open(d.mobile.android,"_self","noreferrer noopener");else{let I=S(d.mobile.android,y,"android");window.open(I,"_self","noreferrer noopener")}if(yn())if(!y)window.open(d.mobile.ios,"_self","noreferrer noopener");else{let I=S(d.mobile.ios,y,"ios");window.open(I,"_self","noreferrer noopener")}}},r=()=>{let{wcSignClient:y}=C.getState();if(!y)throw new Error("walletConnect.signClient is not defined");ce(),v.setState({_reconnect:!1,_reconnectConnector:null,recentChain:null})},s=async y=>{let{wcSignClient:d}=C.getState();if(!d)throw new Error("walletConnect.signClient is not defined");if(!y)throw new Error("No wallet connect session");await d.disconnect({topic:y,reason:ci("USER_DISCONNECTED")}),await c(d),r()},i=y=>{var d,S;try{let{wcSignClient:I}=C.getState();if(!I)throw new Error("walletConnect.signClient is not defined");let O=I.session.getAll().at(-1);if(!O)return;let N=(S=(d=I.session.getAll().at(-1))==null?void 0:d.namespaces.cosmos)==null?void 0:S.accounts.find(L=>L.startsWith(`cosmos:${y}`));if(!(O.expiry*1e3>Date.now()+1e3))throw s(O.topic),new Error("invalid session");if(!N)try{let L=I.find({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${y}`],events:["chainChanged","accountsChanged"]}}});if(!L.length)throw new Error("no session");return L.at(-1)}catch(L){if(!L.message.toLowerCase().includes("no matching key"))throw L}return O}catch(I){if(!I.message.toLowerCase().includes("no matching key"))throw I}},o=y=>{try{return i(y)}catch{return}},c=async y=>{try{let d=y.core.pairing.pairings.getAll({active:!1});if(!d.length)return;await Promise.all(d.map(async S=>{await y.core.pairing.pairings.delete(S.topic,{code:7001,message:"clear pairing"})}))}catch(d){if(!d.message.toLowerCase().includes("no matching key"))throw d}},a=async()=>{let{walletConnect:y}=v.getState();if(!(y!=null&&y.options))throw new Error("walletConnect.options is not defined");let{wcSignClient:d}=C.getState();if(d)return C.setState({wcSignClient:d}),d;let S=await ai.init(y.options);return C.setState({wcSignClient:S}),S},u=y=>{let{wcSignClient:d}=C.getState();if(d)return d.events.on("session_delete",S=>{r()}),d.events.on("session_expire",S=>{r()}),d.events.on("session_event",S=>{var I,O;if(S.params.event.name==="accountsChanged"&&((I=S.params.event.data)==null?void 0:I[0])!==((O=C.getState().account)==null?void 0:O.bech32Address)){let N=S.params.chainId.split(":")[1];N&&p(N)}else y()}),()=>{d.events.off("session_delete",S=>{r()}),d.events.off("session_expire",S=>{r()}),d.events.off("session_event",S=>{var I,O;if(S.params.event.name==="accountsChanged"&&((I=S.params.event.data)==null?void 0:I[0])!==((O=C.getState().account)==null?void 0:O.bech32Address)){let N=S.params.chainId.split(":")[1];N&&p(N)}else y()})}},p=async y=>{var Ge;let{wcSignClient:d}=C.getState();if(!d)throw new Error("enable walletConnect.signClient is not defined");let{walletConnect:S}=v.getState();if(!((Ge=S==null?void 0:S.options)!=null&&Ge.projectId))throw new Error("walletConnect.options.projectId is not defined");let{Web3Modal:I}=await import("@web3modal/standalone"),O=new I({projectId:S.options.projectId,walletConnectVersion:2,enableExplorer:!1,explorerRecommendedWalletIds:"NONE",...S.web3Modal}),{account:N,activeChain:Z}=C.getState(),L=o(y);if((Z==null?void 0:Z.chainId)!==y&&!L||!N){let{uri:G,approval:Ue}=await d.connect({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${y}`],events:["chainChanged","accountsChanged"]}}});if(!G)throw new Error("No wallet connect uri");t?n(G):await O.openModal({uri:G});try{await at((async()=>{await Ue()})(),4e4,new Error("Modal approval timeout"))}catch(Qt){if(O.closeModal(),!Qt.message.toLowerCase().includes("no matching key"))return Promise.reject(Qt)}return t||O.closeModal(),Promise.resolve()}try{await at((async()=>{let G=await E(y);C.setState({account:G})})(),1e4,new Error("Connection timeout"))}catch(G){if(s(L==null?void 0:L.topic),!G.message.toLowerCase().includes("no matching key"))throw G}},h=async y=>{var O;let{wcSignClient:d}=C.getState();if(!d)throw new Error("walletConnect.signClient is not defined");let S=(O=i(y))==null?void 0:O.topic;if(!S)throw new Error("No wallet connect session");n();let I=await d.request({topic:S,chainId:`cosmos:${y}`,request:{method:"cosmos_getAccounts",params:{}}});if(!I[0])throw new Error("No wallet connect account");return{address:I[0].address,algo:I[0].algo,pubkey:new Uint8Array(Buffer.from(I[0].pubkey,e))}},E=async y=>{let{address:d,algo:S,pubkey:I}=await h(y);return{address:oi(d).data,algo:S,bech32Address:d,name:"",pubKey:I,isKeystone:!1,isNanoLedger:!1}},m=async(...y)=>{var G,Ue;let[d,S,I]=y,{account:O,wcSignClient:N}=C.getState();if(!N)throw new Error("walletConnect.signClient is not defined");if(!O)throw new Error("account is not defined");let Z=(G=i(d))==null?void 0:G.topic;if(!Z)throw new Error("No wallet connect session");if(!I.bodyBytes)throw new Error("No bodyBytes");if(!I.authInfoBytes)throw new Error("No authInfoBytes");let L={topic:Z,chainId:`cosmos:${d}`,request:{method:"cosmos_signDirect",params:{signerAddress:S,signDoc:{...I,bodyBytes:Buffer.from(I.bodyBytes).toString(e),authInfoBytes:Buffer.from(I.authInfoBytes).toString(e),accountNumber:(Ue=I.accountNumber)==null?void 0:Ue.toString()}}}};return n(),await N.request(L)},$=async(...y)=>{let[d,S,I]=y,{signature:O,signed:N}=await m(d,S,I);return{signed:{chainId:N.chainId,accountNumber:Cn.default.fromString(N.accountNumber,!1),authInfoBytes:new Uint8Array(Buffer.from(N.authInfoBytes,e)),bodyBytes:new Uint8Array(Buffer.from(N.bodyBytes,e))},signature:O}},$e=async(...y)=>{var G;let[d,S,I,O]=y,{wcSignClient:N}=C.getState(),{account:Z}=C.getState();if(!N)throw new Error("walletConnect.signClient is not defined");if(!Z)throw new Error("account is not defined");let L=(G=i(d))==null?void 0:G.topic;if(!L)throw new Error("No wallet connect session");return n(),await N.request({topic:L,chainId:`cosmos:${d}`,request:{method:"cosmos_signDirect",params:{signerAddress:S,signDoc:I}}})},ne=async(...y)=>{let[d,S,I,O]=y;return await $e(d,S,I)},fe=y=>({getAccounts:async()=>[await h(y)],signDirect:(d,S)=>$(y,d,S)}),Y=y=>({getAccounts:async()=>[await h(y)],signAmino:(d,S)=>ne(y,d,S)});return{enable:p,experimentalSuggestChain:async(...y)=>{await Promise.reject(new Error("WalletConnect does not support experimentalSuggestChain"))},getKey:E,getOfflineSigner:y=>({getAccounts:async()=>[await h(y)],signDirect:(d,S)=>$(y,d,S),signAmino:(d,S)=>ne(y,d,S)}),getOfflineSignerAuto:async y=>(await E(y)).isNanoLedger?Y(y):fe(y),getOfflineSignerOnlyAmino:Y,signAmino:ne,signDirect:$,subscription:u,init:a}},ui=()=>{var e,n,r;if(!((r=(n=(e=v.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!ae())throw new Error("WalletConnect Keplr mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"keplrwallet://",android:"intent://"}},walletType:"wc_keplr_mobile",formatNativeUrl:(s,i,o)=>{let c=s.replaceAll("/","").replaceAll(":",""),a=encodeURIComponent(i);switch(o){case"ios":return`${c}://wcV2?${a}`;case"android":return`${c}://wcV2?${a}#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;`;default:return`${c}://wc?uri=${a}`}}};return Ce(t)},li=()=>{var e,n,r;if(!((r=(n=(e=v.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!ae())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"leapcosmos://",android:"intent://"}},walletType:"wc_leap_mobile",formatNativeUrl:(s,i,o)=>{let c=s.replaceAll("/","").replaceAll(":",""),a=encodeURIComponent(i);switch(o){case"ios":return`${c}://wcV2?${a}`;case"android":return`${c}://wcV2?${a}#Intent;package=io.leapwallet.cosmos;scheme=leapwallet;end;`;default:return`${c}://wc?uri=${a}`}}};return Ce(t)},pi=()=>{var e,n,r;if(!((r=(n=(e=v.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!ae())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"hex",appUrl:{mobile:{ios:"cosmostation://",android:"cosmostation://"}},walletType:"wc_leap_mobile",formatNativeUrl:(s,i,o)=>`${s.replaceAll("/","").replaceAll(":","")}://wc?${i}`};return Ce(t)},ve=(t=v.getState().walletType)=>{switch(t){case"keplr":return ct();case"leap":return ut();case"cosmostation":return lt();case"walletconnect":return Ce();case"wc_keplr_mobile":return ui();case"wc_leap_mobile":return li();case"wc_cosmostation_mobile":return pi();default:throw new Error("Unknown wallet type")}},Ru=()=>Object.fromEntries(Ht.map(t=>[t,ye(t)]));var be=async t=>{var e;try{let{defaultChain:n,recentChain:r,walletType:s}=v.getState(),i=(t==null?void 0:t.walletType)||s;if(!ye(i))throw new Error(`${i} is not available`);let c=ve(i),a=(t==null?void 0:t.chain)||r||n;if(!a)throw new Error("No last known connected chain, connect action requires chain info");C.setState(Y=>{let Ae=v.getState()._reconnect||!!v.getState()._reconnectConnector||!!a;return Y.activeChain&&Y.activeChain.chainId!==a.chainId?{status:"connecting"}:Ae?{status:"reconnecting"}:{status:"connecting"}});let{account:u,activeChain:p}=C.getState();if(await((e=c.init)==null?void 0:e.call(c)),!u||(p==null?void 0:p.chainId)!==a.chainId){await c.enable(a.chainId);let Y=await c.getKey(a.chainId);C.setState({account:Y})}let h=c.getOfflineSigner(a.chainId),E=c.getOfflineSignerOnlyAmino(a.chainId),m=await c.getOfflineSignerAuto(a.chainId),$=a.gas?hi.fromString(`${a.gas.price}${a.gas.denom}`):void 0,[$e,ne]=await Promise.all([ke(a),Be({...a,offlineSignerAuto:m,cosmWasmSignerOptions:{gasPrice:$,...(t==null?void 0:t.signerOpts)||{}}})]);v.setState({recentChain:a,walletType:i,_reconnect:!!(t!=null&&t.autoReconnect),_reconnectConnector:i}),C.setState({activeChain:a,clients:$e,offlineSigner:h,offlineSignerAmino:E,offlineSignerAuto:m,signingClients:ne,status:"connected"}),typeof window<"u"&&window.sessionStorage.setItem(se,"Active");let{account:fe}=C.getState();return{account:fe,walletType:i,chain:a}}catch(n){throw console.error("connect ",n),C.getState().account===null&&C.setState({status:"disconnected"}),C.getState().account&&C.getState().activeChain&&C.setState({status:"connected"}),n}},pt=async(t=!1)=>(typeof window<"u"&&window.sessionStorage.removeItem(se),C.setState(Ie),v.setState(e=>({_reconnect:!1,_reconnectConnector:null,recentChain:t?null:e.recentChain})),Promise.resolve()),J=async t=>{var s;let{recentChain:e,_reconnectConnector:n,_reconnect:r}=v.getState();try{let i=ye(n||void 0);if(e&&i&&n)return await be({chain:e,walletType:n,autoReconnect:r})}catch(i){(s=t==null?void 0:t.onError)==null||s.call(t,i),pt()}};var En=()=>{v.setState({recentChain:null})},Sn=t=>{let{activeChain:e}=C.getState();return e==null?void 0:e.currencies.find(n=>n.coinMinimalDenom===t)},Gu=()=>v.getState().recentChain,ht=async t=>(await ve().experimentalSuggestChain(t),t),wn=async({chainInfo:t,rpcHeaders:e,gas:n,path:r,...s})=>{let i=await ht(t);return{...await be({chain:{chainId:t.chainId,currencies:t.currencies,rest:t.rest,rpc:t.rpc,rpcHeaders:e,gas:n,path:r},...s}),chain:i}};var xn=(t={})=>(v.setState(e=>({defaultChain:t.defaultChain||e.defaultChain,defaultSigningClient:t.defaultSigningClient||e.defaultSigningClient,walletConnect:t.walletConnect||e.walletConnect,walletType:t.defaultWallet||e.walletType,_notFoundFn:t.onNotFound||e._notFoundFn,_onReconnectFailed:t.onReconnectFailed||e._onReconnectFailed,_reconnect:t.autoReconnect===void 0?!0:t.autoReconnect||e._reconnect})),t);var An=async t=>{let{activeChain:e,signingClients:n}=C.getState();if(!e||!n)throw new Error("No connected account detected");let{defaultSigningClient:r}=v.getState();return await Promise.all(e.currencies.map(async i=>{let o=i.coinMinimalDenom.startsWith("cw20:");return n[r].getBalance(t,o?i.coinMinimalDenom.replace("cw20:",""):i.coinMinimalDenom)}))},In=async t=>{let{clients:e}=C.getState();if(!(e!=null&&e.stargate))throw new Error("Stargate client is not ready");return e.stargate.getBalanceStaked(t)},vn=async({senderAddress:t,recipientAddress:e,amount:n,fee:r,memo:s})=>{let{defaultSigningClient:i}=v.getState(),{signingClients:o}=C.getState();if(!o)throw new Error("No connected account detected");if(!t)throw new Error("senderAddress is not defined");return o[i].sendTokens(t,e,n,r,s)},bn=async({senderAddress:t,recipientAddress:e,transferAmount:n,sourcePort:r,sourceChannel:s,timeoutHeight:i,timeoutTimestamp:o,fee:c,memo:a})=>{let{signingClients:u}=C.getState();if(!(u!=null&&u.stargate))throw new Error("Stargate signing client is not ready");if(!t)throw new Error("senderAddress is not defined");return u.stargate.sendIbcTokens(t,e,n,r,s,i,o,c,a)},Tn=async({senderAddress:t,msg:e,fee:n,options:r,label:s,codeId:i})=>{let{signingClients:o}=C.getState();if(!(o!=null&&o.cosmWasm))throw new Error("CosmWasm signing client is not ready");return o.cosmWasm.instantiate(t,i,e,s,n,r)},Rn=async({senderAddress:t,msg:e,fee:n,contractAddress:r,funds:s,memo:i})=>{let{signingClients:o}=C.getState();if(!(o!=null&&o.cosmWasm))throw new Error("CosmWasm signing client is not ready");return o.cosmWasm.execute(t,r,e,n,i,s)},On=async(t,e)=>{let{clients:n}=C.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");return await n.cosmWasm.queryContractSmart(t,e)},_n=(t,e)=>{let{clients:n}=C.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");let r=new TextEncoder().encode(e);return n.cosmWasm.queryContractRaw(t,r)};import{Bech32Address as mi}from"@keplr-wallet/cosmos";var Dn={coinDenom:"axl",coinMinimalDenom:"uaxl",coinDecimals:6,coinGeckoId:"axelar-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axl.png"},fi={coinDenom:"usdc",coinMinimalDenom:"uusdc",coinDecimals:6,coinGeckoId:"usd-coin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdc.png"},gi={coinDenom:"dai",coinMinimalDenom:"dai-wei",coinDecimals:18,coinGeckoId:"dai",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/dai.png"},di={coinDenom:"usdt",coinMinimalDenom:"uusdt",coinDecimals:6,coinGeckoId:"tether",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdt.png"},yi={coinDenom:"weth-wei",coinMinimalDenom:"weth",coinDecimals:18,coinGeckoId:"weth",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/weth.png"},Ci={coinDenom:"wbtc-satoshi",coinMinimalDenom:"wbtc",coinDecimals:8,coinGeckoId:"wrapped-bitcoin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/wbtc.png"},Nn=[Dn,fi,gi,di,yi,Ci],mt={rpc:"https://rpc.axelar.strange.love",rest:"https://api.axelar.strange.love",chainId:"axelar-dojo-1",chainName:"Axelar",stakeCurrency:Dn,bip44:{coinType:118},bech32Config:mi.defaultBech32Config("axelar"),currencies:Nn,feeCurrencies:Nn};import{Bech32Address as Ei}from"@keplr-wallet/cosmos";var qn={coinDenom:"atom",coinMinimalDenom:"uatom",coinDecimals:6,coinGeckoId:"cosmos",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},Ln=[qn],ft={rpc:"https://rpc.cosmoshub.strange.love",rest:"https://api.cosmoshub.strange.love",chainId:"cosmoshub-4",chainName:"Cosmos Hub",stakeCurrency:qn,bip44:{coinType:118},bech32Config:Ei.defaultBech32Config("cosmos"),currencies:Ln,feeCurrencies:Ln};import{Bech32Address as Si}from"@keplr-wallet/cosmos";var Pn={coinDenom:"juno",coinMinimalDenom:"ujuno",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},wi={coinDenom:"neta",coinMinimalDenom:"cw20:juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr",coinDecimals:6,coinGeckoId:"neta",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/neta.png"},xi={coinDenom:"marble",coinMinimalDenom:"cw20:juno1g2g7ucurum66d42g8k5twk34yegdq8c82858gz0tq2fc75zy7khssgnhjl",coinDecimals:3,coinGeckoId:"marble",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/marble.png"},Ai={coinDenom:"hope",coinMinimalDenom:"cw20:juno1re3x67ppxap48ygndmrc7har2cnc7tcxtm9nplcas4v0gc3wnmvs3s807z",coinDecimals:6,coinGeckoId:"hope-galaxy",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hope.png"},Ii={coinDenom:"rac",coinMinimalDenom:"cw20:juno1r4pzw8f9z0sypct5l9j906d47z998ulwvhvqe5xdwgy8wf84583sxwh0pa",coinDecimals:6,coinGeckoId:"racoon",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/rac.png"},vi={coinDenom:"block",coinMinimalDenom:"cw20:juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/block.png"},bi={coinDenom:"dhk",coinMinimalDenom:"cw20:juno1tdjwrqmnztn2j3sj2ln9xnyps5hs48q3ddwjrz7jpv6mskappjys5czd49",coinDecimals:0,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/dhk.png"},Ti={coinDenom:"raw",coinMinimalDenom:"cw20:juno15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hes5sn38g",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/raw.png",coinGeckoId:"junoswap-raw-dao"},Ri={coinDenom:"asvt",coinMinimalDenom:"cw20:juno17wzaxtfdw5em7lc94yed4ylgjme63eh73lm3lutp2rhcxttyvpwsypjm4w",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/asvt.png"},Oi={coinDenom:"hns",coinMinimalDenom:"cw20:juno1ur4jx0sxchdevahep7fwq28yk4tqsrhshdtylz46yka3uf6kky5qllqp4k",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hns.svg"},_i={coinDenom:"joe",coinMinimalDenom:"cw20:juno1n7n7d5088qlzlj37e9mgmkhx6dfgtvt02hqxq66lcap4dxnzdhwqfmgng3",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/joe.png"},jn=[Pn,wi,xi,Ai,Ii,vi,bi,Ti,Ri,Oi,_i],gt={rpc:"https://rpc.juno.strange.love",rest:"https://api.juno.strange.love",chainId:"juno-1",chainName:"Juno",stakeCurrency:Pn,bip44:{coinType:118},bech32Config:Si.defaultBech32Config("juno"),currencies:jn,feeCurrencies:jn};import{Bech32Address as Ni}from"@keplr-wallet/cosmos";var Fn={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},Di={coinDenom:"ion",coinMinimalDenom:"uion",coinDecimals:6,coinGeckoId:"ion",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png"},$n=[Fn,Di],dt={rpc:"https://rpc.osmosis.strange.love",rest:"https://api.osmosis.strange.love",chainId:"osmosis-1",chainName:"Osmosis",stakeCurrency:Fn,bip44:{coinType:118},bech32Config:Ni.defaultBech32Config("osmo"),currencies:$n,feeCurrencies:$n};import{Bech32Address as Li}from"@keplr-wallet/cosmos";var Un={coinDenom:"somm",coinMinimalDenom:"usomm",coinDecimals:6,coinGeckoId:"sommelier",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/sommelier/images/somm.png"},Gn=[Un],yt={rpc:"https://rpc.sommelier.strange.love",rest:"https://api.sommelier.strange.love",chainId:"sommelier-3",chainName:"Sommelier",stakeCurrency:Un,bip44:{coinType:118},bech32Config:Li.defaultBech32Config("somm"),currencies:Gn,feeCurrencies:Gn};import{Bech32Address as qi}from"@keplr-wallet/cosmos";var Bn={coinDenom:"CRE",coinMinimalDenom:"ucre",coinDecimals:6,coinGeckoId:"crescent",coinImageUrl:"https://raw.githubusercontent.com/crescent-network/asset/main/images/coin/CRE.png"},kn=[Bn],Ct={rpc:"https://testnet-endpoint.crescent.network/rpc/crescent",rest:"https://testnet-endpoint.crescent.network/api/crescent",chainId:"mooncat-1-1",chainName:"Crescent Testnet",bip44:{coinType:118},bech32Config:qi.defaultBech32Config("CRE"),currencies:kn,feeCurrencies:kn,stakeCurrency:Bn,coinType:118};import{Bech32Address as ji}from"@keplr-wallet/cosmos";var Et={coinDenom:"junox",coinMinimalDenom:"ujunox",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},Pi=[Et],St={rpc:"https://rpc.uni.junonetwork.io",rest:"https://api.uni.junonetwork.io",chainId:"uni-5",chainName:"Juno Testnet",stakeCurrency:Et,bip44:{coinType:118},bech32Config:ji.defaultBech32Config("juno"),currencies:Pi,feeCurrencies:[Et],coinType:118};import{Bech32Address as $i}from"@keplr-wallet/cosmos";var wt={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://dhj8dql1kzq2v.cloudfront.net/white/osmo.png"},Fi=[wt],xt={rpc:"https://testnet-rpc.osmosis.zone",rest:"https://testnet-rest.osmosis.zone",chainId:"osmo-test-4",chainName:"Osmosis Testnet",stakeCurrency:wt,bip44:{coinType:118},bech32Config:$i.defaultBech32Config("osmo"),currencies:Fi,feeCurrencies:[wt],coinType:118};var Mn=t=>t,dl=t=>t,yl=t=>t,Cl=Mn({axelar:mt,cosmoshub:ft,juno:gt,osmosis:dt,sommelier:yt}),El=[mt,ft,gt,dt,yt],Sl=Mn({crescent:Ct,juno:St,osmosis:xt}),wl=[Ct,St,xt];import{useMutation as Wn,useQuery as At}from"@tanstack/react-query";import{useEffect as ki}from"react";import{shallow as Bi}from"zustand/shallow";import{useQuery as Gi}from"@tanstack/react-query";import{shallow as Ui}from"zustand/shallow";var Tl=()=>v(t=>({walletType:t.walletType,isCosmostation:t.walletType==="cosmostation",isCosmostationMobile:t.walletType==="wc_cosmostation_mobile",isKeplr:t.walletType==="keplr",isKeplrMobile:t.walletType==="wc_keplr_mobile",isLeap:t.walletType==="leap",isLeapMobile:t.walletType==="wc_leap_mobile",isWalletConnect:t.walletType==="walletconnect"}),Ui),We=t=>{let n=["USE_CHECK_WALLET",v(s=>t||s.walletType)];return Gi(n,({queryKey:[,s]})=>ye(s))};var ue=({onConnect:t,onDisconnect:e}={})=>{let n=C(s=>s.account),r=C(s=>s.status);return ki(()=>C.subscribe(s=>s.status,(s,i)=>{if(s==="connected"){let{account:o,activeChain:c}=C.getState(),{walletType:a}=v.getState();t==null||t({account:o,chain:c,walletType:a,isReconnect:i==="reconnecting"})}s==="disconnected"&&(e==null||e())}),[t,e]),{data:n,isConnected:!!n,isConnecting:r==="connecting",isDisconnected:r==="disconnected",isReconnecting:r==="reconnecting",isLoading:r==="connecting"||r==="reconnecting",reconnect:J,status:r}},Mi=t=>{let{data:e}=ue(),n=t||(e==null?void 0:e.bech32Address);return At(["USE_BALANCES",n],({queryKey:[,i]})=>An(i),{enabled:!!n,refetchOnMount:!1,refetchOnReconnect:!0,refetchOnWindowFocus:!1})},Pl=(t,e)=>{let{data:n}=Mi(e);return At(["USE_BALANCE",n,t,e],({queryKey:[,i]})=>i==null?void 0:i.find(o=>o.denom===t),{enabled:!!n})},$l=({onError:t,onLoading:e,onSuccess:n}={})=>{let s=Wn(["USE_CONNECT",t,e,n],be,{onError:(o,c)=>Promise.resolve(t==null?void 0:t(o,c)),onMutate:e,onSuccess:o=>Promise.resolve(n==null?void 0:n(o))}),{data:i}=We();return{connect:o=>s.mutate(o),connectAsync:o=>s.mutateAsync(o),error:s.error,isLoading:s.isLoading,isSuccess:s.isSuccess,isSupported:!!i,status:s.status}},Fl=({onError:t,onLoading:e,onSuccess:n}={})=>{let s=Wn(["USE_DISCONNECT",t,e,n],pt,{onError:i=>Promise.resolve(t==null?void 0:t(i,void 0)),onMutate:e,onSuccess:()=>Promise.resolve(n==null?void 0:n(void 0))});return{disconnect:i=>s.mutate(i),disconnectAsync:i=>s.mutateAsync(i),error:s.error,isLoading:s.isLoading,isSuccess:s.isSuccess,status:s.status}},Wi=()=>C(t=>({signer:t.offlineSigner,signerAmino:t.offlineSignerAmino,signerAuto:t.offlineSignerAuto}),Bi),Gl=()=>Wi(),Ul=t=>{let{data:e}=ue(),n=t||(e==null?void 0:e.bech32Address);return At(["USE_BALANCE_STAKED",n],({queryKey:[,i]})=>In(n),{enabled:!!n})};import{useMutation as zn,useQuery as Kn}from"@tanstack/react-query";var Kl=()=>C(t=>t.activeChain),Ql=t=>Kn(["USE_ACTIVE_CHAIN_CURRENCY",t],({queryKey:[,r]})=>Sn(r)),Vl=(t,e="BOND_STATUS_BONDED")=>Kn(["USE_ACTIVE_CHAIN_VALIDATORS",t,e],({queryKey:[,s,i]})=>s.staking.validators(i),{enabled:typeof t<"u"}),Hl=()=>({data:v(e=>e.recentChain),clear:En}),Xl=({onError:t,onLoading:e,onSuccess:n}={})=>{let s=zn(["USE_SUGGEST_CHAIN",t,e,n],ht,{onError:(i,o)=>Promise.resolve(t==null?void 0:t(i,o)),onMutate:e,onSuccess:i=>Promise.resolve(n==null?void 0:n(i))});return{error:s.error,isLoading:s.isLoading,isSuccess:s.isSuccess,suggest:s.mutate,suggestAsync:s.mutateAsync,status:s.status}},Yl=({onError:t,onLoading:e,onSuccess:n}={})=>{let s=zn(["USE_SUGGEST_CHAIN_AND_CONNECT",t,e,n],wn,{onError:(o,c)=>Promise.resolve(t==null?void 0:t(o,c)),onMutate:o=>e==null?void 0:e(o),onSuccess:o=>Promise.resolve(n==null?void 0:n(o))}),{data:i}=We();return{error:s.error,isLoading:s.isLoading,isSuccess:s.isSuccess,isSupported:!!i,status:s.status,suggestAndConnect:s.mutate,suggestAndConnectAsync:s.mutateAsync}};import{useQuery as Qn}from"@tanstack/react-query";var rp=t=>{let e=C(s=>s.clients);return Qn(["USE_CLIENTS",t,e],({queryKey:[,s,i]})=>s!=null&&s.rpc?ke(s):i,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:s=>{C.setState({clients:s})},initialData:e})},sp=t=>{let e=C(s=>s.signingClients);return Qn(["USE_SIGNING_CLIENTS",t,e],({queryKey:[,s,i]})=>s!=null&&s.rpc?Be(s):i,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:s=>{C.setState({signingClients:s})},initialData:e})};import{useQuery as zi}from"@tanstack/react-query";var cp=(...t)=>{let e=["USE_QUERY_CLIENT",...t];return zi(e,({queryKey:[,...r]})=>tn(...t),{refetchOnMount:!1,refetchOnWindowFocus:!1})};import{useMutation as ze,useQuery as Vn}from"@tanstack/react-query";var mp=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=ue(),s=r==null?void 0:r.bech32Address,o=ze(["USE_SEND_TOKENS",t,e,n,s],c=>vn({senderAddress:s,...c}),{onError:(c,a)=>Promise.resolve(t==null?void 0:t(c,a)),onMutate:e,onSuccess:c=>Promise.resolve(n==null?void 0:n(c))});return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,sendTokens:o.mutate,sendTokensAsync:o.mutateAsync,status:o.status}},fp=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=ue(),s=r==null?void 0:r.bech32Address,o=ze(["USE_SEND_IBC_TOKENS",t,e,n,s],c=>bn({senderAddress:s,...c}),{onError:(c,a)=>Promise.resolve(t==null?void 0:t(c,a)),onMutate:e,onSuccess:c=>Promise.resolve(n==null?void 0:n(c))});return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,sendIbcTokens:o.mutate,sendIbcTokensAsync:o.mutateAsync,status:o.status}},gp=({codeId:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:s}=ue(),i=s==null?void 0:s.bech32Address,a=ze(["USE_INSTANTIATE_CONTRACT",e,n,r,t,i],u=>{if(!i)throw new Error("senderAddress is undefined");let p={...u,fee:u.fee??"auto",senderAddress:i,codeId:t};return Tn(p)},{onError:(u,p)=>Promise.resolve(e==null?void 0:e(u,p)),onMutate:n,onSuccess:u=>Promise.resolve(r==null?void 0:r(u))});return{error:a.error,isLoading:a.isLoading,isSuccess:a.isSuccess,instantiateContract:a.mutate,instantiateContractAsync:a.mutateAsync,status:a.status}},dp=({contractAddress:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:s}=ue(),i=s==null?void 0:s.bech32Address,a=ze(["USE_EXECUTE_CONTRACT",e,n,r,t,i],u=>{if(!i)throw new Error("senderAddress is undefined");let p={...u,fee:u.fee??"auto",senderAddress:i,contractAddress:t,memo:u.memo??"",funds:u.funds??[]};return Rn(p)},{onError:(u,p)=>Promise.resolve(e==null?void 0:e(u,p)),onMutate:n,onSuccess:u=>Promise.resolve(r==null?void 0:r(u))});return{error:a.error,isLoading:a.isLoading,isSuccess:a.isSuccess,executeContract:a.mutate,executeContractAsync:a.mutateAsync,status:a.status}},yp=(t,e)=>Vn(["USE_QUERY_SMART",t,e],({queryKey:[,s]})=>{if(!t||!e)throw new Error("address or queryMsg undefined");return On(t,e)},{enabled:!!t&&!!e}),Cp=(t,e)=>Vn(["USE_QUERY_RAW",e,t],({queryKey:[,s]})=>{if(!t||!e)throw new Error("address or key undefined");return _n(t,e)},{enabled:!!t&&!!e});import{QueryClient as Yi,QueryClientProvider as Zi}from"@tanstack/react-query";import{ReactQueryDevtools as Ji}from"@tanstack/react-query-devtools";import{useEffect as Ki,useState as Qi}from"react";import{Fragment as Vi,jsx as Hi}from"react/jsx-runtime";var Hn=({children:t})=>{let[e,n]=Qi(!1);return Ki(()=>{n(!0)},[]),Hi(Vi,{children:e?t:null})};import{useEffect as Xn}from"react";var Xi=()=>{let t=typeof window<"u"&&window.sessionStorage.getItem(se)==="Active",{_reconnect:e,_onReconnectFailed:n,_reconnectConnector:r}=v(),{activeChain:s,wcSignClient:i}=C();return Xn(()=>{r&&(t&&s?J({onError:n}):!t&&e&&J({onError:n}))},[]),Xn(()=>{var o,c,a,u,p,h,E,m;r&&(r==="cosmostation"&&((c=(o=lt()).subscription)==null||c.call(o,()=>{J({onError:n})})),r==="keplr"&&((u=(a=ct()).subscription)==null||u.call(a,()=>{J({onError:n})})),r==="leap"&&((h=(p=ut()).subscription)==null||h.call(p,()=>{J({onError:n})})),r==="walletconnect"&&i&&((m=(E=Ce()).subscription)==null||m.call(E,()=>{J({onError:n})})))},[r,i]),null},Yn=()=>(Xi(),null);import{jsx as Zn,jsxs as Jn}from"react/jsx-runtime";var eo=new Yi({}),qp=({children:t,grazOptions:e,debug:n,...r})=>(e&&xn(e),Jn(Zi,{client:eo,...r,children:[Jn(Hn,{children:[Zn(Yn,{}),t]}),n?Zn(Ji,{initialIsOpen:!1,position:"bottom-right"}):null]},"graz-provider"));var $p=t=>t,Fp=t=>t,Gp=t=>t;var Pe=st(Wt());import{Bech32Address as Qc}from"@keplr-wallet/cosmos";function Ys(t,e){if(t)return;if(process.env.NODE_ENV==="production")throw new Error(zt);let n=typeof e=="function"?e():e,r=n?`${zt}: ${n}`:zt;throw new Error(r)}var zt="Invariant failed";var Zs=st(Wt()),Kt=t=>{if(!(0,Zs.valid)(t))switch(t.split(".").length){case 1:return`${t}.0.0`;case 2:return`${t}.0`;case 3:default:throw new Error("invalid semver")}return t};var Fh=t=>{var ne,fe,Y,Ae,Fe,rt;let{chain:e,getRestEndpoint:n=({apis:x})=>{var F,V;return((V=(F=x==null?void 0:x.rest)==null?void 0:F[0])==null?void 0:V.address)??""},getRpcEndpoint:r=({apis:x})=>{var F,V;return((V=(F=x==null?void 0:x.rpc)==null?void 0:F[0])==null?void 0:V.address)??""}}=t,s=[],i=Kt(((ne=e.codebase)==null?void 0:ne.cosmos_sdk_version)??"0.4");if((0,Pe.satisfies)(i,">=0.4")&&s.push("stargate"),(0,Pe.satisfies)(i,">=0.43")&&s.push("no-legacy-stdTx"),s.push("ibc-transfer"),(0,Pe.satisfies)(i,">=0.45")&&s.push("ibc-go"),(fe=e.codebase)!=null&&fe.cosmwasm_enabled){s.push("cosmwasm");let x=Kt(e.codebase.cosmwasm_version??"0.24");(0,Pe.satisfies)(x,">=0.24")&&s.push("wasmd_0.24+")}let o=[];"assetlists"in t&&Array.isArray(t.assetlists)&&(o=((Y=t.assetlists.find(x=>x.chain_name===e.chain_name))==null?void 0:Y.assets)||[]),"assetlist"in t&&Array.isArray(t.assetlist.assets)&&(o=t.assetlist.assets),"assets"in t&&Array.isArray(t.assets)&&(o=t.assets);let c=((Ae=e.fees)==null?void 0:Ae.fee_tokens.map(x=>x.denom))||[],a={};for(let x of((Fe=e.fees)==null?void 0:Fe.fee_tokens)||[])a[x.denom]={low:x.low_gas_price??.01,average:x.average_gas_price??.025,high:x.high_gas_price??.04};let u=((rt=e.staking)==null?void 0:rt.staking_tokens.map(x=>x.denom))||[],p=o.map(x=>{var V,y;let F=x.denom_units.reduce((d,S)=>S.exponent>d.exponent?S:d);return{coinDenom:x.symbol,coinMinimalDenom:x.base,coinDecimals:F.exponent,coinGeckoId:x.coingecko_id,coinImageUrl:((V=x.logo_URIs)==null?void 0:V.svg)??((y=x.logo_URIs)==null?void 0:y.png)}}),h=p[0];Ys(h,`chain '${e.chain_name}' has no assets`);let E=p.find(x=>u.includes(x.coinDenom))??h,m=p.filter(x=>c.includes(x.coinMinimalDenom)).map(x=>{if(!a.hasOwnProperty(x.coinMinimalDenom))return x;let F=a[x.coinMinimalDenom];return{...x,gasPriceStep:F}}),$=p.filter(x=>E.coinDenom===x.coinDenom).map(x=>{if(!a.hasOwnProperty(x.coinMinimalDenom))return x;let F=a[x.coinMinimalDenom];return{...x,gasPriceStep:F}});return{rpc:r(e),rest:n(e),chainId:e.chain_id,chainName:e.pretty_name||"",bip44:{coinType:e.slip44||118},bech32Config:Qc.defaultBech32Config(e.bech32_prefix),currencies:p,stakeCurrency:E,feeCurrencies:m.length!==0?m:$,features:s}};var Vc=(o=>(o.Bridge="bridge",o.Ibc="ibc",o.IbcCw20="ibc-cw20",o.LiquidStake="liquid-stake",o.Synthetic="synthetic",o.Wrapped="wrapped",o))(Vc||{}),Hc=(o=>(o.Cw20="cw20",o.Erc20="erc20",o.Ics20="ics20",o.SDKCoin="sdk.coin",o.Snip20="snip20",o.Snip25="snip25",o))(Hc||{}),Xc=(n=>(n.Cometbft="cometbft",n.Tendermint="tendermint",n))(Xc||{}),Yc=(r=>(r.Ics201="ics20-1",r.Ics271="ics27-1",r.Mauth="mauth",r))(Yc||{}),Zc=(n=>(n.Ethermint="ethermint",n.Injective="injective",n))(Zc||{}),Jc=(s=>(s.Ed25519="ed25519",s.Ethsecp256K1="ethsecp256k1",s.Secp256K1="secp256k1",s.Sr25519="sr25519",s))(Jc||{}),eu=(r=>(r.Devnet="devnet",r.Mainnet="mainnet",r.Testnet="testnet",r))(eu||{}),tu=(r=>(r.Killed="killed",r.Live="live",r.Upcoming="upcoming",r))(tu||{}),nu=(n=>(n.Ordered="ordered",n.Unordered="unordered",n))(nu||{});export{Xc as ConsensusType,Zc as ExtraCodec,Yn as GrazEvents,qp as GrazProvider,Yc as ICSEnabled,Jc as KeyAlgo,eu as NetworkType,nu as Ordering,tu as Status,Vc as TraceType,Hc as TypeAsset,Ht as WALLET_TYPES,Vt as WalletType,ye as checkWallet,En as clearRecentChain,xn as configureGraz,be as connect,ke as createClients,tn as createQueryClient,Be as createSigningClients,$p as defineAsset,Fp as defineAssetList,dl as defineChain,yl as defineChainInfo,Mn as defineChains,Gp as defineRegistryChain,pt as disconnect,Rn as executeContract,Sn as getActiveChainCurrency,Ru as getAvailableWallets,In as getBalanceStaked,An as getBalances,lt as getCosmostation,ct as getKeplr,ut as getLeap,_n as getQueryRaw,On as getQuerySmart,Gu as getRecentChain,pi as getWCCosmostation,ui as getWCKeplr,li as getWCLeap,ve as getWallet,Ce as getWalletConnect,Tn as instantiateContract,Cl as mainnetChains,El as mainnetChainsArray,J as reconnect,Fh as registryToChainInfo,bn as sendIbcTokens,vn as sendTokens,ht as suggestChain,wn as suggestChainAndConnect,Sl as testnetChains,wl as testnetChainsArray,ue as useAccount,Kl as useActiveChain,Ql as useActiveChainCurrency,Vl as useActiveChainValidators,Tl as useActiveWalletType,Pl as useBalance,Ul as useBalanceStaked,Mi as useBalances,We as useCheckWallet,rp as useClients,$l as useConnect,Fl as useDisconnect,dp as useExecuteContract,Xi as useGrazEvents,gp as useInstantiateContract,Wi as useOfflineSigners,cp as useQueryClient,Cp as useQueryRaw,yp as useQuerySmart,Hl as useRecentChain,fp as useSendIbcTokens,mp as useSendTokens,Gl as useSigners,sp as useSigningClients,Xl as useSuggestChain,Yl as useSuggestChainAndConnect};
1
+ import{a as Rt,b as Ut,c as R}from"./chunk-HBC2VYPF.mjs";var Xe=Rt((oo,Ye)=>{"use strict";Ye.exports=S;var O=null;try{O=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function S(t,e,n){this.low=t|0,this.high=e|0,this.unsigned=!!n}S.prototype.__isLong__;Object.defineProperty(S.prototype,"__isLong__",{value:!0});function D(t){return(t&&t.__isLong__)===!0}S.isLong=D;var Ge={},Le={};function P(t,e){var n,r,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(r=Le[t],r)?r:(n=w(t,(t|0)<0?-1:0,!0),o&&(Le[t]=n),n)):(t|=0,(o=-128<=t&&t<128)&&(r=Ge[t],r)?r:(n=w(t,t<0?-1:0,!1),o&&(Ge[t]=n),n))}S.fromInt=P;function j(t,e){if(isNaN(t))return e?U:F;if(e){if(t<0)return U;if(t>=He)return Ze}else{if(t<=-Ke)return v;if(t+1>=Ke)return $e}return t<0?j(-t,e).neg():w(t%K|0,t/K|0,e)}S.fromNumber=j;function w(t,e,n){return new S(t,e,n)}S.fromBits=w;var ne=Math.pow;function ce(t,e,n){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return F;if(typeof e=="number"?(n=e,e=!1):e=!!e,n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return ce(t.substring(1),e,n).neg();for(var o=j(ne(n,8)),s=F,i=0;i<t.length;i+=8){var a=Math.min(8,t.length-i),c=parseInt(t.substring(i,i+a),n);if(a<8){var g=j(ne(n,a));s=s.mul(g).add(j(c))}else s=s.mul(o),s=s.add(j(c))}return s.unsigned=e,s}S.fromString=ce;function k(t,e){return typeof t=="number"?j(t,e):typeof t=="string"?ce(t,e):w(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}S.fromValue=k;var ze=65536,Qt=1<<24,K=ze*ze,He=K*K,Ke=He/2,Qe=P(Qt),F=P(0);S.ZERO=F;var U=P(0,!0);S.UZERO=U;var z=P(1);S.ONE=z;var Ve=P(1,!0);S.UONE=Ve;var ie=P(-1);S.NEG_ONE=ie;var $e=w(-1,2147483647,!1);S.MAX_VALUE=$e;var Ze=w(-1,-1,!0);S.MAX_UNSIGNED_VALUE=Ze;var v=w(0,-2147483648,!1);S.MIN_VALUE=v;var u=S.prototype;u.toInt=function(){return this.unsigned?this.low>>>0:this.low};u.toNumber=function(){return this.unsigned?(this.high>>>0)*K+(this.low>>>0):this.high*K+(this.low>>>0)};u.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(v)){var n=j(e),r=this.div(n),o=r.mul(n).sub(this);return r.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=j(ne(e,6),this.unsigned),i=this,a="";;){var c=i.div(s),g=i.sub(c.mul(s)).toInt()>>>0,d=g.toString(e);if(i=c,i.isZero())return d+a;for(;d.length<6;)d="0"+d;a=""+d+a}};u.getHighBits=function(){return this.high};u.getHighBitsUnsigned=function(){return this.high>>>0};u.getLowBits=function(){return this.low};u.getLowBitsUnsigned=function(){return this.low>>>0};u.getNumBitsAbs=function(){if(this.isNegative())return this.eq(v)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,n=31;n>0&&!(e&1<<n);n--);return this.high!=0?n+33:n+1};u.isZero=function(){return this.high===0&&this.low===0};u.eqz=u.isZero;u.isNegative=function(){return!this.unsigned&&this.high<0};u.isPositive=function(){return this.unsigned||this.high>=0};u.isOdd=function(){return(this.low&1)===1};u.isEven=function(){return(this.low&1)===0};u.equals=function(e){return D(e)||(e=k(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};u.eq=u.equals;u.notEquals=function(e){return!this.eq(e)};u.neq=u.notEquals;u.ne=u.notEquals;u.lessThan=function(e){return this.comp(e)<0};u.lt=u.lessThan;u.lessThanOrEqual=function(e){return this.comp(e)<=0};u.lte=u.lessThanOrEqual;u.le=u.lessThanOrEqual;u.greaterThan=function(e){return this.comp(e)>0};u.gt=u.greaterThan;u.greaterThanOrEqual=function(e){return this.comp(e)>=0};u.gte=u.greaterThanOrEqual;u.ge=u.greaterThanOrEqual;u.compare=function(e){if(D(e)||(e=k(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};u.comp=u.compare;u.negate=function(){return!this.unsigned&&this.eq(v)?v:this.not().add(z)};u.neg=u.negate;u.add=function(e){D(e)||(e=k(e));var n=this.high>>>16,r=this.high&65535,o=this.low>>>16,s=this.low&65535,i=e.high>>>16,a=e.high&65535,c=e.low>>>16,g=e.low&65535,d=0,x=0,C=0,E=0;return E+=s+g,C+=E>>>16,E&=65535,C+=o+c,x+=C>>>16,C&=65535,x+=r+a,d+=x>>>16,x&=65535,d+=n+i,d&=65535,w(C<<16|E,d<<16|x,this.unsigned)};u.subtract=function(e){return D(e)||(e=k(e)),this.add(e.neg())};u.sub=u.subtract;u.multiply=function(e){if(this.isZero())return F;if(D(e)||(e=k(e)),O){var n=O.mul(this.low,this.high,e.low,e.high);return w(n,O.get_high(),this.unsigned)}if(e.isZero())return F;if(this.eq(v))return e.isOdd()?v:F;if(e.eq(v))return this.isOdd()?v:F;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Qe)&&e.lt(Qe))return j(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=e.high>>>16,c=e.high&65535,g=e.low>>>16,d=e.low&65535,x=0,C=0,E=0,_=0;return _+=i*d,E+=_>>>16,_&=65535,E+=s*d,C+=E>>>16,E&=65535,E+=i*g,C+=E>>>16,E&=65535,C+=o*d,x+=C>>>16,C&=65535,C+=s*g,x+=C>>>16,C&=65535,C+=i*c,x+=C>>>16,C&=65535,x+=r*d+o*g+s*c+i*a,x&=65535,w(E<<16|_,x<<16|C,this.unsigned)};u.mul=u.multiply;u.divide=function(e){if(D(e)||(e=k(e)),e.isZero())throw Error("division by zero");if(O){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var n=(this.unsigned?O.div_u:O.div_s)(this.low,this.high,e.low,e.high);return w(n,O.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?U:F;var r,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return U;if(e.gt(this.shru(1)))return Ve;s=U}else{if(this.eq(v)){if(e.eq(z)||e.eq(ie))return v;if(e.eq(v))return z;var i=this.shr(1);return r=i.div(e).shl(1),r.eq(F)?e.isNegative()?z:ie:(o=this.sub(e.mul(r)),s=r.add(o.div(e)),s)}else if(e.eq(v))return this.unsigned?U:F;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=F}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),c=a<=48?1:ne(2,a-48),g=j(r),d=g.mul(e);d.isNegative()||d.gt(o);)r-=c,g=j(r,this.unsigned),d=g.mul(e);g.isZero()&&(g=z),s=s.add(g),o=o.sub(d)}return s};u.div=u.divide;u.modulo=function(e){if(D(e)||(e=k(e)),O){var n=(this.unsigned?O.rem_u:O.rem_s)(this.low,this.high,e.low,e.high);return w(n,O.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};u.mod=u.modulo;u.rem=u.modulo;u.not=function(){return w(~this.low,~this.high,this.unsigned)};u.and=function(e){return D(e)||(e=k(e)),w(this.low&e.low,this.high&e.high,this.unsigned)};u.or=function(e){return D(e)||(e=k(e)),w(this.low|e.low,this.high|e.high,this.unsigned)};u.xor=function(e){return D(e)||(e=k(e)),w(this.low^e.low,this.high^e.high,this.unsigned)};u.shiftLeft=function(e){return D(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?w(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):w(0,this.low<<e-32,this.unsigned)};u.shl=u.shiftLeft;u.shiftRight=function(e){return D(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?w(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):w(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};u.shr=u.shiftRight;u.shiftRightUnsigned=function(e){if(D(e)&&(e=e.toInt()),e&=63,e===0)return this;var n=this.high;if(e<32){var r=this.low;return w(r>>>e|n<<32-e,n>>>e,this.unsigned)}else return e===32?w(n,0,this.unsigned):w(n>>>e-32,0,this.unsigned)};u.shru=u.shiftRightUnsigned;u.shr_u=u.shiftRightUnsigned;u.toSigned=function(){return this.unsigned?w(this.low,this.high,!1):this};u.toUnsigned=function(){return this.unsigned?this:w(this.low,this.high,!0)};u.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};u.toBytesLE=function(){var e=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};u.toBytesBE=function(){var e=this.high,n=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,n>>>24,n>>>16&255,n>>>8&255,n&255]};S.fromBytes=function(e,n,r){return r?S.fromBytesLE(e,n):S.fromBytesBE(e,n)};S.fromBytesLE=function(e,n){return new S(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)};S.fromBytesBE=function(e,n){return new S(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)}});import{GasPrice as Xt}from"@cosmjs/stargate";import{create as Be}from"zustand";import{createJSONStorage as Pt}from"zustand/middleware";import{persist as Ne,subscribeWithSelector as We}from"zustand/middleware";var Fe=(c=>(c.KEPLR="keplr",c.LEAP="leap",c.VECTIS="vectis",c.COSMOSTATION="cosmostation",c.WALLETCONNECT="walletconnect",c.WC_KEPLR_MOBILE="wc_keplr_mobile",c.WC_LEAP_MOBILE="wc_leap_mobile",c.WC_COSMOSTATION_MOBILE="wc_cosmostation_mobile",c))(Fe||{}),ke=["keplr","leap","vectis","cosmostation","walletconnect","wc_keplr_mobile","wc_leap_mobile","wc_cosmostation_mobile"];var qt={recentChain:null,defaultChain:null,defaultSigningClient:"stargate",walletType:"keplr",walletConnect:{options:null,web3Modal:null},_notFoundFn:()=>null,_onReconnectFailed:()=>null,_reconnect:!1,_reconnectConnector:null},$={account:null,activeChain:null,balances:null,clients:null,offlineSigner:null,offlineSignerAmino:null,offlineSignerAuto:null,signingClients:null,status:"disconnected",wcSignClient:null},Gt={name:"graz-session",version:1,partialize:t=>({account:t.account,activeChain:t.activeChain}),storage:Pt(()=>sessionStorage)},Lt={name:"graz-internal",partialize:t=>({recentChain:t.recentChain,_reconnect:t._reconnect,_reconnectConnector:t._reconnectConnector}),version:1},m=Be(We(Ne(()=>$,Gt))),y=Be(We(Ne(()=>qt,Lt)));import{SigningCosmWasmClient as Pe}from"@cosmjs/cosmwasm-stargate";import{SigningStargateClient as qe}from"@cosmjs/stargate";import{Tendermint34Client as Kt}from"@cosmjs/tendermint-rpc";import{QueryClient as zt}from"@cosmjs/stargate";import{assert as Me,isNonNullObject as Re}from"@cosmjs/utils";var Ue=(...t)=>{let{tendermint:e}=m.getState().clients,n=new zt(e),r=t.map(o=>o(n));for(let o of r){Me(Re(o),"Extension must be a non-null object");for(let[s,i]of Object.entries(o)){Me(Re(i),`Module must be a non-null object. Found type ${typeof i} for module "${s}".`);let a=n[s]||{};n[s]={...a,...i}}}return n};var ee=async({rpc:t,rpcHeaders:e})=>{let n={url:t,headers:{...e||{}}},[r,o,s]=await Promise.all([Pe.connect(n),qe.connect(n),Kt.connect(t)]);return{cosmWasm:r,stargate:o,tendermint:s}},te=async t=>{let{rpc:e,rpcHeaders:n,offlineSignerAuto:r,cosmWasmSignerOptions:o={},stargateSignerOptions:s={}}=t,i={url:e,headers:{...n||{}}},[a,c]=await Promise.all([Pe.connectWithSigner(i,r,o),qe.connectWithSigner(i,r,s)]);return{cosmWasm:a,stargate:c}};var ue=Ut(Xe());import{fromBech32 as tt}from"@cosmjs/encoding";import{SignClient as Ht}from"@walletconnect/sign-client";import{getSdkError as Vt}from"@walletconnect/utils";var q=()=>typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1,Je=()=>q()&&navigator.userAgent.toLowerCase().includes("android"),et=()=>q()&&(navigator.userAgent.toLowerCase().includes("iphone")||navigator.userAgent.toLowerCase().includes("ipad"));var ae=(t,e,n=new Error("Promise timed out"))=>{let r=new Promise((o,s)=>{setTimeout(()=>{s(n)},e)});return Promise.race([t,r])};var Q=(t=y.getState().walletType)=>{try{return Z(t),!0}catch{return!1}},W=()=>{window.sessionStorage.removeItem(R),m.setState($)},le=()=>{if(typeof window.keplr<"u"){let t=window.keplr;return Object.assign(t,{subscription:r=>(window.addEventListener("keplr_keystorechange",()=>{W(),r()}),()=>{window.removeEventListener("keplr_keystorechange",()=>{W(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.keplr is not defined")},pe=()=>{if(typeof window.leap<"u"){let t=window.leap;return Object.assign(t,{subscription:r=>(window.addEventListener("leap_keystorechange",()=>{W(),r()}),()=>{window.removeEventListener("leap_keystorechange",()=>{W(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.leap is not defined")},me=()=>{if(typeof window.cosmostation.providers.keplr<"u"){let t=window.cosmostation.providers.keplr;return Object.assign(t,{subscription:r=>(window.cosmostation.cosmos.on("accountChanged",()=>{W(),r()}),()=>{window.cosmostation.cosmos.off("accountChanged",()=>{W(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.cosmostation.providers.keplr is not defined")},ge=()=>{if(typeof window.vectis<"u"){let t=window.vectis.cosmos;return{enable:a=>t.enable(a),getOfflineSigner:a=>t.getOfflineSigner(a),getOfflineSignerAuto:a=>t.getOfflineSignerAuto(a),getKey:async a=>{let c=await t.getKey(a);return{address:tt(c.address).data,algo:c.algo,bech32Address:c.address,name:c.name,pubKey:c.pubKey,isKeystone:!1,isNanoLedger:c.isNanoLedger}},subscription:a=>(window.addEventListener("vectis_accountChanged",()=>{W(),a()}),()=>{window.removeEventListener("vectis_accountChanged",()=>{W(),a()})}),getOfflineSignerOnlyAmino:(...a)=>t.getOfflineSignerAmino(...a),experimentalSuggestChain:async(...a)=>{let[c]=a,g={...c,rpcUrl:c.rpc,restUrl:c.rest,prettyName:c.chainName.replace(" ",""),bech32Prefix:c.bech32Config.bech32PrefixAccAddr};return t.suggestChains([g])},signDirect:async(...a)=>{var d;let{1:c,2:g}=a;return t.signDirect(c,{bodyBytes:g.bodyBytes||Uint8Array.from([]),authInfoBytes:g.authInfoBytes||Uint8Array.from([]),accountNumber:ue.default.fromString(((d=g.accountNumber)==null?void 0:d.toString())||"",!1),chainId:g.chainId||""})},signAmino:async(...a)=>{let{1:c,2:g}=a;return t.signAmino(c,g)}}}throw y.getState()._notFoundFn(),new Error("window.vectis is not defined")},H=t=>{var De,_e,Oe;if(!((Oe=(_e=(De=y.getState().walletConnect)==null?void 0:De.options)==null?void 0:_e.projectId)!=null&&Oe.trim()))throw new Error("walletConnect.options.projectId is not defined");let e=(t==null?void 0:t.encoding)||"base64",n=p=>{if(!t)return;let{appUrl:l,formatNativeUrl:f}=t;if(q()){if(Je())if(!p)window.open(l.mobile.android,"_self","noreferrer noopener");else{let h=f(l.mobile.android,p,"android");window.open(h,"_self","noreferrer noopener")}if(et())if(!p)window.open(l.mobile.ios,"_self","noreferrer noopener");else{let h=f(l.mobile.ios,p,"ios");window.open(h,"_self","noreferrer noopener")}}},r=()=>{let{wcSignClient:p}=m.getState();if(!p)throw new Error("walletConnect.signClient is not defined");W(),y.setState({_reconnect:!1,_reconnectConnector:null,recentChain:null})},o=async p=>{let{wcSignClient:l}=m.getState();if(!l)throw new Error("walletConnect.signClient is not defined");if(!p)throw new Error("No wallet connect session");await l.disconnect({topic:p,reason:Vt("USER_DISCONNECTED")}),await a(l),r()},s=p=>{var l,f;try{let{wcSignClient:h}=m.getState();if(!h)throw new Error("walletConnect.signClient is not defined");let A=h.session.getAll().at(-1);if(!A)return;let b=(f=(l=h.session.getAll().at(-1))==null?void 0:l.namespaces.cosmos)==null?void 0:f.accounts.find(I=>I.startsWith(`cosmos:${p}`));if(!(A.expiry*1e3>Date.now()+1e3))throw o(A.topic),new Error("invalid session");if(!b)try{let I=h.find({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${p}`],events:["chainChanged","accountsChanged"]}}});if(!I.length)throw new Error("no session");return I.at(-1)}catch(I){if(!I.message.toLowerCase().includes("no matching key"))throw I}return A}catch(h){if(!h.message.toLowerCase().includes("no matching key"))throw h}},i=p=>{try{return s(p)}catch{return}},a=async p=>{try{let l=p.core.pairing.pairings.getAll({active:!1});if(!l.length)return;await Promise.all(l.map(async f=>{await p.core.pairing.pairings.delete(f.topic,{code:7001,message:"clear pairing"})}))}catch(l){if(!l.message.toLowerCase().includes("no matching key"))throw l}},c=async()=>{let{walletConnect:p}=y.getState();if(!(p!=null&&p.options))throw new Error("walletConnect.options is not defined");let{wcSignClient:l}=m.getState();if(l)return m.setState({wcSignClient:l}),l;let f=await Ht.init(p.options);return m.setState({wcSignClient:f}),f},g=p=>{let{wcSignClient:l}=m.getState();if(l)return l.events.on("session_delete",f=>{r()}),l.events.on("session_expire",f=>{r()}),l.events.on("session_event",f=>{var h,A;if(f.params.event.name==="accountsChanged"&&((h=f.params.event.data)==null?void 0:h[0])!==((A=m.getState().account)==null?void 0:A.bech32Address)){let b=f.params.chainId.split(":")[1];b&&d(b)}else p()}),()=>{l.events.off("session_delete",f=>{r()}),l.events.off("session_expire",f=>{r()}),l.events.off("session_event",f=>{var h,A;if(f.params.event.name==="accountsChanged"&&((h=f.params.event.data)==null?void 0:h[0])!==((A=m.getState().account)==null?void 0:A.bech32Address)){let b=f.params.chainId.split(":")[1];b&&d(b)}else p()})}},d=async p=>{var X;let{wcSignClient:l}=m.getState();if(!l)throw new Error("enable walletConnect.signClient is not defined");let{walletConnect:f}=y.getState();if(!((X=f==null?void 0:f.options)!=null&&X.projectId))throw new Error("walletConnect.options.projectId is not defined");let{Web3Modal:h}=await import("@web3modal/standalone"),A=new h({projectId:f.options.projectId,walletConnectVersion:2,enableExplorer:!1,explorerRecommendedWalletIds:"NONE",...f.web3Modal}),{account:b,activeChain:N}=m.getState(),I=i(p);if((N==null?void 0:N.chainId)!==p&&!I||!b){let{uri:T,approval:J}=await l.connect({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${p}`],events:["chainChanged","accountsChanged"]}}});if(!T)throw new Error("No wallet connect uri");t?n(T):await A.openModal({uri:T});try{await ae((async()=>{await J()})(),4e4,new Error("Modal approval timeout"))}catch(je){if(A.closeModal(),!je.message.toLowerCase().includes("no matching key"))return Promise.reject(je)}return t||A.closeModal(),Promise.resolve()}try{await ae((async()=>{let T=await C(p);m.setState({account:T})})(),1e4,new Error("Connection timeout"))}catch(T){if(o(I==null?void 0:I.topic),!T.message.toLowerCase().includes("no matching key"))throw T}},x=async p=>{var A;let{wcSignClient:l}=m.getState();if(!l)throw new Error("walletConnect.signClient is not defined");let f=(A=s(p))==null?void 0:A.topic;if(!f)throw new Error("No wallet connect session");n();let h=await l.request({topic:f,chainId:`cosmos:${p}`,request:{method:"cosmos_getAccounts",params:{}}});if(!h[0])throw new Error("No wallet connect account");return{address:h[0].address,algo:h[0].algo,pubkey:new Uint8Array(Buffer.from(h[0].pubkey,e))}},C=async p=>{let{address:l,algo:f,pubkey:h}=await x(p);return{address:tt(l).data,algo:f,bech32Address:l,name:"",pubKey:h,isKeystone:!1,isNanoLedger:!1}},E=async(...p)=>{var T,J;let[l,f,h]=p,{account:A,wcSignClient:b}=m.getState();if(!b)throw new Error("walletConnect.signClient is not defined");if(!A)throw new Error("account is not defined");let N=(T=s(l))==null?void 0:T.topic;if(!N)throw new Error("No wallet connect session");if(!h.bodyBytes)throw new Error("No bodyBytes");if(!h.authInfoBytes)throw new Error("No authInfoBytes");let I={topic:N,chainId:`cosmos:${l}`,request:{method:"cosmos_signDirect",params:{signerAddress:f,signDoc:{...h,bodyBytes:Buffer.from(h.bodyBytes).toString(e),authInfoBytes:Buffer.from(h.authInfoBytes).toString(e),accountNumber:(J=h.accountNumber)==null?void 0:J.toString()}}}};return n(),await b.request(I)},_=async(...p)=>{let[l,f,h]=p,{signature:A,signed:b}=await E(l,f,h);return{signed:{chainId:b.chainId,accountNumber:ue.default.fromString(b.accountNumber,!1),authInfoBytes:new Uint8Array(Buffer.from(b.authInfoBytes,e)),bodyBytes:new Uint8Array(Buffer.from(b.bodyBytes,e))},signature:A}},L=async(...p)=>{var T;let[l,f,h,A]=p,{wcSignClient:b}=m.getState(),{account:N}=m.getState();if(!b)throw new Error("walletConnect.signClient is not defined");if(!N)throw new Error("account is not defined");let I=(T=s(l))==null?void 0:T.topic;if(!I)throw new Error("No wallet connect session");return n(),await b.request({topic:I,chainId:`cosmos:${l}`,request:{method:"cosmos_signDirect",params:{signerAddress:f,signDoc:h}}})},V=async(...p)=>{let[l,f,h,A]=p;return await L(l,f,h)},se=p=>({getAccounts:async()=>[await x(p)],signDirect:(l,f)=>_(p,l,f)}),M=p=>({getAccounts:async()=>[await x(p)],signAmino:(l,f)=>V(p,l,f)});return{enable:d,experimentalSuggestChain:async(...p)=>{await Promise.reject(new Error("WalletConnect does not support experimentalSuggestChain"))},getKey:C,getOfflineSigner:p=>({getAccounts:async()=>[await x(p)],signDirect:(l,f)=>_(p,l,f),signAmino:(l,f)=>V(p,l,f)}),getOfflineSignerAuto:async p=>(await C(p)).isNanoLedger?M(p):se(p),getOfflineSignerOnlyAmino:M,signAmino:V,signDirect:_,subscription:g,init:c}},$t=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!q())throw new Error("WalletConnect Keplr mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"keplrwallet://",android:"intent://"}},walletType:"wc_keplr_mobile",formatNativeUrl:(o,s,i)=>{let a=o.replaceAll("/","").replaceAll(":",""),c=encodeURIComponent(s);switch(i){case"ios":return`${a}://wcV2?${c}`;case"android":return`${a}://wcV2?${c}#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;`;default:return`${a}://wc?uri=${c}`}}};return H(t)},Zt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!q())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"leapcosmos://",android:"intent://"}},walletType:"wc_leap_mobile",formatNativeUrl:(o,s,i)=>{let a=o.replaceAll("/","").replaceAll(":",""),c=encodeURIComponent(s);switch(i){case"ios":return`${a}://wcV2?${c}`;case"android":return`${a}://wcV2?${c}#Intent;package=io.leapwallet.cosmos;scheme=leapwallet;end;`;default:return`${a}://wc?uri=${c}`}}};return H(t)},Yt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!q())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"hex",appUrl:{mobile:{ios:"cosmostation://",android:"cosmostation://"}},walletType:"wc_leap_mobile",formatNativeUrl:(o,s,i)=>`${o.replaceAll("/","").replaceAll(":","")}://wc?${s}`};return H(t)},Z=(t=y.getState().walletType)=>{switch(t){case"keplr":return le();case"leap":return pe();case"cosmostation":return me();case"vectis":return ge();case"walletconnect":return H();case"wc_keplr_mobile":return $t();case"wc_leap_mobile":return Zt();case"wc_cosmostation_mobile":return Yt();default:throw new Error("Unknown wallet type")}},fo=()=>Object.fromEntries(ke.map(t=>[t,Q(t)]));var Y=async t=>{var e;try{let{defaultChain:n,recentChain:r,walletType:o}=y.getState(),s=(t==null?void 0:t.walletType)||o;if(!Q(s))throw new Error(`${s} is not available`);let a=Z(s),c=(t==null?void 0:t.chain)||r||n;if(!c)throw new Error("No last known connected chain, connect action requires chain info");m.setState(M=>{let ve=y.getState()._reconnect||!!y.getState()._reconnectConnector||!!c;return M.activeChain&&M.activeChain.chainId!==c.chainId?{status:"connecting"}:ve?{status:"reconnecting"}:{status:"connecting"}});let{account:g,activeChain:d}=m.getState();if(await((e=a.init)==null?void 0:e.call(a)),!g||(d==null?void 0:d.chainId)!==c.chainId){await a.enable(c.chainId);let M=await a.getKey(c.chainId);m.setState({account:M})}let x=a.getOfflineSigner(c.chainId),C=a.getOfflineSignerOnlyAmino(c.chainId),E=await a.getOfflineSignerAuto(c.chainId),_=c.gas?Xt.fromString(`${c.gas.price}${c.gas.denom}`):void 0,[L,V]=await Promise.all([ee(c),te({...c,offlineSignerAuto:E,cosmWasmSignerOptions:{gasPrice:_,...(t==null?void 0:t.signerOpts)||{}}})]);y.setState({recentChain:c,walletType:s,_reconnect:!!(t!=null&&t.autoReconnect),_reconnectConnector:s}),m.setState({activeChain:c,clients:L,offlineSigner:x,offlineSignerAmino:C,offlineSignerAuto:E,signingClients:V,status:"connected"}),typeof window<"u"&&window.sessionStorage.setItem(R,"Active");let{account:se}=m.getState();return{account:se,walletType:s,chain:c}}catch(n){throw console.error("connect ",n),m.getState().account===null&&m.setState({status:"disconnected"}),m.getState().account&&m.getState().activeChain&&m.setState({status:"connected"}),n}},fe=async(t=!1)=>(typeof window<"u"&&window.sessionStorage.removeItem(R),m.setState($),y.setState(e=>({_reconnect:!1,_reconnectConnector:null,recentChain:t?null:e.recentChain})),Promise.resolve()),B=async t=>{var o;let{recentChain:e,_reconnectConnector:n,_reconnect:r}=y.getState();try{let s=Q(n||void 0);if(e&&s&&n)return await Y({chain:e,walletType:n,autoReconnect:r})}catch(s){(o=t==null?void 0:t.onError)==null||o.call(t,s),fe()}};var nt=()=>{y.setState({recentChain:null})},ot=t=>{let{activeChain:e}=m.getState();return e==null?void 0:e.currencies.find(n=>n.coinMinimalDenom===t)},To=()=>y.getState().recentChain,de=async t=>(await Z().experimentalSuggestChain(t),t),rt=async({chainInfo:t,rpcHeaders:e,gas:n,path:r,...o})=>{let s=await de(t);return{...await Y({chain:{chainId:t.chainId,currencies:t.currencies,rest:t.rest,rpc:t.rpc,rpcHeaders:e,gas:n,path:r},...o}),chain:s}};var st=(t={})=>(y.setState(e=>({defaultChain:t.defaultChain||e.defaultChain,defaultSigningClient:t.defaultSigningClient||e.defaultSigningClient,walletConnect:t.walletConnect||e.walletConnect,walletType:t.defaultWallet||e.walletType,_notFoundFn:t.onNotFound||e._notFoundFn,_onReconnectFailed:t.onReconnectFailed||e._onReconnectFailed,_reconnect:t.autoReconnect===void 0?!0:t.autoReconnect||e._reconnect})),t);var it=async t=>{let{activeChain:e,signingClients:n}=m.getState();if(!e||!n)throw new Error("No connected account detected");let{defaultSigningClient:r}=y.getState();return await Promise.all(e.currencies.map(async s=>{let i=s.coinMinimalDenom.startsWith("cw20:");return n[r].getBalance(t,i?s.coinMinimalDenom.replace("cw20:",""):s.coinMinimalDenom)}))},ct=async t=>{let{clients:e}=m.getState();if(!(e!=null&&e.stargate))throw new Error("Stargate client is not ready");return e.stargate.getBalanceStaked(t)},at=async({senderAddress:t,recipientAddress:e,amount:n,fee:r,memo:o})=>{let{defaultSigningClient:s}=y.getState(),{signingClients:i}=m.getState();if(!i)throw new Error("No connected account detected");if(!t)throw new Error("senderAddress is not defined");return i[s].sendTokens(t,e,n,r,o)},ut=async({senderAddress:t,recipientAddress:e,transferAmount:n,sourcePort:r,sourceChannel:o,timeoutHeight:s,timeoutTimestamp:i,fee:a,memo:c})=>{let{signingClients:g}=m.getState();if(!(g!=null&&g.stargate))throw new Error("Stargate signing client is not ready");if(!t)throw new Error("senderAddress is not defined");return g.stargate.sendIbcTokens(t,e,n,r,o,s,i,a,c)},lt=async({senderAddress:t,msg:e,fee:n,options:r,label:o,codeId:s})=>{let{signingClients:i}=m.getState();if(!(i!=null&&i.cosmWasm))throw new Error("CosmWasm signing client is not ready");return i.cosmWasm.instantiate(t,s,e,o,n,r)},pt=async({senderAddress:t,msg:e,fee:n,contractAddress:r,funds:o,memo:s})=>{let{signingClients:i}=m.getState();if(!(i!=null&&i.cosmWasm))throw new Error("CosmWasm signing client is not ready");return i.cosmWasm.execute(t,r,e,n,s,o)},mt=async(t,e)=>{let{clients:n}=m.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");return await n.cosmWasm.queryContractSmart(t,e)},gt=(t,e)=>{let{clients:n}=m.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");let r=new TextEncoder().encode(e);return n.cosmWasm.queryContractRaw(t,r)};import{Bech32Address as Jt}from"@keplr-wallet/cosmos";var dt={coinDenom:"axl",coinMinimalDenom:"uaxl",coinDecimals:6,coinGeckoId:"axelar-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axl.png"},en={coinDenom:"usdc",coinMinimalDenom:"uusdc",coinDecimals:6,coinGeckoId:"usd-coin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdc.png"},tn={coinDenom:"dai",coinMinimalDenom:"dai-wei",coinDecimals:18,coinGeckoId:"dai",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/dai.png"},nn={coinDenom:"usdt",coinMinimalDenom:"uusdt",coinDecimals:6,coinGeckoId:"tether",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdt.png"},on={coinDenom:"weth-wei",coinMinimalDenom:"weth",coinDecimals:18,coinGeckoId:"weth",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/weth.png"},rn={coinDenom:"wbtc-satoshi",coinMinimalDenom:"wbtc",coinDecimals:8,coinGeckoId:"wrapped-bitcoin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/wbtc.png"},ft=[dt,en,tn,nn,on,rn],he={rpc:"https://rpc.axelar.strange.love",rest:"https://api.axelar.strange.love",chainId:"axelar-dojo-1",chainName:"Axelar",stakeCurrency:dt,bip44:{coinType:118},bech32Config:Jt.defaultBech32Config("axelar"),currencies:ft,feeCurrencies:ft};import{Bech32Address as sn}from"@keplr-wallet/cosmos";var yt={coinDenom:"atom",coinMinimalDenom:"uatom",coinDecimals:6,coinGeckoId:"cosmos",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},ht=[yt],ye={rpc:"https://rpc.cosmoshub.strange.love",rest:"https://api.cosmoshub.strange.love",chainId:"cosmoshub-4",chainName:"Cosmos Hub",stakeCurrency:yt,bip44:{coinType:118},bech32Config:sn.defaultBech32Config("cosmos"),currencies:ht,feeCurrencies:ht};import{Bech32Address as cn}from"@keplr-wallet/cosmos";var St={coinDenom:"juno",coinMinimalDenom:"ujuno",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},an={coinDenom:"neta",coinMinimalDenom:"cw20:juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr",coinDecimals:6,coinGeckoId:"neta",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/neta.png"},un={coinDenom:"marble",coinMinimalDenom:"cw20:juno1g2g7ucurum66d42g8k5twk34yegdq8c82858gz0tq2fc75zy7khssgnhjl",coinDecimals:3,coinGeckoId:"marble",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/marble.png"},ln={coinDenom:"hope",coinMinimalDenom:"cw20:juno1re3x67ppxap48ygndmrc7har2cnc7tcxtm9nplcas4v0gc3wnmvs3s807z",coinDecimals:6,coinGeckoId:"hope-galaxy",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hope.png"},pn={coinDenom:"rac",coinMinimalDenom:"cw20:juno1r4pzw8f9z0sypct5l9j906d47z998ulwvhvqe5xdwgy8wf84583sxwh0pa",coinDecimals:6,coinGeckoId:"racoon",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/rac.png"},mn={coinDenom:"block",coinMinimalDenom:"cw20:juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/block.png"},gn={coinDenom:"dhk",coinMinimalDenom:"cw20:juno1tdjwrqmnztn2j3sj2ln9xnyps5hs48q3ddwjrz7jpv6mskappjys5czd49",coinDecimals:0,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/dhk.png"},fn={coinDenom:"raw",coinMinimalDenom:"cw20:juno15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hes5sn38g",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/raw.png",coinGeckoId:"junoswap-raw-dao"},dn={coinDenom:"asvt",coinMinimalDenom:"cw20:juno17wzaxtfdw5em7lc94yed4ylgjme63eh73lm3lutp2rhcxttyvpwsypjm4w",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/asvt.png"},hn={coinDenom:"hns",coinMinimalDenom:"cw20:juno1ur4jx0sxchdevahep7fwq28yk4tqsrhshdtylz46yka3uf6kky5qllqp4k",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hns.svg"},yn={coinDenom:"joe",coinMinimalDenom:"cw20:juno1n7n7d5088qlzlj37e9mgmkhx6dfgtvt02hqxq66lcap4dxnzdhwqfmgng3",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/joe.png"},Ct=[St,an,un,ln,pn,mn,gn,fn,dn,hn,yn],Ce={rpc:"https://rpc.juno.strange.love",rest:"https://api.juno.strange.love",chainId:"juno-1",chainName:"Juno",stakeCurrency:St,bip44:{coinType:118},bech32Config:cn.defaultBech32Config("juno"),currencies:Ct,feeCurrencies:Ct};import{Bech32Address as Cn}from"@keplr-wallet/cosmos";var At={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},Sn={coinDenom:"ion",coinMinimalDenom:"uion",coinDecimals:6,coinGeckoId:"ion",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png"},wt=[At,Sn],Se={rpc:"https://rpc.osmosis.strange.love",rest:"https://api.osmosis.strange.love",chainId:"osmosis-1",chainName:"Osmosis",stakeCurrency:At,bip44:{coinType:118},bech32Config:Cn.defaultBech32Config("osmo"),currencies:wt,feeCurrencies:wt};import{Bech32Address as wn}from"@keplr-wallet/cosmos";var Et={coinDenom:"somm",coinMinimalDenom:"usomm",coinDecimals:6,coinGeckoId:"sommelier",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/sommelier/images/somm.png"},xt=[Et],we={rpc:"https://rpc.sommelier.strange.love",rest:"https://api.sommelier.strange.love",chainId:"sommelier-3",chainName:"Sommelier",stakeCurrency:Et,bip44:{coinType:118},bech32Config:wn.defaultBech32Config("somm"),currencies:xt,feeCurrencies:xt};import{Bech32Address as An}from"@keplr-wallet/cosmos";var It={coinDenom:"CRE",coinMinimalDenom:"ucre",coinDecimals:6,coinGeckoId:"crescent",coinImageUrl:"https://raw.githubusercontent.com/crescent-network/asset/main/images/coin/CRE.png"},bt=[It],Ae={rpc:"https://testnet-endpoint.crescent.network/rpc/crescent",rest:"https://testnet-endpoint.crescent.network/api/crescent",chainId:"mooncat-1-1",chainName:"Crescent Testnet",bip44:{coinType:118},bech32Config:An.defaultBech32Config("CRE"),currencies:bt,feeCurrencies:bt,stakeCurrency:It,coinType:118};import{Bech32Address as xn}from"@keplr-wallet/cosmos";var xe={coinDenom:"junox",coinMinimalDenom:"ujunox",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},En=[xe],Ee={rpc:"https://rpc.uni.junonetwork.io",rest:"https://api.uni.junonetwork.io",chainId:"uni-5",chainName:"Juno Testnet",stakeCurrency:xe,bip44:{coinType:118},bech32Config:xn.defaultBech32Config("juno"),currencies:En,feeCurrencies:[xe],coinType:118};import{Bech32Address as bn}from"@keplr-wallet/cosmos";var be={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://dhj8dql1kzq2v.cloudfront.net/white/osmo.png"},In=[be],Ie={rpc:"https://testnet-rpc.osmosis.zone",rest:"https://testnet-rest.osmosis.zone",chainId:"osmo-test-4",chainName:"Osmosis Testnet",stakeCurrency:be,bip44:{coinType:118},bech32Config:bn.defaultBech32Config("osmo"),currencies:In,feeCurrencies:[be],coinType:118};var Tt=t=>t,or=t=>t,rr=t=>t,sr=Tt({axelar:he,cosmoshub:ye,juno:Ce,osmosis:Se,sommelier:we}),ir=[he,ye,Ce,Se,we],cr=Tt({crescent:Ae,juno:Ee,osmosis:Ie}),ar=[Ae,Ee,Ie];import{useMutation as vt,useQuery as Te}from"@tanstack/react-query";import{useEffect as Dn}from"react";import{shallow as _n}from"zustand/shallow";import{useQuery as Tn}from"@tanstack/react-query";import{shallow as vn}from"zustand/shallow";var fr=()=>y(t=>({walletType:t.walletType,isCosmostation:t.walletType==="cosmostation",isCosmostationMobile:t.walletType==="wc_cosmostation_mobile",isKeplr:t.walletType==="keplr",isKeplrMobile:t.walletType==="wc_keplr_mobile",isLeap:t.walletType==="leap",isLeapMobile:t.walletType==="wc_leap_mobile",isVectis:t.walletType==="vectis",isWalletConnect:t.walletType==="walletconnect"}),vn),oe=t=>{let n=["USE_CHECK_WALLET",y(o=>t||o.walletType)];return Tn(n,({queryKey:[,o]})=>Q(o))};var G=({onConnect:t,onDisconnect:e}={})=>{let n=m(o=>o.account),r=m(o=>o.status);return Dn(()=>m.subscribe(o=>o.status,(o,s)=>{if(o==="connected"){let{account:i,activeChain:a}=m.getState(),{walletType:c}=y.getState();t==null||t({account:i,chain:a,walletType:c,isReconnect:s==="reconnecting"})}o==="disconnected"&&(e==null||e())}),[t,e]),{data:n,isConnected:!!n,isConnecting:r==="connecting",isDisconnected:r==="disconnected",isReconnecting:r==="reconnecting",isLoading:r==="connecting"||r==="reconnecting",reconnect:B,status:r}},On=t=>{let{data:e}=G(),n=t||(e==null?void 0:e.bech32Address);return Te(["USE_BALANCES",n],({queryKey:[,s]})=>it(s),{enabled:!!n,refetchOnMount:!1,refetchOnReconnect:!0,refetchOnWindowFocus:!1})},Er=(t,e)=>{let{data:n}=On(e);return Te(["USE_BALANCE",n,t,e],({queryKey:[,s]})=>s==null?void 0:s.find(i=>i.denom===t),{enabled:!!n})},br=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=vt(["USE_CONNECT",t,e,n],Y,{onError:(i,a)=>Promise.resolve(t==null?void 0:t(i,a)),onMutate:e,onSuccess:i=>Promise.resolve(n==null?void 0:n(i))}),{data:s}=oe();return{connect:i=>o.mutate(i),connectAsync:i=>o.mutateAsync(i),error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,isSupported:!!s,status:o.status}},Ir=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=vt(["USE_DISCONNECT",t,e,n],fe,{onError:s=>Promise.resolve(t==null?void 0:t(s,void 0)),onMutate:e,onSuccess:()=>Promise.resolve(n==null?void 0:n(void 0))});return{disconnect:s=>o.mutate(s),disconnectAsync:s=>o.mutateAsync(s),error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,status:o.status}},jn=()=>m(t=>({signer:t.offlineSigner,signerAmino:t.offlineSignerAmino,signerAuto:t.offlineSignerAuto}),_n),Tr=()=>jn(),vr=t=>{let{data:e}=G(),n=t||(e==null?void 0:e.bech32Address);return Te(["USE_BALANCE_STAKED",n],({queryKey:[,s]})=>ct(n),{enabled:!!n})};import{useMutation as Dt,useQuery as _t}from"@tanstack/react-query";var kr=()=>m(t=>t.activeChain),Br=t=>_t(["USE_ACTIVE_CHAIN_CURRENCY",t],({queryKey:[,r]})=>ot(r)),Nr=(t,e="BOND_STATUS_BONDED")=>_t(["USE_ACTIVE_CHAIN_VALIDATORS",t,e],({queryKey:[,o,s]})=>o.staking.validators(s),{enabled:typeof t<"u"}),Wr=()=>({data:y(e=>e.recentChain),clear:nt}),Mr=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=Dt(["USE_SUGGEST_CHAIN",t,e,n],de,{onError:(s,i)=>Promise.resolve(t==null?void 0:t(s,i)),onMutate:e,onSuccess:s=>Promise.resolve(n==null?void 0:n(s))});return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,suggest:o.mutate,suggestAsync:o.mutateAsync,status:o.status}},Rr=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=Dt(["USE_SUGGEST_CHAIN_AND_CONNECT",t,e,n],rt,{onError:(i,a)=>Promise.resolve(t==null?void 0:t(i,a)),onMutate:i=>e==null?void 0:e(i),onSuccess:i=>Promise.resolve(n==null?void 0:n(i))}),{data:s}=oe();return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,isSupported:!!s,status:o.status,suggestAndConnect:o.mutate,suggestAndConnectAsync:o.mutateAsync}};import{useQuery as Ot}from"@tanstack/react-query";var zr=t=>{let e=m(o=>o.clients);return Ot(["USE_CLIENTS",t,e],({queryKey:[,o,s]})=>o!=null&&o.rpc?ee(o):s,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:o=>{m.setState({clients:o})},initialData:e})},Kr=t=>{let e=m(o=>o.signingClients);return Ot(["USE_SIGNING_CLIENTS",t,e],({queryKey:[,o,s]})=>o!=null&&o.rpc?te(o):s,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:o=>{m.setState({signingClients:o})},initialData:e})};import{useQuery as Fn}from"@tanstack/react-query";var $r=(...t)=>{let e=["USE_QUERY_CLIENT",...t];return Fn(e,({queryKey:[,...r]})=>Ue(...t),{refetchOnMount:!1,refetchOnWindowFocus:!1})};import{useMutation as re,useQuery as jt}from"@tanstack/react-query";var es=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=G(),o=r==null?void 0:r.bech32Address,i=re(["USE_SEND_TOKENS",t,e,n,o],a=>at({senderAddress:o,...a}),{onError:(a,c)=>Promise.resolve(t==null?void 0:t(a,c)),onMutate:e,onSuccess:a=>Promise.resolve(n==null?void 0:n(a))});return{error:i.error,isLoading:i.isLoading,isSuccess:i.isSuccess,sendTokens:i.mutate,sendTokensAsync:i.mutateAsync,status:i.status}},ts=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=G(),o=r==null?void 0:r.bech32Address,i=re(["USE_SEND_IBC_TOKENS",t,e,n,o],a=>ut({senderAddress:o,...a}),{onError:(a,c)=>Promise.resolve(t==null?void 0:t(a,c)),onMutate:e,onSuccess:a=>Promise.resolve(n==null?void 0:n(a))});return{error:i.error,isLoading:i.isLoading,isSuccess:i.isSuccess,sendIbcTokens:i.mutate,sendIbcTokensAsync:i.mutateAsync,status:i.status}},ns=({codeId:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:o}=G(),s=o==null?void 0:o.bech32Address,c=re(["USE_INSTANTIATE_CONTRACT",e,n,r,t,s],g=>{if(!s)throw new Error("senderAddress is undefined");let d={...g,fee:g.fee??"auto",senderAddress:s,codeId:t};return lt(d)},{onError:(g,d)=>Promise.resolve(e==null?void 0:e(g,d)),onMutate:n,onSuccess:g=>Promise.resolve(r==null?void 0:r(g))});return{error:c.error,isLoading:c.isLoading,isSuccess:c.isSuccess,instantiateContract:c.mutate,instantiateContractAsync:c.mutateAsync,status:c.status}},os=({contractAddress:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:o}=G(),s=o==null?void 0:o.bech32Address,c=re(["USE_EXECUTE_CONTRACT",e,n,r,t,s],g=>{if(!s)throw new Error("senderAddress is undefined");let d={...g,fee:g.fee??"auto",senderAddress:s,contractAddress:t,memo:g.memo??"",funds:g.funds??[]};return pt(d)},{onError:(g,d)=>Promise.resolve(e==null?void 0:e(g,d)),onMutate:n,onSuccess:g=>Promise.resolve(r==null?void 0:r(g))});return{error:c.error,isLoading:c.isLoading,isSuccess:c.isSuccess,executeContract:c.mutate,executeContractAsync:c.mutateAsync,status:c.status}},rs=(t,e)=>jt(["USE_QUERY_SMART",t,e],({queryKey:[,o]})=>{if(!t||!e)throw new Error("address or queryMsg undefined");return mt(t,e)},{enabled:!!t&&!!e}),ss=(t,e)=>jt(["USE_QUERY_RAW",e,t],({queryKey:[,o]})=>{if(!t||!e)throw new Error("address or key undefined");return gt(t,e)},{enabled:!!t&&!!e});import{QueryClient as Rn,QueryClientProvider as Un}from"@tanstack/react-query";import{ReactQueryDevtools as Pn}from"@tanstack/react-query-devtools";import{useEffect as kn,useState as Bn}from"react";import{Fragment as Nn,jsx as Wn}from"react/jsx-runtime";var Ft=({children:t})=>{let[e,n]=Bn(!1);return kn(()=>{n(!0)},[]),Wn(Nn,{children:e?t:null})};import{useEffect as kt}from"react";var Mn=()=>{let t=typeof window<"u"&&window.sessionStorage.getItem(R)==="Active",{_reconnect:e,_onReconnectFailed:n,_reconnectConnector:r}=y(),{activeChain:o,wcSignClient:s}=m();return kt(()=>{r&&(t&&o?B({onError:n}):!t&&e&&B({onError:n}))},[]),kt(()=>{var i,a,c,g,d,x,C,E,_,L;r&&(r==="cosmostation"&&((a=(i=me()).subscription)==null||a.call(i,()=>{B({onError:n})})),r==="keplr"&&((g=(c=le()).subscription)==null||g.call(c,()=>{B({onError:n})})),r==="leap"&&((x=(d=pe()).subscription)==null||x.call(d,()=>{B({onError:n})})),r==="vectis"&&((E=(C=ge()).subscription)==null||E.call(C,()=>{B({onError:n})})),r==="walletconnect"&&s&&((L=(_=H()).subscription)==null||L.call(_,()=>{B({onError:n})})))},[r,s]),null},Bt=()=>(Mn(),null);import{jsx as Nt,jsxs as Wt}from"react/jsx-runtime";var qn=new Rn({}),As=({children:t,grazOptions:e,debug:n,...r})=>(e&&st(e),Wt(Un,{client:qn,...r,children:[Wt(Ft,{children:[Nt(Bt,{}),t]}),n?Nt(Pn,{initialIsOpen:!1,position:"bottom-right"}):null]},"graz-provider"));export{Bt as GrazEvents,As as GrazProvider,ke as WALLET_TYPES,Fe as WalletType,Q as checkWallet,nt as clearRecentChain,st as configureGraz,Y as connect,ee as createClients,Ue as createQueryClient,te as createSigningClients,or as defineChain,rr as defineChainInfo,Tt as defineChains,fe as disconnect,pt as executeContract,ot as getActiveChainCurrency,fo as getAvailableWallets,ct as getBalanceStaked,it as getBalances,me as getCosmostation,le as getKeplr,pe as getLeap,gt as getQueryRaw,mt as getQuerySmart,To as getRecentChain,ge as getVectis,Yt as getWCCosmostation,$t as getWCKeplr,Zt as getWCLeap,Z as getWallet,H as getWalletConnect,lt as instantiateContract,sr as mainnetChains,ir as mainnetChainsArray,B as reconnect,ut as sendIbcTokens,at as sendTokens,de as suggestChain,rt as suggestChainAndConnect,cr as testnetChains,ar as testnetChainsArray,G as useAccount,kr as useActiveChain,Br as useActiveChainCurrency,Nr as useActiveChainValidators,fr as useActiveWalletType,Er as useBalance,vr as useBalanceStaked,On as useBalances,oe as useCheckWallet,zr as useClients,br as useConnect,Ir as useDisconnect,os as useExecuteContract,Mn as useGrazEvents,ns as useInstantiateContract,jn as useOfflineSigners,$r as useQueryClient,ss as useQueryRaw,rs as useQuerySmart,Wr as useRecentChain,ts as useSendIbcTokens,es as useSendTokens,Tr as useSigners,Kr as useSigningClients,Mr as useSuggestChain,Rr as useSuggestChainAndConnect};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "graz",
3
3
  "description": "React hooks for Cosmos",
4
- "version": "0.0.44-alpha.2",
4
+ "version": "0.0.44",
5
5
  "author": "Griko Nibras <griko@strange.love>",
6
6
  "repository": "https://github.com/strangelove-ventures/graz.git",
7
7
  "homepage": "https://github.com/strangelove-ventures/graz",
@@ -10,17 +10,18 @@
10
10
  "module": "./dist/index.mjs",
11
11
  "types": "./dist/index.d.ts",
12
12
  "bin": {
13
- "graz": "./dist/cli/index.mjs"
13
+ "graz": "./cli.mjs"
14
14
  },
15
15
  "files": [
16
- "**/*.stub",
17
- "dist/**/*.d.ts",
18
- "dist/**/*.js",
19
- "dist/**/*.mjs"
16
+ "chains/*.stub",
17
+ "cli.js",
18
+ "compiled/**",
19
+ "dist/*.d.ts",
20
+ "dist/*.js",
21
+ "dist/*.mjs"
20
22
  ],
21
23
  "sideEffects": false,
22
24
  "dependencies": {
23
- "@clack/prompts": "^0.6.3",
24
25
  "@cosmjs/cosmwasm-stargate": "^0.30.1",
25
26
  "@cosmjs/launchpad": "^0.27.1",
26
27
  "@cosmjs/proto-signing": "^0.30.1",
@@ -30,12 +31,13 @@
30
31
  "@keplr-wallet/types": "^0.12.10",
31
32
  "@tanstack/react-query": "^4.29.14",
32
33
  "@tanstack/react-query-devtools": "^4.29.14",
34
+ "@vectis/extension-client": "^0.7.1",
33
35
  "@walletconnect/sign-client": "^2.8.1",
34
36
  "@walletconnect/types": "^2.8.1",
35
37
  "@walletconnect/utils": "^2.8.1",
36
38
  "@web3modal/standalone": "^2.4.3",
37
- "commander": "^11.0.0",
38
- "esbuild": "^0.18.4",
39
+ "arg": "^5.0.2",
40
+ "cosmos-directory-client": "0.0.6",
39
41
  "zustand": "^4.3.8"
40
42
  },
41
43
  "devDependencies": {
@@ -59,7 +61,7 @@
59
61
  "scripts": {
60
62
  "build": "tsup",
61
63
  "clean": "rm -rf dist/*",
62
- "cli": "node dist/cli/index.mjs",
64
+ "cli": "node cli.mjs",
63
65
  "dev": "tsup --watch",
64
66
  "lint": "eslint --fix \"src/**/*.{ts,tsx}\""
65
67
  }