diff --git a/assets/___vite-browser-external_commonjs-proxy-_F0zCunc.js b/assets/___vite-browser-external_commonjs-proxy-DoCXvEbS.js similarity index 98% rename from assets/___vite-browser-external_commonjs-proxy-_F0zCunc.js rename to assets/___vite-browser-external_commonjs-proxy-DoCXvEbS.js index a1381921..6f638966 100644 --- a/assets/___vite-browser-external_commonjs-proxy-_F0zCunc.js +++ b/assets/___vite-browser-external_commonjs-proxy-DoCXvEbS.js @@ -1 +1 @@ -import{a as j,g as C}from"./index-BDNLXjIW.js";var p={exports:{}},a=typeof Reflect=="object"?Reflect:null,h=a&&typeof a.apply=="function"?a.apply:function(e,n,r){return Function.prototype.apply.call(e,n,r)},l;a&&typeof a.ownKeys=="function"?l=a.ownKeys:Object.getOwnPropertySymbols?l=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:l=function(e){return Object.getOwnPropertyNames(e)};function N(t){console&&console.warn&&console.warn(t)}var L=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}p.exports=o;p.exports.once=P;o.EventEmitter=o;o.prototype._events=void 0;o.prototype._eventsCount=0;o.prototype._maxListeners=void 0;var m=10;function v(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return m},set:function(t){if(typeof t!="number"||t<0||L(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");m=t}});o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};o.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||L(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function y(t){return t._maxListeners===void 0?o.defaultMaxListeners:t._maxListeners}o.prototype.getMaxListeners=function(){return y(this)};o.prototype.emit=function(e){for(var n=[],r=1;r0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")h(c,this,n);else for(var d=c.length,O=E(c,d),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,N(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=R.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():M(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?A(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;r0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")h(c,this,n);else for(var d=c.length,O=E(c,d),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,N(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function R(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=R.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():M(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?A(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;r` ${w(u)}`)],` Sender: ${d}`,` Data: ${o}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends l{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(a)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends l{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(n,e){if(!p(n))throw new h({address:n});if(!p(e))throw new h({address:e});return n.toLowerCase()===e.toLowerCase()}const v="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function C(n,{blockNumber:e,blockTag:a,data:o,to:c}){const{args:d}=g({data:o,abi:[S]}),[r,i,u,t,s]=d;try{if(!$(c,r))throw new R({sender:r,to:c});const f=await A({data:u,sender:r,urls:i}),{data:b}=await k(n,{blockNumber:e,blockTag:a,data:O([t,L([{type:"bytes"},{type:"bytes"}],[f,s])]),to:c});return b}catch(f){throw new x({callbackSelector:t,cause:f,data:o,extraData:s,sender:r,urls:i})}}async function A({data:n,sender:e,urls:a}){var c;let o=new Error("An unknown error occurred.");for(let d=0;d` ${w(u)}`)],` Sender: ${d}`,` Data: ${o}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends l{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(a)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends l{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(n,e){if(!p(n))throw new h({address:n});if(!p(e))throw new h({address:e});return n.toLowerCase()===e.toLowerCase()}const v="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function C(n,{blockNumber:e,blockTag:a,data:o,to:c}){const{args:d}=g({data:o,abi:[S]}),[r,i,u,t,s]=d;try{if(!$(c,r))throw new R({sender:r,to:c});const f=await A({data:u,sender:r,urls:i}),{data:b}=await k(n,{blockNumber:e,blockTag:a,data:O([t,L([{type:"bytes"},{type:"bytes"}],[f,s])]),to:c});return b}catch(f){throw new x({callbackSelector:t,cause:f,data:o,extraData:s,sender:r,urls:i})}}async function A({data:n,sender:e,urls:a}){var c;let o=new Error("An unknown error occurred.");for(let d=0;dn[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var xo={},Br={},Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.walletLogo=void 0;const Md=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Wn.walletLogo=Md;var Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.LINK_API_URL=void 0;Vn.LINK_API_URL="https://www.walletlink.org";var O={},Wr={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.errorValues=ht.standardErrorCodes=void 0;ht.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};ht.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var zn={},qn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=ht,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(h,g=r){if(h&&Number.isInteger(h)){const b=h.toString();if(d(t.errorValues,b))return t.errorValues[b].message;if(c(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return g}e.getMessageFromCode=n;function s(h){if(!Number.isInteger(h))return!1;const g=h.toString();return!!(t.errorValues[g]||c(h))}e.isValidCode=s;function i(h){var g;if(typeof h=="number")return h;if(o(h))return(g=h.code)!==null&&g!==void 0?g:h.errorCode}e.getErrorCode=i;function o(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function a(h,{shouldIncludeStack:g=!1}={}){const b={};if(h&&typeof h=="object"&&!Array.isArray(h)&&d(h,"code")&&s(h.code)){const R=h;b.code=R.code,R.message&&typeof R.message=="string"?(b.message=R.message,d(R,"data")&&(b.data=R.data)):(b.message=n(b.code),b.data={originalError:l(h)})}else b.code=t.standardErrorCodes.rpc.internal,b.message=u(h,"message")?h.message:r,b.data={originalError:l(h)};return g&&(b.stack=u(h,"stack")?h.stack:void 0),b}e.serialize=a;function c(h){return h>=-32099&&h<=-32e3}function l(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function d(h,g){return Object.prototype.hasOwnProperty.call(h,g)}function u(h,g){return typeof h=="object"&&h!==null&&g in h&&typeof h[g]=="string"}})(qn);Object.defineProperty(zn,"__esModule",{value:!0});zn.standardErrors=void 0;const Se=ht,pl=qn;zn.standardErrors={rpc:{parse:e=>$e(Se.standardErrorCodes.rpc.parse,e),invalidRequest:e=>$e(Se.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>$e(Se.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>$e(Se.standardErrorCodes.rpc.methodNotFound,e),internal:e=>$e(Se.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return $e(t,e)},invalidInput:e=>$e(Se.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>$e(Se.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>$e(Se.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>$e(Se.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>$e(Se.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>$e(Se.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Jt(Se.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Jt(Se.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Jt(Se.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Jt(Se.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Jt(Se.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Jt(Se.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ml(t,r,n)}}};function $e(e,t){const[r,n]=gl(t);return new _l(e,r||(0,pl.getMessageFromCode)(e),n)}function Jt(e,t){const[r,n]=gl(t);return new ml(e,r||(0,pl.getMessageFromCode)(e),n)}function gl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let _l=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},ml=class extends _l{constructor(t,r,n){if(!Ld(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Ld(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Gn={},mr={};Object.defineProperty(mr,"__esModule",{value:!0});mr.isErrorResponse=void 0;function Pd(e){return e.errorMessage!==void 0}mr.isErrorResponse=Pd;var br={};Object.defineProperty(br,"__esModule",{value:!0});br.LIB_VERSION=void 0;br.LIB_VERSION="3.9.1";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.serializeError=void 0;const Od=mr,$d=br,Bd=ht,Dd=qn;function Fd(e,t){const r=(0,Dd.serialize)(jd(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",$d.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=Hd(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Gn.serializeError=Fd;function jd(e){return typeof e=="string"?{message:e,code:Bd.standardErrorCodes.rpc.internal}:(0,Od.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Hd(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=ht;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=zn;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Gn;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=qn;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(Wr);var be={};Object.defineProperty(be,"__esModule",{value:!0});be.ProviderType=be.RegExpString=be.IntNumber=be.BigIntString=be.AddressString=be.HexString=be.OpaqueType=void 0;function Vr(){return e=>e}be.OpaqueType=Vr;be.HexString=Vr();be.AddressString=Vr();be.BigIntString=Vr();function Ud(e){return Math.floor(e)}be.IntNumber=Ud;be.RegExpString=Vr();var ya;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(ya||(be.ProviderType=ya={}));var Wd=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(O,"__esModule",{value:!0});O.isMobileWeb=O.getLocation=O.isInIFrame=O.createQrUrl=O.getFavicon=O.range=O.isBigNumber=O.ensureParsedJSONObject=O.ensureBN=O.ensureRegExpString=O.ensureIntNumber=O.ensureBuffer=O.ensureAddressString=O.ensureEvenLengthHexString=O.ensureHexString=O.isHexString=O.prepend0x=O.strip0x=O.has0xPrefix=O.hexStringFromIntNumber=O.intNumberFromHexString=O.bigIntStringFromBN=O.hexStringFromBuffer=O.hexStringToUint8Array=O.uint8ArrayToHex=O.randomBytesHex=void 0;const bt=Wd(jn),Ft=Wr,je=be,bl=/^[0-9]*$/,yl=/^[a-f0-9]*$/;function Vd(e){return vl(crypto.getRandomValues(new Uint8Array(e)))}O.randomBytesHex=Vd;function vl(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}O.uint8ArrayToHex=vl;function zd(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}O.hexStringToUint8Array=zd;function qd(e,t=!1){const r=e.toString("hex");return(0,je.HexString)(t?`0x${r}`:r)}O.hexStringFromBuffer=qd;function Gd(e){return(0,je.BigIntString)(e.toString(10))}O.bigIntStringFromBN=Gd;function Jd(e){return(0,je.IntNumber)(new bt.default(qr(e,!1),16).toNumber())}O.intNumberFromHexString=Jd;function Zd(e){return(0,je.HexString)(`0x${new bt.default(e).toString(16)}`)}O.hexStringFromIntNumber=Zd;function To(e){return e.startsWith("0x")||e.startsWith("0X")}O.has0xPrefix=To;function Jn(e){return To(e)?e.slice(2):e}O.strip0x=Jn;function wl(e){return To(e)?`0x${e.slice(2)}`:`0x${e}`}O.prepend0x=wl;function zr(e){if(typeof e!="string")return!1;const t=Jn(e).toLowerCase();return yl.test(t)}O.isHexString=zr;function El(e,t=!1){if(typeof e=="string"){const r=Jn(e).toLowerCase();if(yl.test(r))return(0,je.HexString)(t?`0x${r}`:r)}throw Ft.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}O.ensureHexString=El;function qr(e,t=!1){let r=El(e,!1);return r.length%2===1&&(r=(0,je.HexString)(`0${r}`)),t?(0,je.HexString)(`0x${r}`):r}O.ensureEvenLengthHexString=qr;function Kd(e){if(typeof e=="string"){const t=Jn(e).toLowerCase();if(zr(t)&&t.length===40)return(0,je.AddressString)(wl(t))}throw Ft.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}O.ensureAddressString=Kd;function Qd(e){if(G.isBuffer(e))return e;if(typeof e=="string"){if(zr(e)){const t=qr(e,!1);return G.from(t,"hex")}return G.from(e,"utf8")}throw Ft.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}O.ensureBuffer=Qd;function Sl(e){if(typeof e=="number"&&Number.isInteger(e))return(0,je.IntNumber)(e);if(typeof e=="string"){if(bl.test(e))return(0,je.IntNumber)(Number(e));if(zr(e))return(0,je.IntNumber)(new bt.default(qr(e,!1),16).toNumber())}throw Ft.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureIntNumber=Sl;function Yd(e){if(e instanceof RegExp)return(0,je.RegExpString)(e.toString());throw Ft.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}O.ensureRegExpString=Yd;function Xd(e){if(e!==null&&(bt.default.isBN(e)||Rl(e)))return new bt.default(e.toString(10),10);if(typeof e=="number")return new bt.default(Sl(e));if(typeof e=="string"){if(bl.test(e))return new bt.default(e,10);if(zr(e))return new bt.default(qr(e,!1),16)}throw Ft.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureBN=Xd;function eh(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw Ft.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}O.ensureParsedJSONObject=eh;function Rl(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}O.isBigNumber=Rl;function th(e,t){return Array.from({length:t-e},(r,n)=>e+n)}O.range=th;function rh(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}O.getFavicon=rh;function nh(e,t,r,n,s,i){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${a}`}O.createQrUrl=nh;function Cl(){try{return window.frameElement!==null}catch{return!1}}O.isInIFrame=Cl;function sh(){try{return Cl()&&window.top?window.top.location:window.location}catch{return window.location}}O.getLocation=sh;function ih(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}O.isMobileWeb=ih;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ScopedLocalStorage=void 0;class oh{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Zn.ScopedLocalStorage=oh;var cr={},Gr={},Jr={},yr={};Object.defineProperty(yr,"__esModule",{value:!0});yr.EVENTS=void 0;yr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.RelayAbstract=Fe.APP_VERSION_KEY=Fe.LOCAL_STORAGE_ADDRESSES_KEY=Fe.WALLET_USER_NAME_KEY=void 0;const va=Wr;Fe.WALLET_USER_NAME_KEY="walletUsername";Fe.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Fe.APP_VERSION_KEY="AppVersion";class ah{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw va.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,va.serializeError)(i,t.method);return s})}}Fe.RelayAbstract=ah;var vr={},kl={exports:{}},po={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(e,t){var r=Hn,n=r.Buffer;function s(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=i);function i(o,a,c){return n(o,a,c)}i.prototype=Object.create(n.prototype),s(n,i),i.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},i.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(po,po.exports);var Et=po.exports,Il=Et.Buffer;function Kn(e,t){this._block=Il.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Kn.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Il.from(e,t));for(var r=this._block,n=this._blockSize,s=e.length,i=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,s=(r-n)/4294967296;this._block.writeUInt32BE(s,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i};Kn.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var wr=Kn,ch=qe,Al=wr,lh=Et.Buffer,uh=[1518500249,1859775393,-1894007588,-899497514],dh=new Array(80);function Zr(){this.init(),this._w=dh,Al.call(this,64,56)}ch(Zr,Al);Zr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function hh(e){return e<<5|e>>>27}function fh(e){return e<<30|e>>>2}function ph(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Zr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var c=0;c<80;++c){var l=~~(c/20),d=hh(r)+ph(l,n,s,i)+o+t[c]+uh[l]|0;o=i,i=s,s=fh(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0};Zr.prototype._hash=function(){var e=lh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var gh=Zr,_h=qe,xl=wr,mh=Et.Buffer,bh=[1518500249,1859775393,-1894007588,-899497514],yh=new Array(80);function Kr(){this.init(),this._w=yh,xl.call(this,64,56)}_h(Kr,xl);Kr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function vh(e){return e<<1|e>>>31}function wh(e){return e<<5|e>>>27}function Eh(e){return e<<30|e>>>2}function Sh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Kr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=vh(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var c=0;c<80;++c){var l=~~(c/20),d=wh(r)+Sh(l,n,s,i)+o+t[c]+bh[l]|0;o=i,i=s,s=Eh(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0};Kr.prototype._hash=function(){var e=mh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Rh=Kr,Ch=qe,Tl=wr,kh=Et.Buffer,Ih=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ah=new Array(64);function Qr(){this.init(),this._w=Ah,Tl.call(this,64,56)}Ch(Qr,Tl);Qr.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function xh(e,t,r){return r^e&(t^r)}function Th(e,t,r){return e&t|r&(e|t)}function Nh(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Mh(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Lh(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Ph(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Qr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,l=this._h|0,d=0;d<16;++d)t[d]=e.readInt32BE(d*4);for(;d<64;++d)t[d]=Ph(t[d-2])+t[d-7]+Lh(t[d-15])+t[d-16]|0;for(var u=0;u<64;++u){var h=l+Mh(o)+xh(o,a,c)+Ih[u]+t[u]|0,g=Nh(r)+Th(r,n,s)|0;l=c,c=a,a=o,o=i+h|0,i=s,s=n,n=r,r=h+g|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0};Qr.prototype._hash=function(){var e=kh.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Nl=Qr,Oh=qe,$h=Nl,Bh=wr,Dh=Et.Buffer,Fh=new Array(64);function Qn(){this.init(),this._w=Fh,Bh.call(this,64,56)}Oh(Qn,$h);Qn.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Qn.prototype._hash=function(){var e=Dh.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var jh=Qn,Hh=qe,Ml=wr,Uh=Et.Buffer,wa=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Wh=new Array(160);function Yr(){this.init(),this._w=Wh,Ml.call(this,128,112)}Hh(Yr,Ml);Yr.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ea(e,t,r){return r^e&(t^r)}function Sa(e,t,r){return e&t|r&(e|t)}function Ra(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Ca(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Vh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function zh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function qh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function ve(e,t){return e>>>0>>0?1:0}Yr.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,s=this._ch|0,i=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,l=this._hh|0,d=this._al|0,u=this._bl|0,h=this._cl|0,g=this._dl|0,b=this._el|0,R=this._fl|0,E=this._gl|0,_=this._hl|0,m=0;m<32;m+=2)t[m]=e.readInt32BE(m*4),t[m+1]=e.readInt32BE(m*4+4);for(;m<160;m+=2){var y=t[m-30],C=t[m-15*2+1],S=Vh(y,C),I=zh(C,y);y=t[m-2*2],C=t[m-2*2+1];var j=qh(y,C),$=Gh(C,y),N=t[m-7*2],J=t[m-7*2+1],de=t[m-16*2],oe=t[m-16*2+1],T=I+J|0,x=S+N+ve(T,I)|0;T=T+$|0,x=x+j+ve(T,$)|0,T=T+oe|0,x=x+de+ve(T,oe)|0,t[m]=x,t[m+1]=T}for(var P=0;P<160;P+=2){x=t[P],T=t[P+1];var D=Sa(r,n,s),B=Sa(d,u,h),L=Ra(r,d),H=Ra(d,r),Z=Ca(o,b),W=Ca(b,o),Y=wa[P],ce=wa[P+1],se=Ea(o,a,c),Ie=Ea(b,R,E),v=_+W|0,w=l+Z+ve(v,_)|0;v=v+Ie|0,w=w+se+ve(v,Ie)|0,v=v+ce|0,w=w+Y+ve(v,ce)|0,v=v+T|0,w=w+x+ve(v,T)|0;var A=H+B|0,U=L+D+ve(A,H)|0;l=c,_=E,c=a,E=R,a=o,R=b,b=g+v|0,o=i+w+ve(b,g)|0,i=s,g=h,s=n,h=u,n=r,u=d,d=v+A|0,r=w+U+ve(d,v)|0}this._al=this._al+d|0,this._bl=this._bl+u|0,this._cl=this._cl+h|0,this._dl=this._dl+g|0,this._el=this._el+b|0,this._fl=this._fl+R|0,this._gl=this._gl+E|0,this._hl=this._hl+_|0,this._ah=this._ah+r+ve(this._al,d)|0,this._bh=this._bh+n+ve(this._bl,u)|0,this._ch=this._ch+s+ve(this._cl,h)|0,this._dh=this._dh+i+ve(this._dl,g)|0,this._eh=this._eh+o+ve(this._el,b)|0,this._fh=this._fh+a+ve(this._fl,R)|0,this._gh=this._gh+c+ve(this._gl,E)|0,this._hh=this._hh+l+ve(this._hl,_)|0};Yr.prototype._hash=function(){var e=Uh.allocUnsafe(64);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ll=Yr,Jh=qe,Zh=Ll,Kh=wr,Qh=Et.Buffer,Yh=new Array(160);function Yn(){this.init(),this._w=Yh,Kh.call(this,128,112)}Jh(Yn,Zh);Yn.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Yn.prototype._hash=function(){var e=Qh.allocUnsafe(48);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Xh=Yn,jt=kl.exports=function(t){t=t.toLowerCase();var r=jt[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};jt.sha=gh;jt.sha1=Rh;jt.sha224=jh;jt.sha256=Nl;jt.sha384=Xh;jt.sha512=Ll;var ef=kl.exports;Object.defineProperty(vr,"__esModule",{value:!0});vr.Session=void 0;const ka=ef,Ia=O,Aa="session:id",xa="session:secret",Ta="session:linked";class No{constructor(t,r,n,s){this._storage=t,this._id=r||(0,Ia.randomBytesHex)(16),this._secret=n||(0,Ia.randomBytesHex)(32),this._key=new ka.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(Aa),n=t.getItem(Ta),s=t.getItem(xa);return r&&s?new No(t,r,s,n==="1"):null}static hash(t){return new ka.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Aa,this._id),this._storage.setItem(xa,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ta,this._linked?"1":"0")}}vr.Session=No;var Xn={},es={};Object.defineProperty(es,"__esModule",{value:!0});es.Cipher=void 0;const mn=O;class tf{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,mn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(t)),a=16,c=o.slice(o.byteLength-a),l=o.slice(0,o.byteLength-a),d=new Uint8Array(c),u=new Uint8Array(l),h=new Uint8Array([...n,...d,...u]);return(0,mn.uint8ArrayToHex)(h)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,mn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,mn.hexStringToUint8Array)(t),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),d=new Uint8Array([...l,...c]),u={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(u,i,d),g=new TextDecoder;n(g.decode(h))}catch(h){s(h)}})()})}}es.Cipher=tf;var ts={};Object.defineProperty(ts,"__esModule",{value:!0});ts.WalletLinkHTTP=void 0;class rf{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const s=`${r}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:s}=await r.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${r.status}`)}}ts.WalletLinkHTTP=rf;var lr={};Object.defineProperty(lr,"__esModule",{value:!0});lr.WalletLinkWebSocket=lr.ConnectionState=void 0;var rr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(rr||(lr.ConnectionState=rr={}));class nf{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){r(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,rr.CONNECTING),s.onclose=i=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${i.code}: ${i.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,rr.DISCONNECTED)},s.onopen=i=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,rr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var o,a;if(i.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,c)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,rr.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}lr.WalletLinkWebSocket=nf;Object.defineProperty(Xn,"__esModule",{value:!0});Xn.WalletLinkConnection=void 0;const Zt=be,sf=es,Ke=yr,Na=Fe,Kt=vr,of=ts,bn=lr,Ma=1e4,af=6e4;class cf{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Zt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>a.JsonRpcUrl&&this.handleChainUpdated(l,a.JsonRpcUrl)]]).forEach((l,d)=>{const u=a[d];u!==void 0&&l(u)})},this.handleDestroyed=a=>{var c,l;a==="1"&&((c=this.listener)===null||c===void 0||c.resetAndReload(),(l=this.diagnostic)===null||l===void 0||l.log(Ke.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Kt.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var c,l;try{const d=await this.cipher.decrypt(a);(c=this.listener)===null||c===void 0||c.accountUpdated(d)}catch{(l=this.diagnostic)===null||l===void 0||l.log(Ke.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,c)=>{var l,d;try{const u=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.metadataUpdated(a,u)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Ke.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(Na.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Na.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,c)=>{var l,d;try{const u=await this.cipher.decrypt(a),h=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.chainUpdated(u,h)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Ke.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new sf.Cipher(t.secret),this.diagnostic=s,this.listener=n;const o=new bn.WalletLinkWebSocket(`${r}/rpc`,i);o.setConnectionStateListener(async a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(Ke.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Kt.Session.hash(t.id)});let l=!1;switch(a){case bn.ConnectionState.DISCONNECTED:if(!this.destroyed){const d=async()=>{await new Promise(u=>setTimeout(u,5e3)),this.destroyed||o.connect().catch(()=>{d()})};d()}break;case bn.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),l=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Ma),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case bn.ConnectionState.CONNECTING:break}this.connected!==l&&(this.connected=l)}),o.setIncomingDataListener(a=>{var c,l,d;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const u=a.type==="IsLinkedOK"?a.linked:void 0;(c=this.diagnostic)===null||c===void 0||c.log(Ke.EVENTS.LINKED,{sessionIdHash:Kt.Session.hash(t.id),linked:u,type:a.type,onlineGuests:a.onlineGuests}),this.linked=u||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(l=this.diagnostic)===null||l===void 0||l.log(Ke.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Kt.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((d=this.requestResolutions.get(a.id))===null||d===void 0||d(a))}),this.ws=o,this.http=new of.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Ke.EVENTS.STARTED_CONNECTING,{sessionIdHash:Kt.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Ke.EVENTS.DISCONNECTED,{sessionIdHash:Kt.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const s=await this.cipher.decrypt(t.data),i=JSON.parse(s);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Ke.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,Zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(i);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Ma*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=af){const n=t.id;this.sendData(t);let s;return Promise.race([new Promise((i,o)=>{s=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(i=>{this.requestResolutions.set(n,o=>{clearTimeout(s),i(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Xn.WalletLinkConnection=cf;var Xr={},en={},Mo={};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var lf=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(en,"__esModule",{value:!0});en.injectCssReset=void 0;const uf=lf(Mo);function df(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(uf.default)),document.documentElement.appendChild(e)}en.injectCssReset=df;var rs={},tn,ae,Pl,Ol,At,La,$l,go,Bl,Dr={},Lo=[],hf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ns=Array.isArray;function dt(e,t){for(var r in t)e[r]=t[r];return e}function Dl(e){var t=e.parentNode;t&&t.removeChild(e)}function _o(e,t,r){var n,s,i,o={};for(i in t)i=="key"?n=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?tn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return Lr(e,o,n,s,null)}function Lr(e,t,r,n,s){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++Pl,__i:-1,__u:0};return s==null&&ae.vnode!=null&&ae.vnode(i),i}function ff(){return{current:null}}function rn(e){return e.children}function Pr(e,t){this.props=e,this.context=t}function ur(e,t){if(t==null)return e.__?ur(e.__,e.__i+1):null;for(var r;tr?(bo(n,t,s),s.length=n.length=0,t=void 0,At.sort(go)):t&&ae.__c&&ae.__c(t,Lo));t&&bo(n,t,s),On.__r=0}function jl(e,t,r,n,s,i,o,a,c,l,d){var u,h,g,b,R,E=n&&n.__k||Lo,_=t.length;for(r.__d=c,gf(r,t,E),c=r.__d,u=0;u<_;u++)(g=r.__k[u])!=null&&typeof g!="boolean"&&typeof g!="function"&&(h=g.__i===-1?Dr:E[g.__i]||Dr,g.__i=u,Po(e,g,h,s,i,o,a,c,l,d),b=g.__e,g.ref&&h.ref!=g.ref&&(h.ref&&Oo(h.ref,null,g),d.push(g.ref,g.__c||b,g)),R==null&&b!=null&&(R=b),65536&g.__u||h.__k===g.__k?c=Hl(g,c,e):typeof g.type=="function"&&g.__d!==void 0?c=g.__d:b&&(c=b.nextSibling),g.__d=void 0,g.__u&=-196609);r.__d=c,r.__e=R}function gf(e,t,r){var n,s,i,o,a,c=t.length,l=r.length,d=l,u=0;for(e.__k=[],n=0;n0?Lr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null?(s.__=e,s.__b=e.__b+1,a=_f(s,r,o=n+u,d),s.__i=a,i=null,a!==-1&&(d--,(i=r[a])&&(i.__u|=131072)),i==null||i.__v===null?(a==-1&&u--,typeof s.type!="function"&&(s.__u|=65536)):a!==o&&(a===o+1?u++:a>o?d>c-o?u+=a-o:u--:u=a(c!=null&&!(131072&c.__u)?1:0))for(;o>=0||a=0){if((c=t[o])&&!(131072&c.__u)&&s==c.key&&i===c.type)return o;o--}if(a2&&(a.children=arguments.length>3?tn.call(arguments,2):r),Lr(e.type,a,n||e.key,s||e.ref,null)}function vf(e,t){var r={__c:t="__cC"+Bl++,__:e,Consumer:function(n,s){return n.children(s)},Provider:function(n){var s,i;return this.getChildContext||(s=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&s.some(function(a){a.__e=!0,mo(a)})},this.sub=function(o){s.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){s.splice(s.indexOf(o),1),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}tn=Lo.slice,ae={__e:function(e,t,r,n){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,n||{}),o=s.__d),o)return s.__E=s}catch(a){e=a}throw e}},Pl=0,Ol=function(e){return e!=null&&e.constructor==null},Pr.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=dt({},this.state),typeof e=="function"&&(e=e(dt({},r),this.props)),e&&dt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),mo(this))},Pr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),mo(this))},Pr.prototype.render=rn,At=[],$l=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,go=function(e,t){return e.__v.__b-t.__v.__b},On.__r=0,Bl=0;const wf=Object.freeze(Object.defineProperty({__proto__:null,Component:Pr,Fragment:rn,cloneElement:yf,createContext:vf,createElement:_o,createRef:ff,h:_o,hydrate:Vl,get isValidElement(){return Ol},get options(){return ae},render:Wl,toChildArray:Ul},Symbol.toStringTag,{value:"Module"})),Ne=Ur(wf);var ss={};function zl(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t=r.__.length&&r.__.push({__V:Nn}),r.__[e]}function Gl(e){return dr=1,Jl(Kl,e)}function Jl(e,t,r){var n=Ht(ft++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Kl(void 0,t),function(a){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,a);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=le,!le.u)){var s=function(a,c,l){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!i||i.call(this,a,c,l);var u=!1;return d.forEach(function(h){if(h.__N){var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(u=!0)}}),!(!u&&n.__c.props===a)&&(!i||i.call(this,a,c,l))};le.u=!0;var i=le.shouldComponentUpdate,o=le.componentWillUpdate;le.componentWillUpdate=function(a,c,l){if(this.__e){var d=i;i=void 0,s(a,c,l),i=d}o&&o.call(this,a,c,l)},le.shouldComponentUpdate=s}return n.__N||n.__}function Sf(e,t){var r=Ht(ft++,3);!pe.__s&&Bo(r.__H,t)&&(r.__=e,r.i=t,le.__H.__h.push(r))}function Zl(e,t){var r=Ht(ft++,4);!pe.__s&&Bo(r.__H,t)&&(r.__=e,r.i=t,le.__h.push(r))}function Rf(e){return dr=5,$o(function(){return{current:e}},[])}function Cf(e,t,r){dr=6,Zl(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function $o(e,t){var r=Ht(ft++,7);return Bo(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function kf(e,t){return dr=8,$o(function(){return e},t)}function If(e){var t=le.context[e.__c],r=Ht(ft++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(le)),t.props.value):e.__}function Af(e,t){pe.useDebugValue&&pe.useDebugValue(t?t(e):e)}function xf(e){var t=Ht(ft++,10),r=Gl();return t.__=e,le.componentDidCatch||(le.componentDidCatch=function(n,s){t.__&&t.__(n,s),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Tf(){var e=Ht(ft++,11);if(!e.__){for(var t=le.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Nf(){for(var e;e=ql.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Mn),e.__H.__h.forEach(vo),e.__H.__h=[]}catch(t){e.__H.__h=[],pe.__e(t,e.__v)}}pe.__b=function(e){le=null,Fa&&Fa(e)},pe.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Va&&Va(e,t)},pe.__r=function(e){ja&&ja(e),ft=0;var t=(le=e.__c).__H;t&&(Pi===le?(t.__h=[],le.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Nn,r.__N=r.i=void 0})):(t.__h.forEach(Mn),t.__h.forEach(vo),t.__h=[],ft=0)),Pi=le},pe.diffed=function(e){Ha&&Ha(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ql.push(t)!==1&&Da===pe.requestAnimationFrame||((Da=pe.requestAnimationFrame)||Mf)(Nf)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Nn&&(r.__=r.__V),r.i=void 0,r.__V=Nn})),Pi=le=null},pe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Mn),r.__h=r.__h.filter(function(n){return!n.__||vo(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],pe.__e(n,r.__v)}}),Ua&&Ua(e,t)},pe.unmount=function(e){Wa&&Wa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Mn(n)}catch(s){t=s}}),r.__H=void 0,t&&pe.__e(t,r.__v))};var za=typeof requestAnimationFrame=="function";function Mf(e){var t,r=function(){clearTimeout(n),za&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);za&&(t=requestAnimationFrame(r))}function Mn(e){var t=le,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),le=t}function vo(e){var t=le;e.__c=e.__(),le=t}function Bo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Kl(e,t){return typeof t=="function"?t(e):t}const Lf=Object.freeze(Object.defineProperty({__proto__:null,useCallback:kf,useContext:If,useDebugValue:Af,useEffect:Sf,useErrorBoundary:xf,useId:Tf,useImperativeHandle:Cf,useLayoutEffect:Zl,useMemo:$o,useReducer:Jl,useRef:Rf,useState:Gl},Symbol.toStringTag,{value:"Module"})),is=Ur(Lf);var hr={},os={};Object.defineProperty(os,"__esModule",{value:!0});os.CloseIcon=void 0;const qa=Ne;function Pf(e){return(0,qa.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,qa.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}os.CloseIcon=Pf;var as={};Object.defineProperty(as,"__esModule",{value:!0});as.CoinbaseWalletRound=void 0;const vn=Ne;function Of(e){return(0,vn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,vn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,vn.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,vn.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}as.CoinbaseWalletRound=Of;var cs={};Object.defineProperty(cs,"__esModule",{value:!0});cs.QRCodeIcon=void 0;const Ar=Ne;function $f(e){return(0,Ar.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ar.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Ar.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Ar.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Ar.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}cs.QRCodeIcon=$f;var ls={};function Ql(e){this.mode=Pe.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>2048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Ql.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=rt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=fe.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),s=1;this.make();for(var i=0;i>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=fe.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<6?this.modules[s][8]=i:s<8?this.modules[s+1][8]=i:this.modules[this.moduleCount-15+s][8]=i}for(var s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=i:s<9?this.modules[8][15-s-1+1]=i:this.modules[8][15-s-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,s=7,i=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;i>>s&1)==1);var l=fe.getMask(t,n,o-a);l&&(c=!c),this.modules[n][o-a]=c,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};rt.PAD0=236;rt.PAD1=17;rt.createData=function(e,t,r){for(var n=tt.getRSBlocks(e,t),s=new Yl,i=0;ia*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(rt.PAD0,8),s.getLengthInBits()>=a*8));)s.put(rt.PAD1,8);return rt.createBytes(s,n)};rt.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),o=new Array(t.length),a=0;a=0?g.get(b):0}}for(var R=0,d=0;d=0;)t^=fe.G15<=0;)t^=fe.G18<>>=1;return t},getPatternPosition:function(e){return fe.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case _t.PATTERN000:return(t+r)%2==0;case _t.PATTERN001:return t%2==0;case _t.PATTERN010:return r%3==0;case _t.PATTERN011:return(t+r)%3==0;case _t.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case _t.PATTERN101:return t*r%2+t*r%3==0;case _t.PATTERN110:return(t*r%2+t*r%3)%2==0;case _t.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new nr([1],0),r=0;r5&&(r+=3+i-5)}for(var n=0;n=256;)e-=255;return Ee.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Re=0;Re<8;Re++)Ee.EXP_TABLE[Re]=1<>>7-e%8&1)==1},put:function(e,t){for(var r=0;r>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Oi=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Xl(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return yt.L;case"M":return yt.M;case"Q":return yt.Q;case"H":return yt.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,l){for(var d=s(c),u=1,h=0,g=0,b=Oi.length;g<=b;g++){var R=Oi[g];if(!R)throw new Error("Content too long: expected "+h+" but got "+d);switch(l){case"L":h=R[0];break;case"M":h=R[1];break;case"Q":h=R[2];break;case"H":h=R[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(d<=h)break;u++}if(u>Oi.length)throw new Error("Content too long");return u}function s(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var i=this.options.content,o=n(i,this.options.ecl),a=r(this.options.ecl);this.qrcode=new rt(o,a),this.qrcode.addData(i),this.qrcode.make()}Xl.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,s=n?" ":"",i=n?`\r +import{c as F,b as jn,B as G,r as Hn,i as qe,g as Ur,p as ne,t as Ad,e as xd,a as Td}from"./index-BliWCjCt.js";import{e as Un,r as fl}from"./___vite-browser-external_commonjs-proxy-DoCXvEbS.js";function Nd(e,t){for(var r=0;rn[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var xo={},Br={},Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.walletLogo=void 0;const Md=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Wn.walletLogo=Md;var Vn={};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.LINK_API_URL=void 0;Vn.LINK_API_URL="https://www.walletlink.org";var O={},Wr={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.errorValues=ht.standardErrorCodes=void 0;ht.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};ht.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var zn={},qn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=ht,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(h,g=r){if(h&&Number.isInteger(h)){const b=h.toString();if(d(t.errorValues,b))return t.errorValues[b].message;if(c(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return g}e.getMessageFromCode=n;function s(h){if(!Number.isInteger(h))return!1;const g=h.toString();return!!(t.errorValues[g]||c(h))}e.isValidCode=s;function i(h){var g;if(typeof h=="number")return h;if(o(h))return(g=h.code)!==null&&g!==void 0?g:h.errorCode}e.getErrorCode=i;function o(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function a(h,{shouldIncludeStack:g=!1}={}){const b={};if(h&&typeof h=="object"&&!Array.isArray(h)&&d(h,"code")&&s(h.code)){const R=h;b.code=R.code,R.message&&typeof R.message=="string"?(b.message=R.message,d(R,"data")&&(b.data=R.data)):(b.message=n(b.code),b.data={originalError:l(h)})}else b.code=t.standardErrorCodes.rpc.internal,b.message=u(h,"message")?h.message:r,b.data={originalError:l(h)};return g&&(b.stack=u(h,"stack")?h.stack:void 0),b}e.serialize=a;function c(h){return h>=-32099&&h<=-32e3}function l(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function d(h,g){return Object.prototype.hasOwnProperty.call(h,g)}function u(h,g){return typeof h=="object"&&h!==null&&g in h&&typeof h[g]=="string"}})(qn);Object.defineProperty(zn,"__esModule",{value:!0});zn.standardErrors=void 0;const Se=ht,pl=qn;zn.standardErrors={rpc:{parse:e=>$e(Se.standardErrorCodes.rpc.parse,e),invalidRequest:e=>$e(Se.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>$e(Se.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>$e(Se.standardErrorCodes.rpc.methodNotFound,e),internal:e=>$e(Se.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return $e(t,e)},invalidInput:e=>$e(Se.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>$e(Se.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>$e(Se.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>$e(Se.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>$e(Se.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>$e(Se.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Jt(Se.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Jt(Se.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Jt(Se.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Jt(Se.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Jt(Se.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Jt(Se.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ml(t,r,n)}}};function $e(e,t){const[r,n]=gl(t);return new _l(e,r||(0,pl.getMessageFromCode)(e),n)}function Jt(e,t){const[r,n]=gl(t);return new ml(e,r||(0,pl.getMessageFromCode)(e),n)}function gl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let _l=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},ml=class extends _l{constructor(t,r,n){if(!Ld(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Ld(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Gn={},mr={};Object.defineProperty(mr,"__esModule",{value:!0});mr.isErrorResponse=void 0;function Pd(e){return e.errorMessage!==void 0}mr.isErrorResponse=Pd;var br={};Object.defineProperty(br,"__esModule",{value:!0});br.LIB_VERSION=void 0;br.LIB_VERSION="3.9.1";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.serializeError=void 0;const Od=mr,$d=br,Bd=ht,Dd=qn;function Fd(e,t){const r=(0,Dd.serialize)(jd(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",$d.LIB_VERSION),n.searchParams.set("code",r.code.toString());const s=Hd(r.data,t);return s&&n.searchParams.set("method",s),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Gn.serializeError=Fd;function jd(e){return typeof e=="string"?{message:e,code:Bd.standardErrorCodes.rpc.internal}:(0,Od.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Hd(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=ht;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=zn;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Gn;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const s=qn;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return s.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return s.getMessageFromCode}})})(Wr);var be={};Object.defineProperty(be,"__esModule",{value:!0});be.ProviderType=be.RegExpString=be.IntNumber=be.BigIntString=be.AddressString=be.HexString=be.OpaqueType=void 0;function Vr(){return e=>e}be.OpaqueType=Vr;be.HexString=Vr();be.AddressString=Vr();be.BigIntString=Vr();function Ud(e){return Math.floor(e)}be.IntNumber=Ud;be.RegExpString=Vr();var ya;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(ya||(be.ProviderType=ya={}));var Wd=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(O,"__esModule",{value:!0});O.isMobileWeb=O.getLocation=O.isInIFrame=O.createQrUrl=O.getFavicon=O.range=O.isBigNumber=O.ensureParsedJSONObject=O.ensureBN=O.ensureRegExpString=O.ensureIntNumber=O.ensureBuffer=O.ensureAddressString=O.ensureEvenLengthHexString=O.ensureHexString=O.isHexString=O.prepend0x=O.strip0x=O.has0xPrefix=O.hexStringFromIntNumber=O.intNumberFromHexString=O.bigIntStringFromBN=O.hexStringFromBuffer=O.hexStringToUint8Array=O.uint8ArrayToHex=O.randomBytesHex=void 0;const bt=Wd(jn),Ft=Wr,je=be,bl=/^[0-9]*$/,yl=/^[a-f0-9]*$/;function Vd(e){return vl(crypto.getRandomValues(new Uint8Array(e)))}O.randomBytesHex=Vd;function vl(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}O.uint8ArrayToHex=vl;function zd(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}O.hexStringToUint8Array=zd;function qd(e,t=!1){const r=e.toString("hex");return(0,je.HexString)(t?`0x${r}`:r)}O.hexStringFromBuffer=qd;function Gd(e){return(0,je.BigIntString)(e.toString(10))}O.bigIntStringFromBN=Gd;function Jd(e){return(0,je.IntNumber)(new bt.default(qr(e,!1),16).toNumber())}O.intNumberFromHexString=Jd;function Zd(e){return(0,je.HexString)(`0x${new bt.default(e).toString(16)}`)}O.hexStringFromIntNumber=Zd;function To(e){return e.startsWith("0x")||e.startsWith("0X")}O.has0xPrefix=To;function Jn(e){return To(e)?e.slice(2):e}O.strip0x=Jn;function wl(e){return To(e)?`0x${e.slice(2)}`:`0x${e}`}O.prepend0x=wl;function zr(e){if(typeof e!="string")return!1;const t=Jn(e).toLowerCase();return yl.test(t)}O.isHexString=zr;function El(e,t=!1){if(typeof e=="string"){const r=Jn(e).toLowerCase();if(yl.test(r))return(0,je.HexString)(t?`0x${r}`:r)}throw Ft.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}O.ensureHexString=El;function qr(e,t=!1){let r=El(e,!1);return r.length%2===1&&(r=(0,je.HexString)(`0${r}`)),t?(0,je.HexString)(`0x${r}`):r}O.ensureEvenLengthHexString=qr;function Kd(e){if(typeof e=="string"){const t=Jn(e).toLowerCase();if(zr(t)&&t.length===40)return(0,je.AddressString)(wl(t))}throw Ft.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}O.ensureAddressString=Kd;function Qd(e){if(G.isBuffer(e))return e;if(typeof e=="string"){if(zr(e)){const t=qr(e,!1);return G.from(t,"hex")}return G.from(e,"utf8")}throw Ft.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}O.ensureBuffer=Qd;function Sl(e){if(typeof e=="number"&&Number.isInteger(e))return(0,je.IntNumber)(e);if(typeof e=="string"){if(bl.test(e))return(0,je.IntNumber)(Number(e));if(zr(e))return(0,je.IntNumber)(new bt.default(qr(e,!1),16).toNumber())}throw Ft.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureIntNumber=Sl;function Yd(e){if(e instanceof RegExp)return(0,je.RegExpString)(e.toString());throw Ft.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}O.ensureRegExpString=Yd;function Xd(e){if(e!==null&&(bt.default.isBN(e)||Rl(e)))return new bt.default(e.toString(10),10);if(typeof e=="number")return new bt.default(Sl(e));if(typeof e=="string"){if(bl.test(e))return new bt.default(e,10);if(zr(e))return new bt.default(qr(e,!1),16)}throw Ft.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureBN=Xd;function eh(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw Ft.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}O.ensureParsedJSONObject=eh;function Rl(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}O.isBigNumber=Rl;function th(e,t){return Array.from({length:t-e},(r,n)=>e+n)}O.range=th;function rh(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}O.getFavicon=rh;function nh(e,t,r,n,s,i){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:e,secret:t,server:r,v:s,chainId:i.toString()}).toString();return`${r}/#/link?${a}`}O.createQrUrl=nh;function Cl(){try{return window.frameElement!==null}catch{return!1}}O.isInIFrame=Cl;function sh(){try{return Cl()&&window.top?window.top.location:window.location}catch{return window.location}}O.getLocation=sh;function ih(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}O.isMobileWeb=ih;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ScopedLocalStorage=void 0;class oh{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Zn.ScopedLocalStorage=oh;var cr={},Gr={},Jr={},yr={};Object.defineProperty(yr,"__esModule",{value:!0});yr.EVENTS=void 0;yr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.RelayAbstract=Fe.APP_VERSION_KEY=Fe.LOCAL_STORAGE_ADDRESSES_KEY=Fe.WALLET_USER_NAME_KEY=void 0;const va=Wr;Fe.WALLET_USER_NAME_KEY="walletUsername";Fe.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Fe.APP_VERSION_KEY="AppVersion";class ah{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw va.standardErrors.rpc.parse({});const s=n,{error:i}=s;if(i)throw(0,va.serializeError)(i,t.method);return s})}}Fe.RelayAbstract=ah;var vr={},kl={exports:{}},po={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(e,t){var r=Hn,n=r.Buffer;function s(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=i);function i(o,a,c){return n(o,a,c)}i.prototype=Object.create(n.prototype),s(n,i),i.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},i.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},i.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},i.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(po,po.exports);var Et=po.exports,Il=Et.Buffer;function Kn(e,t){this._block=Il.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Kn.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Il.from(e,t));for(var r=this._block,n=this._blockSize,s=e.length,i=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,s=(r-n)/4294967296;this._block.writeUInt32BE(s,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i};Kn.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var wr=Kn,ch=qe,Al=wr,lh=Et.Buffer,uh=[1518500249,1859775393,-1894007588,-899497514],dh=new Array(80);function Zr(){this.init(),this._w=dh,Al.call(this,64,56)}ch(Zr,Al);Zr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function hh(e){return e<<5|e>>>27}function fh(e){return e<<30|e>>>2}function ph(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Zr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var c=0;c<80;++c){var l=~~(c/20),d=hh(r)+ph(l,n,s,i)+o+t[c]+uh[l]|0;o=i,i=s,s=fh(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0};Zr.prototype._hash=function(){var e=lh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var gh=Zr,_h=qe,xl=wr,mh=Et.Buffer,bh=[1518500249,1859775393,-1894007588,-899497514],yh=new Array(80);function Kr(){this.init(),this._w=yh,xl.call(this,64,56)}_h(Kr,xl);Kr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function vh(e){return e<<1|e>>>31}function wh(e){return e<<5|e>>>27}function Eh(e){return e<<30|e>>>2}function Sh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Kr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=vh(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var c=0;c<80;++c){var l=~~(c/20),d=wh(r)+Sh(l,n,s,i)+o+t[c]+bh[l]|0;o=i,i=s,s=Eh(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0};Kr.prototype._hash=function(){var e=mh.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Rh=Kr,Ch=qe,Tl=wr,kh=Et.Buffer,Ih=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ah=new Array(64);function Qr(){this.init(),this._w=Ah,Tl.call(this,64,56)}Ch(Qr,Tl);Qr.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function xh(e,t,r){return r^e&(t^r)}function Th(e,t,r){return e&t|r&(e|t)}function Nh(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function Mh(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function Lh(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function Ph(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Qr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,s=this._c|0,i=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,l=this._h|0,d=0;d<16;++d)t[d]=e.readInt32BE(d*4);for(;d<64;++d)t[d]=Ph(t[d-2])+t[d-7]+Lh(t[d-15])+t[d-16]|0;for(var u=0;u<64;++u){var h=l+Mh(o)+xh(o,a,c)+Ih[u]+t[u]|0,g=Nh(r)+Th(r,n,s)|0;l=c,c=a,a=o,o=i+h|0,i=s,s=n,n=r,r=h+g|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=i+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0};Qr.prototype._hash=function(){var e=kh.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Nl=Qr,Oh=qe,$h=Nl,Bh=wr,Dh=Et.Buffer,Fh=new Array(64);function Qn(){this.init(),this._w=Fh,Bh.call(this,64,56)}Oh(Qn,$h);Qn.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Qn.prototype._hash=function(){var e=Dh.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var jh=Qn,Hh=qe,Ml=wr,Uh=Et.Buffer,wa=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Wh=new Array(160);function Yr(){this.init(),this._w=Wh,Ml.call(this,128,112)}Hh(Yr,Ml);Yr.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ea(e,t,r){return r^e&(t^r)}function Sa(e,t,r){return e&t|r&(e|t)}function Ra(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Ca(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Vh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function zh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function qh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function ve(e,t){return e>>>0>>0?1:0}Yr.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,s=this._ch|0,i=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,l=this._hh|0,d=this._al|0,u=this._bl|0,h=this._cl|0,g=this._dl|0,b=this._el|0,R=this._fl|0,E=this._gl|0,_=this._hl|0,m=0;m<32;m+=2)t[m]=e.readInt32BE(m*4),t[m+1]=e.readInt32BE(m*4+4);for(;m<160;m+=2){var y=t[m-30],C=t[m-15*2+1],S=Vh(y,C),I=zh(C,y);y=t[m-2*2],C=t[m-2*2+1];var j=qh(y,C),$=Gh(C,y),N=t[m-7*2],J=t[m-7*2+1],de=t[m-16*2],oe=t[m-16*2+1],T=I+J|0,x=S+N+ve(T,I)|0;T=T+$|0,x=x+j+ve(T,$)|0,T=T+oe|0,x=x+de+ve(T,oe)|0,t[m]=x,t[m+1]=T}for(var P=0;P<160;P+=2){x=t[P],T=t[P+1];var D=Sa(r,n,s),B=Sa(d,u,h),L=Ra(r,d),H=Ra(d,r),Z=Ca(o,b),W=Ca(b,o),Y=wa[P],ce=wa[P+1],se=Ea(o,a,c),Ie=Ea(b,R,E),v=_+W|0,w=l+Z+ve(v,_)|0;v=v+Ie|0,w=w+se+ve(v,Ie)|0,v=v+ce|0,w=w+Y+ve(v,ce)|0,v=v+T|0,w=w+x+ve(v,T)|0;var A=H+B|0,U=L+D+ve(A,H)|0;l=c,_=E,c=a,E=R,a=o,R=b,b=g+v|0,o=i+w+ve(b,g)|0,i=s,g=h,s=n,h=u,n=r,u=d,d=v+A|0,r=w+U+ve(d,v)|0}this._al=this._al+d|0,this._bl=this._bl+u|0,this._cl=this._cl+h|0,this._dl=this._dl+g|0,this._el=this._el+b|0,this._fl=this._fl+R|0,this._gl=this._gl+E|0,this._hl=this._hl+_|0,this._ah=this._ah+r+ve(this._al,d)|0,this._bh=this._bh+n+ve(this._bl,u)|0,this._ch=this._ch+s+ve(this._cl,h)|0,this._dh=this._dh+i+ve(this._dl,g)|0,this._eh=this._eh+o+ve(this._el,b)|0,this._fh=this._fh+a+ve(this._fl,R)|0,this._gh=this._gh+c+ve(this._gl,E)|0,this._hh=this._hh+l+ve(this._hl,_)|0};Yr.prototype._hash=function(){var e=Uh.allocUnsafe(64);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Ll=Yr,Jh=qe,Zh=Ll,Kh=wr,Qh=Et.Buffer,Yh=new Array(160);function Yn(){this.init(),this._w=Yh,Kh.call(this,128,112)}Jh(Yn,Zh);Yn.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Yn.prototype._hash=function(){var e=Qh.allocUnsafe(48);function t(r,n,s){e.writeInt32BE(r,s),e.writeInt32BE(n,s+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Xh=Yn,jt=kl.exports=function(t){t=t.toLowerCase();var r=jt[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};jt.sha=gh;jt.sha1=Rh;jt.sha224=jh;jt.sha256=Nl;jt.sha384=Xh;jt.sha512=Ll;var ef=kl.exports;Object.defineProperty(vr,"__esModule",{value:!0});vr.Session=void 0;const ka=ef,Ia=O,Aa="session:id",xa="session:secret",Ta="session:linked";class No{constructor(t,r,n,s){this._storage=t,this._id=r||(0,Ia.randomBytesHex)(16),this._secret=n||(0,Ia.randomBytesHex)(32),this._key=new ka.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(t){const r=t.getItem(Aa),n=t.getItem(Ta),s=t.getItem(xa);return r&&s?new No(t,r,s,n==="1"):null}static hash(t){return new ka.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Aa,this._id),this._storage.setItem(xa,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ta,this._linked?"1":"0")}}vr.Session=No;var Xn={},es={};Object.defineProperty(es,"__esModule",{value:!0});es.Cipher=void 0;const mn=O;class tf{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,mn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(t)),a=16,c=o.slice(o.byteLength-a),l=o.slice(0,o.byteLength-a),d=new Uint8Array(c),u=new Uint8Array(l),h=new Uint8Array([...n,...d,...u]);return(0,mn.uint8ArrayToHex)(h)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,mn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,mn.hexStringToUint8Array)(t),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),d=new Uint8Array([...l,...c]),u={name:"AES-GCM",iv:new Uint8Array(a)};try{const h=await window.crypto.subtle.decrypt(u,i,d),g=new TextDecoder;n(g.decode(h))}catch(h){s(h)}})()})}}es.Cipher=tf;var ts={};Object.defineProperty(ts,"__esModule",{value:!0});ts.WalletLinkHTTP=void 0;class rf{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const s=`${r}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:s}=await r.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${r.status}`)}}ts.WalletLinkHTTP=rf;var lr={};Object.defineProperty(lr,"__esModule",{value:!0});lr.WalletLinkWebSocket=lr.ConnectionState=void 0;var rr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(rr||(lr.ConnectionState=rr={}));class nf{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){r(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,rr.CONNECTING),s.onclose=i=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${i.code}: ${i.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,rr.DISCONNECTED)},s.onopen=i=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,rr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var o,a;if(i.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,c)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,rr.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}lr.WalletLinkWebSocket=nf;Object.defineProperty(Xn,"__esModule",{value:!0});Xn.WalletLinkConnection=void 0;const Zt=be,sf=es,Ke=yr,Na=Fe,Kt=vr,of=ts,bn=lr,Ma=1e4,af=6e4;class cf{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:s,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Zt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>a.JsonRpcUrl&&this.handleChainUpdated(l,a.JsonRpcUrl)]]).forEach((l,d)=>{const u=a[d];u!==void 0&&l(u)})},this.handleDestroyed=a=>{var c,l;a==="1"&&((c=this.listener)===null||c===void 0||c.resetAndReload(),(l=this.diagnostic)===null||l===void 0||l.log(Ke.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Kt.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var c,l;try{const d=await this.cipher.decrypt(a);(c=this.listener)===null||c===void 0||c.accountUpdated(d)}catch{(l=this.diagnostic)===null||l===void 0||l.log(Ke.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,c)=>{var l,d;try{const u=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.metadataUpdated(a,u)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Ke.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(Na.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Na.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,c)=>{var l,d;try{const u=await this.cipher.decrypt(a),h=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.chainUpdated(u,h)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Ke.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new sf.Cipher(t.secret),this.diagnostic=s,this.listener=n;const o=new bn.WalletLinkWebSocket(`${r}/rpc`,i);o.setConnectionStateListener(async a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(Ke.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Kt.Session.hash(t.id)});let l=!1;switch(a){case bn.ConnectionState.DISCONNECTED:if(!this.destroyed){const d=async()=>{await new Promise(u=>setTimeout(u,5e3)),this.destroyed||o.connect().catch(()=>{d()})};d()}break;case bn.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),l=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Ma),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case bn.ConnectionState.CONNECTING:break}this.connected!==l&&(this.connected=l)}),o.setIncomingDataListener(a=>{var c,l,d;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const u=a.type==="IsLinkedOK"?a.linked:void 0;(c=this.diagnostic)===null||c===void 0||c.log(Ke.EVENTS.LINKED,{sessionIdHash:Kt.Session.hash(t.id),linked:u,type:a.type,onlineGuests:a.onlineGuests}),this.linked=u||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(l=this.diagnostic)===null||l===void 0||l.log(Ke.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Kt.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((d=this.requestResolutions.get(a.id))===null||d===void 0||d(a))}),this.ws=o,this.http=new of.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Ke.EVENTS.STARTED_CONNECTING,{sessionIdHash:Kt.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Ke.EVENTS.DISCONNECTED,{sessionIdHash:Kt.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const s=await this.cipher.decrypt(t.data),i=JSON.parse(s);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Ke.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,Zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(i);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Ma*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=af){const n=t.id;this.sendData(t);let s;return Promise.race([new Promise((i,o)=>{s=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(i=>{this.requestResolutions.set(n,o=>{clearTimeout(s),i(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Xn.WalletLinkConnection=cf;var Xr={},en={},Mo={};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var lf=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(en,"__esModule",{value:!0});en.injectCssReset=void 0;const uf=lf(Mo);function df(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(uf.default)),document.documentElement.appendChild(e)}en.injectCssReset=df;var rs={},tn,ae,Pl,Ol,At,La,$l,go,Bl,Dr={},Lo=[],hf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ns=Array.isArray;function dt(e,t){for(var r in t)e[r]=t[r];return e}function Dl(e){var t=e.parentNode;t&&t.removeChild(e)}function _o(e,t,r){var n,s,i,o={};for(i in t)i=="key"?n=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?tn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return Lr(e,o,n,s,null)}function Lr(e,t,r,n,s){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++Pl,__i:-1,__u:0};return s==null&&ae.vnode!=null&&ae.vnode(i),i}function ff(){return{current:null}}function rn(e){return e.children}function Pr(e,t){this.props=e,this.context=t}function ur(e,t){if(t==null)return e.__?ur(e.__,e.__i+1):null;for(var r;tr?(bo(n,t,s),s.length=n.length=0,t=void 0,At.sort(go)):t&&ae.__c&&ae.__c(t,Lo));t&&bo(n,t,s),On.__r=0}function jl(e,t,r,n,s,i,o,a,c,l,d){var u,h,g,b,R,E=n&&n.__k||Lo,_=t.length;for(r.__d=c,gf(r,t,E),c=r.__d,u=0;u<_;u++)(g=r.__k[u])!=null&&typeof g!="boolean"&&typeof g!="function"&&(h=g.__i===-1?Dr:E[g.__i]||Dr,g.__i=u,Po(e,g,h,s,i,o,a,c,l,d),b=g.__e,g.ref&&h.ref!=g.ref&&(h.ref&&Oo(h.ref,null,g),d.push(g.ref,g.__c||b,g)),R==null&&b!=null&&(R=b),65536&g.__u||h.__k===g.__k?c=Hl(g,c,e):typeof g.type=="function"&&g.__d!==void 0?c=g.__d:b&&(c=b.nextSibling),g.__d=void 0,g.__u&=-196609);r.__d=c,r.__e=R}function gf(e,t,r){var n,s,i,o,a,c=t.length,l=r.length,d=l,u=0;for(e.__k=[],n=0;n0?Lr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null?(s.__=e,s.__b=e.__b+1,a=_f(s,r,o=n+u,d),s.__i=a,i=null,a!==-1&&(d--,(i=r[a])&&(i.__u|=131072)),i==null||i.__v===null?(a==-1&&u--,typeof s.type!="function"&&(s.__u|=65536)):a!==o&&(a===o+1?u++:a>o?d>c-o?u+=a-o:u--:u=a(c!=null&&!(131072&c.__u)?1:0))for(;o>=0||a=0){if((c=t[o])&&!(131072&c.__u)&&s==c.key&&i===c.type)return o;o--}if(a2&&(a.children=arguments.length>3?tn.call(arguments,2):r),Lr(e.type,a,n||e.key,s||e.ref,null)}function vf(e,t){var r={__c:t="__cC"+Bl++,__:e,Consumer:function(n,s){return n.children(s)},Provider:function(n){var s,i;return this.getChildContext||(s=[],(i={})[t]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&s.some(function(a){a.__e=!0,mo(a)})},this.sub=function(o){s.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){s.splice(s.indexOf(o),1),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}tn=Lo.slice,ae={__e:function(e,t,r,n){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,n||{}),o=s.__d),o)return s.__E=s}catch(a){e=a}throw e}},Pl=0,Ol=function(e){return e!=null&&e.constructor==null},Pr.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=dt({},this.state),typeof e=="function"&&(e=e(dt({},r),this.props)),e&&dt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),mo(this))},Pr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),mo(this))},Pr.prototype.render=rn,At=[],$l=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,go=function(e,t){return e.__v.__b-t.__v.__b},On.__r=0,Bl=0;const wf=Object.freeze(Object.defineProperty({__proto__:null,Component:Pr,Fragment:rn,cloneElement:yf,createContext:vf,createElement:_o,createRef:ff,h:_o,hydrate:Vl,get isValidElement(){return Ol},get options(){return ae},render:Wl,toChildArray:Ul},Symbol.toStringTag,{value:"Module"})),Ne=Ur(wf);var ss={};function zl(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t=r.__.length&&r.__.push({__V:Nn}),r.__[e]}function Gl(e){return dr=1,Jl(Kl,e)}function Jl(e,t,r){var n=Ht(ft++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Kl(void 0,t),function(a){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,a);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=le,!le.u)){var s=function(a,c,l){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!i||i.call(this,a,c,l);var u=!1;return d.forEach(function(h){if(h.__N){var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(u=!0)}}),!(!u&&n.__c.props===a)&&(!i||i.call(this,a,c,l))};le.u=!0;var i=le.shouldComponentUpdate,o=le.componentWillUpdate;le.componentWillUpdate=function(a,c,l){if(this.__e){var d=i;i=void 0,s(a,c,l),i=d}o&&o.call(this,a,c,l)},le.shouldComponentUpdate=s}return n.__N||n.__}function Sf(e,t){var r=Ht(ft++,3);!pe.__s&&Bo(r.__H,t)&&(r.__=e,r.i=t,le.__H.__h.push(r))}function Zl(e,t){var r=Ht(ft++,4);!pe.__s&&Bo(r.__H,t)&&(r.__=e,r.i=t,le.__h.push(r))}function Rf(e){return dr=5,$o(function(){return{current:e}},[])}function Cf(e,t,r){dr=6,Zl(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function $o(e,t){var r=Ht(ft++,7);return Bo(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function kf(e,t){return dr=8,$o(function(){return e},t)}function If(e){var t=le.context[e.__c],r=Ht(ft++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(le)),t.props.value):e.__}function Af(e,t){pe.useDebugValue&&pe.useDebugValue(t?t(e):e)}function xf(e){var t=Ht(ft++,10),r=Gl();return t.__=e,le.componentDidCatch||(le.componentDidCatch=function(n,s){t.__&&t.__(n,s),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Tf(){var e=Ht(ft++,11);if(!e.__){for(var t=le.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Nf(){for(var e;e=ql.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Mn),e.__H.__h.forEach(vo),e.__H.__h=[]}catch(t){e.__H.__h=[],pe.__e(t,e.__v)}}pe.__b=function(e){le=null,Fa&&Fa(e)},pe.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Va&&Va(e,t)},pe.__r=function(e){ja&&ja(e),ft=0;var t=(le=e.__c).__H;t&&(Pi===le?(t.__h=[],le.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Nn,r.__N=r.i=void 0})):(t.__h.forEach(Mn),t.__h.forEach(vo),t.__h=[],ft=0)),Pi=le},pe.diffed=function(e){Ha&&Ha(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ql.push(t)!==1&&Da===pe.requestAnimationFrame||((Da=pe.requestAnimationFrame)||Mf)(Nf)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Nn&&(r.__=r.__V),r.i=void 0,r.__V=Nn})),Pi=le=null},pe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Mn),r.__h=r.__h.filter(function(n){return!n.__||vo(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],pe.__e(n,r.__v)}}),Ua&&Ua(e,t)},pe.unmount=function(e){Wa&&Wa(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Mn(n)}catch(s){t=s}}),r.__H=void 0,t&&pe.__e(t,r.__v))};var za=typeof requestAnimationFrame=="function";function Mf(e){var t,r=function(){clearTimeout(n),za&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);za&&(t=requestAnimationFrame(r))}function Mn(e){var t=le,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),le=t}function vo(e){var t=le;e.__c=e.__(),le=t}function Bo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Kl(e,t){return typeof t=="function"?t(e):t}const Lf=Object.freeze(Object.defineProperty({__proto__:null,useCallback:kf,useContext:If,useDebugValue:Af,useEffect:Sf,useErrorBoundary:xf,useId:Tf,useImperativeHandle:Cf,useLayoutEffect:Zl,useMemo:$o,useReducer:Jl,useRef:Rf,useState:Gl},Symbol.toStringTag,{value:"Module"})),is=Ur(Lf);var hr={},os={};Object.defineProperty(os,"__esModule",{value:!0});os.CloseIcon=void 0;const qa=Ne;function Pf(e){return(0,qa.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,qa.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}os.CloseIcon=Pf;var as={};Object.defineProperty(as,"__esModule",{value:!0});as.CoinbaseWalletRound=void 0;const vn=Ne;function Of(e){return(0,vn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,vn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,vn.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,vn.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}as.CoinbaseWalletRound=Of;var cs={};Object.defineProperty(cs,"__esModule",{value:!0});cs.QRCodeIcon=void 0;const Ar=Ne;function $f(e){return(0,Ar.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ar.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Ar.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Ar.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Ar.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}cs.QRCodeIcon=$f;var ls={};function Ql(e){this.mode=Pe.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>2048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Ql.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=rt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=fe.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),s=1;this.make();for(var i=0;i>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=fe.getBCHTypeInfo(r),s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<6?this.modules[s][8]=i:s<8?this.modules[s+1][8]=i:this.modules[this.moduleCount-15+s][8]=i}for(var s=0;s<15;s++){var i=!e&&(n>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=i:s<9?this.modules[8][15-s-1+1]=i:this.modules[8][15-s-1]=i}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,s=7,i=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;i>>s&1)==1);var l=fe.getMask(t,n,o-a);l&&(c=!c),this.modules[n][o-a]=c,s--,s==-1&&(i++,s=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};rt.PAD0=236;rt.PAD1=17;rt.createData=function(e,t,r){for(var n=tt.getRSBlocks(e,t),s=new Yl,i=0;ia*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+a*8+")");for(s.getLengthInBits()+4<=a*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=a*8||(s.put(rt.PAD0,8),s.getLengthInBits()>=a*8));)s.put(rt.PAD1,8);return rt.createBytes(s,n)};rt.createBytes=function(e,t){for(var r=0,n=0,s=0,i=new Array(t.length),o=new Array(t.length),a=0;a=0?g.get(b):0}}for(var R=0,d=0;d=0;)t^=fe.G15<=0;)t^=fe.G18<>>=1;return t},getPatternPosition:function(e){return fe.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case _t.PATTERN000:return(t+r)%2==0;case _t.PATTERN001:return t%2==0;case _t.PATTERN010:return r%3==0;case _t.PATTERN011:return(t+r)%3==0;case _t.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case _t.PATTERN101:return t*r%2+t*r%3==0;case _t.PATTERN110:return(t*r%2+t*r%3)%2==0;case _t.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new nr([1],0),r=0;r5&&(r+=3+i-5)}for(var n=0;n=256;)e-=255;return Ee.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Re=0;Re<8;Re++)Ee.EXP_TABLE[Re]=1<>>7-e%8&1)==1},put:function(e,t){for(var r=0;r>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Oi=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Xl(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return yt.L;case"M":return yt.M;case"Q":return yt.Q;case"H":return yt.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,l){for(var d=s(c),u=1,h=0,g=0,b=Oi.length;g<=b;g++){var R=Oi[g];if(!R)throw new Error("Content too long: expected "+h+" but got "+d);switch(l){case"L":h=R[0];break;case"M":h=R[1];break;case"Q":h=R[2];break;case"H":h=R[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(d<=h)break;u++}if(u>Oi.length)throw new Error("Content too long");return u}function s(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var i=this.options.content,o=n(i,this.options.ecl),a=r(this.options.ecl);this.qrcode=new rt(o,a),this.qrcode.addData(i),this.qrcode.make()}Xl.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,s=n?" ":"",i=n?`\r `:"",o=t.width,a=t.height,c=r.length,l=o/(c+2*t.padding),d=a/(c+2*t.padding),u=typeof t.join<"u"?!!t.join:!1,h=typeof t.swap<"u"?!!t.swap:!1,g=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,b=typeof t.predefined<"u"?!!t.predefined:!1,R=b?s+''+i:"",E=s+''+i,_="",m="",y=0;y'+i:_+=s+''+i}}u&&(_=s+'');let de="";if(this.options.image!==void 0&&this.options.image.svg){const T=o*this.options.image.width/100,x=a*this.options.image.height/100,P=o/2-T/2,D=a/2-x/2;de+=``,de+=this.options.image.svg+i,de+=""}var oe="";switch(e.container){case"svg":g&&(oe+=''+i),oe+=''+i,oe+=R+E+_,oe+=de,oe+="";break;case"svg-viewbox":g&&(oe+=''+i),oe+=''+i,oe+=R+E+_,oe+=de,oe+="";break;case"g":oe+=''+i,oe+=R+E+_,oe+=de,oe+="";break;default:oe+=(R+E+_+de).replace(/^\s+/,"");break}return oe};var Bf=Xl,Df=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ls,"__esModule",{value:!0});ls.QRCode=void 0;const Ff=Ne,Ga=is,jf=Df(Bf),Hf=e=>{const[t,r]=(0,Ga.useState)("");return(0,Ga.useEffect)(()=>{var n,s;const i=new jf.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(s=e.height)!==null&&s!==void 0?s:256,padding:0,image:e.image}),o=G.from(i.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Ff.h)("img",{src:t,alt:"QR Code"}):null};ls.QRCode=Hf;var us={},Do={};Object.defineProperty(Do,"__esModule",{value:!0});Do.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var Uf=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(us,"__esModule",{value:!0});us.Spinner=void 0;const wn=Ne,Wf=Uf(Do),Vf=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,wn.h)("div",{class:"-cbwsdk-spinner"},(0,wn.h)("style",null,Wf.default),(0,wn.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,wn.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};us.Spinner=Vf;var Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var eu=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hr,"__esModule",{value:!0});hr.CoinbaseWalletSteps=hr.ConnectContent=void 0;const Ot=eu(nn),ee=Ne,zf=O,qf=br,Gf=os,Jf=as,Zf=cs,Kf=ls,Qf=us,Yf=eu(Fo),$i={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:tu},Xf=e=>e==="light"?"#FFFFFF":"#0A0B0D";function e0(e){const{theme:t}=e,r=(0,zf.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=$i.steps;return(0,ee.h)("div",{"data-testid":"connect-content",className:(0,Ot.default)("-cbwsdk-connect-content",t)},(0,ee.h)("style",null,Yf.default),(0,ee.h)("div",{className:"-cbwsdk-connect-content-header"},(0,ee.h)("h2",{className:(0,Ot.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,ee.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,ee.h)(Gf.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ee.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,ee.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,ee.h)(t0,{title:$i.title,description:$i.description,theme:t})),(0,ee.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,ee.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,ee.h)(Kf.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,ee.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:qf.LIB_VERSION}),(0,ee.h)("input",{type:"hidden",value:r})),(0,ee.h)(n,{theme:t}),!e.isConnected&&(0,ee.h)("div",{"data-testid":"connecting-spinner",className:(0,Ot.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,ee.h)(Qf.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,ee.h)("p",null,"Connecting...")))))}hr.ConnectContent=e0;function t0({title:e,description:t,theme:r}){return(0,ee.h)("div",{className:(0,Ot.default)("-cbwsdk-connect-item",r)},(0,ee.h)("div",null,(0,ee.h)(Jf.CoinbaseWalletRound,null)),(0,ee.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,ee.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,ee.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function tu({theme:e}){return(0,ee.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,ee.h)("li",{className:(0,Ot.default)("-cbwsdk-wallet-steps-item",e)},(0,ee.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,ee.h)("li",{className:(0,Ot.default)("-cbwsdk-wallet-steps-item",e)},(0,ee.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,ee.h)("span",null,"Tap ",(0,ee.h)("strong",null,"Scan")," "),(0,ee.h)("span",{className:(0,Ot.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,ee.h)(Zf.QRCodeIcon,{fill:Xf(e)})))))}hr.CoinbaseWalletSteps=tu;var ds={},hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.ArrowLeftIcon=void 0;const Ja=Ne;function r0(e){return(0,Ja.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ja.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}hs.ArrowLeftIcon=r0;var fs={};Object.defineProperty(fs,"__esModule",{value:!0});fs.LaptopIcon=void 0;const Bi=Ne;function n0(e){return(0,Bi.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Bi.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Bi.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}fs.LaptopIcon=n0;var ps={};Object.defineProperty(ps,"__esModule",{value:!0});ps.SafeIcon=void 0;const Za=Ne;function s0(e){return(0,Za.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Za.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}ps.SafeIcon=s0;var jo={};Object.defineProperty(jo,"__esModule",{value:!0});jo.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var ru=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ds,"__esModule",{value:!0});ds.TryExtensionContent=void 0;const Rt=ru(nn),me=Ne,Di=is,i0=hs,o0=fs,a0=ps,c0=ru(jo);function l0({theme:e}){const[t,r]=(0,Di.useState)(!1),n=(0,Di.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),s=(0,Di.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,me.h)("div",{class:(0,Rt.default)("-cbwsdk-try-extension",e)},(0,me.h)("style",null,c0.default),(0,me.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,me.h)("h3",{class:(0,Rt.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,me.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,me.h)("button",{class:(0,Rt.default)("-cbwsdk-try-extension-cta",e),onClick:s},t?"Refresh":"Install"),(0,me.h)("div",null,!t&&(0,me.h)(i0.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,me.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,me.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,me.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,me.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,me.h)("span",{class:(0,Rt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,me.h)(o0.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,me.h)("div",{class:(0,Rt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,me.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,me.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,me.h)("span",{class:(0,Rt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,me.h)(a0.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,me.h)("div",{class:(0,Rt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}ds.TryExtensionContent=l0;var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var nu=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ss,"__esModule",{value:!0});ss.ConnectDialog=void 0;const Fi=nu(nn),Ct=Ne,ji=is,u0=hr,d0=ds,h0=nu(Ho),f0=e=>{const{isOpen:t,darkMode:r}=e,[n,s]=(0,ji.useState)(!t),[i,o]=(0,ji.useState)(!t);(0,ji.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!t)},10)];return t?s(!1):c.push(window.setTimeout(()=>{s(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t]);const a=r?"dark":"light";return(0,Ct.h)("div",{class:(0,Fi.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Ct.h)("style",null,h0.default),(0,Ct.h)("div",{class:(0,Fi.default)("-cbwsdk-connect-dialog-backdrop",a,i&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Ct.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Ct.h)("div",{class:(0,Fi.default)("-cbwsdk-connect-dialog-box",i&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,Ct.h)(u0.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,Ct.h)(d0.TryExtensionContent,{theme:a}))))};ss.ConnectDialog=f0;Object.defineProperty(rs,"__esModule",{value:!0});rs.LinkFlow=void 0;const Hi=Ne,p0=ss;class g0{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,Hi.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Hi.render)((0,Hi.h)(p0.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}rs.LinkFlow=g0;var Uo={},Wo={};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=F&&F.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(nn),n=Ne,s=is,i=t(Wo),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(h){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=h.darkMode}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",h.appendChild(this.root),this.render()}presentItem(h){const g=this.nextItemKey++;return this.items.set(g,h),this.render(),()=>{this.items.delete(g),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([h,g])=>(0,n.h)(e.SnackbarInstance,Object.assign({},g,{key:h}))))),this.root)}}e.Snackbar=c;const l=u=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,i.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},u.children));e.SnackbarContainer=l;const d=({autoExpand:u,message:h,menuItems:g})=>{const[b,R]=(0,s.useState)(!0),[E,_]=(0,s.useState)(u??!1);(0,s.useEffect)(()=>{const y=[window.setTimeout(()=>{R(!1)},1),window.setTimeout(()=>{_(!0)},1e4)];return()=>{y.forEach(window.clearTimeout)}});const m=()=>{_(!E)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",b&&"-cbwsdk-snackbar-instance-hidden",E&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:m},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},h),(0,n.h)("div",{class:"-gear-container"},!E&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),g&&g.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},g.map((y,C)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",y.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:y.onClick,key:C},(0,n.h)("svg",{width:y.svgWidth,height:y.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":y.defaultFillRule,"clip-rule":y.defaultClipRule,d:y.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",y.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},y.info)))))};e.SnackbarInstance=d})(Uo);Object.defineProperty(Xr,"__esModule",{value:!0});Xr.WalletLinkRelayUI=void 0;const _0=en,m0=rs,b0=Uo;class y0{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new b0.Snackbar({darkMode:t.darkMode}),this.linkFlow=new m0.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,_0.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Xr.WalletLinkRelayUI=y0;Object.defineProperty(Jr,"__esModule",{value:!0});Jr.WalletLinkRelay=void 0;const Qt=Wr,v0=be,he=O,kt=yr,Ka=Fe,mt=vr,w0=Xn,It=mr,E0=Xr;class lt extends Ka.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{var a;this.isLinked=o;const c=this.storage.getItem(Ka.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,c){const l=c.split(" "),d=this.storage.getItem("IsStandaloneSigning")==="true";if(l[0]!==""&&!o&&this.session.linked&&!d){this.isUnlinkedErrorState=!0;const u=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(kt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:u})}}},this.metadataUpdated=(o,a)=>{this.storage.setItem(o,a)},this.chainUpdated=(o,a)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:o,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(o,a))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),lt.accountRequestCallbackIds.size>0&&(Array.from(lt.accountRequestCallbackIds.values()).forEach(a=>{const c={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},c),{id:a}))}),lt.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:s,connection:i}=this.subscribe();this._session=n,this.connection=i,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=s}subscribe(){const t=mt.Session.load(this.storage)||new mt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,s=new w0.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:i,darkMode:o}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:i,darkMode:o,session:t});return s.connect(),{session:t,ui:a,connection:s}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(kt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const s=mt.Session.load(this.storage);if((s==null?void 0:s.id)===this._session.id?this.storage.clear():s&&((r=this.diagnostic)===null||r===void 0||r.log(kt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:mt.Session.hash(s.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:i,ui:o,connection:a}=this.subscribe();this._session=i,this.connection=a,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(kt.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,he.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,he.hexStringFromBuffer)(t,!0),signature:(0,he.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,he.bigIntStringFromBN)(t.weiValue),data:(0,he.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,he.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,he.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,he.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,he.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,he.bigIntStringFromBN)(t.weiValue),data:(0,he.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,he.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,he.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,he.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,he.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,he.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,he.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,he.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),(0,It.isErrorResponse)(c))return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:s}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof E0.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const s={type:"WEB3_REQUEST",id:t,request:r},i=mt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(kt.EVENTS.WEB3_REQUEST,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?mt.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",s,!0).then(o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(kt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:s.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:i?mt.Session.hash(i.id):"",isSessionMismatched:((i==null?void 0:i.id)!==this._session.id).toString()})}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s.id,response:{method:r.method,errorMessage:o.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(kt.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){lt.accountRequestCallbackIds.forEach(s=>this.invokeCallback(Object.assign(Object.assign({},t),{id:s}))),lt.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,s){var i;const o=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:(0,Qt.getMessageFromCode)(s);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:s}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,he.randomBytesHex)(8),n=i=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,i)};return{promise:new Promise((i,o)=>{if(this.relayEventManager.callbacks.set(r,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,It.isErrorResponse)(a))return o(new Error(a.errorMessage));i(a)}),this.ui.inlineAccountsResponse()){const a=c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:c}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:a})}else{const a=Qt.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}lt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,he.randomBytesHex)(8),s=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},i=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,d=>{if((0,It.isErrorResponse)(d))return a(new Error(d.errorMessage));o(d)});const c=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:v0.ProviderType.Unselected}})},l=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:d}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:c,providerOptions:t})});return{cancel:s,promise:i}}watchAsset(t,r,n,s,i,o){const a={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:s,image:i},chainId:o}};let c=null;const l=(0,he.randomBytesHex)(8),d=h=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,h),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}));const u=new Promise((h,g)=>{this.relayEventManager.callbacks.set(l,E=>{if(c==null||c(),(0,It.isErrorResponse)(E))return g(new Error(E.errorMessage));h(E)});const b=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!1}})},R=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:R,onCancel:b,type:t,address:r,symbol:n,decimals:s,image:i,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:d,promise:u}}addEthereumChain(t,r,n,s,i,o){const a={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:o}};let c=null;const l=(0,he.randomBytesHex)(8),d=h=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,h),c==null||c()};return this.ui.inlineAddEthereumChain(t)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload})),{promise:new Promise((h,g)=>{this.relayEventManager.callbacks.set(l,E=>{if(c==null||c(),(0,It.isErrorResponse)(E))return g(new Error(E.errorMessage));h(E)});const b=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},R=E=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:E}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:b,onApprove:R,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:d}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},s=(0,he.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(s,u=>{if((0,It.isErrorResponse)(u)&&u.errorCode)return c(Qt.standardErrors.provider.custom({code:u.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,It.isErrorResponse)(u))return c(new Error(u.errorMessage));a(u)});const l=u=>{var h;if(u){const g=(h=(0,Qt.getErrorCode)(u))!==null&&h!==void 0?h:Qt.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(s,"switchEthereumChain",u instanceof Error?u:Qt.standardErrors.provider.unsupportedChain(t),g)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},d=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:s,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:u}}})};this.ui.switchEthereumChain({onCancel:l,onApprove:d,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(s,n)}),cancel:i}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return mt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=i=>{this.handleErrorResponse(t,r.method,i)},s=i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:i})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:s,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:s,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:s});break;default:n();break}}}Jr.WalletLinkRelay=lt;lt.accountRequestCallbackIds=new Set;var sn={},gs={},su={};(function(e){var t=F&&F.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=F&&F.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Uo,e)})(su);var Vo={};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var iu=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gs,"__esModule",{value:!0});gs.RedirectDialog=void 0;const S0=iu(nn),et=Ne,R0=en,C0=su,k0=iu(Vo);class I0{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,R0.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,et.render)(null,this.root),t&&(0,et.render)((0,et.h)(A0,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}gs.RedirectDialog=I0;const A0=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:s})=>{const i=r?"dark":"light";return(0,et.h)(C0.SnackbarContainer,{darkMode:r},(0,et.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,et.h)("style",null,k0.default),(0,et.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,et.h)("div",{class:(0,S0.default)("-cbwsdk-redirect-dialog-box",i)},(0,et.h)("p",null,e),(0,et.h)("button",{onClick:n},t))))};Object.defineProperty(sn,"__esModule",{value:!0});sn.MobileRelayUI=void 0;const x0=gs;class T0{constructor(t){this.attached=!1,this.darkMode=!1,this.openedWindow=null,this.redirectDialog=new x0.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}closeOpenedWindow(){var t;(t=this.openedWindow)===null||t===void 0||t.close(),this.openedWindow=null}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t),this.openedWindow=window.open(r.href,"cbw-opener"),this.openedWindow&&setTimeout(()=>this.closeOpenedWindow(),5e3)}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.closeOpenedWindow(),this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.closeOpenedWindow(),this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}sn.MobileRelayUI=T0;Object.defineProperty(Gr,"__esModule",{value:!0});Gr.MobileRelay=void 0;const N0=O,M0=Jr,Qa=sn;class L0 extends M0.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,N0.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof Qa.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t),this._enableMobileWalletLink&&this.ui instanceof Qa.MobileRelayUI&&this.ui.closeOpenedWindow()}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}Gr.MobileRelay=L0;var wo={exports:{}},ou=Un.EventEmitter,Ui,Ya;function P0(){if(Ya)return Ui;Ya=1;function e(b,R){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(b);R&&(_=_.filter(function(m){return Object.getOwnPropertyDescriptor(b,m).enumerable})),E.push.apply(E,_)}return E}function t(b){for(var R=1;R0?this.tail.next=_:this.head=_,this.tail=_,++this.length}},{key:"unshift",value:function(E){var _={data:E,next:this.head};this.length===0&&(this.tail=_),this.head=_,++this.length}},{key:"shift",value:function(){if(this.length!==0){var E=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,E}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(E){if(this.length===0)return"";for(var _=this.head,m=""+_.data;_=_.next;)m+=E+_.data;return m}},{key:"concat",value:function(E){if(this.length===0)return l.alloc(0);for(var _=l.allocUnsafe(E>>>0),m=this.head,y=0;m;)g(m.data,_,y),y+=m.data.length,m=m.next;return _}},{key:"consume",value:function(E,_){var m;return EC.length?C.length:E;if(S===C.length?y+=C:y+=C.slice(0,E),E-=S,E===0){S===C.length?(++m,_.next?this.head=_.next:this.head=this.tail=null):(this.head=_,_.data=C.slice(S));break}++m}return this.length-=m,y}},{key:"_getBuffer",value:function(E){var _=l.allocUnsafe(E),m=this.head,y=1;for(m.data.copy(_),E-=m.data.length;m=m.next;){var C=m.data,S=E>C.length?C.length:E;if(C.copy(_,_.length-E,0,S),E-=S,E===0){S===C.length?(++y,m.next?this.head=m.next:this.head=this.tail=null):(this.head=m,m.data=C.slice(S));break}++y}return this.length-=y,_}},{key:h,value:function(E,_){return u(this,t(t({},_),{},{depth:0,customInspect:!1}))}}]),b}(),Ui}function O0(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return n||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,ne.nextTick(Eo,this,e)):ne.nextTick(Eo,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(i){!t&&i?r._writableState?r._writableState.errorEmitted?ne.nextTick(Ln,r):(r._writableState.errorEmitted=!0,ne.nextTick(Xa,r,i)):ne.nextTick(Xa,r,i):t?(ne.nextTick(Ln,r),t(i)):ne.nextTick(Ln,r)}),this)}function Xa(e,t){Eo(e,t),Ln(e)}function Ln(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function $0(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Eo(e,t){e.emit("error",t)}function B0(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var au={destroy:O0,undestroy:$0,errorOrDestroy:B0},Ut={};function D0(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var cu={};function Ue(e,t,r){r||(r=Error);function n(i,o,a){return typeof t=="string"?t:t(i,o,a)}var s=function(i){D0(o,i);function o(a,c,l){return i.call(this,n(a,c,l))||this}return o}(r);s.prototype.name=r.name,s.prototype.code=e,cu[e]=s}function ec(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function F0(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function j0(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function H0(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Ue("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Ue("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&F0(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var s;if(j0(e," argument"))s="The ".concat(e," ").concat(n," ").concat(ec(t,"type"));else{var i=H0(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(i," ").concat(n," ").concat(ec(t,"type"))}return s+=". Received type ".concat(typeof r),s},TypeError);Ue("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ue("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Ue("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ue("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Ue("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ue("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ue("ERR_STREAM_WRITE_AFTER_END","write after end");Ue("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ue("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Ue("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Ut.codes=cu;var U0=Ut.codes.ERR_INVALID_OPT_VALUE;function W0(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function V0(e,t,r,n){var s=W0(t,n,r);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var i=n?r:"highWaterMark";throw new U0(i,s)}return Math.floor(s)}return e.objectMode?16:16*1024}var lu={getHighWaterMark:V0},z0=q0;function q0(e,t){if(Wi("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Wi("throwDeprecation"))throw new Error(t);Wi("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Wi(e){try{if(!F.localStorage)return!1}catch{return!1}var t=F.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Vi,tc;function uu(){if(tc)return Vi;tc=1,Vi=$;function e(v){var w=this;this.next=null,this.entry=null,this.finish=function(){Ie(w,v)}}var t;$.WritableState=I;var r={deprecate:z0},n=ou,s=Hn.Buffer,i=(typeof F<"u"?F:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(v){return s.from(v)}function a(v){return s.isBuffer(v)||v instanceof i}var c=au,l=lu,d=l.getHighWaterMark,u=Ut.codes,h=u.ERR_INVALID_ARG_TYPE,g=u.ERR_METHOD_NOT_IMPLEMENTED,b=u.ERR_MULTIPLE_CALLBACK,R=u.ERR_STREAM_CANNOT_PIPE,E=u.ERR_STREAM_DESTROYED,_=u.ERR_STREAM_NULL_VALUES,m=u.ERR_STREAM_WRITE_AFTER_END,y=u.ERR_UNKNOWN_ENCODING,C=c.errorOrDestroy;qe($,n);function S(){}function I(v,w,A){t=t||fr(),v=v||{},typeof A!="boolean"&&(A=w instanceof t),this.objectMode=!!v.objectMode,A&&(this.objectMode=this.objectMode||!!v.writableObjectMode),this.highWaterMark=d(this,v,"writableHighWaterMark",A),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=v.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=v.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){D(w,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=v.emitClose!==!1,this.autoDestroy=!!v.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}I.prototype.getBuffer=function(){for(var w=this.bufferedRequest,A=[];w;)A.push(w),w=w.next;return A},function(){try{Object.defineProperty(I.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var j;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(j=Function.prototype[Symbol.hasInstance],Object.defineProperty($,Symbol.hasInstance,{value:function(w){return j.call(this,w)?!0:this!==$?!1:w&&w._writableState instanceof I}})):j=function(w){return w instanceof this};function $(v){t=t||fr();var w=this instanceof t;if(!w&&!j.call($,this))return new $(v);this._writableState=new I(v,this,w),this.writable=!0,v&&(typeof v.write=="function"&&(this._write=v.write),typeof v.writev=="function"&&(this._writev=v.writev),typeof v.destroy=="function"&&(this._destroy=v.destroy),typeof v.final=="function"&&(this._final=v.final)),n.call(this)}$.prototype.pipe=function(){C(this,new R)};function N(v,w){var A=new m;C(v,A),ne.nextTick(w,A)}function J(v,w,A,U){var K;return A===null?K=new _:typeof A!="string"&&!w.objectMode&&(K=new h("chunk",["string","Buffer"],A)),K?(C(v,K),ne.nextTick(U,K),!1):!0}$.prototype.write=function(v,w,A){var U=this._writableState,K=!1,f=!U.objectMode&&a(v);return f&&!s.isBuffer(v)&&(v=o(v)),typeof w=="function"&&(A=w,w=null),f?w="buffer":w||(w=U.defaultEncoding),typeof A!="function"&&(A=S),U.ending?N(this,A):(f||J(this,U,v,A))&&(U.pendingcb++,K=oe(this,U,f,v,w,A)),K},$.prototype.cork=function(){this._writableState.corked++},$.prototype.uncork=function(){var v=this._writableState;v.corked&&(v.corked--,!v.writing&&!v.corked&&!v.bufferProcessing&&v.bufferedRequest&&H(this,v))},$.prototype.setDefaultEncoding=function(w){if(typeof w=="string"&&(w=w.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((w+"").toLowerCase())>-1))throw new y(w);return this._writableState.defaultEncoding=w,this},Object.defineProperty($.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function de(v,w,A){return!v.objectMode&&v.decodeStrings!==!1&&typeof w=="string"&&(w=s.from(w,A)),w}Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function oe(v,w,A,U,K,f){if(!A){var p=de(w,U,K);U!==p&&(A=!0,K="buffer",U=p)}var k=w.objectMode?1:U.length;w.length+=k;var M=w.length>5===6?2:_>>4===14?3:_>>3===30?4:_>>6===2?-1:-2}function o(_,m,y){var C=m.length-1;if(C=0?(S>0&&(_.lastNeed=S-1),S):--C=0?(S>0&&(_.lastNeed=S-2),S):--C=0?(S>0&&(S===2?S=0:_.lastNeed=S-3),S):0))}function a(_,m,y){if((m[0]&192)!==128)return _.lastNeed=0,"�";if(_.lastNeed>1&&m.length>1){if((m[1]&192)!==128)return _.lastNeed=1,"�";if(_.lastNeed>2&&m.length>2&&(m[2]&192)!==128)return _.lastNeed=2,"�"}}function c(_){var m=this.lastTotal-this.lastNeed,y=a(this,_);if(y!==void 0)return y;if(this.lastNeed<=_.length)return _.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,m,0,_.length),this.lastNeed-=_.length}function l(_,m){var y=o(this,_,m);if(!this.lastNeed)return _.toString("utf8",m);this.lastTotal=y;var C=_.length-(y-this.lastNeed);return _.copy(this.lastChar,0,C),_.toString("utf8",m,C)}function d(_){var m=_&&_.length?this.write(_):"";return this.lastNeed?m+"�":m}function u(_,m){if((_.length-m)%2===0){var y=_.toString("utf16le",m);if(y){var C=y.charCodeAt(y.length-1);if(C>=55296&&C<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_[_.length-1],_.toString("utf16le",m,_.length-1)}function h(_){var m=_&&_.length?this.write(_):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,y)}return m}function g(_,m){var y=(_.length-m)%3;return y===0?_.toString("base64",m):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=_[_.length-1]:(this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1]),_.toString("base64",m,_.length-y))}function b(_){var m=_&&_.length?this.write(_):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function R(_){return _.toString(this.encoding)}function E(_){return _&&_.length?this.write(_):""}return qi}var ic=Ut.codes.ERR_STREAM_PREMATURE_CLOSE;function G0(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),s=0;s0)if(typeof p!="string"&&!q.objectMode&&Object.getPrototypeOf(p)!==n.prototype&&(p=i(p)),M)q.endEmitted?S(f,new _):de(f,q,p,!0);else if(q.ended)S(f,new R);else{if(q.destroyed)return!1;q.reading=!1,q.decoder&&!k?(p=q.decoder.write(p),q.objectMode||p.length!==0?de(f,q,p,!1):H(f,q)):de(f,q,p,!1)}else M||(q.reading=!1,H(f,q))}return!q.ended&&(q.length=T?f=T:(f--,f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f++),f}function P(f,p){return f<=0||p.length===0&&p.ended?0:p.objectMode?1:f!==f?p.flowing&&p.length?p.buffer.head.data.length:p.length:(f>p.highWaterMark&&(p.highWaterMark=x(f)),f<=p.length?f:p.ended?p.length:(p.needReadable=!0,0))}N.prototype.read=function(f){c("read",f),f=parseInt(f,10);var p=this._readableState,k=f;if(f!==0&&(p.emittedReadable=!1),f===0&&p.needReadable&&((p.highWaterMark!==0?p.length>=p.highWaterMark:p.length>0)||p.ended))return c("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?A(this):B(this),null;if(f=P(f,p),f===0&&p.ended)return p.length===0&&A(this),null;var M=p.needReadable;c("need readable",M),(p.length===0||p.length-f0?ue=w(f,p):ue=null,ue===null?(p.needReadable=p.length<=p.highWaterMark,f=0):(p.length-=f,p.awaitDrain=0),p.length===0&&(p.ended||(p.needReadable=!0),k!==f&&p.ended&&A(this)),ue!==null&&this.emit("data",ue),ue};function D(f,p){if(c("onEofChunk"),!p.ended){if(p.decoder){var k=p.decoder.end();k&&k.length&&(p.buffer.push(k),p.length+=p.objectMode?1:k.length)}p.ended=!0,p.sync?B(f):(p.needReadable=!1,p.emittedReadable||(p.emittedReadable=!0,L(f)))}}function B(f){var p=f._readableState;c("emitReadable",p.needReadable,p.emittedReadable),p.needReadable=!1,p.emittedReadable||(c("emitReadable",p.flowing),p.emittedReadable=!0,ne.nextTick(L,f))}function L(f){var p=f._readableState;c("emitReadable_",p.destroyed,p.length,p.ended),!p.destroyed&&(p.length||p.ended)&&(f.emit("readable"),p.emittedReadable=!1),p.needReadable=!p.flowing&&!p.ended&&p.length<=p.highWaterMark,v(f)}function H(f,p){p.readingMore||(p.readingMore=!0,ne.nextTick(Z,f,p))}function Z(f,p){for(;!p.reading&&!p.ended&&(p.length1&&K(M.pipes,f)!==-1)&&!kr&&(c("false write response, pause",M.awaitDrain),M.awaitDrain++),k.pause())}function zt(ot){c("onerror",ot),gt(),f.removeListener("error",zt),t(f,"error")===0&&S(f,ot)}j(f,"error",zt);function qt(){f.removeListener("finish",Gt),gt()}f.once("close",qt);function Gt(){c("onfinish"),f.removeListener("close",qt),gt()}f.once("finish",Gt);function gt(){c("unpipe"),k.unpipe(f)}return f.emit("pipe",k),M.flowing||(c("pipe resume"),k.resume()),f};function W(f){return function(){var k=f._readableState;c("pipeOnDrain",k.awaitDrain),k.awaitDrain&&k.awaitDrain--,k.awaitDrain===0&&t(f,"data")&&(k.flowing=!0,v(f))}}N.prototype.unpipe=function(f){var p=this._readableState,k={hasUnpiped:!1};if(p.pipesCount===0)return this;if(p.pipesCount===1)return f&&f!==p.pipes?this:(f||(f=p.pipes),p.pipes=null,p.pipesCount=0,p.flowing=!1,f&&f.emit("unpipe",this,k),this);if(!f){var M=p.pipes,ue=p.pipesCount;p.pipes=null,p.pipesCount=0,p.flowing=!1;for(var q=0;q0,M.flowing!==!1&&this.resume()):f==="readable"&&!M.endEmitted&&!M.readableListening&&(M.readableListening=M.needReadable=!0,M.flowing=!1,M.emittedReadable=!1,c("on readable",M.length,M.reading),M.length?B(this):M.reading||ne.nextTick(ce,this)),k},N.prototype.addListener=N.prototype.on,N.prototype.removeListener=function(f,p){var k=r.prototype.removeListener.call(this,f,p);return f==="readable"&&ne.nextTick(Y,this),k},N.prototype.removeAllListeners=function(f){var p=r.prototype.removeAllListeners.apply(this,arguments);return(f==="readable"||f===void 0)&&ne.nextTick(Y,this),p};function Y(f){var p=f._readableState;p.readableListening=f.listenerCount("readable")>0,p.resumeScheduled&&!p.paused?p.flowing=!0:f.listenerCount("data")>0&&f.resume()}function ce(f){c("readable nexttick read 0"),f.read(0)}N.prototype.resume=function(){var f=this._readableState;return f.flowing||(c("resume"),f.flowing=!f.readableListening,se(this,f)),f.paused=!1,this};function se(f,p){p.resumeScheduled||(p.resumeScheduled=!0,ne.nextTick(Ie,f,p))}function Ie(f,p){c("resume",p.reading),p.reading||f.read(0),p.resumeScheduled=!1,f.emit("resume"),v(f),p.flowing&&!p.reading&&f.read(0)}N.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function v(f){var p=f._readableState;for(c("flow",p.flowing);p.flowing&&f.read()!==null;);}N.prototype.wrap=function(f){var p=this,k=this._readableState,M=!1;f.on("end",function(){if(c("wrapped end"),k.decoder&&!k.ended){var ie=k.decoder.end();ie&&ie.length&&p.push(ie)}p.push(null)}),f.on("data",function(ie){if(c("wrapped data"),k.decoder&&(ie=k.decoder.write(ie)),!(k.objectMode&&ie==null)&&!(!k.objectMode&&(!ie||!ie.length))){var it=p.push(ie);it||(M=!0,f.pause())}});for(var ue in f)this[ue]===void 0&&typeof f[ue]=="function"&&(this[ue]=function(it){return function(){return f[it].apply(f,arguments)}}(ue));for(var q=0;q=p.length?(p.decoder?k=p.buffer.join(""):p.buffer.length===1?k=p.buffer.first():k=p.buffer.concat(p.length),p.buffer.clear()):k=p.buffer.consume(f,p.decoder),k}function A(f){var p=f._readableState;c("endReadable",p.endEmitted),p.endEmitted||(p.ended=!0,ne.nextTick(U,p,f))}function U(f,p){if(c("endReadableNT",f.endEmitted,f.length),!f.endEmitted&&f.length===0&&(f.endEmitted=!0,p.readable=!1,p.emit("end"),f.autoDestroy)){var k=p._writableState;(!k||k.autoDestroy&&k.finished)&&p.destroy()}}typeof Symbol=="function"&&(N.from=function(f,p){return C===void 0&&(C=Q0()),C(N,f,p)});function K(f,p){for(var k=0,M=f.length;k0;return l1(o,c,l,function(d){s||(s=d),d&&i.forEach(dc),!c&&(i.forEach(dc),n(s))})});return t.reduce(u1)}var f1=h1;(function(e,t){t=e.exports=hu(),t.Stream=t,t.Readable=t,t.Writable=uu(),t.Duplex=fr(),t.Transform=fu,t.PassThrough=s1,t.finished=zo,t.pipeline=f1})(wo,wo.exports);var _u=wo.exports;const{Transform:p1}=_u;var g1=e=>class mu extends p1{constructor(r,n,s,i,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._hashBitLength=i,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(r){let n=null;try{this.push(this.digest())}catch(s){n=s}r(n)}update(r,n){if(!G.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return G.isBuffer(r)||(r=G.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new mu(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:_1}=_u;var m1=e=>class bu extends _1{constructor(r,n,s,i){super(i),this._rate=r,this._capacity=n,this._delimitedSuffix=s,this._options=i,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,s){let i=null;try{this.update(r,n)}catch(o){i=o}s(i)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!G.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return G.isBuffer(r)||(r=G.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let s=this._state.squeeze(r);return n!==void 0&&(s=s.toString(n)),s}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new bu(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const b1=g1,y1=m1;var v1=function(e){const t=b1(e),r=y1(e);return function(n,s){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,s);case"keccak256":return new t(1088,512,null,256,s);case"keccak384":return new t(832,768,null,384,s);case"keccak512":return new t(576,1024,null,512,s);case"sha3-224":return new t(1152,448,6,224,s);case"sha3-256":return new t(1088,512,6,256,s);case"sha3-384":return new t(832,768,6,384,s);case"sha3-512":return new t(576,1024,6,512,s);case"shake128":return new r(1344,256,31,s);case"shake256":return new r(1088,512,31,s);default:throw new Error("Invald algorithm: "+n)}}},yu={};const hc=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];yu.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],i=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],d=e[8]^e[18]^e[28]^e[38]^e[48],u=e[9]^e[19]^e[29]^e[39]^e[49];let h=d^(s<<1|i>>>31),g=u^(i<<1|s>>>31);const b=e[0]^h,R=e[1]^g,E=e[10]^h,_=e[11]^g,m=e[20]^h,y=e[21]^g,C=e[30]^h,S=e[31]^g,I=e[40]^h,j=e[41]^g;h=r^(o<<1|a>>>31),g=n^(a<<1|o>>>31);const $=e[2]^h,N=e[3]^g,J=e[12]^h,de=e[13]^g,oe=e[22]^h,T=e[23]^g,x=e[32]^h,P=e[33]^g,D=e[42]^h,B=e[43]^g;h=s^(c<<1|l>>>31),g=i^(l<<1|c>>>31);const L=e[4]^h,H=e[5]^g,Z=e[14]^h,W=e[15]^g,Y=e[24]^h,ce=e[25]^g,se=e[34]^h,Ie=e[35]^g,v=e[44]^h,w=e[45]^g;h=o^(d<<1|u>>>31),g=a^(u<<1|d>>>31);const A=e[6]^h,U=e[7]^g,K=e[16]^h,f=e[17]^g,p=e[26]^h,k=e[27]^g,M=e[36]^h,ue=e[37]^g,q=e[46]^h,ie=e[47]^g;h=c^(r<<1|n>>>31),g=l^(n<<1|r>>>31);const it=e[8]^h,St=e[9]^g,kr=e[18]^h,_n=e[19]^g,Ir=e[28]^h,zt=e[29]^g,qt=e[38]^h,Gt=e[39]^g,gt=e[48]^h,ot=e[49]^g,Ze=b,Fs=R,js=_<<4|E>>>28,Hs=E<<4|_>>>28,Us=m<<3|y>>>29,Ws=y<<3|m>>>29,Vs=S<<9|C>>>23,zs=C<<9|S>>>23,qs=I<<18|j>>>14,Gs=j<<18|I>>>14,Js=$<<1|N>>>31,Zs=N<<1|$>>>31,Ks=de<<12|J>>>20,Qs=J<<12|de>>>20,Ys=oe<<10|T>>>22,Xs=T<<10|oe>>>22,ei=P<<13|x>>>19,ti=x<<13|P>>>19,ri=D<<2|B>>>30,ni=B<<2|D>>>30,si=H<<30|L>>>2,ii=L<<30|H>>>2,oi=Z<<6|W>>>26,ai=W<<6|Z>>>26,ci=ce<<11|Y>>>21,li=Y<<11|ce>>>21,ui=se<<15|Ie>>>17,di=Ie<<15|se>>>17,hi=w<<29|v>>>3,fi=v<<29|w>>>3,pi=A<<28|U>>>4,gi=U<<28|A>>>4,_i=f<<23|K>>>9,mi=K<<23|f>>>9,bi=p<<25|k>>>7,yi=k<<25|p>>>7,vi=M<<21|ue>>>11,wi=ue<<21|M>>>11,Ei=ie<<24|q>>>8,Si=q<<24|ie>>>8,Ri=it<<27|St>>>5,Ci=St<<27|it>>>5,ki=kr<<20|_n>>>12,Ii=_n<<20|kr>>>12,Ai=zt<<7|Ir>>>25,xi=Ir<<7|zt>>>25,Ti=qt<<8|Gt>>>24,Ni=Gt<<8|qt>>>24,Mi=gt<<14|ot>>>18,Li=ot<<14|gt>>>18;e[0]=Ze^~Ks&ci,e[1]=Fs^~Qs&li,e[10]=pi^~ki&Us,e[11]=gi^~Ii&Ws,e[20]=Js^~oi&bi,e[21]=Zs^~ai&yi,e[30]=Ri^~js&Ys,e[31]=Ci^~Hs&Xs,e[40]=si^~_i&Ai,e[41]=ii^~mi&xi,e[2]=Ks^~ci&vi,e[3]=Qs^~li&wi,e[12]=ki^~Us&ei,e[13]=Ii^~Ws&ti,e[22]=oi^~bi&Ti,e[23]=ai^~yi&Ni,e[32]=js^~Ys&ui,e[33]=Hs^~Xs&di,e[42]=_i^~Ai&Vs,e[43]=mi^~xi&zs,e[4]=ci^~vi&Mi,e[5]=li^~wi&Li,e[14]=Us^~ei&hi,e[15]=Ws^~ti&fi,e[24]=bi^~Ti&qs,e[25]=yi^~Ni&Gs,e[34]=Ys^~ui&Ei,e[35]=Xs^~di&Si,e[44]=Ai^~Vs&ri,e[45]=xi^~zs&ni,e[6]=vi^~Mi&Ze,e[7]=wi^~Li&Fs,e[16]=ei^~hi&pi,e[17]=ti^~fi&gi,e[26]=Ti^~qs&Js,e[27]=Ni^~Gs&Zs,e[36]=ui^~Ei&Ri,e[37]=di^~Si&Ci,e[46]=Vs^~ri&si,e[47]=zs^~ni&ii,e[8]=Mi^~Ze&Ks,e[9]=Li^~Fs&Qs,e[18]=hi^~pi&ki,e[19]=fi^~gi&Ii,e[28]=qs^~Js&oi,e[29]=Gs^~Zs&ai,e[38]=Ei^~Ri&js,e[39]=Si^~Ci&Hs,e[48]=ri^~si&_i,e[49]=ni^~ii&mi,e[0]^=hc[t*2],e[1]^=hc[t*2+1]}};const $n=yu;function Er(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Er.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Er.prototype.absorb=function(e){for(let t=0;t>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&($n.p1600(this.state),this.count=0);return t};Er.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var w1=Er,E1=v1(w1);const S1=E1,R1=jn;function vu(e){return G.allocUnsafe(e).fill(0)}function wu(e,t,r){const n=vu(t);return e=bs(e),r?e.length"u")throw new Error("Not an array?");if(r=ku(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);s=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(i in t)s.push(Xe(e,t[i]));if(r==="dynamic"){var o=Xe("uint256",t.length);s.unshift(o)}return G.concat(s)}else{if(e==="bytes")return t=new G(t),s=G.concat([Xe("uint256",t.length),t]),t.length%32!==0&&(s=G.concat([s,$t.zeros(32-t.length%32)])),s;if(e.startsWith("bytes")){if(r=sr(e),r<1||r>32)throw new Error("Invalid bytes width: "+r);return $t.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=sr(e),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=xt(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(G,"be",32)}else if(e.startsWith("int")){if(r=sr(e),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=xt(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(G,"be",32)}else if(e.startsWith("ufixed")){if(r=fc(e),n=xt(t),n<0)throw new Error("Supplied ufixed is negative");return Xe("uint256",n.mul(new Mt(2).pow(new Mt(r[1]))))}else if(e.startsWith("fixed"))return r=fc(e),Xe("int256",xt(t).mul(new Mt(2).pow(new Mt(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function x1(e){return e==="string"||e==="bytes"||ku(e)==="dynamic"}function T1(e){return e.lastIndexOf("]")===e.length-1}function N1(e,t){var r=[],n=[],s=32*e.length;for(var i in e){var o=Cu(e[i]),a=t[i],c=Xe(o,a);x1(o)?(r.push(Xe("uint256",s)),n.push(c),s+=c.length):r.push(c)}return G.concat(r.concat(n))}function Iu(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,s=[],i=0;i32)throw new Error("Invalid bytes width: "+r);s.push($t.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=sr(o),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=xt(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());s.push(n.toArrayLike(G,"be",r/8))}else if(o.startsWith("int")){if(r=sr(o),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=xt(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());s.push(n.toTwos(r).toArrayLike(G,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return G.concat(s)}function M1(e,t){return $t.keccak(Iu(e,t))}var L1={rawEncode:N1,solidityPack:Iu,soliditySHA3:M1};const Ve=Ru,Or=L1,Au={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Qi={encodeData(e,t,r,n=!0){const s=["bytes32"],i=[this.hashType(e,r)];if(n){const o=(a,c,l)=>{if(r[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Ve.keccak(this.encodeData(c,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",Ve.keccak(l)];if(c==="string")return typeof l=="string"&&(l=G.from(l,"utf8")),["bytes32",Ve.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const d=c.slice(0,c.lastIndexOf("[")),u=l.map(h=>o(a,d,h));return["bytes32",Ve.keccak(Or.rawEncode(u.map(([h])=>h),u.map(([,h])=>h)))]}return[c,l]};for(const a of r[e]){const[c,l]=o(a.name,a.type,t[a.name]);s.push(c),i.push(l)}}else for(const o of r[e]){let a=t[o.name];if(a!==void 0)if(o.type==="bytes")s.push("bytes32"),a=Ve.keccak(a),i.push(a);else if(o.type==="string")s.push("bytes32"),typeof a=="string"&&(a=G.from(a,"utf8")),a=Ve.keccak(a),i.push(a);else if(r[o.type]!==void 0)s.push("bytes32"),a=Ve.keccak(this.encodeData(o.type,a,r,n)),i.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(o.type),i.push(a)}}return Or.rawEncode(s,i)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(s=>s!==e);n=[e].concat(n.sort());for(const s of n){if(!t[s])throw new Error("No type definition specified: "+s);r+=s+"("+t[s].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const s of this.findTypeDependencies(n.type,t,r))!r.includes(s)&&r.push(s);return r},hashStruct(e,t,r,n=!0){return Ve.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Ve.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Au.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[G.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Ve.keccak(G.concat(n))}};var P1={TYPED_MESSAGE_SCHEMA:Au,TypedDataUtils:Qi,hashForSignTypedDataLegacy:function(e){return O1(e.data)},hashForSignTypedData_v3:function(e){return Qi.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return Qi.hash(e.data)}};function O1(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(i){return i.type==="bytes"?Ve.toBuffer(i.value):i.value}),n=e.map(function(i){return i.type}),s=e.map(function(i){if(!i.name)throw t;return i.type+" "+i.name});return Or.soliditySHA3(["bytes32","bytes32"],[Or.soliditySHA3(new Array(e.length).fill("string"),s),Or.soliditySHA3(n,r)])}var pr={};Object.defineProperty(pr,"__esModule",{value:!0});pr.filterFromParam=pr.FilterPolyfill=void 0;const tr=be,Ae=O,$1=5*60*1e3,Tt={jsonrpc:"2.0",id:0};class B1{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,tr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=xu(t),n=this.makeFilterId(),s=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",s),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Ae.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,Ae.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,Ae.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,Ae.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,Ae.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(En())}async getFilterLogs(t){const r=(0,Ae.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Tt),{method:"eth_getLogs",params:[pc(n)]})):En()}makeFilterId(){return(0,tr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(s,i)=>{if(s)return n(s);if(Array.isArray(i)||i==null)return n(new Error(`unexpected response received: ${JSON.stringify(i)}`));r(i)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return En();const s=await this.getCurrentBlockHeight(),i=r.toBlock==="latest"?s:r.toBlock;if(n>s||n>Number(r.toBlock))return Sn();console.info(`Fetching logs from ${n} to ${i} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Tt),{method:"eth_getLogs",params:[pc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:i}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,Ae.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const l=(0,tr.IntNumber)(c+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${l}`),this.cursors.set(t,l)}}return o}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return En();const n=await this.getCurrentBlockHeight();if(r>n)return Sn();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const s=(await Promise.all((0,Ae.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,tr.IntNumber)(o))))).filter(o=>!!o),i=(0,tr.IntNumber)(r+s.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${i}`),this.cursors.set(t,i),Object.assign(Object.assign({},Tt),{result:s})}async getPendingTransactionFilterChanges(t){return Promise.resolve(Sn())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),s=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,s),s}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},$1);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},Tt),{method:"eth_blockNumber",params:[]}));return(0,Ae.intNumberFromHexString)((0,Ae.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},Tt),{method:"eth_getBlockByNumber",params:[(0,Ae.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Ae.ensureHexString)(r.result.hash):null}}pr.FilterPolyfill=B1;function xu(e){return{fromBlock:gc(e.fromBlock),toBlock:gc(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}pr.filterFromParam=xu;function pc(e){const t={fromBlock:_c(e.fromBlock),toBlock:_c(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function gc(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,tr.IntNumber)(0);if((0,Ae.isHexString)(e))return(0,Ae.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function _c(e){return e==="latest"?e:(0,Ae.hexStringFromIntNumber)(e)}function En(){return Object.assign(Object.assign({},Tt),{error:{code:-32e3,message:"filter not found"}})}function Sn(){return Object.assign(Object.assign({},Tt),{result:[]})}var ys={},Tu={},vs={},qo=D1;function D1(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const mc=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let s=0;s{t.errorFirst?n.push(function(o,a){if(t.multiArgs){const c=new Array(arguments.length-1);for(let l=1;l{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=s=>{const i=o=>typeof o=="string"?s===o:o.test(s);return t.include?t.include.some(i):!t.exclude.some(i)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):mc(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const s in e){const i=e[s];n[s]=typeof i=="function"&&r(s)?mc(i,t):i}return n},on={},an={};Object.defineProperty(an,"__esModule",{value:!0});const j1=Un;function bc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function H1(e){const t=e.length,r=new Array(t);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")bc(i,this,r);else{const o=i.length,a=H1(i);for(let c=0;ce+t,yc=["sync","latest"];class G1 extends V1.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*z1,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){yc.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return yc.map(t=>this.listenerCount(t)).reduce(q1)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=vc(t),s=vc(r);return this._usePastBlocks&&ns}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}on.BaseBlockTracker=G1;function vc(e){return Number.parseInt(e,16)}var Nu={},Mu={},Ce={};class Lu extends TypeError{constructor(t,r){let n;const{message:s,explanation:i,...o}=t,{path:a}=t,c=a.length===0?s:`At path: ${a.join(".")} -- ${s}`;super(i??c),i!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function J1(e){return He(e)&&typeof e[Symbol.iterator]=="function"}function He(e){return typeof e=="object"&&e!=null}function wc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function ye(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Z1(e){const{done:t,value:r}=e.next();return t?void 0:r}function K1(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:s,branch:i}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${ye(n)}\``}=e;return{value:n,type:o,refinement:a,key:s[s.length-1],path:s,branch:i,...e,message:c}}function*So(e,t,r,n){J1(e)||(e=[e]);for(const s of e){const i=K1(s,t,r,n);i&&(yield i)}}function*Go(e,t,r={}){const{path:n=[],branch:s=[e],coerce:i=!1,mask:o=!1}=r,a={path:n,branch:s};if(i&&(e=t.coercer(e,a),o&&t.type!=="type"&&He(t.schema)&&He(e)&&!Array.isArray(e)))for(const l in e)t.schema[l]===void 0&&delete e[l];let c="valid";for(const l of t.validator(e,a))l.explanation=r.message,c="not_valid",yield[l,void 0];for(let[l,d,u]of t.entries(e,a)){const h=Go(d,u,{path:l===void 0?n:[...n,l],branch:l===void 0?s:[...s,d],coerce:i,mask:o,message:r.message});for(const g of h)g[0]?(c=g[0].refinement!=null?"not_refined":"not_valid",yield[g[0],void 0]):i&&(d=g[1],l===void 0?e=d:e instanceof Map?e.set(l,d):e instanceof Set?e.add(d):He(e)&&(d!==void 0||l in e)&&(e[l]=d))}if(c!=="not_valid")for(const l of t.refiner(e,a))l.explanation=r.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,e])}class _e{constructor(t){const{type:r,schema:n,validator:s,refiner:i,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,s?this.validator=(c,l)=>{const d=s(c,l);return So(d,l,this,c)}:this.validator=()=>[],i?this.refiner=(c,l)=>{const d=i(c,l);return So(d,l,this,c)}:this.refiner=()=>[]}assert(t,r){return Pu(t,this,r)}create(t,r){return Ou(t,this,r)}is(t){return Jo(t,this)}mask(t,r){return $u(t,this,r)}validate(t,r={}){return Sr(t,this,r)}}function Pu(e,t,r){const n=Sr(e,t,{message:r});if(n[0])throw n[0]}function Ou(e,t,r){const n=Sr(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function $u(e,t,r){const n=Sr(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Jo(e,t){return!Sr(e,t)[0]}function Sr(e,t,r={}){const n=Go(e,t,r),s=Z1(n);return s[0]?[new Lu(s[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,s[1]]}function Q1(...e){const t=e[0].type==="type",r=e.map(s=>s.schema),n=Object.assign({},...r);return t?Ko(n):cn(n)}function Me(e,t){return new _e({type:e,schema:null,validator:t})}function Y1(e,t){return new _e({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function X1(e){return new _e({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function ep(e){let t;return new _e({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function tp(e,t){const{schema:r}=e,n={...r};for(const s of t)delete n[s];switch(e.type){case"type":return Ko(n);default:return cn(n)}}function rp(e){const t=e instanceof _e?{...e.schema}:{...e};for(const r in t)t[r]=Bu(t[r]);return cn(t)}function np(e,t){const{schema:r}=e,n={};for(const s of t)n[s]=r[s];return cn(n)}function sp(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Me(e,t)}function ip(){return Me("any",()=>!0)}function op(e){return new _e({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${ye(t)}`}})}function ap(){return Me("bigint",e=>typeof e=="bigint")}function cp(){return Me("boolean",e=>typeof e=="boolean")}function lp(){return Me("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${ye(e)}`)}function up(e){const t={},r=e.map(n=>ye(n)).join();for(const n of e)t[n]=n;return new _e({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${ye(n)}`}})}function dp(){return Me("func",e=>typeof e=="function"||`Expected a function, but received: ${ye(e)}`)}function hp(e){return Me("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${ye(t)}`)}function fp(){return Me("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${ye(e)}`)}function pp(e){return new _e({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function gp(e){const t=ye(e),r=typeof e;return new _e({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${ye(n)}`}})}function _p(e,t){return new _e({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,s]of r.entries())yield[n,n,e],yield[n,s,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${ye(r)}`}})}function Zo(){return Me("never",()=>!1)}function mp(e){return new _e({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function bp(){return Me("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${ye(e)}`)}function cn(e){const t=e?Object.keys(e):[],r=Zo();return new _e({type:"object",schema:e||null,*entries(n){if(e&&He(n)){const s=new Set(Object.keys(n));for(const i of t)s.delete(i),yield[i,n[i],e[i]];for(const i of s)yield[i,n[i],r]}},validator(n){return He(n)||`Expected an object, but received: ${ye(n)}`},coercer(n){return He(n)?{...n}:n}})}function Bu(e){return new _e({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function yp(e,t){return new _e({type:"record",schema:null,*entries(r){if(He(r))for(const n in r){const s=r[n];yield[n,n,e],yield[n,s,t]}},validator(r){return He(r)||`Expected an object, but received: ${ye(r)}`}})}function vp(){return Me("regexp",e=>e instanceof RegExp)}function wp(e){return new _e({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${ye(t)}`}})}function Du(){return Me("string",e=>typeof e=="string"||`Expected a string, but received: ${ye(e)}`)}function Ep(e){const t=Zo();return new _e({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let s=0;sr.type).join(" | ");return new _e({type:"union",schema:null,coercer(r){for(const n of e){const[s,i]=n.validate(r,{coerce:!0});if(!s)return i}return r},validator(r,n){const s=[];for(const i of e){const[...o]=Go(r,i,n),[a]=o;if(a[0])for(const[c]of o)c&&s.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${ye(r)}`,...s]}})}function Fu(){return Me("unknown",()=>!0)}function Qo(e,t,r){return new _e({...e,coercer:(n,s)=>Jo(n,t)?e.coercer(r(n,s),s):e.coercer(n,s)})}function Rp(e,t,r={}){return Qo(e,Fu(),n=>{const s=typeof t=="function"?t():t;if(n===void 0)return s;if(!r.strict&&wc(n)&&wc(s)){const i={...n};let o=!1;for(const a in s)i[a]===void 0&&(i[a]=s[a],o=!0);if(o)return i}return n})}function Cp(e){return Qo(e,Du(),t=>t.trim())}function kp(e){return Wt(e,"empty",t=>{const r=ju(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function ju(e){return e instanceof Map||e instanceof Set?e.size:e.length}function Ip(e,t,r={}){const{exclusive:n}=r;return Wt(e,"max",s=>n?sn?s>t:s>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${s}\``)}function xp(e){return Wt(e,"nonempty",t=>ju(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Tp(e,t){return Wt(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function Np(e,t,r=t){const n=`Expected a ${e.type}`,s=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Wt(e,"size",i=>{if(typeof i=="number"||i instanceof Date)return t<=i&&i<=r||`${n} ${s} but received \`${i}\``;if(i instanceof Map||i instanceof Set){const{size:o}=i;return t<=o&&o<=r||`${n} with a size ${s} but received one with a size of \`${o}\``}else{const{length:o}=i;return t<=o&&o<=r||`${n} with a length ${s} but received one with a length of \`${o}\``}})}function Wt(e,t,r){return new _e({...e,*refiner(n,s){yield*e.refiner(n,s);const i=r(n,s),o=So(i,s,e,n);for(const a of o)yield{...a,refinement:t}}})}const Mp=Object.freeze(Object.defineProperty({__proto__:null,Struct:_e,StructError:Lu,any:ip,array:op,assert:Pu,assign:Q1,bigint:ap,boolean:cp,coerce:Qo,create:Ou,date:lp,defaulted:Rp,define:Me,deprecated:Y1,dynamic:X1,empty:kp,enums:up,func:dp,instance:hp,integer:fp,intersection:pp,is:Jo,lazy:ep,literal:gp,map:_p,mask:$u,max:Ip,min:Ap,never:Zo,nonempty:xp,nullable:mp,number:bp,object:cn,omit:tp,optional:Bu,partial:rp,pattern:Tp,pick:np,record:yp,refine:Wt,regexp:vp,set:wp,size:Np,string:Du,struct:sp,trimmed:Cp,tuple:Ep,type:Ko,union:Sp,unknown:Fu,validate:Sr},Symbol.toStringTag,{value:"Module"})),Vt=Ur(Mp);Object.defineProperty(Ce,"__esModule",{value:!0});Ce.assertExhaustive=Ce.assertStruct=Ce.assert=Ce.AssertionError=void 0;const Lp=Vt;function Pp(e){return typeof e=="object"&&e!==null&&"message"in e}function Op(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function $p(e){const t=Pp(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Hu(e,t){return Op(e)?new e({message:t}):e({message:t})}class Yo extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}Ce.AssertionError=Yo;function Bp(e,t="Assertion failed.",r=Yo){if(!e)throw t instanceof Error?t:Hu(r,t)}Ce.assert=Bp;function Dp(e,t,r="Assertion failed",n=Yo){try{(0,Lp.assert)(e,t)}catch(s){throw Hu(n,`${r}: ${$p(s)}.`)}}Ce.assertStruct=Dp;function Fp(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}Ce.assertExhaustive=Fp;var ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.base64=void 0;const jp=Vt,Hp=Ce,Up=(e,t={})=>{var r,n;const s=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,i=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let o;i==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,Hp.assert)(i==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return s?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,jp.pattern)(e,a)};ln.base64=Up;var te={},un={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Vt,r=Ce;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,t.is)(l,e.HexStruct)}e.isHexString=n;function s(l){return(0,t.is)(l,e.StrictHexStruct)}e.isStrictHexString=s;function i(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}e.assertIsHexString=i;function o(l){(0,r.assert)(s(l),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}e.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}e.remove0x=c})(un);Object.defineProperty(te,"__esModule",{value:!0});te.createDataView=te.concatBytes=te.valueToBytes=te.stringToBytes=te.numberToBytes=te.signedBigIntToBytes=te.bigIntToBytes=te.hexToBytes=te.bytesToString=te.bytesToNumber=te.bytesToSignedBigInt=te.bytesToBigInt=te.bytesToHex=te.assertIsBytes=te.isBytes=void 0;const Oe=Ce,Ro=un,Ec=48,Sc=58,Rc=87;function Wp(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const Vp=Wp();function Xo(e){return e instanceof Uint8Array}te.isBytes=Xo;function Rr(e){(0,Oe.assert)(Xo(e),"Value must be a Uint8Array.")}te.assertIsBytes=Rr;function Uu(e){if(Rr(e),e.length===0)return"0x";const t=Vp(),r=new Array(e.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return ws(t)}te.bigIntToBytes=Vu;function Jp(e,t){(0,Oe.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function Zp(e,t){(0,Oe.assert)(typeof e=="bigint","Value must be a bigint."),(0,Oe.assert)(typeof t=="number","Byte length must be a number."),(0,Oe.assert)(t>0,"Byte length must be greater than 0."),(0,Oe.assert)(Jp(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let s=0;s>=BigInt(8);return n.reverse()}te.signedBigIntToBytes=Zp;function zu(e){(0,Oe.assert)(typeof e=="number","Value must be a number."),(0,Oe.assert)(e>=0,"Value must be a non-negative number."),(0,Oe.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return ws(t)}te.numberToBytes=zu;function qu(e){return(0,Oe.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}te.stringToBytes=qu;function Gu(e){if(typeof e=="bigint")return Vu(e);if(typeof e=="number")return zu(e);if(typeof e=="string")return e.startsWith("0x")?ws(e):qu(e);if(Xo(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}te.valueToBytes=Gu;function Kp(e){const t=new Array(e.length);let r=0;for(let s=0;st.call(r,n,s,this))}get(t){return xe(this,We,"f").get(t)}has(t){return xe(this,We,"f").has(t)}keys(){return xe(this,We,"f").keys()}values(){return xe(this,We,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}gr.FrozenMap=ea;class ta{constructor(t){Qe.set(this,void 0),Ku(this,Qe,new Set(t),"f"),Object.freeze(this)}get size(){return xe(this,Qe,"f").size}[(Qe=new WeakMap,Symbol.iterator)](){return xe(this,Qe,"f")[Symbol.iterator]()}entries(){return xe(this,Qe,"f").entries()}forEach(t,r){return xe(this,Qe,"f").forEach((n,s,i)=>t.call(r,n,s,this))}has(t){return xe(this,Qe,"f").has(t)}keys(){return xe(this,Qe,"f").keys()}values(){return xe(this,Qe,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}gr.FrozenSet=ta;Object.freeze(ea);Object.freeze(ea.prototype);Object.freeze(ta);Object.freeze(ta.prototype);var Qu={};Object.defineProperty(Qu,"__esModule",{value:!0});var Yu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Vt,r=Ce,n=()=>(0,t.define)("finite number",S=>(0,t.is)(S,(0,t.number)())&&Number.isFinite(S));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(S,I)=>{function j($,N){const de=[...N.validator($,I)];return de.length>0?de:!0}try{const $=j(S,e.UnsafeJsonStruct);return $!==!0?$:j(JSON.parse(JSON.stringify(S)),e.UnsafeJsonStruct)}catch($){return $ instanceof RangeError?"Circular reference detected":!1}});function s(S){return(0,t.is)(S,e.JsonStruct)}e.isValidJson=s;function i(S){(0,r.assertStruct)(S,e.JsonStruct,"Invalid JSON value");const I=JSON.stringify(S);return new TextEncoder().encode(I).byteLength}e.getJsonSize=i,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(S){return(0,t.is)(S,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function a(S,I){(0,r.assertStruct)(S,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",I)}e.assertIsJsonRpcNotification=a;function c(S){return(0,t.is)(S,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=c;function l(S,I){(0,r.assertStruct)(S,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",I)}e.assertIsJsonRpcRequest=l,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function d(S){return(0,t.is)(S,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=d;function u(S,I){(0,r.assertStruct)(S,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",I)}e.assertIsPendingJsonRpcResponse=u;function h(S){return(0,t.is)(S,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=h;function g(S,I){(0,r.assertStruct)(S,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",I)}e.assertIsJsonRpcResponse=g;function b(S){return(0,t.is)(S,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=b;function R(S,I){(0,r.assertStruct)(S,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",I)}e.assertIsJsonRpcSuccess=R;function E(S){return(0,t.is)(S,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=E;function _(S,I){(0,r.assertStruct)(S,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",I)}e.assertIsJsonRpcFailure=_;function m(S){return(0,t.is)(S,e.JsonRpcErrorStruct)}e.isJsonRpcError=m;function y(S,I){(0,r.assertStruct)(S,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",I)}e.assertIsJsonRpcError=y;function C(S){const{permitEmptyString:I,permitFractions:j,permitNull:$}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},S);return J=>!!(typeof J=="number"&&(j||Number.isInteger(J))||typeof J=="string"&&(I||J.length>0)||$&&J===null)}e.getJsonRpcIdValidator=C})(Yu);var Xu={};Object.defineProperty(Xu,"__esModule",{value:!0});var _r={},Co={exports:{}},Yi,kc;function cg(){if(kc)return Yi;kc=1;var e=1e3,t=e*60,r=t*60,n=r*24,s=n*7,i=n*365.25;Yi=function(d,u){u=u||{};var h=typeof d;if(h==="string"&&d.length>0)return o(d);if(h==="number"&&isFinite(d))return u.long?c(d):a(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function o(d){if(d=String(d),!(d.length>100)){var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(u){var h=parseFloat(u[1]),g=(u[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return h*i;case"weeks":case"week":case"w":return h*s;case"days":case"day":case"d":return h*n;case"hours":case"hour":case"hrs":case"hr":case"h":return h*r;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(d){var u=Math.abs(d);return u>=n?Math.round(d/n)+"d":u>=r?Math.round(d/r)+"h":u>=t?Math.round(d/t)+"m":u>=e?Math.round(d/e)+"s":d+"ms"}function c(d){var u=Math.abs(d);return u>=n?l(d,u,n,"day"):u>=r?l(d,u,r,"hour"):u>=t?l(d,u,t,"minute"):u>=e?l(d,u,e,"second"):d+" ms"}function l(d,u,h,g){var b=u>=h*1.5;return Math.round(d/h)+" "+g+(b?"s":"")}return Yi}function lg(e){r.debug=r,r.default=r,r.coerce=c,r.disable=i,r.enable=s,r.enabled=o,r.humanize=cg(),r.destroy=l,Object.keys(e).forEach(d=>{r[d]=e[d]}),r.names=[],r.skips=[],r.formatters={};function t(d){let u=0;for(let h=0;h{if(I==="%%")return"%";C++;const $=r.formatters[j];if(typeof $=="function"){const N=E[C];I=$.call(_,N),E.splice(C,1),C--}return I}),r.formatArgs.call(_,E),(_.log||r.log).apply(_,E)}return R.namespace=d,R.useColors=r.useColors(),R.color=r.selectColor(d),R.extend=n,R.destroy=r.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,b=r.enabled(d)),b),set:E=>{h=E}}),typeof r.init=="function"&&r.init(R),R}function n(d,u){const h=r(this.namespace+(typeof u>"u"?":":u)+d);return h.log=this.log,h}function s(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let u;const h=(typeof d=="string"?d:"").split(/[\s,]+/),g=h.length;for(u=0;u"-"+u)].join(",");return r.enable(""),d}function o(d){if(d[d.length-1]==="*")return!0;let u,h;for(u=0,h=r.skips.length;u{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function s(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const d="color: "+this.color;l.splice(1,0,d,"color: inherit");let u=0,h=0;l[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(u++,g==="%c"&&(h=u))}),l.splice(h,0,d)}t.log=console.debug||console.log||(()=>{});function i(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof ne<"u"&&"env"in ne&&(l=r.DEBUG),l}function a(){try{return localStorage}catch{}}e.exports=ug(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}})(Co,Co.exports);var dg=Co.exports,hg=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_r,"__esModule",{value:!0});_r.createModuleLogger=_r.createProjectLogger=void 0;const fg=hg(dg),pg=(0,fg.default)("metamask");function gg(e){return pg.extend(e)}_r.createProjectLogger=gg;function _g(e,t){return e.extend(t)}_r.createModuleLogger=_g;var ed={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(l){return Array.isArray(l)&&l.length>0}e.isNonEmptyArray=t;function r(l){return l==null}e.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}e.isObject=n;const s=(l,d)=>Object.hasOwnProperty.call(l,d);e.hasProperty=s,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function i(l){if(typeof l!="object"||l===null)return!1;try{let d=l;for(;Object.getPrototypeOf(d)!==null;)d=Object.getPrototypeOf(d);return Object.getPrototypeOf(l)===d}catch{return!1}}e.isPlainObject=i;function o(l){return l.charCodeAt(0)<=127}e.isASCII=o;function a(l){var d;return l.split("").reduce((h,g)=>o(g)?h+1:h+2,0)+((d=l.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&d!==void 0?d:[]).length}e.calculateStringSize=a;function c(l){return l.toString().length}e.calculateNumberSize=c})(ed);var st={};Object.defineProperty(st,"__esModule",{value:!0});st.hexToBigInt=st.hexToNumber=st.bigIntToHex=st.numberToHex=void 0;const ir=Ce,jr=un,mg=e=>((0,ir.assert)(typeof e=="number","Value must be a number."),(0,ir.assert)(e>=0,"Value must be a non-negative number."),(0,ir.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,jr.add0x)(e.toString(16)));st.numberToHex=mg;const bg=e=>((0,ir.assert)(typeof e=="bigint","Value must be a bigint."),(0,ir.assert)(e>=0,"Value must be a non-negative bigint."),(0,jr.add0x)(e.toString(16)));st.bigIntToHex=bg;const yg=e=>{(0,jr.assertIsHexString)(e);const t=parseInt(e,16);return(0,ir.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};st.hexToNumber=yg;const vg=e=>((0,jr.assertIsHexString)(e),BigInt((0,jr.add0x)(e)));st.hexToBigInt=vg;var td={};Object.defineProperty(td,"__esModule",{value:!0});var rd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(i){i[i.Millisecond=1]="Millisecond",i[i.Second=1e3]="Second",i[i.Minute=6e4]="Minute",i[i.Hour=36e5]="Hour",i[i.Day=864e5]="Day",i[i.Week=6048e5]="Week",i[i.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=i=>Number.isInteger(i)&&i>=0,r=(i,o)=>{if(!t(i))throw new Error(`"${o}" must be a non-negative integer. Received: "${i}".`)};function n(i,o){return r(i,"count"),i*o}e.inMilliseconds=n;function s(i){return r(i,"timestamp"),Date.now()-i}e.timeSince=s})(rd);var nd={};Object.defineProperty(nd,"__esModule",{value:!0});var sd={},ko={exports:{}};const wg="2.0.0",id=256,Eg=Number.MAX_SAFE_INTEGER||9007199254740991,Sg=16,Rg=id-6,Cg=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Rs={MAX_LENGTH:id,MAX_SAFE_COMPONENT_LENGTH:Sg,MAX_SAFE_BUILD_LENGTH:Rg,MAX_SAFE_INTEGER:Eg,RELEASE_TYPES:Cg,SEMVER_SPEC_VERSION:wg,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Xi={};const kg=typeof ne=="object"&&Xi&&Xi.NODE_DEBUG&&/\bsemver\b/i.test(Xi.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Cs=kg;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=Rs,i=Cs;t=e.exports={};const o=t.re=[],a=t.safeRe=[],c=t.src=[],l=t.t={};let d=0;const u="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[u,n]],g=R=>{for(const[E,_]of h)R=R.split(`${E}*`).join(`${E}{0,${_}}`).split(`${E}+`).join(`${E}{1,${_}}`);return R},b=(R,E,_)=>{const m=g(E),y=d++;i(R,y,E),l[R]=y,c[y]=E,o[y]=new RegExp(E,_?"g":void 0),a[y]=new RegExp(m,_?"g":void 0)};b("NUMERICIDENTIFIER","0|[1-9]\\d*"),b("NUMERICIDENTIFIERLOOSE","\\d+"),b("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),b("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),b("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),b("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),b("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),b("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),b("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),b("BUILDIDENTIFIER",`${u}+`),b("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),b("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),b("FULL",`^${c[l.FULLPLAIN]}$`),b("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),b("LOOSE",`^${c[l.LOOSEPLAIN]}$`),b("GTLT","((?:<|>)?=?)"),b("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),b("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),b("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),b("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),b("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),b("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),b("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),b("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),b("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),b("COERCERTL",c[l.COERCE],!0),b("COERCERTLFULL",c[l.COERCEFULL],!0),b("LONETILDE","(?:~>?)"),b("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",b("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),b("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),b("LONECARET","(?:\\^)"),b("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",b("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),b("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),b("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),b("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),b("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",b("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),b("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),b("STAR","(<|>)?=?\\s*\\*"),b("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),b("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ko,ko.exports);var dn=ko.exports;const Ig=Object.freeze({loose:!0}),Ag=Object.freeze({}),xg=e=>e?typeof e!="object"?Ig:e:Ag;var ra=xg;const Ic=/^[0-9]+$/,od=(e,t)=>{const r=Ic.test(e),n=Ic.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:eod(t,e);var ad={compareIdentifiers:od,rcompareIdentifiers:Tg};const Rn=Cs,{MAX_LENGTH:Ac,MAX_SAFE_INTEGER:Cn}=Rs,{safeRe:xc,t:Tc}=dn,Ng=ra,{compareIdentifiers:Yt}=ad;let Mg=class Ye{constructor(t,r){if(r=Ng(r),t instanceof Ye){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ac)throw new TypeError(`version is longer than ${Ac} characters`);Rn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?xc[Tc.LOOSE]:xc[Tc.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Cn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Cn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Cn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){const i=+s;if(i>=0&&i=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let i=[r,s];n===!1&&(i=[r]),Yt(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Te=Mg;const Nc=Te,Lg=(e,t,r=!1)=>{if(e instanceof Nc)return e;try{return new Nc(e,t)}catch(n){if(!r)return null;throw n}};var Cr=Lg;const Pg=Cr,Og=(e,t)=>{const r=Pg(e,t);return r?r.version:null};var $g=Og;const Bg=Cr,Dg=(e,t)=>{const r=Bg(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var Fg=Dg;const Mc=Te,jg=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Mc(e instanceof Mc?e.version:e,r).inc(t,n,s).version}catch{return null}};var Hg=jg;const Lc=Cr,Ug=(e,t)=>{const r=Lc(e,null,!0),n=Lc(t,null,!0),s=r.compare(n);if(s===0)return null;const i=s>0,o=i?r:n,a=i?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const d=c?"pre":"";return r.major!==n.major?d+"major":r.minor!==n.minor?d+"minor":r.patch!==n.patch?d+"patch":"prerelease"};var Wg=Ug;const Vg=Te,zg=(e,t)=>new Vg(e,t).major;var qg=zg;const Gg=Te,Jg=(e,t)=>new Gg(e,t).minor;var Zg=Jg;const Kg=Te,Qg=(e,t)=>new Kg(e,t).patch;var Yg=Qg;const Xg=Cr,e_=(e,t)=>{const r=Xg(e,t);return r&&r.prerelease.length?r.prerelease:null};var t_=e_;const Pc=Te,r_=(e,t,r)=>new Pc(e,r).compare(new Pc(t,r));var Ge=r_;const n_=Ge,s_=(e,t,r)=>n_(t,e,r);var i_=s_;const o_=Ge,a_=(e,t)=>o_(e,t,!0);var c_=a_;const Oc=Te,l_=(e,t,r)=>{const n=new Oc(e,r),s=new Oc(t,r);return n.compare(s)||n.compareBuild(s)};var na=l_;const u_=na,d_=(e,t)=>e.sort((r,n)=>u_(r,n,t));var h_=d_;const f_=na,p_=(e,t)=>e.sort((r,n)=>f_(n,r,t));var g_=p_;const __=Ge,m_=(e,t,r)=>__(e,t,r)>0;var ks=m_;const b_=Ge,y_=(e,t,r)=>b_(e,t,r)<0;var sa=y_;const v_=Ge,w_=(e,t,r)=>v_(e,t,r)===0;var cd=w_;const E_=Ge,S_=(e,t,r)=>E_(e,t,r)!==0;var ld=S_;const R_=Ge,C_=(e,t,r)=>R_(e,t,r)>=0;var ia=C_;const k_=Ge,I_=(e,t,r)=>k_(e,t,r)<=0;var oa=I_;const A_=cd,x_=ld,T_=ks,N_=ia,M_=sa,L_=oa,P_=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return A_(e,r,n);case"!=":return x_(e,r,n);case">":return T_(e,r,n);case">=":return N_(e,r,n);case"<":return M_(e,r,n);case"<=":return L_(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var ud=P_;const O_=Te,$_=Cr,{safeRe:kn,t:In}=dn,B_=(e,t)=>{if(e instanceof O_)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?kn[In.COERCEFULL]:kn[In.COERCE]);else{const c=t.includePrerelease?kn[In.COERCERTLFULL]:kn[In.COERCERTL];let l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;const n=r[2],s=r[3]||"0",i=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return $_(`${n}.${s}.${i}${o}${a}`,t)};var D_=B_,eo,$c;function F_(){return $c||($c=1,eo=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),eo}var j_=re;re.Node=Bt;re.create=re;function re(e){var t=this;if(t instanceof re||(t=new re),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(s){t.push(s)});else if(arguments.length>0)for(var r=0,n=arguments.length;r1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;n!==null;s++)r=e(r,n.value,s),n=n.next;return r};re.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;n!==null;s--)r=e(r,n.value,s),n=n.prev;return r};re.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};re.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};re.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new re;if(tthis.length&&(t=this.length);for(var n=0,s=this.head;s!==null&&nthis.length&&(t=this.length);for(var n=this.length,s=this.tail;s!==null&&n>t;n--)s=s.prev;for(;s!==null&&n>e;n--,s=s.prev)r.push(s.value);return r};re.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,s=this.head;s!==null&&n1;class z_{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[Nt]=t.max||1/0;const r=t.length||to;if(this[Xt]=typeof r!="function"?to:r,this[$r]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Lt]=t.maxAge||0,this[at]=t.dispose,this[Bc]=t.noDisposeOnSet||!1,this[dd]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[Nt]=t||1/0,xr(this)}get max(){return this[Nt]}set allowStale(t){this[$r]=!!t}get allowStale(){return this[$r]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Lt]=t,xr(this)}get maxAge(){return this[Lt]}set lengthCalculator(t){typeof t!="function"&&(t=to),t!==this[Xt]&&(this[Xt]=t,this[ut]=0,this[we].forEach(r=>{r.length=this[Xt](r.value,r.key),this[ut]+=r.length})),xr(this)}get lengthCalculator(){return this[Xt]}get length(){return this[ut]}get itemCount(){return this[we].length}rforEach(t,r){r=r||this;for(let n=this[we].tail;n!==null;){const s=n.prev;Dc(this,t,n,r),n=s}}forEach(t,r){r=r||this;for(let n=this[we].head;n!==null;){const s=n.next;Dc(this,t,n,r),n=s}}keys(){return this[we].toArray().map(t=>t.key)}values(){return this[we].toArray().map(t=>t.value)}reset(){this[at]&&this[we]&&this[we].length&&this[we].forEach(t=>this[at](t.key,t.value)),this[ze]=new Map,this[we]=new V_,this[ut]=0}dump(){return this[we].map(t=>Bn(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[we]}set(t,r,n){if(n=n||this[Lt],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const s=n?Date.now():0,i=this[Xt](r,t);if(this[ze].has(t)){if(i>this[Nt])return or(this,this[ze].get(t)),!1;const c=this[ze].get(t).value;return this[at]&&(this[Bc]||this[at](t,c.value)),c.now=s,c.maxAge=n,c.value=r,this[ut]+=i-c.length,c.length=i,this.get(t),xr(this),!0}const o=new q_(t,r,i,s,n);return o.length>this[Nt]?(this[at]&&this[at](t,r),!1):(this[ut]+=o.length,this[we].unshift(o),this[ze].set(t,this[we].head),xr(this),!0)}has(t){if(!this[ze].has(t))return!1;const r=this[ze].get(t).value;return!Bn(this,r)}get(t){return ro(this,t,!0)}peek(t){return ro(this,t,!1)}pop(){const t=this[we].tail;return t?(or(this,t),t.value):null}del(t){or(this,this[ze].get(t))}load(t){this.reset();const r=Date.now();for(let n=t.length-1;n>=0;n--){const s=t[n],i=s.e||0;if(i===0)this.set(s.k,s.v);else{const o=i-r;o>0&&this.set(s.k,s.v,o)}}}prune(){this[ze].forEach((t,r)=>ro(this,r,!1))}}const ro=(e,t,r)=>{const n=e[ze].get(t);if(n){const s=n.value;if(Bn(e,s)){if(or(e,n),!e[$r])return}else r&&(e[dd]&&(n.value.now=Date.now()),e[we].unshiftNode(n));return s.value}},Bn=(e,t)=>{if(!t||!t.maxAge&&!e[Lt])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[Lt]&&r>e[Lt]},xr=e=>{if(e[ut]>e[Nt])for(let t=e[we].tail;e[ut]>e[Nt]&&t!==null;){const r=t.prev;or(e,t),t=r}},or=(e,t)=>{if(t){const r=t.value;e[at]&&e[at](r.key,r.value),e[ut]-=r.length,e[ze].delete(r.key),e[we].removeNode(t)}};class q_{constructor(t,r,n,s,i){this.key=t,this.value=r,this.length=n,this.now=s,this.maxAge=i||0}}const Dc=(e,t,r,n)=>{let s=r.value;Bn(e,s)&&(or(e,r),e[$r]||(s=void 0)),s&&t.call(n,s.value,s.key,e)};var G_=z_,no,Fc;function Je(){if(Fc)return no;Fc=1;class e{constructor(x,P){if(P=n(P),x instanceof e)return x.loose===!!P.loose&&x.includePrerelease===!!P.includePrerelease?x:new e(x.raw,P);if(x instanceof s)return this.raw=x.value,this.set=[[x]],this.format(),this;if(this.options=P,this.loose=!!P.loose,this.includePrerelease=!!P.includePrerelease,this.raw=x.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(D=>this.parseRange(D.trim())).filter(D=>D.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const D=this.set[0];if(this.set=this.set.filter(B=>!b(B[0])),this.set.length===0)this.set=[D];else if(this.set.length>1){for(const B of this.set)if(B.length===1&&R(B[0])){this.set=[B];break}}}this.format()}format(){return this.range=this.set.map(x=>x.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(x){const D=((this.options.includePrerelease&&h)|(this.options.loose&&g))+":"+x,B=r.get(D);if(B)return B;const L=this.options.loose,H=L?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];x=x.replace(H,de(this.options.includePrerelease)),i("hyphen replace",x),x=x.replace(a[c.COMPARATORTRIM],l),i("comparator trim",x),x=x.replace(a[c.TILDETRIM],d),i("tilde trim",x),x=x.replace(a[c.CARETTRIM],u),i("caret trim",x);let Z=x.split(" ").map(se=>_(se,this.options)).join(" ").split(/\s+/).map(se=>J(se,this.options));L&&(Z=Z.filter(se=>(i("loose invalid filter",se,this.options),!!se.match(a[c.COMPARATORLOOSE])))),i("range list",Z);const W=new Map,Y=Z.map(se=>new s(se,this.options));for(const se of Y){if(b(se))return[se];W.set(se.value,se)}W.size>1&&W.has("")&&W.delete("");const ce=[...W.values()];return r.set(D,ce),ce}intersects(x,P){if(!(x instanceof e))throw new TypeError("a Range is required");return this.set.some(D=>E(D,P)&&x.set.some(B=>E(B,P)&&D.every(L=>B.every(H=>L.intersects(H,P)))))}test(x){if(!x)return!1;if(typeof x=="string")try{x=new o(x,this.options)}catch{return!1}for(let P=0;PT.value==="<0.0.0-0",R=T=>T.value==="",E=(T,x)=>{let P=!0;const D=T.slice();let B=D.pop();for(;P&&D.length;)P=D.every(L=>B.intersects(L,x)),B=D.pop();return P},_=(T,x)=>(i("comp",T,x),T=S(T,x),i("caret",T),T=y(T,x),i("tildes",T),T=j(T,x),i("xrange",T),T=N(T,x),i("stars",T),T),m=T=>!T||T.toLowerCase()==="x"||T==="*",y=(T,x)=>T.trim().split(/\s+/).map(P=>C(P,x)).join(" "),C=(T,x)=>{const P=x.loose?a[c.TILDELOOSE]:a[c.TILDE];return T.replace(P,(D,B,L,H,Z)=>{i("tilde",T,D,B,L,H,Z);let W;return m(B)?W="":m(L)?W=`>=${B}.0.0 <${+B+1}.0.0-0`:m(H)?W=`>=${B}.${L}.0 <${B}.${+L+1}.0-0`:Z?(i("replaceTilde pr",Z),W=`>=${B}.${L}.${H}-${Z} <${B}.${+L+1}.0-0`):W=`>=${B}.${L}.${H} <${B}.${+L+1}.0-0`,i("tilde return",W),W})},S=(T,x)=>T.trim().split(/\s+/).map(P=>I(P,x)).join(" "),I=(T,x)=>{i("caret",T,x);const P=x.loose?a[c.CARETLOOSE]:a[c.CARET],D=x.includePrerelease?"-0":"";return T.replace(P,(B,L,H,Z,W)=>{i("caret",T,B,L,H,Z,W);let Y;return m(L)?Y="":m(H)?Y=`>=${L}.0.0${D} <${+L+1}.0.0-0`:m(Z)?L==="0"?Y=`>=${L}.${H}.0${D} <${L}.${+H+1}.0-0`:Y=`>=${L}.${H}.0${D} <${+L+1}.0.0-0`:W?(i("replaceCaret pr",W),L==="0"?H==="0"?Y=`>=${L}.${H}.${Z}-${W} <${L}.${H}.${+Z+1}-0`:Y=`>=${L}.${H}.${Z}-${W} <${L}.${+H+1}.0-0`:Y=`>=${L}.${H}.${Z}-${W} <${+L+1}.0.0-0`):(i("no pr"),L==="0"?H==="0"?Y=`>=${L}.${H}.${Z}${D} <${L}.${H}.${+Z+1}-0`:Y=`>=${L}.${H}.${Z}${D} <${L}.${+H+1}.0-0`:Y=`>=${L}.${H}.${Z} <${+L+1}.0.0-0`),i("caret return",Y),Y})},j=(T,x)=>(i("replaceXRanges",T,x),T.split(/\s+/).map(P=>$(P,x)).join(" ")),$=(T,x)=>{T=T.trim();const P=x.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return T.replace(P,(D,B,L,H,Z,W)=>{i("xRange",T,D,B,L,H,Z,W);const Y=m(L),ce=Y||m(H),se=ce||m(Z),Ie=se;return B==="="&&Ie&&(B=""),W=x.includePrerelease?"-0":"",Y?B===">"||B==="<"?D="<0.0.0-0":D="*":B&&Ie?(ce&&(H=0),Z=0,B===">"?(B=">=",ce?(L=+L+1,H=0,Z=0):(H=+H+1,Z=0)):B==="<="&&(B="<",ce?L=+L+1:H=+H+1),B==="<"&&(W="-0"),D=`${B+L}.${H}.${Z}${W}`):ce?D=`>=${L}.0.0${W} <${+L+1}.0.0-0`:se&&(D=`>=${L}.${H}.0${W} <${L}.${+H+1}.0-0`),i("xRange return",D),D})},N=(T,x)=>(i("replaceStars",T,x),T.trim().replace(a[c.STAR],"")),J=(T,x)=>(i("replaceGTE0",T,x),T.trim().replace(a[x.includePrerelease?c.GTE0PRE:c.GTE0],"")),de=T=>(x,P,D,B,L,H,Z,W,Y,ce,se,Ie,v)=>(m(D)?P="":m(B)?P=`>=${D}.0.0${T?"-0":""}`:m(L)?P=`>=${D}.${B}.0${T?"-0":""}`:H?P=`>=${P}`:P=`>=${P}${T?"-0":""}`,m(Y)?W="":m(ce)?W=`<${+Y+1}.0.0-0`:m(se)?W=`<${Y}.${+ce+1}.0-0`:Ie?W=`<=${Y}.${ce}.${se}-${Ie}`:T?W=`<${Y}.${ce}.${+se+1}-0`:W=`<=${W}`,`${P} ${W}`.trim()),oe=(T,x,P)=>{for(let D=0;D0){const B=T[D].semver;if(B.major===x.major&&B.minor===x.minor&&B.patch===x.patch)return!0}return!1}return!0};return no}var so,jc;function Is(){if(jc)return so;jc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(d,u){if(u=r(u),d instanceof t){if(d.loose===!!u.loose)return d;d=d.value}d=d.trim().split(/\s+/).join(" "),o("comparator",d,u),this.options=u,this.loose=!!u.loose,this.parse(d),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(d){const u=this.options.loose?n[s.COMPARATORLOOSE]:n[s.COMPARATOR],h=d.match(u);if(!h)throw new TypeError(`Invalid comparator: ${d}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=e}toString(){return this.value}test(d){if(o("Comparator.test",d,this.options.loose),this.semver===e||d===e)return!0;if(typeof d=="string")try{d=new a(d,this.options)}catch{return!1}return i(d,this.operator,this.semver,this.options)}intersects(d,u){if(!(d instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(d.value,u).test(this.value):d.operator===""?d.value===""?!0:new c(this.value,u).test(d.semver):(u=r(u),u.includePrerelease&&(this.value==="<0.0.0-0"||d.value==="<0.0.0-0")||!u.includePrerelease&&(this.value.startsWith("<0.0.0")||d.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&d.operator.startsWith(">")||this.operator.startsWith("<")&&d.operator.startsWith("<")||this.semver.version===d.semver.version&&this.operator.includes("=")&&d.operator.includes("=")||i(this.semver,"<",d.semver,u)&&this.operator.startsWith(">")&&d.operator.startsWith("<")||i(this.semver,">",d.semver,u)&&this.operator.startsWith("<")&&d.operator.startsWith(">")))}}so=t;const r=ra,{safeRe:n,t:s}=dn,i=ud,o=Cs,a=Te,c=Je();return so}const J_=Je(),Z_=(e,t,r)=>{try{t=new J_(t,r)}catch{return!1}return t.test(e)};var As=Z_;const K_=Je(),Q_=(e,t)=>new K_(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Y_=Q_;const X_=Te,em=Je(),tm=(e,t,r)=>{let n=null,s=null,i=null;try{i=new em(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===-1)&&(n=o,s=new X_(n,r))}),n};var rm=tm;const nm=Te,sm=Je(),im=(e,t,r)=>{let n=null,s=null,i=null;try{i=new sm(t,r)}catch{return null}return e.forEach(o=>{i.test(o)&&(!n||s.compare(o)===1)&&(n=o,s=new nm(n,r))}),n};var om=im;const io=Te,am=Je(),Hc=ks,cm=(e,t)=>{e=new am(e,t);let r=new io("0.0.0");if(e.test(r)||(r=new io("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n{const a=new io(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!i||Hc(a,i))&&(i=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),i&&(!r||Hc(r,i))&&(r=i)}return r&&e.test(r)?r:null};var lm=cm;const um=Je(),dm=(e,t)=>{try{return new um(e,t).range||"*"}catch{return null}};var hm=dm;const fm=Te,hd=Is(),{ANY:pm}=hd,gm=Je(),_m=As,Uc=ks,Wc=sa,mm=oa,bm=ia,ym=(e,t,r,n)=>{e=new fm(e,n),t=new gm(t,n);let s,i,o,a,c;switch(r){case">":s=Uc,i=mm,o=Wc,a=">",c=">=";break;case"<":s=Wc,i=bm,o=Uc,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(_m(e,t,n))return!1;for(let l=0;l{g.semver===pm&&(g=new hd(">=0.0.0")),u=u||g,h=h||g,s(g.semver,u.semver,n)?u=g:o(g.semver,h.semver,n)&&(h=g)}),u.operator===a||u.operator===c||(!h.operator||h.operator===a)&&i(e,h.semver))return!1;if(h.operator===c&&o(e,h.semver))return!1}return!0};var aa=ym;const vm=aa,wm=(e,t,r)=>vm(e,t,">",r);var Em=wm;const Sm=aa,Rm=(e,t,r)=>Sm(e,t,"<",r);var Cm=Rm;const Vc=Je(),km=(e,t,r)=>(e=new Vc(e,r),t=new Vc(t,r),e.intersects(t,r));var Im=km;const Am=As,xm=Ge;var Tm=(e,t,r)=>{const n=[];let s=null,i=null;const o=e.sort((d,u)=>xm(d,u,r));for(const d of o)Am(d,t,r)?(i=d,s||(s=d)):(i&&n.push([s,i]),i=null,s=null);s&&n.push([s,null]);const a=[];for(const[d,u]of n)d===u?a.push(d):!u&&d===o[0]?a.push("*"):u?d===o[0]?a.push(`<=${u}`):a.push(`${d} - ${u}`):a.push(`>=${d}`);const c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length{if(e===t)return!0;e=new zc(e,r),t=new zc(t,r);let n=!1;e:for(const s of e.set){for(const i of t.set){const o=Lm(s,i,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Mm=[new ca(">=0.0.0-0")],qc=[new ca(">=0.0.0")],Lm=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===oo){if(t.length===1&&t[0].semver===oo)return!0;r.includePrerelease?e=Mm:e=qc}if(t.length===1&&t[0].semver===oo){if(r.includePrerelease)return!0;t=qc}const n=new Set;let s,i;for(const g of e)g.operator===">"||g.operator===">="?s=Gc(s,g,r):g.operator==="<"||g.operator==="<="?i=Jc(i,g,r):n.add(g.semver);if(n.size>1)return null;let o;if(s&&i){if(o=la(s.semver,i.semver,r),o>0)return null;if(o===0&&(s.operator!==">="||i.operator!=="<="))return null}for(const g of n){if(s&&!Tr(g,String(s),r)||i&&!Tr(g,String(i),r))return null;for(const b of t)if(!Tr(g,String(b),r))return!1;return!0}let a,c,l,d,u=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,h=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;u&&u.prerelease.length===1&&i.operator==="<"&&u.prerelease[0]===0&&(u=!1);for(const g of t){if(d=d||g.operator===">"||g.operator===">=",l=l||g.operator==="<"||g.operator==="<=",s){if(h&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===h.major&&g.semver.minor===h.minor&&g.semver.patch===h.patch&&(h=!1),g.operator===">"||g.operator===">="){if(a=Gc(s,g,r),a===g&&a!==s)return!1}else if(s.operator===">="&&!Tr(s.semver,String(g),r))return!1}if(i){if(u&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===u.major&&g.semver.minor===u.minor&&g.semver.patch===u.patch&&(u=!1),g.operator==="<"||g.operator==="<="){if(c=Jc(i,g,r),c===g&&c!==i)return!1}else if(i.operator==="<="&&!Tr(i.semver,String(g),r))return!1}if(!g.operator&&(i||s)&&o!==0)return!1}return!(s&&l&&!i&&o!==0||i&&d&&!s&&o!==0||h||u)},Gc=(e,t,r)=>{if(!e)return t;const n=la(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Jc=(e,t,r)=>{if(!e)return t;const n=la(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Pm=Nm;const ao=dn,Zc=Rs,Om=Te,Kc=ad,$m=Cr,Bm=$g,Dm=Fg,Fm=Hg,jm=Wg,Hm=qg,Um=Zg,Wm=Yg,Vm=t_,zm=Ge,qm=i_,Gm=c_,Jm=na,Zm=h_,Km=g_,Qm=ks,Ym=sa,Xm=cd,eb=ld,tb=ia,rb=oa,nb=ud,sb=D_,ib=Is(),ob=Je(),ab=As,cb=Y_,lb=rm,ub=om,db=lm,hb=hm,fb=aa,pb=Em,gb=Cm,_b=Im,mb=Tm,bb=Pm;var yb={parse:$m,valid:Bm,clean:Dm,inc:Fm,diff:jm,major:Hm,minor:Um,patch:Wm,prerelease:Vm,compare:zm,rcompare:qm,compareLoose:Gm,compareBuild:Jm,sort:Zm,rsort:Km,gt:Qm,lt:Ym,eq:Xm,neq:eb,gte:tb,lte:rb,cmp:nb,coerce:sb,Comparator:ib,Range:ob,satisfies:ab,toComparators:cb,maxSatisfying:lb,minSatisfying:ub,minVersion:db,validRange:hb,outside:fb,gtr:pb,ltr:gb,intersects:_b,simplifyRange:mb,subset:bb,SemVer:Om,re:ao.re,src:ao.src,tokens:ao.t,SEMVER_SPEC_VERSION:Zc.SEMVER_SPEC_VERSION,RELEASE_TYPES:Zc.RELEASE_TYPES,compareIdentifiers:Kc.compareIdentifiers,rcompareIdentifiers:Kc.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=yb,r=Vt,n=Ce;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",u=>(0,t.valid)(u)===null?`Expected SemVer version, got "${u}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",u=>(0,t.validRange)(u)===null?`Expected SemVer range, got "${u}"`:!0);function s(u){return(0,r.is)(u,e.VersionStruct)}e.isValidSemVerVersion=s;function i(u){return(0,r.is)(u,e.VersionRangeStruct)}e.isValidSemVerRange=i;function o(u){(0,n.assertStruct)(u,e.VersionStruct)}e.assertIsSemVerVersion=o;function a(u){(0,n.assertStruct)(u,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function c(u,h){return(0,t.gt)(u,h)}e.gtVersion=c;function l(u,h){return(0,t.gtr)(u,h)}e.gtRange=l;function d(u,h){return(0,t.satisfies)(u,h,{includePrerelease:!0})}e.satisfiesVersionRange=d})(sd);(function(e){var t=F&&F.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(n,o,a)}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=F&&F.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ce,e),r(ln,e),r(te,e),r(Es,e),r(nt,e),r(gr,e),r(Qu,e),r(un,e),r(Yu,e),r(Xu,e),r(_r,e),r(ed,e),r(st,e),r(td,e),r(rd,e),r(nd,e),r(sd,e)})(Mu);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Mu;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Nu);var fd=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vs,"__esModule",{value:!0});vs.PollingBlockTracker=void 0;const vb=fd(qo),wb=fd(F1),Eb=on,Qc=Nu,Yc=(0,Qc.createModuleLogger)(Qc.projectLogger,"polling-block-tracker"),Sb=(0,vb.default)(),Rb=1e3;class Cb extends Eb.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*Rb,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=Xc(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: ${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const s=Xc(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await s}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:Sb(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Yc("Making request",t);const r=await(0,wb.default)(n=>this._provider.sendAsync(t,n))();if(Yc("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: ${r.error.message}`);return r.result}}vs.PollingBlockTracker=Cb;function Xc(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var xs={},kb=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xs,"__esModule",{value:!0});xs.SubscribeBlockTracker=void 0;const Ib=kb(qo),Ab=on,xb=(0,Ib.default)();class Tb extends Ab.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,s)=>{this._provider.sendAsync({id:xb(),method:t,params:r,jsonrpc:"2.0"},(i,o)=>{i?s(i):n(o.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}xs.SubscribeBlockTracker=Tb;(function(e){var t=F&&F.__createBinding||(Object.create?function(n,s,i,o){o===void 0&&(o=i),Object.defineProperty(n,o,{enumerable:!0,get:function(){return s[i]}})}:function(n,s,i,o){o===void 0&&(o=i),n[o]=s[i]}),r=F&&F.__exportStar||function(n,s){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&t(s,n,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(vs,e),r(xs,e)})(Tu);var ua={},Ts={},hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.getUniqueId=void 0;const pd=4294967295;let co=Math.floor(Math.random()*pd);function Nb(){return co=(co+1)%pd,co}hn.getUniqueId=Nb;Object.defineProperty(Ts,"__esModule",{value:!0});Ts.createIdRemapMiddleware=void 0;const Mb=hn;function Lb(){return(e,t,r,n)=>{const s=e.id,i=Mb.getUniqueId();e.id=i,t.id=i,r(o=>{e.id=s,t.id=s,o()})}}Ts.createIdRemapMiddleware=Lb;var Ns={};Object.defineProperty(Ns,"__esModule",{value:!0});Ns.createAsyncMiddleware=void 0;function Pb(e){return async(t,r,n,s)=>{let i;const o=new Promise(d=>{i=d});let a=null,c=!1;const l=async()=>{c=!0,n(d=>{a=d,i()}),await o};try{await e(t,r,l),c?(await o,a(null)):s(null)}catch(d){a?a(d):s(d)}}}Ns.createAsyncMiddleware=Pb;var Ms={};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.createScaffoldMiddleware=void 0;function Ob(e){return(t,r,n,s)=>{const i=e[t.method];return i===void 0?n():typeof i=="function"?i(t,r,n,s):(r.result=i,s())}}Ms.createScaffoldMiddleware=Ob;var fn={},da={};Object.defineProperty(da,"__esModule",{value:!0});const $b=Un;function el(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Bb(e){const t=e.length,r=new Array(t);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const i=s[t];if(i===void 0)return!1;if(typeof i=="function")el(i,this,r);else{const o=i.length,a=Bb(i);for(let c=0;c"u"&&(n=md()),Io(e,"",0,[],void 0,0,n);var s;try{Pt.length===0?s=JSON.stringify(e,t,r):s=JSON.stringify(e,yd(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Dt.length!==0;){var i=Dt.pop();i.length===4?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return s}function ar(e,t,r,n){var s=Object.getOwnPropertyDescriptor(n,r);s.get!==void 0?s.configurable?(Object.defineProperty(n,r,{value:e}),Dt.push([n,r,t,s])):Pt.push([t,r,e]):(n[r]=e,Dt.push([n,r,t]))}function Io(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;ao.depthLimit){ar(Dn,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){ar(Dn,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;at?1:0}function bd(e,t,r,n){typeof n>"u"&&(n=md());var s=Ao(e,"",0,[],void 0,0,n)||e,i;try{Pt.length===0?i=JSON.stringify(s,t,r):i=JSON.stringify(s,yd(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Dt.length!==0;){var o=Dt.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Ao(e,t,r,n,s,i,o){i+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;ao.depthLimit){ar(Dn,e,t,s);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){ar(Dn,e,t,s);return}if(n.push(e),Array.isArray(e))for(a=0;a0)for(var n=0;n=1e3&&e<=4999}function Vb(e,t){if(t!=="[Circular]")return t}var ha={},wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.errorValues=wt.errorCodes=void 0;wt.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};wt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=wt,r=vt,n=t.errorCodes.rpc.internal,s="Unspecified error message. This is a bug, please report it.",i={code:n,message:o(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(h,g=s){if(Number.isInteger(h)){const b=h.toString();if(u(t.errorValues,b))return t.errorValues[b].message;if(l(h))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return g}e.getMessageFromCode=o;function a(h){if(!Number.isInteger(h))return!1;const g=h.toString();return!!(t.errorValues[g]||l(h))}e.isValidCode=a;function c(h,{fallbackError:g=i,shouldIncludeStack:b=!1}={}){var R,E;if(!g||!Number.isInteger(g.code)||typeof g.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(h instanceof r.EthereumRpcError)return h.serialize();const _={};if(h&&typeof h=="object"&&!Array.isArray(h)&&u(h,"code")&&a(h.code)){const y=h;_.code=y.code,y.message&&typeof y.message=="string"?(_.message=y.message,u(y,"data")&&(_.data=y.data)):(_.message=o(_.code),_.data={originalError:d(h)})}else{_.code=g.code;const y=(R=h)===null||R===void 0?void 0:R.message;_.message=y&&typeof y=="string"?y:g.message,_.data={originalError:d(h)}}const m=(E=h)===null||E===void 0?void 0:E.stack;return b&&h&&m&&typeof m=="string"&&(_.stack=m),_}e.serializeError=c;function l(h){return h>=-32099&&h<=-32e3}function d(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function u(h,g){return Object.prototype.hasOwnProperty.call(h,g)}})(ha);var Ls={};Object.defineProperty(Ls,"__esModule",{value:!0});Ls.ethErrors=void 0;const fa=vt,wd=ha,ke=wt;Ls.ethErrors={rpc:{parse:e=>Be(ke.errorCodes.rpc.parse,e),invalidRequest:e=>Be(ke.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Be(ke.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Be(ke.errorCodes.rpc.methodNotFound,e),internal:e=>Be(ke.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Be(t,e)},invalidInput:e=>Be(ke.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Be(ke.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Be(ke.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Be(ke.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Be(ke.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Be(ke.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Nr(ke.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>Nr(ke.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>Nr(ke.errorCodes.provider.unsupportedMethod,e),disconnected:e=>Nr(ke.errorCodes.provider.disconnected,e),chainDisconnected:e=>Nr(ke.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new fa.EthereumProviderError(t,r,n)}}};function Be(e,t){const[r,n]=Ed(t);return new fa.EthereumRpcError(e,r||wd.getMessageFromCode(e),n)}function Nr(e,t){const[r,n]=Ed(t);return new fa.EthereumProviderError(e,r||wd.getMessageFromCode(e),n)}function Ed(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=vt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=ha;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Ls;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const s=wt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return s.errorCodes}})})(gd);var zb=F&&F.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fn,"__esModule",{value:!0});fn.JsonRpcEngine=void 0;const qb=zb(da),De=gd;class ct extends qb.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,s)=>{try{const[i,o,a]=await ct._runAllMiddleware(t,r,this._middleware);return o?(await ct._runReturnHandlers(a),s(i)):n(async c=>{try{await ct._runReturnHandlers(a)}catch(l){return c(l)}return c()})}catch(i){return s(i)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,s)=>{r(s)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const o=new De.EthereumRpcError(De.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof t.method!="string"){const o=new De.EthereumRpcError(De.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(o,{id:t.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},t),s={id:n.id,jsonrpc:n.jsonrpc};let i=null;try{await this._processRequest(n,s)}catch(o){i=o}return i&&(delete s.result,s.error||(s.error=De.serializeError(i))),r(i,s)}async _processRequest(t,r){const[n,s,i]=await ct._runAllMiddleware(t,r,this._middleware);if(ct._checkForCompletion(t,r,s),await ct._runReturnHandlers(i),n)throw n}static async _runAllMiddleware(t,r,n){const s=[];let i=null,o=!1;for(const a of n)if([i,o]=await ct._runMiddleware(t,r,a,s),o)break;return[i,o,s.reverse()]}static _runMiddleware(t,r,n,s){return new Promise(i=>{const o=c=>{const l=c||r.error;l&&(r.error=De.serializeError(l)),i([l,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new De.EthereumRpcError(De.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request: diff --git a/assets/index-BDNLXjIW.js b/assets/index-BliWCjCt.js similarity index 99% rename from assets/index-BDNLXjIW.js rename to assets/index-BliWCjCt.js index 46acdc35..3e3691e5 100644 --- a/assets/index-BDNLXjIW.js +++ b/assets/index-BliWCjCt.js @@ -165,7 +165,7 @@ Defaulting to \`null\`.`}const WB="Radio",[Pde,HB]=Sn(WB),[Ide,Tde]=Pde(WB),Ode= `,i+=NA(n.stateDiff)),i},` State Override: `).slice(0,-1)}class VF extends me{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,stateOverride:h}){var v;const p=r?Si(r):void 0;let m=V1({from:p==null?void 0:p.address,to:f,value:typeof d<"u"&&`${_E(d)} ${((v=i==null?void 0:i.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Xn(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Xn(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Xn(l)} gwei`,nonce:u});h&&(m+=` ${Lpe(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class Bpe extends me{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=K1({abi:r,args:n,name:o}),l=c?qF({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?ra(c,{includeName:!0}):void 0,f=V1({address:i&&L0e(i),function:u,args:l&&l!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",f].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=o,this.sender=a}}class N6 extends me{constructor({abi:e,data:r,functionName:n,message:i}){let s,o,a,c;if(r&&r!=="0x")try{o=Mpe({abi:e,data:r});const{abiItem:u,errorName:f,args:d}=o;if(f==="Error")c=d[0];else if(f==="Panic"){const[h]=d;c=HF[h]}else{const h=u?ra(u,{includeName:!0}):void 0,p=u&&d?qF({abiItem:u,args:d,includeFunctionName:!1,includeName:!1}):void 0;a=[h?`Error: ${h}`:"",p&&p!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${p}`:""]}}catch(u){s=u}else i&&(c=i);let l;s instanceof yF&&(l=s.signature,a=[`Unable to decode signature "${l}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${l}.`]),super(c&&c!=="execution reverted"||l?[`The contract function "${n}" reverted with the following ${l?"signature":"reason"}:`,c||l].join(` -`):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=l}}class Fpe extends me{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class jE extends me{constructor({data:e,message:r}){super(r||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}function UE(t,e){var n,i,s,o,a,c;if(!(t instanceof me))return!1;const r=t.walk(l=>l instanceof N6);return r instanceof N6?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((s=r.data)==null?void 0:s.errorName)==="ResolverNotContract"||((o=r.data)==null?void 0:o.errorName)==="ResolverError"||((a=r.data)==null?void 0:a.errorName)==="HttpError"||(c=r.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===HF[50]):!1}function GF(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return mo(e)?e:null}function Hm(t){let e=new Uint8Array(32).fill(0);if(!t)return Es(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=GF(r[n]),s=i?Yl(i):Kn(jo(r[n]),"bytes");e=Kn(na([e,s]),"bytes")}return Es(e)}function jpe(t){return`[${t.slice(2)}]`}function Upe(t){const e=new Uint8Array(32).fill(0);return t?GF(t)||Kn(jo(t)):Es(e)}function wb(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(jo(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=jo(jpe(Upe(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}const zpe=3;function a1(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:u}=t instanceof jE?t:t instanceof me?t.walk(d=>"data"in d)||t.walk():{},f=t instanceof pb?new Fpe({functionName:s}):[zpe,Jl.code].includes(a)&&(c||l||u)?new N6({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:u??l}):t;return new Bpe(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}const Wpe="modulepreload",Hpe=function(t,e){return new URL(t,e).href},DA={},zE=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){const s=document.getElementsByTagName("link");i=Promise.all(r.map(o=>{if(o=Hpe(o,n),o in DA)return;DA[o]=!0;const a=o.endsWith(".css"),c=a?'[rel="stylesheet"]':"";if(!!n)for(let f=s.length-1;f>=0;f--){const d=s[f];if(d.href===o&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${c}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":Wpe,a||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),a)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})}))}return i.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},qpe="0x82ad56cb";function Vpe(t,{docsPath:e,...r}){const n=(()=>{const i=IE(t,r);return i instanceof yb?t:i})();return new VF(n,{docsPath:e,...r})}const Ax=new Map;function KF({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const u=c();o();const f=u.map(({args:d})=>d);f.length!==0&&t(f).then(d=>{var h;i&&Array.isArray(d)&&d.sort(i);for(let p=0;p{var h;for(let p=0;pAx.delete(e),a=()=>c().map(({args:u})=>u),c=()=>Ax.get(e)||[],l=u=>Ax.set(e,[...c(),u]);return{flush:o,async schedule(u){const f={},d=new Promise((m,v)=>{f.resolve=m,f.reject=v});return(r==null?void 0:r([...a(),u]))&&s(),c().length>0?(l({args:u,pendingPromise:f}),d):(l({args:u,pendingPromise:f}),setTimeout(s,n),d)}}}async function Cb(t,e){var g,x,S,I;const{account:r=t.account,batch:n=!!((g=t.batch)!=null&&g.multicall),blockNumber:i,blockTag:s="latest",accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:h,value:p,stateOverride:m,...v}=e,y=r?Si(r):void 0;try{G1(e);const L=(i?Re(i):void 0)||s,N=Jpe(m),q=(I=(S=(x=t.chain)==null?void 0:x.formatters)==null?void 0:S.transactionRequest)==null?void 0:I.format,Q=(q||gb)({...TE(v,{format:q}),from:y==null?void 0:y.address,accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:h,value:p});if(n&&Gpe({request:Q})&&!N)try{return await Kpe(t,{...Q,blockNumber:i,blockTag:s})}catch(U){if(!(U instanceof EF)&&!(U instanceof w6))throw U}const J=await t.request({method:"eth_call",params:N?[Q,L,N]:[Q,L]});return J==="0x"?{data:void 0}:{data:J}}catch($){const L=Qpe($),{offchainLookup:N,offchainLookupSignature:q}=await zE(()=>import("./ccip-DEfimekn.js"),__vite__mapDeps([]),import.meta.url);if((L==null?void 0:L.slice(0,10))===q&&h)return{data:await N(t,{data:L,to:h})};throw Vpe($,{...e,account:y,chain:t.chain})}}function Gpe({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(qpe)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function Kpe(t,e){var m;const{batchSize:r=1024,wait:n=0}=typeof((m=t.batch)==null?void 0:m.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:s="latest",data:o,multicallAddress:a,to:c}=e;let l=a;if(!l){if(!t.chain)throw new EF;l=$d({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?Re(i):void 0)||s,{schedule:d}=KF({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(v){return v.reduce((g,{data:x})=>g+(x.length-2),0)>r*2},fn:async v=>{const y=v.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),g=Vc({abi:O6,args:[y],functionName:"aggregate3"}),x=await t.request({method:"eth_call",params:[{data:g,to:l},f]});return Rd({abi:O6,args:[y],functionName:"aggregate3",data:x||"0x"})}}),[{returnData:h,success:p}]=await d({data:o,to:c});if(!p)throw new jE({data:h});return h==="0x"?{data:void 0}:{data:h}}function Qpe(t){if(!(t instanceof me))return;const e=t.walk();return typeof e.data=="object"?e.data.data:e.data}function LA(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new gA({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new gA({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function Ype(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:s}=t,o={};if(s!==void 0&&(o.code=s),e!==void 0&&(o.balance=Re(e,{size:32})),r!==void 0&&(o.nonce=Re(r,{size:8})),n!==void 0&&(o.state=LA(n)),i!==void 0){if(o.state)throw new Dpe;o.stateDiff=LA(i)}return o}function Jpe(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!ia(r))throw new nd({address:r});if(e[r])throw new Npe({address:r});e[r]=Ype(n)}return e}async function Tc(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=Vc({abi:r,args:i,functionName:s});try{const{data:c}=await Oe(t,Cb,"call")({...o,data:a,to:n});return Rd({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw a1(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function Zpe(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=$d({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l=Vc({abi:kA,functionName:"addr",...n!=null?{args:[Hm(i),BigInt(n)]}:{args:[Hm(i)]}}),u={address:c,abi:NF,functionName:"resolve",args:[wa(wb(i)),l],blockNumber:e,blockTag:r},f=Oe(t,Tc,"readContract"),d=s?await f({...u,args:[...u.args,s]}):await f(u);if(d[0]==="0x")return null;const h=Rd({abi:kA,args:n!=null?[Hm(i),BigInt(n)]:void 0,functionName:"addr",data:d[0]});return h==="0x"||pc(h)==="0x00"?null:h}catch(l){if(o)throw l;if(UE(l,"resolve"))return null;throw l}}class Xpe extends me{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class fh extends me{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class WE extends me{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class eme extends me{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const tme=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,rme=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,nme=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,ime=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function sme(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function BA(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function QF({uri:t,gatewayUrls:e}){const r=nme.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=BA(e==null?void 0:e.ipfs,"https://ipfs.io"),i=BA(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(tme),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||rme.test(t);if(t.startsWith("http")&&!u&&!f){let h=t;return e!=null&&e.arweave&&(h=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((u||f)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let d=t.replace(ime,"");if(d.startsWith("i.json());return await HE({gatewayUrls:t,uri:YF(r)})}catch{throw new WE({uri:e})}}async function HE({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=QF({uri:e,gatewayUrls:t});if(n||await sme(r))return r;throw new WE({uri:e})}function ame(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new fh({reason:"Only EIP-155 supported"});if(!o)throw new fh({reason:"Chain ID not found"});if(!c)throw new fh({reason:"Contract address not found"});if(!i)throw new fh({reason:"Token ID not found"});if(!a)throw new fh({reason:"ERC namespace not found"});return{chainID:parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function cme(t,{nft:e}){if(e.namespace==="erc721")return Tc(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return Tc(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new eme({namespace:e.namespace})}async function lme(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?ume(t,{gatewayUrls:e,record:r}):HE({uri:r,gatewayUrls:e})}async function ume(t,{gatewayUrls:e,record:r}){const n=ame(r),i=await cme(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=QF({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return HE({uri:YF(u),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),ome({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function JF(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=$d({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l={address:c,abi:NF,functionName:"resolve",args:[wa(wb(n)),Vc({abi:SA,functionName:"text",args:[Hm(n),i]})],blockNumber:e,blockTag:r},u=Oe(t,Tc,"readContract"),f=s?await u({...l,args:[...l.args,s]}):await u(l);if(f[0]==="0x")return null;const d=Rd({abi:SA,functionName:"text",data:f[0]});return d===""?null:d}catch(l){if(o)throw l;if(UE(l,"resolve"))return null;throw l}}async function fme(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await Oe(t,JF,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await lme(t,{record:c,gatewayUrls:n})}catch{return null}}async function dme(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:s,universalResolverAddress:o}){let a=o;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=$d({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const l={address:a,abi:z1e,functionName:"reverse",args:[wa(wb(c))],blockNumber:r,blockTag:n},u=Oe(t,Tc,"readContract"),[f,d]=i?await u({...l,args:[...l.args,i]}):await u(l);return e.toLowerCase()!==d.toLowerCase()?null:f}catch(l){if(s)throw l;if(UE(l,"reverse"))return null;throw l}}async function hme(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=$d({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[o]=await Oe(t,Tc,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[wa(wb(n))],blockNumber:e,blockTag:r});return o}function Eb(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:s,response:o,status:a,transport:c})=>{a==="success"&&e===s&&(r[o]=c.request)})),s=>r[s]||t.request}async function pme(t){const e=Eb(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}class mme extends me{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const FA="/docs/contract/encodeEventTopics";function Q1(t){var c;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const l=K1({abi:e,name:r});if(!l)throw new CA(r,{docsPath:FA});i=l}if(i.type!=="event")throw new CA(void 0,{docsPath:FA});const s=ra(i),o=BE(s);let a=[];if(n&&"inputs"in i){const l=(c=i.inputs)==null?void 0:c.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?(l==null?void 0:l.map(f=>n[f.name]))??[]:[];u.length>0&&(a=(l==null?void 0:l.map((f,d)=>Array.isArray(u[d])?u[d].map((h,p)=>jA({param:f,value:u[d][p]})):u[d]?jA({param:f,value:u[d]}):null))??[])}return[o,...a]}function jA({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Kn(Yl(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new mme(t.type);return q1([t],[e])}async function ZF(t,e){const{address:r,abi:n,args:i,eventName:s,fromBlock:o,strict:a,toBlock:c}=e,l=Eb(t,{method:"eth_newFilter"}),u=s?Q1({abi:n,args:i,eventName:s}):void 0,f=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof o=="bigint"?Re(o):o,toBlock:typeof c=="bigint"?Re(c):c,topics:u}]});return{abi:n,args:i,eventName:s,id:f,request:l(f),strict:!!a,type:"event"}}async function XF(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){const c=i??(n?[n]:void 0),l=Eb(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(d=>Q1({abi:[d],eventName:d.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?Re(s):s,toBlock:typeof a=="bigint"?Re(a):a,...u.length?{topics:u}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:s,id:f,request:l(f),strict:!!o,toBlock:a,type:"event"}}async function ej(t){const e=Eb(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function vme(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=Vc({abi:r,args:i,functionName:s});try{return await Oe(t,$E,"estimateGas")({data:a,to:n,...o})}catch(c){const l=o.account?Si(o.account):void 0;throw a1(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:l==null?void 0:l.address})}}async function yme(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?Re(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}const gme=new Map,bme=new Map;function xme(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,gme),n=e(t,bme);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function wme(t,{cacheKey:e,cacheTime:r=1/0}){const n=xme(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function Y1(t,{cacheTime:e=t.cacheTime}={}){const r=await wme(()=>t.request({method:"eth_blockNumber"}),{cacheKey:Cme(t.uid),cacheTime:e});return BigInt(r)}async function Eme(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?Re(r):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]}),ta(s)}async function Sme(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?Re(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]});if(s!=="0x")return s}const UA="/docs/contract/decodeEventLog";function qE(t){const{abi:e,data:r,strict:n,topics:i}=t,s=n??!0,[o,...a]=i;if(!o)throw new n1e({docsPath:UA});const c=e.find(m=>m.type==="event"&&o===BE(ra(m)));if(!(c&&"name"in c)||c.type!=="event")throw new gF(o,{docsPath:UA});const{name:l,inputs:u}=c,f=u==null?void 0:u.some(m=>!("name"in m&&m.name));let d=f?[]:{};const h=u.filter(m=>"indexed"in m&&m.indexed);for(let m=0;m!("indexed"in m&&m.indexed));if(p.length>0){if(r&&r!=="0x")try{const m=xb(p,r);if(m)if(f)d=[...d,...m];else for(let v=0;v0?d:void 0}}function kme({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(xb([t],e)||[])[0]}async function Ame(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=a.account?Si(a.account):t.account,l=Vc({abi:r,args:i,functionName:o});try{const{data:u}=await Oe(t,Cb,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:n,...a,account:c}),f=Rd({abi:r,args:i,functionName:o,data:u||"0x"}),d=r.filter(h=>"name"in h&&h.name===e.functionName);return{result:f,request:{abi:d,address:n,args:i,dataSuffix:s,functionName:o,...a,account:c}}}catch(u){throw a1(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}function Oc(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}const _x=new Map,zA=new Map;let _me=0;function Md(t,e,r){const n=++_me,i=()=>_x.get(t)||[],s=()=>{const u=i();_x.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=zA.get(t);i().length===1&&u&&u(),s()},a=i();if(_x.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const u in e)c[u]=(...f)=>{var h,p;const d=i();if(d.length!==0)for(const m of d)(p=(h=m.fns)[u])==null||p.call(h,...f)};const l=r(c);return typeof l=="function"&&zA.set(t,l),o}async function D6(t){return new Promise(e=>setTimeout(e,t))}function J1(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await(r==null?void 0:r(a))??n;await D6(c);const l=async()=>{i&&(await t({unpoll:s}),await D6(n),l())};l()})(),s}async function Sb(t,{filter:e}){const r="strict"in e&&e.strict,n=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof n[0]=="string")return n;const i=n.map(s=>Oc(s));return!("abi"in e)||!e.abi?i:GE({abi:e.abi,logs:i,strict:r})}async function kb(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function Pme(t,e){const{abi:r,address:n,args:i,batch:s=!0,eventName:o,onError:a,onLogs:c,poll:l,pollingInterval:u=t.pollingInterval,strict:f}=e;return(typeof l<"u"?l:t.transport.type!=="webSocket")?(()=>{const m=ei(["watchContractEvent",n,i,s,t.uid,o,u]),v=f??!1;return Md(m,{onLogs:c,onError:a},y=>{let g,x,S=!1;const I=J1(async()=>{var $;if(!S){try{x=await Oe(t,ZF,"createContractEventFilter")({abi:r,address:n,args:i,eventName:o,strict:v})}catch{}S=!0;return}try{let L;if(x)L=await Oe(t,Sb,"getFilterChanges")({filter:x});else{const N=await Oe(t,Y1,"getBlockNumber")({});g&&g!==N?L=await Oe(t,mj,"getContractEvents")({abi:r,address:n,args:i,eventName:o,fromBlock:g+1n,toBlock:N,strict:v}):L=[],g=N}if(L.length===0)return;if(s)y.onLogs(L);else for(const N of L)y.onLogs([N])}catch(L){x&&L instanceof Zl&&(S=!1),($=y.onError)==null||$.call(y,L)}},{emitOnBegin:!0,interval:u});return async()=>{x&&await Oe(t,kb,"uninstallFilter")({filter:x}),I()}})})():(()=>{let m=!0,v=()=>m=!1;return(async()=>{try{const y=o?Q1({abi:r,eventName:o,args:i}):[],{unsubscribe:g}=await t.transport.subscribe({params:["logs",{address:n,topics:y}],onData(x){var I;if(!m)return;const S=x.result;try{const{eventName:$,args:L}=qE({abi:r,data:S.data,topics:S.topics,strict:f}),N=Oc(S,{args:L,eventName:$});c([N])}catch($){let L,N;if($ instanceof V0||$ instanceof mb){if(f)return;L=$.abiItem.name,N=(I=$.abiItem.inputs)==null?void 0:I.some(G=>!("name"in G&&G.name))}const q=Oc(S,{args:N?[]:{},eventName:L});c([q])}},onError(x){a==null||a(x)}});v=g,m||v()}catch(y){a==null||a(y)}})(),v})()}async function Ime(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=Vc({abi:r,args:i,functionName:o});return Oe(t,NE,"sendTransaction")({data:`${c}${s?s.replace("0x",""):""}`,to:n,...a})}const L6=256;let Kp=L6,Qp;function Tme(t=11){if(!Qp||Kp+t>L6*2){Qp="",Kp=0;for(let e=0;e{const y=v(m);for(const x in h)delete y[x];const g={...m,...y};return Object.assign(g,{extend:p(g)})}}return Object.assign(h,{extend:p(h)})}function Sy(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:a,error:l}):e;u&&await D6(u),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a{const{retryDelay:i=150,retryCount:s=3}={...e,...n};return Sy(async()=>{try{return await t(r)}catch(o){const a=o;switch(a.code){case G0.code:throw new G0(a);case K0.code:throw new K0(a);case Q0.code:throw new Q0(a);case Y0.code:throw new Y0(a);case Jl.code:throw new Jl(a);case Zl.code:throw new Zl(a);case J0.code:throw new J0(a);case mc.code:throw new mc(a);case Z0.code:throw new Z0(a);case X0.code:throw new X0(a);case id.code:throw new id(a);case e1.code:throw new e1(a);case At.code:throw new At(a);case t1.code:throw new t1(a);case r1.code:throw new r1(a);case n1.code:throw new n1(a);case i1.code:throw new i1(a);case Vi.code:throw new Vi(a);case 5e3:throw new At(a);default:throw o instanceof me?o:new O1e(a)}}},{delay:({count:o,error:a})=>{var c;if(a&&a instanceof n0){const l=(c=a==null?void 0:a.headers)==null?void 0:c.get("Retry-After");if(l!=null&&l.match(/\d/))return parseInt(l)*1e3}return~~(1<Rme(o)})}}function Rme(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===id.code||t.code===Jl.code:t instanceof n0&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function rj({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:Ome(r,{retryCount:n,retryDelay:i}),value:a}}function nj(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>rj({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}class $me extends me{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function ij(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:a==null?void 0:a.signal}))}catch(a){a.name==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function Mme(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const WA=Mme();function sj(t,e={}){return{async request(r){var l;const{body:n,fetchOptions:i={},timeout:s=e.timeout??1e4}=r,{headers:o,method:a,signal:c}={...e.fetchOptions,...i};try{const u=await ij(async({signal:d})=>await fetch(t,{...i,body:Array.isArray(n)?ei(n.map(p=>({jsonrpc:"2.0",id:p.id??WA.take(),...p}))):ei({jsonrpc:"2.0",id:n.id??WA.take(),...n}),headers:{...o,"Content-Type":"application/json"},method:a||"POST",signal:c||(s>0?d:void 0)}),{errorInstance:new EA({body:n,url:t}),timeout:s,signal:!0});let f;if((l=u.headers.get("Content-Type"))!=null&&l.startsWith("application/json")?f=await u.json():f=await u.text(),!u.ok)throw new n0({body:n,details:ei(f.error)||u.statusText,headers:u.headers,status:u.status,url:t});return f}catch(u){throw u instanceof n0||u instanceof EA?u:new n0({body:n,details:u.message,url:t})}}}}function Nme(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:s="HTTP JSON-RPC",retryDelay:o}=e;return({chain:a,retryCount:c,timeout:l})=>{const{batchSize:u=1e3,wait:f=0}=typeof r=="object"?r:{},d=e.retryCount??c,h=l??e.timeout??1e4,p=t||(a==null?void 0:a.rpcUrls.default.http[0]);if(!p)throw new $me;const m=sj(p,{fetchOptions:n,timeout:h});return rj({key:i,name:s,async request({method:v,params:y}){const g={method:v,params:y},{schedule:x}=KF({id:`${t}`,wait:f,shouldSplitBatch(L){return L.length>u},fn:L=>m.request({body:L}),sort:(L,N)=>L.id-N.id}),S=async L=>r?x(L):[await m.request({body:L})],[{error:I,result:$}]=await S(g);if(I)throw new PE({body:g,error:I,url:p});return $},retryCount:d,retryDelay:o,timeout:h,type:"http"},{fetchOptions:n,url:p})}}function Dme(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(r=>r.map(n=>BigInt(n)))}}async function Lme(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=r?Re(r):void 0,o=await t.request({method:"eth_feeHistory",params:[Re(e),s||n,i]});return Dme(o)}async function Bme(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>Oc(s));return e.abi?GE({abi:e.abi,logs:i,strict:r}):i}function oj(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}const Fme=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,jme=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Ume(t,{body:e,onError:r,onResponse:n}){return t.request({body:e,onError:r,onResponse:n}),t}async function zme(t,{body:e,timeout:r=1e4}){return t.requestAsync({body:e,timeout:r})}const Wme={http(t,e){return sj(t).request(e)},webSocket:Ume,webSocketAsync:zme};function Hme(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:dj({domain:e}),...t.types};fj({domain:e,message:r,primaryType:n,types:i});const s=["0x1901"];return e&&s.push(qme({domain:e,types:i})),n!=="EIP712Domain"&&s.push(aj({data:r,primaryType:n,types:i})),Kn(na(s))}function qme({domain:t,types:e}){return aj({data:t,primaryType:"EIP712Domain",types:e})}function aj({data:t,primaryType:e,types:r}){const n=cj({data:t,primaryType:e,types:r});return Kn(n)}function cj({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[Vme({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=uj({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return q1(n,i)}function Vme({primaryType:t,types:e}){const r=wa(Gme({primaryType:t,types:e}));return Kn(r)}function Gme({primaryType:t,types:e}){let r="";const n=lj({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return r}function lj({primaryType:t,types:e},r=new Set){const n=t.match(/^\w*/u),i=n==null?void 0:n[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const s of e[i])lj({primaryType:s.type,types:e},r);return r}function uj({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},Kn(cj({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Kn(n)];if(r==="string")return[{type:"bytes32"},Kn(wa(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>uj({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},Kn(q1(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function fj(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(o,a)=>{for(const c of o){const{name:l,type:u}=c,f=a[l],d=u.match(jme);if(d&&(typeof f=="number"||typeof f=="bigint")){const[m,v,y]=d;Re(f,{signed:v==="int",size:parseInt(y)/8})}if(u==="address"&&typeof f=="string"&&!ia(f))throw new nd({address:f});const h=u.match(Fme);if(h){const[m,v]=h;if(v&&Lr(f)!==parseInt(v))throw new o1e({expectedSize:parseInt(v),givenSize:Lr(f)})}const p=i[u];p&&s(p,f)}};if(i.EIP712Domain&&e&&s(i.EIP712Domain,e),n!=="EIP712Domain"){const o=i[n];s(o,r)}}function dj({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},typeof(t==null?void 0:t.chainId)=="number"&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const Kme={"0x0":"reverted","0x1":"success"};function Qme(t){const e={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(r=>Oc(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?ta(t.transactionIndex):null,status:t.status?Kme[t.status]:null,type:t.type?IF[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}const Yme=`Ethereum Signed Message: +`):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=l}}class Fpe extends me{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class jE extends me{constructor({data:e,message:r}){super(r||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}function UE(t,e){var n,i,s,o,a,c;if(!(t instanceof me))return!1;const r=t.walk(l=>l instanceof N6);return r instanceof N6?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((s=r.data)==null?void 0:s.errorName)==="ResolverNotContract"||((o=r.data)==null?void 0:o.errorName)==="ResolverError"||((a=r.data)==null?void 0:a.errorName)==="HttpError"||(c=r.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===HF[50]):!1}function GF(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return mo(e)?e:null}function Hm(t){let e=new Uint8Array(32).fill(0);if(!t)return Es(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=GF(r[n]),s=i?Yl(i):Kn(jo(r[n]),"bytes");e=Kn(na([e,s]),"bytes")}return Es(e)}function jpe(t){return`[${t.slice(2)}]`}function Upe(t){const e=new Uint8Array(32).fill(0);return t?GF(t)||Kn(jo(t)):Es(e)}function wb(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(jo(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=jo(jpe(Upe(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}const zpe=3;function a1(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:u}=t instanceof jE?t:t instanceof me?t.walk(d=>"data"in d)||t.walk():{},f=t instanceof pb?new Fpe({functionName:s}):[zpe,Jl.code].includes(a)&&(c||l||u)?new N6({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:u??l}):t;return new Bpe(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}const Wpe="modulepreload",Hpe=function(t,e){return new URL(t,e).href},DA={},zE=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){const s=document.getElementsByTagName("link");i=Promise.all(r.map(o=>{if(o=Hpe(o,n),o in DA)return;DA[o]=!0;const a=o.endsWith(".css"),c=a?'[rel="stylesheet"]':"";if(!!n)for(let f=s.length-1;f>=0;f--){const d=s[f];if(d.href===o&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${c}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":Wpe,a||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),a)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})}))}return i.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},qpe="0x82ad56cb";function Vpe(t,{docsPath:e,...r}){const n=(()=>{const i=IE(t,r);return i instanceof yb?t:i})();return new VF(n,{docsPath:e,...r})}const Ax=new Map;function KF({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const u=c();o();const f=u.map(({args:d})=>d);f.length!==0&&t(f).then(d=>{var h;i&&Array.isArray(d)&&d.sort(i);for(let p=0;p{var h;for(let p=0;pAx.delete(e),a=()=>c().map(({args:u})=>u),c=()=>Ax.get(e)||[],l=u=>Ax.set(e,[...c(),u]);return{flush:o,async schedule(u){const f={},d=new Promise((m,v)=>{f.resolve=m,f.reject=v});return(r==null?void 0:r([...a(),u]))&&s(),c().length>0?(l({args:u,pendingPromise:f}),d):(l({args:u,pendingPromise:f}),setTimeout(s,n),d)}}}async function Cb(t,e){var g,x,S,I;const{account:r=t.account,batch:n=!!((g=t.batch)!=null&&g.multicall),blockNumber:i,blockTag:s="latest",accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:h,value:p,stateOverride:m,...v}=e,y=r?Si(r):void 0;try{G1(e);const L=(i?Re(i):void 0)||s,N=Jpe(m),q=(I=(S=(x=t.chain)==null?void 0:x.formatters)==null?void 0:S.transactionRequest)==null?void 0:I.format,Q=(q||gb)({...TE(v,{format:q}),from:y==null?void 0:y.address,accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:h,value:p});if(n&&Gpe({request:Q})&&!N)try{return await Kpe(t,{...Q,blockNumber:i,blockTag:s})}catch(U){if(!(U instanceof EF)&&!(U instanceof w6))throw U}const J=await t.request({method:"eth_call",params:N?[Q,L,N]:[Q,L]});return J==="0x"?{data:void 0}:{data:J}}catch($){const L=Qpe($),{offchainLookup:N,offchainLookupSignature:q}=await zE(()=>import("./ccip-BLH0mFrL.js"),__vite__mapDeps([]),import.meta.url);if((L==null?void 0:L.slice(0,10))===q&&h)return{data:await N(t,{data:L,to:h})};throw Vpe($,{...e,account:y,chain:t.chain})}}function Gpe({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(qpe)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function Kpe(t,e){var m;const{batchSize:r=1024,wait:n=0}=typeof((m=t.batch)==null?void 0:m.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:s="latest",data:o,multicallAddress:a,to:c}=e;let l=a;if(!l){if(!t.chain)throw new EF;l=$d({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?Re(i):void 0)||s,{schedule:d}=KF({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(v){return v.reduce((g,{data:x})=>g+(x.length-2),0)>r*2},fn:async v=>{const y=v.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),g=Vc({abi:O6,args:[y],functionName:"aggregate3"}),x=await t.request({method:"eth_call",params:[{data:g,to:l},f]});return Rd({abi:O6,args:[y],functionName:"aggregate3",data:x||"0x"})}}),[{returnData:h,success:p}]=await d({data:o,to:c});if(!p)throw new jE({data:h});return h==="0x"?{data:void 0}:{data:h}}function Qpe(t){if(!(t instanceof me))return;const e=t.walk();return typeof e.data=="object"?e.data.data:e.data}function LA(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new gA({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new gA({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function Ype(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:s}=t,o={};if(s!==void 0&&(o.code=s),e!==void 0&&(o.balance=Re(e,{size:32})),r!==void 0&&(o.nonce=Re(r,{size:8})),n!==void 0&&(o.state=LA(n)),i!==void 0){if(o.state)throw new Dpe;o.stateDiff=LA(i)}return o}function Jpe(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!ia(r))throw new nd({address:r});if(e[r])throw new Npe({address:r});e[r]=Ype(n)}return e}async function Tc(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=Vc({abi:r,args:i,functionName:s});try{const{data:c}=await Oe(t,Cb,"call")({...o,data:a,to:n});return Rd({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw a1(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function Zpe(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=$d({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l=Vc({abi:kA,functionName:"addr",...n!=null?{args:[Hm(i),BigInt(n)]}:{args:[Hm(i)]}}),u={address:c,abi:NF,functionName:"resolve",args:[wa(wb(i)),l],blockNumber:e,blockTag:r},f=Oe(t,Tc,"readContract"),d=s?await f({...u,args:[...u.args,s]}):await f(u);if(d[0]==="0x")return null;const h=Rd({abi:kA,args:n!=null?[Hm(i),BigInt(n)]:void 0,functionName:"addr",data:d[0]});return h==="0x"||pc(h)==="0x00"?null:h}catch(l){if(o)throw l;if(UE(l,"resolve"))return null;throw l}}class Xpe extends me{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class fh extends me{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class WE extends me{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class eme extends me{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const tme=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,rme=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,nme=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,ime=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function sme(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function BA(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function QF({uri:t,gatewayUrls:e}){const r=nme.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=BA(e==null?void 0:e.ipfs,"https://ipfs.io"),i=BA(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(tme),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||rme.test(t);if(t.startsWith("http")&&!u&&!f){let h=t;return e!=null&&e.arweave&&(h=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((u||f)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let d=t.replace(ime,"");if(d.startsWith("i.json());return await HE({gatewayUrls:t,uri:YF(r)})}catch{throw new WE({uri:e})}}async function HE({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=QF({uri:e,gatewayUrls:t});if(n||await sme(r))return r;throw new WE({uri:e})}function ame(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new fh({reason:"Only EIP-155 supported"});if(!o)throw new fh({reason:"Chain ID not found"});if(!c)throw new fh({reason:"Contract address not found"});if(!i)throw new fh({reason:"Token ID not found"});if(!a)throw new fh({reason:"ERC namespace not found"});return{chainID:parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function cme(t,{nft:e}){if(e.namespace==="erc721")return Tc(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return Tc(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new eme({namespace:e.namespace})}async function lme(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?ume(t,{gatewayUrls:e,record:r}):HE({uri:r,gatewayUrls:e})}async function ume(t,{gatewayUrls:e,record:r}){const n=ame(r),i=await cme(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=QF({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return HE({uri:YF(u),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),ome({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function JF(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=$d({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l={address:c,abi:NF,functionName:"resolve",args:[wa(wb(n)),Vc({abi:SA,functionName:"text",args:[Hm(n),i]})],blockNumber:e,blockTag:r},u=Oe(t,Tc,"readContract"),f=s?await u({...l,args:[...l.args,s]}):await u(l);if(f[0]==="0x")return null;const d=Rd({abi:SA,functionName:"text",data:f[0]});return d===""?null:d}catch(l){if(o)throw l;if(UE(l,"resolve"))return null;throw l}}async function fme(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await Oe(t,JF,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await lme(t,{record:c,gatewayUrls:n})}catch{return null}}async function dme(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:s,universalResolverAddress:o}){let a=o;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=$d({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const l={address:a,abi:z1e,functionName:"reverse",args:[wa(wb(c))],blockNumber:r,blockTag:n},u=Oe(t,Tc,"readContract"),[f,d]=i?await u({...l,args:[...l.args,i]}):await u(l);return e.toLowerCase()!==d.toLowerCase()?null:f}catch(l){if(s)throw l;if(UE(l,"reverse"))return null;throw l}}async function hme(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=$d({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[o]=await Oe(t,Tc,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[wa(wb(n))],blockNumber:e,blockTag:r});return o}function Eb(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:s,response:o,status:a,transport:c})=>{a==="success"&&e===s&&(r[o]=c.request)})),s=>r[s]||t.request}async function pme(t){const e=Eb(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}class mme extends me{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const FA="/docs/contract/encodeEventTopics";function Q1(t){var c;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const l=K1({abi:e,name:r});if(!l)throw new CA(r,{docsPath:FA});i=l}if(i.type!=="event")throw new CA(void 0,{docsPath:FA});const s=ra(i),o=BE(s);let a=[];if(n&&"inputs"in i){const l=(c=i.inputs)==null?void 0:c.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?(l==null?void 0:l.map(f=>n[f.name]))??[]:[];u.length>0&&(a=(l==null?void 0:l.map((f,d)=>Array.isArray(u[d])?u[d].map((h,p)=>jA({param:f,value:u[d][p]})):u[d]?jA({param:f,value:u[d]}):null))??[])}return[o,...a]}function jA({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Kn(Yl(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new mme(t.type);return q1([t],[e])}async function ZF(t,e){const{address:r,abi:n,args:i,eventName:s,fromBlock:o,strict:a,toBlock:c}=e,l=Eb(t,{method:"eth_newFilter"}),u=s?Q1({abi:n,args:i,eventName:s}):void 0,f=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof o=="bigint"?Re(o):o,toBlock:typeof c=="bigint"?Re(c):c,topics:u}]});return{abi:n,args:i,eventName:s,id:f,request:l(f),strict:!!a,type:"event"}}async function XF(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){const c=i??(n?[n]:void 0),l=Eb(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(d=>Q1({abi:[d],eventName:d.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?Re(s):s,toBlock:typeof a=="bigint"?Re(a):a,...u.length?{topics:u}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:s,id:f,request:l(f),strict:!!o,toBlock:a,type:"event"}}async function ej(t){const e=Eb(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function vme(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=Vc({abi:r,args:i,functionName:s});try{return await Oe(t,$E,"estimateGas")({data:a,to:n,...o})}catch(c){const l=o.account?Si(o.account):void 0;throw a1(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:l==null?void 0:l.address})}}async function yme(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?Re(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}const gme=new Map,bme=new Map;function xme(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,gme),n=e(t,bme);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function wme(t,{cacheKey:e,cacheTime:r=1/0}){const n=xme(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function Y1(t,{cacheTime:e=t.cacheTime}={}){const r=await wme(()=>t.request({method:"eth_blockNumber"}),{cacheKey:Cme(t.uid),cacheTime:e});return BigInt(r)}async function Eme(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?Re(r):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]}),ta(s)}async function Sme(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?Re(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]});if(s!=="0x")return s}const UA="/docs/contract/decodeEventLog";function qE(t){const{abi:e,data:r,strict:n,topics:i}=t,s=n??!0,[o,...a]=i;if(!o)throw new n1e({docsPath:UA});const c=e.find(m=>m.type==="event"&&o===BE(ra(m)));if(!(c&&"name"in c)||c.type!=="event")throw new gF(o,{docsPath:UA});const{name:l,inputs:u}=c,f=u==null?void 0:u.some(m=>!("name"in m&&m.name));let d=f?[]:{};const h=u.filter(m=>"indexed"in m&&m.indexed);for(let m=0;m!("indexed"in m&&m.indexed));if(p.length>0){if(r&&r!=="0x")try{const m=xb(p,r);if(m)if(f)d=[...d,...m];else for(let v=0;v0?d:void 0}}function kme({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(xb([t],e)||[])[0]}async function Ame(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=a.account?Si(a.account):t.account,l=Vc({abi:r,args:i,functionName:o});try{const{data:u}=await Oe(t,Cb,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:n,...a,account:c}),f=Rd({abi:r,args:i,functionName:o,data:u||"0x"}),d=r.filter(h=>"name"in h&&h.name===e.functionName);return{result:f,request:{abi:d,address:n,args:i,dataSuffix:s,functionName:o,...a,account:c}}}catch(u){throw a1(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}function Oc(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}const _x=new Map,zA=new Map;let _me=0;function Md(t,e,r){const n=++_me,i=()=>_x.get(t)||[],s=()=>{const u=i();_x.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=zA.get(t);i().length===1&&u&&u(),s()},a=i();if(_x.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const u in e)c[u]=(...f)=>{var h,p;const d=i();if(d.length!==0)for(const m of d)(p=(h=m.fns)[u])==null||p.call(h,...f)};const l=r(c);return typeof l=="function"&&zA.set(t,l),o}async function D6(t){return new Promise(e=>setTimeout(e,t))}function J1(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await(r==null?void 0:r(a))??n;await D6(c);const l=async()=>{i&&(await t({unpoll:s}),await D6(n),l())};l()})(),s}async function Sb(t,{filter:e}){const r="strict"in e&&e.strict,n=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof n[0]=="string")return n;const i=n.map(s=>Oc(s));return!("abi"in e)||!e.abi?i:GE({abi:e.abi,logs:i,strict:r})}async function kb(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function Pme(t,e){const{abi:r,address:n,args:i,batch:s=!0,eventName:o,onError:a,onLogs:c,poll:l,pollingInterval:u=t.pollingInterval,strict:f}=e;return(typeof l<"u"?l:t.transport.type!=="webSocket")?(()=>{const m=ei(["watchContractEvent",n,i,s,t.uid,o,u]),v=f??!1;return Md(m,{onLogs:c,onError:a},y=>{let g,x,S=!1;const I=J1(async()=>{var $;if(!S){try{x=await Oe(t,ZF,"createContractEventFilter")({abi:r,address:n,args:i,eventName:o,strict:v})}catch{}S=!0;return}try{let L;if(x)L=await Oe(t,Sb,"getFilterChanges")({filter:x});else{const N=await Oe(t,Y1,"getBlockNumber")({});g&&g!==N?L=await Oe(t,mj,"getContractEvents")({abi:r,address:n,args:i,eventName:o,fromBlock:g+1n,toBlock:N,strict:v}):L=[],g=N}if(L.length===0)return;if(s)y.onLogs(L);else for(const N of L)y.onLogs([N])}catch(L){x&&L instanceof Zl&&(S=!1),($=y.onError)==null||$.call(y,L)}},{emitOnBegin:!0,interval:u});return async()=>{x&&await Oe(t,kb,"uninstallFilter")({filter:x}),I()}})})():(()=>{let m=!0,v=()=>m=!1;return(async()=>{try{const y=o?Q1({abi:r,eventName:o,args:i}):[],{unsubscribe:g}=await t.transport.subscribe({params:["logs",{address:n,topics:y}],onData(x){var I;if(!m)return;const S=x.result;try{const{eventName:$,args:L}=qE({abi:r,data:S.data,topics:S.topics,strict:f}),N=Oc(S,{args:L,eventName:$});c([N])}catch($){let L,N;if($ instanceof V0||$ instanceof mb){if(f)return;L=$.abiItem.name,N=(I=$.abiItem.inputs)==null?void 0:I.some(G=>!("name"in G&&G.name))}const q=Oc(S,{args:N?[]:{},eventName:L});c([q])}},onError(x){a==null||a(x)}});v=g,m||v()}catch(y){a==null||a(y)}})(),v})()}async function Ime(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=Vc({abi:r,args:i,functionName:o});return Oe(t,NE,"sendTransaction")({data:`${c}${s?s.replace("0x",""):""}`,to:n,...a})}const L6=256;let Kp=L6,Qp;function Tme(t=11){if(!Qp||Kp+t>L6*2){Qp="",Kp=0;for(let e=0;e{const y=v(m);for(const x in h)delete y[x];const g={...m,...y};return Object.assign(g,{extend:p(g)})}}return Object.assign(h,{extend:p(h)})}function Sy(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:a,error:l}):e;u&&await D6(u),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a{const{retryDelay:i=150,retryCount:s=3}={...e,...n};return Sy(async()=>{try{return await t(r)}catch(o){const a=o;switch(a.code){case G0.code:throw new G0(a);case K0.code:throw new K0(a);case Q0.code:throw new Q0(a);case Y0.code:throw new Y0(a);case Jl.code:throw new Jl(a);case Zl.code:throw new Zl(a);case J0.code:throw new J0(a);case mc.code:throw new mc(a);case Z0.code:throw new Z0(a);case X0.code:throw new X0(a);case id.code:throw new id(a);case e1.code:throw new e1(a);case At.code:throw new At(a);case t1.code:throw new t1(a);case r1.code:throw new r1(a);case n1.code:throw new n1(a);case i1.code:throw new i1(a);case Vi.code:throw new Vi(a);case 5e3:throw new At(a);default:throw o instanceof me?o:new O1e(a)}}},{delay:({count:o,error:a})=>{var c;if(a&&a instanceof n0){const l=(c=a==null?void 0:a.headers)==null?void 0:c.get("Retry-After");if(l!=null&&l.match(/\d/))return parseInt(l)*1e3}return~~(1<Rme(o)})}}function Rme(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===id.code||t.code===Jl.code:t instanceof n0&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function rj({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:Ome(r,{retryCount:n,retryDelay:i}),value:a}}function nj(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>rj({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}class $me extends me{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function ij(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:a==null?void 0:a.signal}))}catch(a){a.name==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function Mme(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const WA=Mme();function sj(t,e={}){return{async request(r){var l;const{body:n,fetchOptions:i={},timeout:s=e.timeout??1e4}=r,{headers:o,method:a,signal:c}={...e.fetchOptions,...i};try{const u=await ij(async({signal:d})=>await fetch(t,{...i,body:Array.isArray(n)?ei(n.map(p=>({jsonrpc:"2.0",id:p.id??WA.take(),...p}))):ei({jsonrpc:"2.0",id:n.id??WA.take(),...n}),headers:{...o,"Content-Type":"application/json"},method:a||"POST",signal:c||(s>0?d:void 0)}),{errorInstance:new EA({body:n,url:t}),timeout:s,signal:!0});let f;if((l=u.headers.get("Content-Type"))!=null&&l.startsWith("application/json")?f=await u.json():f=await u.text(),!u.ok)throw new n0({body:n,details:ei(f.error)||u.statusText,headers:u.headers,status:u.status,url:t});return f}catch(u){throw u instanceof n0||u instanceof EA?u:new n0({body:n,details:u.message,url:t})}}}}function Nme(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:s="HTTP JSON-RPC",retryDelay:o}=e;return({chain:a,retryCount:c,timeout:l})=>{const{batchSize:u=1e3,wait:f=0}=typeof r=="object"?r:{},d=e.retryCount??c,h=l??e.timeout??1e4,p=t||(a==null?void 0:a.rpcUrls.default.http[0]);if(!p)throw new $me;const m=sj(p,{fetchOptions:n,timeout:h});return rj({key:i,name:s,async request({method:v,params:y}){const g={method:v,params:y},{schedule:x}=KF({id:`${t}`,wait:f,shouldSplitBatch(L){return L.length>u},fn:L=>m.request({body:L}),sort:(L,N)=>L.id-N.id}),S=async L=>r?x(L):[await m.request({body:L})],[{error:I,result:$}]=await S(g);if(I)throw new PE({body:g,error:I,url:p});return $},retryCount:d,retryDelay:o,timeout:h,type:"http"},{fetchOptions:n,url:p})}}function Dme(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(r=>r.map(n=>BigInt(n)))}}async function Lme(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=r?Re(r):void 0,o=await t.request({method:"eth_feeHistory",params:[Re(e),s||n,i]});return Dme(o)}async function Bme(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>Oc(s));return e.abi?GE({abi:e.abi,logs:i,strict:r}):i}function oj(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}const Fme=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,jme=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Ume(t,{body:e,onError:r,onResponse:n}){return t.request({body:e,onError:r,onResponse:n}),t}async function zme(t,{body:e,timeout:r=1e4}){return t.requestAsync({body:e,timeout:r})}const Wme={http(t,e){return sj(t).request(e)},webSocket:Ume,webSocketAsync:zme};function Hme(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:dj({domain:e}),...t.types};fj({domain:e,message:r,primaryType:n,types:i});const s=["0x1901"];return e&&s.push(qme({domain:e,types:i})),n!=="EIP712Domain"&&s.push(aj({data:r,primaryType:n,types:i})),Kn(na(s))}function qme({domain:t,types:e}){return aj({data:t,primaryType:"EIP712Domain",types:e})}function aj({data:t,primaryType:e,types:r}){const n=cj({data:t,primaryType:e,types:r});return Kn(n)}function cj({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[Vme({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=uj({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return q1(n,i)}function Vme({primaryType:t,types:e}){const r=wa(Gme({primaryType:t,types:e}));return Kn(r)}function Gme({primaryType:t,types:e}){let r="";const n=lj({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return r}function lj({primaryType:t,types:e},r=new Set){const n=t.match(/^\w*/u),i=n==null?void 0:n[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const s of e[i])lj({primaryType:s.type,types:e},r);return r}function uj({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},Kn(cj({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Kn(n)];if(r==="string")return[{type:"bytes32"},Kn(wa(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>uj({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},Kn(q1(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function fj(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(o,a)=>{for(const c of o){const{name:l,type:u}=c,f=a[l],d=u.match(jme);if(d&&(typeof f=="number"||typeof f=="bigint")){const[m,v,y]=d;Re(f,{signed:v==="int",size:parseInt(y)/8})}if(u==="address"&&typeof f=="string"&&!ia(f))throw new nd({address:f});const h=u.match(Fme);if(h){const[m,v]=h;if(v&&Lr(f)!==parseInt(v))throw new o1e({expectedSize:parseInt(v),givenSize:Lr(f)})}const p=i[u];p&&s(p,f)}};if(i.EIP712Domain&&e&&s(i.EIP712Domain,e),n!=="EIP712Domain"){const o=i[n];s(o,r)}}function dj({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},typeof(t==null?void 0:t.chainId)=="number"&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const Kme={"0x0":"reverted","0x1":"success"};function Qme(t){const e={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(r=>Oc(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?ta(t.transactionIndex):null,status:t.status?Kme[t.status]:null,type:t.type?IF[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}const Yme=`Ethereum Signed Message: `;function Jme(t,e){const r=typeof t=="string"?jo(t):t.raw instanceof Uint8Array?t.raw:Yl(t.raw),n=jo(`${Yme}${r.length}`);return Kn(na([n,r]),e)}function Zme(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function Xme(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?ta(t.nonce):void 0,storageProof:t.storageProof?Zme(t.storageProof):void 0}}async function eve(t,{address:e,blockNumber:r,blockTag:n,storageKeys:i}){const s=n??"latest",o=r!==void 0?Re(r):void 0,a=await t.request({method:"eth_getProof",params:[e,i,o||s]});return Xme(a)}async function tve(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const s=r!==void 0?Re(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||n]})}async function VE(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var u,f,d;const o=n||"latest",a=r!==void 0?Re(r):void 0;let c=null;if(i?c=await t.request({method:"eth_getTransactionByHash",params:[i]}):e?c=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,Re(s)]}):(a||o)&&(c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,Re(s)]})),!c)throw new AF({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:s});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:d.format)||TF)(c)}async function rve(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([Oe(t,Y1,"getBlockNumber")({}),e?Oe(t,VE,"getBlockNumber")({hash:e}):void 0]),s=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return s?n-s+1n:0n}async function B6(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]});if(!r)throw new _F({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||Qme)(r)}async function nve(t,e){var v;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:s,multicallAddress:o,stateOverride:a}=e,c=e.contracts,l=n??(typeof((v=t.batch)==null?void 0:v.multicall)=="object"&&t.batch.multicall.batchSize||1024);let u=o;if(!u){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");u=$d({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=[[]];let d=0,h=0;for(let y=0;y0&&h>l&&f[d].length>0&&(d++,h=($.length-2)/2,f[d]=[]),f[d]=[...f[d],{allowFailure:!0,callData:$,target:x}]}catch($){const L=a1($,{abi:g,address:x,args:S,docsPath:"/docs/contract/multicall",functionName:I});if(!r)throw L;f[d]=[...f[d],{allowFailure:!0,callData:"0x",target:x}]}}const p=await Promise.allSettled(f.map(y=>Oe(t,Tc,"readContract")({abi:O6,address:u,args:[y],blockNumber:i,blockTag:s,functionName:"aggregate3",stateOverride:a}))),m=[];for(let y=0;y{const f=ei(["watchBlockNumber",t.uid,e,r,o]);return Md(f,{onBlockNumber:n,onError:i},d=>J1(async()=>{var h;try{const p=await Oe(t,Y1,"getBlockNumber")({cacheTime:0});if(c){if(p===c)return;if(p-c>1&&r)for(let m=c+1n;mc)&&(d.onBlockNumber(p,c),c=p)}catch(p){(h=d.onError)==null||h.call(d,p)}},{emitOnBegin:e,interval:o}))})():(()=>{let f=!0,d=()=>f=!1;return(async()=>{try{const{unsubscribe:h}=await t.transport.subscribe({params:["newHeads"],onData(p){var v;if(!f)return;const m=H1((v=p.result)==null?void 0:v.number);n(m,c),c=m},onError(p){i==null||i(p)}});d=h,f||d()}catch(h){i==null||i(h)}})(),d})()}async function lve(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:s=6,retryDelay:o=({count:c})=>~~(1<{a&&setTimeout(()=>p(new I1e({hash:r})),a);const m=Md(c,{onReplaced:n,resolve:h,reject:p},v=>{const y=Oe(t,pj,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(g){if(d)return;let x=g;const S=I=>{y(),I(),m()};try{if(f){if(e>1&&(!f.blockNumber||x-f.blockNumber+1nv.resolve(f));return}if(l||(d=!0,await Sy(async()=>{l=await Oe(t,VE,"getTransaction")({hash:r}),l.blockNumber&&(x=l.blockNumber)},{delay:o,retryCount:s}),d=!1),f=await Oe(t,B6,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||x-f.blockNumber+1nv.resolve(f))}catch(I){if(I instanceof AF||I instanceof _F){if(!l){d=!1;return}try{u=l,d=!0;const $=await Sy(()=>Oe(t,Ic,"getBlock")({blockNumber:x,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:q})=>q instanceof PF});d=!1;const L=$.transactions.find(({from:q,nonce:G})=>q===u.from&&G===u.nonce);if(!L||(f=await Oe(t,B6,"getTransactionReceipt")({hash:L.hash}),e>1&&(!f.blockNumber||x-f.blockNumber+1n{var q;(q=v.onReplaced)==null||q.call(v,{reason:N,replacedTransaction:u,transaction:L,transactionReceipt:f}),v.resolve(f)})}catch($){S(()=>v.reject($))}}else S(()=>v.reject(I))}}})})})}function uve(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:o,poll:a,pollingInterval:c=t.pollingInterval}){const l=typeof a<"u"?a:t.transport.type!=="webSocket",u=o??!1;let f;return l?(()=>{const p=ei(["watchBlocks",t.uid,r,n,u,c]);return Md(p,{onBlock:i,onError:s},m=>J1(async()=>{var v;try{const y=await Oe(t,Ic,"getBlock")({blockTag:e,includeTransactions:u});if(y.number&&(f!=null&&f.number)){if(y.number===f.number)return;if(y.number-f.number>1&&r)for(let g=(f==null?void 0:f.number)+1n;gf.number)&&(m.onBlock(y,f),f=y)}catch(y){(v=m.onError)==null||v.call(m,y)}},{emitOnBegin:n,interval:c}))})():(()=>{let p=!0,m=()=>p=!1;return(async()=>{try{const{unsubscribe:v}=await t.transport.subscribe({params:["newHeads"],onData(y){var S,I,$;if(!p)return;const x=((($=(I=(S=t.chain)==null?void 0:S.formatters)==null?void 0:I.block)==null?void 0:$.format)||OF)(y.result);i(x,f),f=x},onError(y){s==null||s(y)}});m=v,p||m()}catch(v){s==null||s(v)}})(),m})()}function fve(t,{address:e,args:r,batch:n=!0,event:i,events:s,onError:o,onLogs:a,poll:c,pollingInterval:l=t.pollingInterval,strict:u}){const f=typeof c<"u"?c:t.transport.type!=="webSocket",d=u??!1;return f?(()=>{const m=ei(["watchEvent",e,r,n,t.uid,i,l]);return Md(m,{onLogs:a,onError:o},v=>{let y,g,x=!1;const S=J1(async()=>{var I;if(!x){try{g=await Oe(t,XF,"createEventFilter")({address:e,args:r,event:i,events:s,strict:d})}catch{}x=!0;return}try{let $;if(g)$=await Oe(t,Sb,"getFilterChanges")({filter:g});else{const L=await Oe(t,Y1,"getBlockNumber")({});y&&y!==L?$=await Oe(t,KE,"getLogs")({address:e,args:r,event:i,events:s,fromBlock:y+1n,toBlock:L}):$=[],y=L}if($.length===0)return;if(n)v.onLogs($);else for(const L of $)v.onLogs([L])}catch($){g&&$ instanceof Zl&&(x=!1),(I=v.onError)==null||I.call(v,$)}},{emitOnBegin:!0,interval:l});return async()=>{g&&await Oe(t,kb,"uninstallFilter")({filter:g}),S()}})})():(()=>{let m=!0,v=()=>m=!1;return(async()=>{try{const y=s??(i?[i]:void 0);let g=[];y&&(g=[y.flatMap(S=>Q1({abi:[S],eventName:S.name,args:r}))],i&&(g=g[0]));const{unsubscribe:x}=await t.transport.subscribe({params:["logs",{address:e,topics:g}],onData(S){var $;if(!m)return;const I=S.result;try{const{eventName:L,args:N}=qE({abi:y??[],data:I.data,topics:I.topics,strict:d}),q=Oc(I,{args:N,eventName:L});a([q])}catch(L){let N,q;if(L instanceof V0||L instanceof mb){if(u)return;N=L.abiItem.name,q=($=L.abiItem.inputs)==null?void 0:$.some(Q=>!("name"in Q&&Q.name))}const G=Oc(I,{args:q?[]:{},eventName:N});a([G])}},onError(S){o==null||o(S)}});v=x,m||v()}catch(y){o==null||o(y)}})(),v})()}function dve(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const l=ei(["watchPendingTransactions",t.uid,e,s]);return Md(l,{onTransactions:n,onError:r},u=>{let f;const d=J1(async()=>{var h;try{if(!f)try{f=await Oe(t,ej,"createPendingTransactionFilter")({});return}catch(m){throw d(),m}const p=await Oe(t,Sb,"getFilterChanges")({filter:f});if(p.length===0)return;if(e)u.onTransactions(p);else for(const m of p)u.onTransactions([m])}catch(p){(h=u.onError)==null||h.call(u,p)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await Oe(t,kb,"uninstallFilter")({filter:f}),d()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:f}=await t.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!l)return;const h=d.result;n([h])},onError(d){r==null||r(d)}});u=f,l||u()}catch(f){r==null||r(f)}})(),u})()}function hve(t){return{call:e=>Cb(t,e),createBlockFilter:()=>pme(t),createContractEventFilter:e=>ZF(t,e),createEventFilter:e=>XF(t,e),createPendingTransactionFilter:()=>ej(t),estimateContractGas:e=>vme(t,e),estimateGas:e=>$E(t,e),getBalance:e=>yme(t,e),getBlock:e=>Ic(t,e),getBlockNumber:e=>Y1(t,e),getBlockTransactionCount:e=>Eme(t,e),getBytecode:e=>Sme(t,e),getChainId:()=>s1(t),getContractEvents:e=>mj(t,e),getEnsAddress:e=>Zpe(t,e),getEnsAvatar:e=>fme(t,e),getEnsName:e=>dme(t,e),getEnsResolver:e=>hme(t,e),getEnsText:e=>JF(t,e),getFeeHistory:e=>Lme(t,e),estimateFeesPerGas:e=>L1e(t,e),getFilterChanges:e=>Sb(t,e),getFilterLogs:e=>Bme(t,e),getGasPrice:()=>RE(t),getLogs:e=>KE(t,e),getProof:e=>eve(t,e),estimateMaxPriorityFeePerGas:e=>D1e(t,e),getStorageAt:e=>tve(t,e),getTransaction:e=>VE(t,e),getTransactionConfirmations:e=>rve(t,e),getTransactionCount:e=>$F(t,e),getTransactionReceipt:e=>B6(t,e),multicall:e=>nve(t,e),prepareTransactionRequest:e=>bb(t,e),readContract:e=>Tc(t,e),sendRawTransaction:e=>ME(t,e),simulateContract:e=>Ame(t,e),verifyMessage:e=>ave(t,e),verifyTypedData:e=>cve(t,e),uninstallFilter:e=>kb(t,e),waitForTransactionReceipt:e=>lve(t,e),watchBlocks:e=>uve(t,e),watchBlockNumber:e=>pj(t,e),watchContractEvent:e=>Pme(t,e),watchEvent:e=>fve(t,e),watchPendingTransactions:e=>dve(t,e)}}async function pve(t){var r;return((r=t.account)==null?void 0:r.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"})).map(n=>LE(n))}async function mve(t){return await t.request({method:"wallet_getPermissions"})}async function vve(t){return(await t.request({method:"eth_requestAccounts"},{retryCount:0})).map(r=>Qn(r))}async function yve(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function gve(t,{account:e=t.account,message:r}){if(!e)throw new vb({docsPath:"/docs/actions/wallet/signMessage"});const n=Si(e);if(n.type==="local")return n.signMessage({message:r});const i=typeof r=="string"?CE(r):r.raw instanceof Uint8Array?wa(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function bve(t,e){var l,u,f,d;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new vb({docsPath:"/docs/actions/wallet/signTransaction"});const s=Si(r);G1({account:s,...e});const o=await Oe(t,s1,"getChainId")({});n!==null&&SF({currentChainId:o,chain:n});const a=(n==null?void 0:n.formatters)||((l=t.chain)==null?void 0:l.formatters),c=((u=a==null?void 0:a.transactionRequest)==null?void 0:u.format)||gb;return s.type==="local"?s.signTransaction({...i,chainId:o},{serializer:(d=(f=t.chain)==null?void 0:f.serializers)==null?void 0:d.transaction}):await t.request({method:"eth_signTransaction",params:[{...c(i),chainId:Re(o),from:s.address}]},{retryCount:0})}async function xve(t,e){const{account:r=t.account,domain:n,message:i,primaryType:s}=e;if(!r)throw new vb({docsPath:"/docs/actions/wallet/signTypedData"});const o=Si(r),a={EIP712Domain:dj({domain:n}),...e.types};if(fj({domain:n,message:i,primaryType:s,types:a}),o.type==="local")return o.signTypedData({domain:n,message:i,primaryType:s,types:a});const c=ei({domain:n??{},message:i,primaryType:s,types:a},(l,u)=>mo(u)?u.toLowerCase():u);return t.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function wve(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:Re(e)}]},{retryCount:0})}async function Cve(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function HA(t){return{addChain:e=>J0e(t,e),deployContract:e=>U1e(t,e),getAddresses:()=>pve(t),getChainId:()=>s1(t),getPermissions:()=>mve(t),prepareTransactionRequest:e=>bb(t,e),requestAddresses:()=>vve(t),requestPermissions:e=>yve(t,e),sendRawTransaction:e=>ME(t,e),sendTransaction:e=>NE(t,e),signMessage:e=>gve(t,e),signTransaction:e=>bve(t,e),signTypedData:e=>xve(t,e),switchChain:e=>wve(t,e),watchAsset:e=>Cve(t,e),writeContract:e=>Ime(t,e)}}function GE({abi:t,eventName:e,logs:r,strict:n=!0}){return r.map(i=>{var s;try{const o=qE({...i,abi:t,strict:n});return e&&!e.includes(o.eventName)?null:{...o,...i}}catch(o){let a,c;if(o instanceof gF)return null;if(o instanceof V0||o instanceof mb){if(n)return null;a=o.abiItem.name,c=(s=o.abiItem.inputs)==null?void 0:s.some(l=>!("name"in l&&l.name))}return{...i,args:c?[]:{},eventName:a}}}).filter(Boolean)}async function KE(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:s,events:o,args:a,strict:c}={}){const l=c??!1,u=o??(s?[s]:void 0);let f=[];u&&(f=[u.flatMap(p=>Q1({abi:[p],eventName:p.name,args:a}))],s&&(f=f[0]));let d;r?d=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,blockHash:r}]}):d=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,fromBlock:typeof n=="bigint"?Re(n):n,toBlock:typeof i=="bigint"?Re(i):i}]});const h=d.map(p=>Oc(p));return u?GE({abi:u,logs:h,strict:l}):h}async function mj(t,e){const{abi:r,address:n,args:i,blockHash:s,eventName:o,fromBlock:a,toBlock:c,strict:l}=e,u=o?K1({abi:r,name:o}):void 0,f=u?void 0:r.filter(d=>d.type==="event");return Oe(t,KE,"getLogs")({address:n,args:i,blockHash:s,event:u,events:f,fromBlock:a,toBlock:c,strict:l})}function Eve(t){const e=r=>t(r.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function Sve(){const t=new Set;let e=[];const r=()=>Eve(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(e,{added:[i]})))});let n=r();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),n()},findProvider({rdns:i}){return e.find(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n(),n=r()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}var kve={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Ave=t=>(e,r,n)=>{const i=n.subscribe;return n.subscribe=(o,a,c)=>{let l=o;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let f=o(n.getState());l=d=>{const h=o(d);if(!u(f,h)){const p=f;a(f=h,p)}},c!=null&&c.fireImmediately&&a(f,f)}return i(l)},t(e,r,n)},_ve=Ave;function Pve(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,e==null?void 0:e.reviver),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,e==null?void 0:e.replacer)),removeItem:i=>r.removeItem(i)}}const c1=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return c1(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return c1(n)(r)}}}},Ive=(t,e)=>(r,n,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,y)=>({...y,...v}),...e},o=!1;const a=new Set,c=new Set;let l;try{l=s.getStorage()}catch{}if(!l)return t((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...v)},n,i);const u=c1(s.serialize),f=()=>{const v=s.partialize({...n()});let y;const g=u({state:v,version:s.version}).then(x=>l.setItem(s.name,x)).catch(x=>{y=x});if(y)throw y;return g},d=i.setState;i.setState=(v,y)=>{d(v,y),f()};const h=t((...v)=>{r(...v),f()},n,i);let p;const m=()=>{var v;if(!l)return;o=!1,a.forEach(g=>g(n()));const y=((v=s.onRehydrateStorage)==null?void 0:v.call(s,n()))||void 0;return c1(l.getItem.bind(l))(s.name).then(g=>{if(g)return s.deserialize(g)}).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==s.version){if(s.migrate)return s.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var x;return p=s.merge(g,(x=n())!=null?x:h),r(p,!0),f()}).then(()=>{y==null||y(p,void 0),o=!0,c.forEach(g=>g(p))}).catch(g=>{y==null||y(void 0,g)})};return i.persist={setOptions:v=>{s={...s,...v},v.getStorage&&(l=v.getStorage())},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},m(),p||h},Tve=(t,e)=>(r,n,i)=>{let s={storage:Pve(()=>localStorage),partialize:m=>m,version:0,merge:(m,v)=>({...v,...m}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...m)},n,i);const u=()=>{const m=s.partialize({...n()});return l.setItem(s.name,{state:m,version:s.version})},f=i.setState;i.setState=(m,v)=>{f(m,v),u()};const d=t((...m)=>{r(...m),u()},n,i);let h;const p=()=>{var m,v;if(!l)return;o=!1,a.forEach(g=>{var x;return g((x=n())!=null?x:d)});const y=((v=s.onRehydrateStorage)==null?void 0:v.call(s,(m=n())!=null?m:d))||void 0;return c1(l.getItem.bind(l))(s.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==s.version){if(s.migrate)return s.migrate(g.state,g.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return g.state}).then(g=>{var x;return h=s.merge(g,(x=n())!=null?x:d),r(h,!0),u()}).then(()=>{y==null||y(h,void 0),h=n(),o=!0,c.forEach(g=>g(h))}).catch(g=>{y==null||y(void 0,g)})};return i.persist={setOptions:m=>{s={...s,...m},m.storage&&(l=m.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(c.add(m),()=>{c.delete(m)})},s.skipHydration||p(),h||d},Ove=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((kve?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Ive(t,e)):Tve(t,e),Rve=Ove;var $ve={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const qA=t=>{let e;const r=new Set,n=(c,l)=>{const u=typeof c=="function"?c(e):c;if(!Object.is(u,e)){const f=e;e=l??typeof u!="object"?u:Object.assign({},e,u),r.forEach(d=>d(e,f))}},i=()=>e,a={setState:n,getState:i,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{($ve?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return e=t(n,i,a),a},Px=t=>t?qA(t):qA;var vj={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||c,d),p=r?r+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],h]:c._events[p].push(h):(c._events[p]=h,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,f;if(this._eventsCount===0)return l;for(f in u=this._events)e.call(u,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=r?r+l:l,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d{let i=n;return(i==null?void 0:i.__type)==="bigint"&&(i=BigInt(i.value)),(i==null?void 0:i.__type)==="Map"&&(i=new Map(i.value)),(e==null?void 0:e(r,i))??i})}function VA(t,e){return t.slice(0,e).join(".")||"."}function GA(t,e){const{length:r}=t;for(let n=0;n{let o=s;return typeof o=="bigint"&&(o={__type:"bigint",value:s.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(i,o))??o},n),r??void 0)}function Uve(t){const{deserialize:e=Bve,key:r="wagmi",serialize:n=jve,storage:i=yj}=t;function s(o){return o instanceof Promise?o.then(a=>a).catch(()=>null):o}return{...i,key:r,async getItem(o,a){const c=i.getItem(`${r}.${o}`),l=await s(c);return l?e(l)??null:a??null},async setItem(o,a){const c=`${r}.${o}`;a===null?await s(i.removeItem(c)):await s(i.setItem(c,n(a)))},async removeItem(o){await s(i.removeItem(`${r}.${o}`))}}}const yj={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};const qm="2.6.5",zve=()=>`@wagmi/core@${qm}`;var gj=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},ky,bj;let mu=class F6 extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return zve()}constructor(e,r={}){var s;super(),ky.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const n=r.cause instanceof F6?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof F6&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` `),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return gj(this,ky,"m",bj).call(this,this,e)}};ky=new WeakSet,bj=function t(e,r){return r!=null&&r(e)?e:e.cause?gj(this,ky,"m",t).call(this,e.cause,r):e};class Xl extends mu{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Wve extends mu{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class xj extends mu{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Hve extends mu{constructor({address:e,connector:r}){super(`Account "${e}" not found for connector "${r.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class dl extends mu{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class qve extends mu{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}function vc(t){if(typeof t=="string")return Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10);if(typeof t=="bigint")return Number(t);if(typeof t=="number")return t;throw new Error(`Cannot normalize chainId "${t}" of type "${typeof t}"`)}const Vve={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:Vm(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return Vm(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const r=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"];for(const n of r)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(t){var e,r;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(r=t.phantom)==null?void 0:r.ethereum:Vm(t,"isPhantom")}}};Ab.type="injected";function Ab(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:r}=t;function n(){const i=t.target;if(typeof i=="function"){const s=i();if(s)return s}return typeof i=="object"?i:typeof i=="string"?{...Vve[i]??{id:i,name:`${i[0].toUpperCase()}${i.slice(1)}`,provider:`is${i[0].toUpperCase()}${i.slice(1)}`}}:{id:"injected",name:"Injected",provider(s){return s==null?void 0:s.ethereum}}}return i=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:Ab.type,async setup(){const s=await this.getProvider();s&&t.target&&s.on("connect",this.onConnect.bind(this))},async connect({chainId:s,isReconnecting:o}={}){var l,u,f,d,h,p;const a=await this.getProvider();if(!a)throw new dl;let c=null;if(!o&&(c=await this.getAccounts().catch(()=>null),!!(c!=null&&c.length)))try{c=(d=(f=(u=(l=(await a.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:l.caveats)==null?void 0:u[0])==null?void 0:f.value)==null?void 0:d.map(y=>Qn(y))}catch(v){const y=v;if(y.code===At.code)throw new At(y);if(y.code===mc.code)throw y}try{c!=null&&c.length||(c=(await a.request({method:"eth_requestAccounts"})).map(y=>Qn(y))),a.removeListener("connect",this.onConnect.bind(this)),a.on("accountsChanged",this.onAccountsChanged.bind(this)),a.on("chainChanged",this.onChainChanged),a.on("disconnect",this.onDisconnect.bind(this));let m=await this.getChainId();if(s&&m!==s){const v=await this.switchChain({chainId:s}).catch(y=>{if(y.code===At.code)throw y;return{id:m}});m=(v==null?void 0:v.id)??m}return e&&(await((h=i.storage)==null?void 0:h.removeItem(`${this.id}.disconnected`)),t.target||await((p=i.storage)==null?void 0:p.setItem("injected.connected",!0))),{accounts:c,chainId:m}}catch(m){const v=m;throw v.code===At.code?new At(v):v.code===mc.code?new mc(v):v}},async disconnect(){var o,a;const s=await this.getProvider();if(!s)throw new dl;s.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),s.removeListener("chainChanged",this.onChainChanged),s.removeListener("disconnect",this.onDisconnect.bind(this)),s.on("connect",this.onConnect.bind(this)),e&&(await((o=i.storage)==null?void 0:o.setItem(`${this.id}.disconnected`,!0)),t.target||await((a=i.storage)==null?void 0:a.removeItem("injected.connected")))},async getAccounts(){const s=await this.getProvider();if(!s)throw new dl;return(await s.request({method:"eth_accounts"})).map(a=>Qn(a))},async getChainId(){const s=await this.getProvider();if(!s)throw new dl;const o=await s.request({method:"eth_chainId"});return vc(o)},async getProvider(){if(typeof window>"u")return;let s;const o=n();return typeof o.provider=="function"?s=o.provider(window):typeof o.provider=="string"?s=Vm(window,o.provider):s=o.provider,s&&!s.removeListener&&("off"in s&&typeof s.off=="function"?s.removeListener=s.off:s.removeListener=()=>{}),s},async isAuthorized(){var s,o;try{if(e&&await((s=i.storage)==null?void 0:s.getItem(`${this.id}.disconnected`))||!t.target&&!await((o=i.storage)==null?void 0:o.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(r!==void 0&&r!==!1){const u=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",u),!!await this.getProvider()),f=typeof r=="number"?r:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(h=>window.addEventListener("ethereum#initialized",()=>h(u()),{once:!0}))]:[],new Promise(h=>setTimeout(()=>h(u()),f))]))return!0}throw new dl}return!!(await Sy(()=>ij(()=>this.getAccounts(),{timeout:100}))).length}catch{return!1}},async switchChain({chainId:s}){var c,l,u;const o=await this.getProvider();if(!o)throw new dl;const a=i.chains.find(f=>f.id===s);if(!a)throw new Vi(new Xl);try{return await Promise.all([o.request({method:"wallet_switchEthereumChain",params:[{chainId:Re(s)}]}),new Promise(f=>i.emitter.once("change",({chainId:d})=>{d===s&&f()}))]),a}catch(f){const d=f;if(d.code===4902||((l=(c=d==null?void 0:d.data)==null?void 0:c.originalError)==null?void 0:l.code)===4902)try{const{default:h,...p}=a.blockExplorers??{};let m=[];if(h&&(m=[h.url,...Object.values(p).map(y=>y.url)]),await o.request({method:"wallet_addEthereumChain",params:[{chainId:Re(s),chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[((u=a.rpcUrls.default)==null?void 0:u.http[0])??""],blockExplorerUrls:m}]}),await this.getChainId()!==s)throw new At(new Error("User rejected switch after adding network."));return a}catch(h){throw new At(h)}throw d.code===At.code?new At(d):new Vi(d)}},async onAccountsChanged(s){var o;if(s.length===0)this.onDisconnect();else if(i.emitter.listenerCount("connect")){const a=(await this.getChainId()).toString();this.onConnect({chainId:a}),e&&await((o=i.storage)==null?void 0:o.removeItem(`${this.id}.disconnected`))}else i.emitter.emit("change",{accounts:s.map(a=>Qn(a))})},onChainChanged(s){const o=vc(s);i.emitter.emit("change",{chainId:o})},async onConnect(s){const o=await this.getAccounts();if(o.length===0)return;const a=vc(s.chainId);i.emitter.emit("connect",{accounts:o,chainId:a});const c=await this.getProvider();c&&(c.removeListener("connect",this.onConnect.bind(this)),c.on("accountsChanged",this.onAccountsChanged.bind(this)),c.on("chainChanged",this.onChainChanged),c.on("disconnect",this.onDisconnect.bind(this)))},async onDisconnect(s){const o=await this.getProvider();s&&s.code===1013&&o&&(await this.getAccounts()).length||(i.emitter.emit("disconnect"),o&&(o.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),o.removeListener("chainChanged",this.onChainChanged),o.removeListener("disconnect",this.onDisconnect.bind(this)),o.on("connect",this.onConnect.bind(this))))}})}function Vm(t,e){function r(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const n=t.ethereum;if(n!=null&&n.providers)return n.providers.find(i=>r(i));if(n&&r(n))return n}const j6=256;let Yp=j6,Jp;function Gve(t=11){if(!Jp||Yp+t>j6*2){Jp="",Yp=0;for(let e=0;es.chains),c=Px(()=>[...s.connectors??[],...i?[]:(o==null?void 0:o.getProviders().map(u))??[]].map(l));function l(S){var L;const I=Lve(Gve()),$={...S({emitter:I,chains:a.getState(),storage:r}),emitter:I,uid:I.uid};return I.on("connect",g),(L=$.setup)==null||L.call($),$}function u(S){const{info:I}=S,$=S.provider;return Ab({target:{...I,id:I.rdns,provider:$}})}const f=new Map;function d(S={}){const I=S.chainId??v.getState().chainId,$=a.getState().find(N=>N.id===I);if(S.chainId&&!$)throw new Xl;{const N=f.get(v.getState().chainId);if(N&&!$)return N;if(!$)throw new Xl}{const N=f.get(I);if(N)return N}let L;if(s.client)L=s.client({chain:$});else{const N=$.id,q=a.getState().map(J=>J.id),G={},Q=Object.entries(s);for(const[J,U]of Q)if(!(J==="chains"||J==="client"||J==="connectors"||J==="transports"))if(typeof U=="object")if(N in U)G[J]=U[N];else{if(q.some(A=>A in U))continue;G[J]=U}else G[J]=U;L=tj({...G,chain:$,batch:G.batch??{multicall:!0},transport:J=>s.transports[N]({...J,connectors:c})})}return f.set(I,L),L}function h(){return{chainId:a.getState()[0].id,connections:new Map,current:void 0,status:"disconnected"}}let p;const m="0.0.0-canary-";qm.startsWith(m)?p=parseInt(qm.replace(m,"")):p=parseInt(qm.split(".")[0]??"0");const v=Px(_ve(r?Rve(h,{migrate(S,I){if(I===p)return S;const $=h(),L=S&&typeof S=="object"&&"chainId"in S&&typeof S.chainId=="number"?S.chainId:$.chainId;return{...$,chainId:L}},name:"store",partialize(S){return{connections:{__type:"Map",value:Array.from(S.connections.entries()).map(([I,$])=>{const{id:L,name:N,type:q,uid:G}=$.connector;return[I,{...$,connector:{id:L,name:N,type:q,uid:G}}]})},chainId:S.chainId,current:S.current}},skipHydration:i,storage:r,version:p}):h));n&&v.subscribe(({connections:S,current:I})=>{var $;return I?($=S.get(I))==null?void 0:$.chainId:void 0},S=>{if(a.getState().some($=>$.id===S))return v.setState($=>({...$,chainId:S??$.chainId}))}),o==null||o.subscribe(S=>{const I=new Map;for(const L of c.getState())I.set(L.id,!0);const $=[];for(const L of S){const N=l(u(L));I.has(N.id)||$.push(N)}c.setState(L=>[...L,...$],!0)});function y(S){v.setState(I=>{const $=I.connections.get(S.uid);return $?{...I,connections:new Map(I.connections).set(S.uid,{accounts:S.accounts??$.accounts,chainId:S.chainId??$.chainId,connector:$.connector})}:I})}function g(S){v.getState().status==="connecting"||v.getState().status==="reconnecting"||v.setState(I=>{const $=c.getState().find(L=>L.uid===S.uid);return $?{...I,connections:new Map(I.connections).set(S.uid,{accounts:S.accounts,chainId:S.chainId,connector:$}),current:S.uid,status:"connected"}:I})}function x(S){v.setState(I=>{const $=I.connections.get(S.uid);if($&&($.connector.emitter.off("change",y),$.connector.emitter.off("disconnect",x),$.connector.emitter.on("connect",g)),I.connections.delete(S.uid),I.connections.size===0)return{...I,connections:new Map,current:void 0,status:"disconnected"};const L=I.connections.values().next().value;return{...I,connections:new Map(I.connections),current:L.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:r,getClient:d,get state(){return v.getState()},setState(S){let I;typeof S=="function"?I=S(v.getState()):I=S;const $=h();typeof I!="object"&&(I=$),Object.keys($).some(N=>!(N in I))&&(I=$),v.setState(I,!0)},subscribe(S,I,$){return v.subscribe(S,I,$?{...$,fireImmediately:$.emitImmediately}:void 0)},_internal:{mipd:o,store:v,ssr:!!i,syncConnectedChain:n,transports:s.transports,chains:{setState(S){const I=typeof S=="function"?S(a.getState()):S;if(I.length!==0)return a.setState(I,!0)},subscribe(S){return a.subscribe(S)}},connectors:{providerDetailToConnector:u,setup:l,setState(S){return c.setState(typeof S=="function"?S(c.getState()):S,!0)},subscribe(S){return c.subscribe(S)}},events:{change:y,connect:g,disconnect:x}}}}async function Qve(t,e){var n;let r;if(typeof e.connector=="function"?r=t._internal.connectors.setup(e.connector):r=e.connector,r.uid===t.state.current)throw new Wve;try{t.setState(o=>({...o,status:"connecting"})),r.emitter.emit("message",{type:"connecting"});const i=await r.connect({chainId:e.chainId}),s=i.accounts;return r.emitter.off("connect",t._internal.events.connect),r.emitter.on("change",t._internal.events.change),r.emitter.on("disconnect",t._internal.events.disconnect),await((n=t.storage)==null?void 0:n.setItem("recentConnectorId",r.id)),t.setState(o=>({...o,connections:new Map(o.connections).set(r.uid,{accounts:s,chainId:i.chainId,connector:r}),current:r.uid,status:"connected"})),{accounts:s,chainId:i.chainId}}catch(i){throw t.setState(s=>({...s,status:s.current?"connected":"disconnected"})),i}}async function Yve(t,e={}){var i,s;let r;if(e.connector)r=e.connector;else{const{connections:o,current:a}=t.state,c=o.get(a);r=c==null?void 0:c.connector}const n=t.state.connections;r&&(await r.disconnect(),r.emitter.off("change",t._internal.events.change),r.emitter.off("disconnect",t._internal.events.disconnect),r.emitter.on("connect",t._internal.events.connect),n.delete(r.uid)),t.setState(o=>{if(n.size===0)return{...o,connections:new Map,current:void 0,status:"disconnected"};const a=n.values().next().value;return{...o,connections:new Map(n),current:a.connector.uid}});{const o=t.state.current;if(!o)return;const a=(i=t.state.connections.get(o))==null?void 0:i.connector;if(!a)return;await((s=t.storage)==null?void 0:s.setItem("recentConnectorId",a.id))}}async function Jve(t,e={}){let r;if(e.connector){const{connector:c}=e,[l,u]=await Promise.all([c.getAccounts(),c.getChainId()]);r={accounts:l,chainId:u,connector:c}}else r=t.state.connections.get(t.state.current);if(!r)throw new xj;const n=e.chainId??r.chainId,i=r.connector;if(i.getClient)return i.getClient({chainId:n});const s=Si(e.account??r.accounts[0]),o=t.chains.find(c=>c.id===n),a=await r.connector.getProvider({chainId:n});if(e.account&&!r.accounts.includes(s.address))throw new Hve({address:s.address,connector:i});return tj({account:s,chain:o,name:"Connector Client",transport:c=>nj(a)({...c,retryCount:0})})}function wj(t){const e=t.state.current,r=t.state.connections.get(e),n=r==null?void 0:r.accounts,i=n==null?void 0:n[0],s=t.chains.find(a=>a.id===(r==null?void 0:r.chainId)),o=t.state.status;switch(o){case"connected":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}function KA(t){return t.state.chainId}function Rc(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)&&Array.isArray(e)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Rc(t[n],e[n]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(s&&!Rc(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}let Ix=[];function QA(t){const e=t.chains;return Rc(Ix,e)?Ix:(Ix=e,e)}function Zve(t,e={}){let r;try{r=t.getClient(e)}catch{}return r}let Zp=[];function U6(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||Rc(Zp,e)?Zp:(Zp=e,e)}let Tx=[];function YA(t){const e=t.connectors;return Rc(Tx,e)?Tx:(Tx=e,e)}function z6(t,e={}){const r=Zve(t,e);return r==null?void 0:r.extend(hve)}async function Xve(t,e={}){const r=await Jve(t,e);return r.extend(HA),r.extend(HA)}let Ox=!1;async function eye(t,e={}){var l,u;if(Ox)return[];Ox=!0,t.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const f of e.connectors){let d;typeof f=="function"?d=t._internal.connectors.setup(f):d=f,r.push(d)}else r.push(...t.connectors);let n;try{n=await((u=t.storage)==null?void 0:u.getItem("recentConnectorId"))}catch{}const i={};for(const[,f]of t.state.connections)i[f.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((f,d)=>(i[f.id]??10)-(i[d.id]??10)):r;let o=!1;const a=[],c=[];for(const f of s){const d=await f.getProvider();if(!d||c.some(m=>m===d)||!await f.isAuthorized())continue;const p=await f.connect({isReconnecting:!0}).catch(()=>null);p&&(f.emitter.off("connect",t._internal.events.connect),f.emitter.on("change",t._internal.events.change),f.emitter.on("disconnect",t._internal.events.disconnect),t.setState(m=>{const v=new Map(o?m.connections:new Map).set(f.uid,{accounts:p.accounts,chainId:p.chainId,connector:f});return{...m,current:o?m.current:f.uid,connections:v}}),a.push({accounts:p.accounts,chainId:p.chainId,connector:f}),c.push(d),o=!0)}return o?t.setState(f=>({...f,status:"connected"})):t.setState(f=>({...f,connections:new Map,current:void 0,status:"disconnected"})),Ox=!1,a}async function tye(t,e){var s;const{chainId:r}=e,n=t.state.connections.get(((s=e.connector)==null?void 0:s.uid)??t.state.current);if(n){const o=n.connector;if(!o.switchChain)throw new qve({connector:o});return await o.switchChain({chainId:r})}const i=t.chains.find(o=>o.id===r);if(!i)throw new Xl;return t.setState(o=>({...o,chainId:r})),i}function rye(t,e){const{onChange:r}=e;return t.subscribe(()=>wj(t),r,{equalityFn(n,i){const{connector:s,...o}=n,{connector:a,...c}=i;return Rc(o,c)&&(s==null?void 0:s.id)===(a==null?void 0:a.id)&&(s==null?void 0:s.uid)===(a==null?void 0:a.uid)}})}function nye(t,e){const{onChange:r}=e;return t.subscribe(n=>n.chainId,r)}function iye(t,e){const{onChange:r}=e;return t.subscribe(()=>U6(t),r,{equalityFn:Rc})}function sye(t,e){const{onChange:r}=e;return t._internal.connectors.subscribe((n,i)=>{r(Object.values(n),i)})}function oye(t,e){const{onChange:r}=e;return t.subscribe(()=>z6(t),r,{equalityFn(n,i){return(n==null?void 0:n.uid)===(i==null?void 0:i.uid)}})}QE.type="mock";function QE(t){const e=t.features??{};let r=!1,n;return i=>({id:"mock",name:"Mock Connector",type:QE.type,async setup(){n=i.chains[0].id},async connect({chainId:s}={}){if(e.connectError)throw typeof e.connectError=="boolean"?new At(new Error("Failed to connect.")):e.connectError;const a=await(await this.getProvider()).request({method:"eth_requestAccounts"});let c=await this.getChainId();return s&&c!==s&&(c=(await this.switchChain({chainId:s})).id),r=!0,{accounts:a,chainId:c}},async disconnect(){r=!1},async getAccounts(){if(!r)throw new xj;return(await(await this.getProvider()).request({method:"eth_accounts"})).map(a=>Qn(a))},async getChainId(){const o=await(await this.getProvider()).request({method:"eth_chainId"});return xA(o,"number")},async isAuthorized(){return!e.reconnect||!r?!1:!!(await this.getAccounts()).length},async switchChain({chainId:s}){const o=await this.getProvider(),a=i.chains.find(c=>c.id===s);if(!a)throw new Vi(new Xl);return await o.request({method:"wallet_switchEthereumChain",params:[{chainId:Re(s)}]}),a},onAccountsChanged(s){s.length===0?this.onDisconnect():i.emitter.emit("change",{accounts:s.map(o=>Qn(o))})},onChainChanged(s){const o=vc(s);i.emitter.emit("change",{chainId:o})},async onDisconnect(s){i.emitter.emit("disconnect"),r=!1},async getProvider({chainId:s}={}){const a=(i.chains.find(l=>l.id===s)??i.chains[0]).rpcUrls.default.http[0];return nj({request:async({method:l,params:u})=>{if(l==="eth_chainId")return Re(n);if(l==="eth_requestAccounts")return t.accounts;if(l==="eth_signTypedData_v4"&&e.signTypedDataError)throw typeof e.signTypedDataError=="boolean"?new At(new Error("Failed to sign typed data.")):e.signTypedDataError;if(l==="wallet_switchEthereumChain"){if(e.switchChainError)throw typeof e.switchChainError=="boolean"?new At(new Error("Failed to switch chain.")):e.switchChainError;n=xA(u[0].chainId,"number"),this.onChainChanged(n.toString());return}if(l==="personal_sign"){if(e.signMessageError)throw typeof e.signMessageError=="boolean"?new At(new Error("Failed to sign message.")):e.signMessageError;l="eth_sign",u=[u[1],u[0]]}const f={method:l,params:u},{error:d,result:h}=await Wme.http(a,{body:f});if(d)throw new PE({body:f,error:d,url:a});return h}})({retryCount:0})}})}function aye(t,e){const{initialState:r,reconnectOnMount:n}=e;return r&&t.setState({...r,connections:n?r.connections:new Map,status:n?"reconnecting":"disconnected"}),{async onMount(){var i;if(t._internal.ssr){await t._internal.store.persist.rehydrate();const s=(i=t._internal.mipd)==null?void 0:i.getProviders().map(t._internal.connectors.providerDetailToConnector).map(t._internal.connectors.setup);t._internal.connectors.setState(o=>[...o,...s??[]])}n?eye(t):t.storage&&t.setState(s=>({...s,connections:new Map}))}}}function cye(t){const{children:e,config:r,initialState:n,reconnectOnMount:i=!0}=t,{onMount:s}=aye(r,{initialState:n,reconnectOnMount:i});r._internal.ssr||s();const o=E.useRef(!0);return E.useEffect(()=>{if(o.current&&r._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const Cj=E.createContext(void 0);function lye(t){const{children:e,config:r}=t,n={value:r};return E.createElement(cye,t,E.createElement(Cj.Provider,n,e))}const uye="2.5.7",fye=()=>`wagmi@${uye}`;class dye extends mu{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return fye()}}class hye extends dye{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"https://wagmi.sh/react/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}class Nd{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const r={listener:e};return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const l1=typeof window>"u"||"Deno"in window;function Oi(){}function pye(t,e){return typeof t=="function"?t(e):t}function W6(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ej(t,e){return Math.max(t+(e||0)-Date.now(),0)}function uf(t,e,r){return Z1(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function mye(t,e,r){return Z1(t)?typeof e=="function"?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:typeof t=="function"?{...e,mutationFn:t}:{...t}}function za(t,e,r){return Z1(t)?[{...e,queryKey:t},r]:[t||{},e]}function JA(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(Z1(o)){if(n){if(e.queryHash!==YE(o,e.options))return!1}else if(!Ay(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||typeof i<"u"&&i!==e.state.fetchStatus||s&&!s(e))}function ZA(t,e){const{exact:r,fetching:n,predicate:i,mutationKey:s}=t;if(Z1(s)){if(!e.options.mutationKey)return!1;if(r){if(Al(e.options.mutationKey)!==Al(s))return!1}else if(!Ay(e.options.mutationKey,s))return!1}return!(typeof n=="boolean"&&e.state.status==="loading"!==n||i&&!i(e))}function YE(t,e){return((e==null?void 0:e.queryKeyHashFn)||Al)(t)}function Al(t){return JSON.stringify(t,(e,r)=>H6(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Ay(t,e){return Sj(t,e)}function Sj(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!Sj(t[r],e[r])):!1}function kj(t,e){if(t===e)return t;const r=XA(t)&&XA(e);if(r||H6(t)&&H6(e)){const n=r?t.length:Object.keys(t).length,i=r?e:Object.keys(e),s=i.length,o=r?[]:{};let a=0;for(let c=0;c"u")return!0;const r=e.prototype;return!(!e_(r)||!r.hasOwnProperty("isPrototypeOf"))}function e_(t){return Object.prototype.toString.call(t)==="[object Object]"}function Z1(t){return Array.isArray(t)}function Aj(t){return new Promise(e=>{setTimeout(e,t)})}function t_(t){Aj(0).then(t)}function vye(){if(typeof AbortController=="function")return new AbortController}function q6(t,e,r){return r.isDataEqual!=null&&r.isDataEqual(t,e)?t:typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?kj(t,e):e}class yye extends Nd{constructor(){super(),this.setup=e=>{if(!l1&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Py=new yye,r_=["online","offline"];class gye extends Nd{constructor(){super(),this.setup=e=>{if(!l1&&window.addEventListener){const r=()=>e();return r_.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{r_.forEach(n=>{window.removeEventListener(n,r)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const Iy=new gye;function bye(t){return Math.min(1e3*2**t,3e4)}function _b(t){return(t??"online")==="online"?Iy.isOnline():!0}class _j{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function Gm(t){return t instanceof _j}function Pj(t){let e=!1,r=0,n=!1,i,s,o;const a=new Promise((v,y)=>{s=v,o=y}),c=v=>{n||(h(new _j(v)),t.abort==null||t.abort())},l=()=>{e=!0},u=()=>{e=!1},f=()=>!Py.isFocused()||t.networkMode!=="always"&&!Iy.isOnline(),d=v=>{n||(n=!0,t.onSuccess==null||t.onSuccess(v),i==null||i(),s(v))},h=v=>{n||(n=!0,t.onError==null||t.onError(v),i==null||i(),o(v))},p=()=>new Promise(v=>{i=y=>{const g=n||!f();return g&&v(y),g},t.onPause==null||t.onPause()}).then(()=>{i=void 0,n||t.onContinue==null||t.onContinue()}),m=()=>{if(n)return;let v;try{v=t.fn()}catch(y){v=Promise.reject(y)}Promise.resolve(v).then(d).catch(y=>{var g,x;if(n)return;const S=(g=t.retry)!=null?g:3,I=(x=t.retryDelay)!=null?x:bye,$=typeof I=="function"?I(r,y):I,L=S===!0||typeof S=="number"&&r{if(f())return p()}).then(()=>{e?h(y):m()})})};return _b(t.networkMode)?m():p().then(m),{promise:a,cancel:c,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:l,continueRetry:u}}const JE=console;function xye(){let t=[],e=0,r=u=>{u()},n=u=>{u()};const i=u=>{let f;e++;try{f=u()}finally{e--,e||a()}return f},s=u=>{e?t.push(u):t_(()=>{r(u)})},o=u=>(...f)=>{s(()=>{u(...f)})},a=()=>{const u=t;t=[],u.length&&t_(()=>{n(()=>{u.forEach(f=>{r(f)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}const hr=xye();class Ij{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),W6(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e??(l1?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class wye extends Ij{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||JE,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||Cye(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,r){const n=q6(this.state.data,e,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){this.dispatch({type:"setState",state:e,setStateOptions:r})}cancel(e){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(e),n?n.then(Oi).catch(Oi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Ej(this.state.dataUpdatedAt,e)}onFocus(){var e;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const o=vye(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},c=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};c(a);const l=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),u={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:l};if(c(u),(n=this.options.behavior)==null||n.onFetch(u),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=u.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=u.fetchOptions)==null?void 0:f.meta})}const d=h=>{if(Gm(h)&&h.silent||this.dispatch({type:"error",error:h}),!Gm(h)){var p,m,v,y;(p=(m=this.cache.config).onError)==null||p.call(m,h,this),(v=(y=this.cache.config).onSettled)==null||v.call(y,this.state.data,h,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Pj({fn:u.fetchFn,abort:o==null?void 0:o.abort.bind(o),onSuccess:h=>{var p,m,v,y;if(typeof h>"u"){d(new Error(this.queryHash+" data is undefined"));return}this.setData(h),(p=(m=this.cache.config).onSuccess)==null||p.call(m,h,this),(v=(y=this.cache.config).onSettled)==null||v.call(y,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(h,p)=>{this.dispatch({type:"failed",failureCount:h,error:p})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const r=n=>{var i,s;switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:_b(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(s=e.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=e.error;return Gm(o)&&o.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),hr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function Cye(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=typeof e<"u",n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class Eye extends Nd{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,r,n){var i;const s=r.queryKey,o=(i=r.queryHash)!=null?i:YE(s,r);let a=this.get(o);return a||(a=new wye({cache:this,logger:e.getLogger(),queryKey:s,queryHash:o,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const r=this.queriesMap[e.queryHash];r&&(e.destroy(),this.queries=this.queries.filter(n=>n!==e),r===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){hr.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,r){const[n]=za(e,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>JA(n,i))}findAll(e,r){const[n]=za(e,r);return Object.keys(n).length>0?this.queries.filter(i=>JA(n,i)):this.queries}notify(e){hr.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}onFocus(){hr.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){hr.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class Sye extends Ij{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||JE,this.observers=[],this.state=e.state||Tj(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(r=>r!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,r;return(e=(r=this.retryer)==null?void 0:r.continue())!=null?e:this.execute()}async execute(){const e=()=>{var L;return this.retryer=Pj({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(N,q)=>{this.dispatch({type:"failed",failureCount:N,error:q})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(L=this.options.retry)!=null?L:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,s,o,a,c,l,u;if(!r){var f,d,h,p;this.dispatch({type:"loading",variables:this.options.variables}),await((f=(d=this.mutationCache.config).onMutate)==null?void 0:f.call(d,this.state.variables,this));const N=await((h=(p=this.options).onMutate)==null?void 0:h.call(p,this.state.variables));N!==this.state.context&&this.dispatch({type:"loading",context:N,variables:this.state.variables})}const L=await e();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,L,this.state.variables,this.state.context,this)),await((s=(o=this.options).onSuccess)==null?void 0:s.call(o,L,this.state.variables,this.state.context)),await((a=(c=this.mutationCache.config).onSettled)==null?void 0:a.call(c,L,null,this.state.variables,this.state.context,this)),await((l=(u=this.options).onSettled)==null?void 0:l.call(u,L,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:L}),L}catch(L){try{var m,v,y,g,x,S,I,$;throw await((m=(v=this.mutationCache.config).onError)==null?void 0:m.call(v,L,this.state.variables,this.state.context,this)),await((y=(g=this.options).onError)==null?void 0:y.call(g,L,this.state.variables,this.state.context)),await((x=(S=this.mutationCache.config).onSettled)==null?void 0:x.call(S,void 0,L,this.state.variables,this.state.context,this)),await((I=($=this.options).onSettled)==null?void 0:I.call($,void 0,L,this.state.variables,this.state.context)),L}finally{this.dispatch({type:"error",error:L})}}}dispatch(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!_b(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...n,...e.state}}};this.state=r(this.state),hr.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function Tj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class kye extends Nd{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,r,n){const i=new Sye({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?e.getMutationDefaults(r.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(r=>r!==e),this.notify({type:"removed",mutation:e})}clear(){hr.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact>"u"&&(e.exact=!0),this.mutations.find(r=>ZA(e,r))}findAll(e){return this.mutations.filter(r=>ZA(e,r))}notify(e){hr.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return hr.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(Oi)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function V6(){return{onFetch:t=>{t.fetchFn=()=>{var e,r,n,i,s,o;const a=(e=t.fetchOptions)==null||(r=e.meta)==null?void 0:r.refetchPage,c=(n=t.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,l=c==null?void 0:c.pageParam,u=(c==null?void 0:c.direction)==="forward",f=(c==null?void 0:c.direction)==="backward",d=((s=t.state.data)==null?void 0:s.pages)||[],h=((o=t.state.data)==null?void 0:o.pageParams)||[];let p=h,m=!1;const v=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>{var L;if((L=t.signal)!=null&&L.aborted)m=!0;else{var N;(N=t.signal)==null||N.addEventListener("abort",()=>{m=!0})}return t.signal}})},y=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),g=($,L,N,q)=>(p=q?[L,...p]:[...p,L],q?[N,...$]:[...$,N]),x=($,L,N,q)=>{if(m)return Promise.reject("Cancelled");if(typeof N>"u"&&!L&&$.length)return Promise.resolve($);const G={queryKey:t.queryKey,pageParam:N,meta:t.options.meta};v(G);const Q=y(G);return Promise.resolve(Q).then(U=>g($,N,U,q))};let S;if(!d.length)S=x([]);else if(u){const $=typeof l<"u",L=$?l:G6(t.options,d);S=x(d,$,L)}else if(f){const $=typeof l<"u",L=$?l:Oj(t.options,d);S=x(d,$,L,!0)}else{p=[];const $=typeof t.options.getNextPageParam>"u";S=(a&&d[0]?a(d[0],0,d):!0)?x([],$,h[0]):Promise.resolve(g([],h[0],d[0]));for(let N=1;N{if(a&&d[N]?a(d[N],N,d):!0){const Q=$?h[N]:G6(t.options,q);return x(q,$,Q)}return Promise.resolve(g(q,h[N],d[N]))})}return S.then($=>({pages:$,pageParams:p}))}}}}function G6(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function Oj(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}function Aye(t,e){if(t.getNextPageParam&&Array.isArray(e)){const r=G6(t,e);return typeof r<"u"&&r!==null&&r!==!1}}function _ye(t,e){if(t.getPreviousPageParam&&Array.isArray(e)){const r=Oj(t,e);return typeof r<"u"&&r!==null&&r!==!1}}class ZE{constructor(e={}){this.queryCache=e.queryCache||new Eye,this.mutationCache=e.mutationCache||new kye,this.logger=e.logger||JE,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Py.subscribe(()=>{Py.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Iy.subscribe(()=>{Iy.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,r;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(e,r){const[n]=za(e,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state.data}ensureQueryData(e,r,n){const i=uf(e,r,n),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(e,r,n){const i=this.queryCache.find(e),s=i==null?void 0:i.state.data,o=pye(r,s);if(typeof o>"u")return;const a=uf(e),c=this.defaultQueryOptions(a);return this.queryCache.build(this,c).setData(o,{...n,manual:!0})}setQueriesData(e,r,n){return hr.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state}removeQueries(e,r){const[n]=za(e,r),i=this.queryCache;hr.batch(()=>{i.findAll(n).forEach(s=>{i.remove(s)})})}resetQueries(e,r,n){const[i,s]=za(e,r,n),o=this.queryCache,a={type:"active",...i};return hr.batch(()=>(o.findAll(i).forEach(c=>{c.reset()}),this.refetchQueries(a,s)))}cancelQueries(e,r,n){const[i,s={}]=za(e,r,n);typeof s.revert>"u"&&(s.revert=!0);const o=hr.batch(()=>this.queryCache.findAll(i).map(a=>a.cancel(s)));return Promise.all(o).then(Oi).catch(Oi)}invalidateQueries(e,r,n){const[i,s]=za(e,r,n);return hr.batch(()=>{var o,a;if(this.queryCache.findAll(i).forEach(l=>{l.invalidate()}),i.refetchType==="none")return Promise.resolve();const c={...i,type:(o=(a=i.refetchType)!=null?a:i.type)!=null?o:"active"};return this.refetchQueries(c,s)})}refetchQueries(e,r,n){const[i,s]=za(e,r,n),o=hr.batch(()=>this.queryCache.findAll(i).filter(c=>!c.isDisabled()).map(c=>{var l;return c.fetch(void 0,{...s,cancelRefetch:(l=s==null?void 0:s.cancelRefetch)!=null?l:!0,meta:{refetchPage:i.refetchPage}})}));let a=Promise.all(o).then(Oi);return s!=null&&s.throwOnError||(a=a.catch(Oi)),a}fetchQuery(e,r,n){const i=uf(e,r,n),s=this.defaultQueryOptions(i);typeof s.retry>"u"&&(s.retry=!1);const o=this.queryCache.build(this,s);return o.isStaleByTime(s.staleTime)?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(e,r,n){return this.fetchQuery(e,r,n).then(Oi).catch(Oi)}fetchInfiniteQuery(e,r,n){const i=uf(e,r,n);return i.behavior=V6(),this.fetchQuery(i)}prefetchInfiniteQuery(e,r,n){return this.fetchInfiniteQuery(e,r,n).then(Oi).catch(Oi)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,r){const n=this.queryDefaults.find(i=>Al(e)===Al(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:e,defaultOptions:r})}getQueryDefaults(e){if(!e)return;const r=this.queryDefaults.find(n=>Ay(e,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(e,r){const n=this.mutationDefaults.find(i=>Al(e)===Al(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:e,defaultOptions:r})}getMutationDefaults(e){if(!e)return;const r=this.mutationDefaults.find(n=>Ay(e,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const r={...this.defaultOptions.queries,...this.getQueryDefaults(e==null?void 0:e.queryKey),...e,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=YE(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(e==null?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class Rj extends Nd{constructor(e,r){super(),this.client=e,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),n_(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return K6(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return K6(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,r){const n=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),_y(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const s=this.hasListeners();s&&i_(this.currentQuery,i,this.options,n)&&this.executeFetch(),this.updateResult(r),s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const o=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(e){const r=this.client.getQueryCache().build(this.client,e),n=this.createResult(r,e);return Iye(this,n,e)&&(this.currentResult=n,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),n}getCurrentResult(){return this.currentResult}trackResult(e){const r={};return Object.keys(e).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),e[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...r}={}){return this.fetch({...r,meta:{refetchPage:e}})}fetchOptimistic(e){const r=this.client.defaultQueryOptions(e),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(e){var r;return this.executeFetch({...e,cancelRefetch:(r=e.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let r=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(Oi)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),l1||this.currentResult.isStale||!W6(this.options.staleTime))return;const r=Ej(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(l1||this.options.enabled===!1||!W6(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Py.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,r){const n=this.currentQuery,i=this.options,s=this.currentResult,o=this.currentResultState,a=this.currentResultOptions,c=e!==n,l=c?e.state:this.currentQueryInitialState,u=c?this.currentResult:this.previousQueryResult,{state:f}=e;let{dataUpdatedAt:d,error:h,errorUpdatedAt:p,fetchStatus:m,status:v}=f,y=!1,g=!1,x;if(r._optimisticResults){const N=this.hasListeners(),q=!N&&n_(e,r),G=N&&i_(e,n,r,i);(q||G)&&(m=_b(e.options.networkMode)?"fetching":"paused",d||(v="loading")),r._optimisticResults==="isRestoring"&&(m="idle")}if(r.keepPreviousData&&!f.dataUpdatedAt&&u!=null&&u.isSuccess&&v!=="error")x=u.data,d=u.dataUpdatedAt,v=u.status,y=!0;else if(r.select&&typeof f.data<"u")if(s&&f.data===(o==null?void 0:o.data)&&r.select===this.selectFn)x=this.selectResult;else try{this.selectFn=r.select,x=r.select(f.data),x=q6(s==null?void 0:s.data,x,r),this.selectResult=x,this.selectError=null}catch(N){this.selectError=N}else x=f.data;if(typeof r.placeholderData<"u"&&typeof x>"u"&&v==="loading"){let N;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))N=s.data;else if(N=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof N<"u")try{N=r.select(N),this.selectError=null}catch(q){this.selectError=q}typeof N<"u"&&(v="success",x=q6(s==null?void 0:s.data,N,r),g=!0)}this.selectError&&(h=this.selectError,x=this.selectResult,p=Date.now(),v="error");const S=m==="fetching",I=v==="loading",$=v==="error";return{status:v,fetchStatus:m,isLoading:I,isSuccess:v==="success",isError:$,isInitialLoading:I&&S,data:x,dataUpdatedAt:d,error:h,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:S,isRefetching:S&&!I,isLoadingError:$&&f.dataUpdatedAt===0,isPaused:m==="paused",isPlaceholderData:g,isPreviousData:y,isRefetchError:$&&f.dataUpdatedAt!==0,isStale:XE(e,r),refetch:this.refetch,remove:this.remove}}updateResult(e){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,_y(n,r))return;this.currentResult=n;const i={cache:!0},s=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!this.trackedProps.size)return!0;const c=new Set(a??this.trackedProps);return this.options.useErrorBoundary&&c.add("error"),Object.keys(this.currentResult).some(l=>{const u=l;return this.currentResult[u]!==r[u]&&c.has(u)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),this.notify({...i,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const r={};e.type==="success"?r.onSuccess=!e.manual:e.type==="error"&&!Gm(e.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(e){hr.batch(()=>{if(e.onSuccess){var r,n,i,s;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(e.onError){var o,a,c,l;(o=(a=this.options).onError)==null||o.call(a,this.currentResult.error),(c=(l=this.options).onSettled)==null||c.call(l,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function Pye(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function n_(t,e){return Pye(t,e)||t.state.dataUpdatedAt>0&&K6(t,e,e.refetchOnMount)}function K6(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&XE(t,e)}return!1}function i_(t,e,r,n){return r.enabled!==!1&&(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&XE(t,r)}function XE(t,e){return t.isStaleByTime(e.staleTime)}function Iye(t,e,r){return r.keepPreviousData?!1:r.placeholderData!==void 0?e.isPlaceholderData:!_y(t.getCurrentResult(),e)}class Tye extends Rj{constructor(e,r){super(e,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,r){super.setOptions({...e,behavior:V6()},r)}getOptimisticResult(e){return e.behavior=V6(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,r){var n,i,s,o,a,c;const{state:l}=e,u=super.createResult(e,r),{isFetching:f,isRefetching:d}=u,h=f&&((n=l.fetchMeta)==null||(i=n.fetchMore)==null?void 0:i.direction)==="forward",p=f&&((s=l.fetchMeta)==null||(o=s.fetchMore)==null?void 0:o.direction)==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Aye(r,(a=l.data)==null?void 0:a.pages),hasPreviousPage:_ye(r,(c=l.data)==null?void 0:c.pages),isFetchingNextPage:h,isFetchingPreviousPage:p,isRefetching:d&&!h&&!p}}}let Oye=class extends Nd{constructor(e,r){super(),this.client=e,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var r;const n=this.options;this.options=this.client.defaultMutationOptions(e),_y(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(r=this.currentMutation)==null||r.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.currentMutation)==null||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();const r={listeners:!0};e.type==="success"?r.onSuccess=!0:e.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof e<"u"?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const e=this.currentMutation?this.currentMutation.state:Tj(),r={...e,isLoading:e.status==="loading",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(e){hr.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(e.onSuccess){var r,n,i,s;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(s=this.mutateOptions).onSettled)==null||i.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(e.onError){var o,a,c,l;(o=(a=this.mutateOptions).onError)==null||o.call(a,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(c=(l=this.mutateOptions).onSettled)==null||c.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)})})}};var $j={exports:{}},Mj={};/** * @license React @@ -183,7 +183,7 @@ ${Lpe(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMess * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Pb=E,tge=Nj;function rge(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var nge=typeof Object.is=="function"?Object.is:rge,ige=tge.useSyncExternalStore,sge=Pb.useRef,oge=Pb.useEffect,age=Pb.useMemo,cge=Pb.useDebugValue;Wj.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var s=sge(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=age(function(){function c(h){if(!l){if(l=!0,u=h,h=n(h),i!==void 0&&o.hasValue){var p=o.value;if(i(p,h))return f=p}return f=h}if(p=f,nge(u,h))return p;var m=n(h);return i!==void 0&&i(p,m)?p:(u=h,f=m)}var l=!1,u,f,d=r===void 0?null:r;return[function(){return c(e())},d===null?void 0:function(){return c(d())}]},[e,r,n,i]);var a=ige(t,s[0],s[1]);return oge(function(){o.hasValue=!0,o.value=a},[a]),cge(a),a};zj.exports=Wj;var Hj=zj.exports;const $x=t=>typeof t=="object"&&!Array.isArray(t);function lge(t,e,r=e,n=Rc){const i=E.useRef([]),s=Hj.useSyncExternalStoreWithSelector(t,e,r,o=>o,(o,a)=>{if($x(o)&&$x(a)&&i.current.length){for(const c of i.current)if(!n(o[c],a[c]))return!1;return!0}return n(o,a)});if($x(s)){const o={...s};return Object.defineProperties(o,Object.entries(o).reduce((a,[c,l])=>({...a,[c]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(c)||i.current.push(c),l)}}),{})),o}return s}function ln(t={}){const e=St(t);return lge(r=>rye(e,{onChange:r}),()=>wj(e))}function uge(t){return JSON.stringify(t,(e,r)=>fge(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):typeof r=="bigint"?r.toString():r)}function fge(t){if(!o_(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!o_(r)||!r.hasOwnProperty("isPrototypeOf"))}function o_(t){return Object.prototype.toString.call(t)==="[object Object]"}function dge(t){const{_defaulted:e,behavior:r,gcTime:n,initialData:i,initialDataUpdatedAt:s,maxPages:o,meta:a,networkMode:c,queryFn:l,queryHash:u,queryKey:f,queryKeyHashFn:d,retry:h,retryDelay:p,structuralSharing:m,getPreviousPageParam:v,getNextPageParam:y,initialPageParam:g,_optimisticResults:x,enabled:S,notifyOnChangeProps:I,placeholderData:$,refetchInterval:L,refetchIntervalInBackground:N,refetchOnMount:q,refetchOnReconnect:G,refetchOnWindowFocus:Q,retryOnMount:J,select:U,staleTime:b,suspense:A,throwOnError:M,config:B,connector:k,query:R,...F}=t;return F}function hge(t){return{mutationFn(e){return Qve(t,e)},mutationKey:["connect"]}}function pge(t){return{mutationFn(e){return Yve(t,e)},mutationKey:["disconnect"]}}function mge(t,e={}){return{gcTime:0,async queryFn({queryKey:r}){const{connector:n}=e,{connectorUid:i,scopeKey:s,...o}=r[1];return Xve(t,{...o,connector:n})},queryKey:vge(e)}}function vge(t={}){const{connector:e,...r}=t;return["walletClient",{...dge(r),connectorUid:e==null?void 0:e.uid}]}function yge(t){return{mutationFn(e){return tye(t,e)},mutationKey:["switchChain"]}}function gge(t){const e=Bn({...t,queryKeyHashFn:uge});return e.queryKey=t.queryKey,e}function Ib(t={}){const e=St(t);return E.useSyncExternalStore(r=>nye(e,{onChange:r}),()=>KA(e),()=>KA(e))}function bge(t={}){const e=St(t);return E.useSyncExternalStore(r=>ege(e,{onChange:r}),()=>QA(e),()=>QA(e))}function xge(t={}){const e=St(t);return E.useSyncExternalStore(r=>sye(e,{onChange:r}),()=>YA(e),()=>YA(e))}function qj(t={}){const{mutation:e}=t,r=St(t),n=xge({config:r}),i=hge(r),{mutate:s,mutateAsync:o,...a}=r4({...e,...i});return E.useEffect(()=>r.subscribe(({status:c})=>c,(c,l)=>{l==="connected"&&c==="disconnected"&&a.reset()}),[r,a]),{...a,connect:s,connectAsync:o,connectors:n}}function wge(t={}){const e=St(t);return E.useSyncExternalStore(r=>iye(e,{onChange:r}),()=>U6(e),()=>U6(e))}function Vj(t={}){const{mutation:e}=t,r=St(t),n=pge(r),{mutate:i,mutateAsync:s,...o}=r4({...e,...n});return{...o,connectors:wge({config:r}).map(a=>a.connector),disconnect:i,disconnectAsync:s}}function Cge(t={}){const e=St(t);return Hj.useSyncExternalStoreWithSelector(r=>oye(e,{onChange:r}),()=>z6(e,t),()=>z6(e,t),r=>r,(r,n)=>(r==null?void 0:r.uid)===(n==null?void 0:n.uid))}function n4(t={}){const{mutation:e}=t,r=St(t),n=yge(r),{mutate:i,mutateAsync:s,...o}=r4({...e,...n});return{...o,chains:bge({config:r}),switchChain:i,switchChainAsync:s}}function i4(t={}){const{query:e={},...r}=t,n=St(r),i=e4(),{address:s,connector:o,status:a}=ln(),c=Ib(),{queryKey:l,...u}=mge(n,{...t,chainId:t.chainId??c,connector:t.connector??o}),f=!!(a!=="disconnected"&&(e.enabled??!0));return E.useEffect(()=>{s?i.invalidateQueries({queryKey:l}):i.removeQueries({queryKey:l})},[s,i]),gge({...e,...u,queryKey:l,enabled:f,staleTime:1/0})}s4.type="coinbaseWallet";function s4(t){let r,n;return i=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:s4.type,async connect({chainId:s}={}){try{const o=await this.getProvider(),a=(await o.request({method:"eth_requestAccounts"})).map(l=>Qn(l));o.on("accountsChanged",this.onAccountsChanged),o.on("chainChanged",this.onChainChanged),o.on("disconnect",this.onDisconnect.bind(this));let c=await this.getChainId();if(s&&c!==s){const l=await this.switchChain({chainId:s}).catch(u=>{if(u.code===At.code)throw u;return{id:c}});c=(l==null?void 0:l.id)??c}return{accounts:a,chainId:c}}catch(o){throw/(user closed modal|accounts received is empty|user denied account)/i.test(o.message)?new At(o):o}},async disconnect(){const s=await this.getProvider();s.removeListener("accountsChanged",this.onAccountsChanged),s.removeListener("chainChanged",this.onChainChanged),s.removeListener("disconnect",this.onDisconnect.bind(this)),s.disconnect(),s.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(o=>Qn(o))},async getChainId(){const o=await(await this.getProvider()).request({method:"eth_chainId"});return vc(o)},async getProvider(){var s;if(!n){const{default:o}=await zE(()=>import("./index-CGiSbdNl.js").then(d=>d.i),__vite__mapDeps([0,1]),import.meta.url);let a;typeof o!="function"&&typeof o.default=="function"?a=o.default:a=o,r=new a({reloadOnDisconnect:!1,...t});const c=(s=r.walletExtension)==null?void 0:s.getChainId(),l=i.chains.find(d=>t.chainId?d.id===t.chainId:d.id===c)||i.chains[0],u=t.chainId||(l==null?void 0:l.id),f=t.jsonRpcUrl||(l==null?void 0:l.rpcUrls.default.http[0]);n=r.makeWeb3Provider(f,u)}return n},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({chainId:s}){var l,u;const o=i.chains.find(f=>f.id===s);if(!o)throw new Vi(new Xl);const a=await this.getProvider(),c=Re(o.id);try{return await a.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]}),o}catch(f){if(f.code===4902)try{return await a.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:o.name,nativeCurrency:o.nativeCurrency,rpcUrls:[((l=o.rpcUrls.default)==null?void 0:l.http[0])??""],blockExplorerUrls:[(u=o.blockExplorers)==null?void 0:u.default.url]}]}),o}catch(d){throw new At(d)}throw new Vi(f)}},onAccountsChanged(s){s.length===0?i.emitter.emit("disconnect"):i.emitter.emit("change",{accounts:s.map(o=>Qn(o))})},onChainChanged(s){const o=vc(s);i.emitter.emit("change",{chainId:o})},async onDisconnect(s){i.emitter.emit("disconnect");const o=await this.getProvider();o.removeListener("accountsChanged",this.onAccountsChanged),o.removeListener("chainChanged",this.onChainChanged),o.removeListener("disconnect",this.onDisconnect.bind(this))}})}o4.type="walletConnect";function o4(t){const e=t.isNewChainsStale??!0;let r,n;const i="eip155";return s=>({id:"walletConnect",name:"WalletConnect",type:o4.type,async setup(){const o=await this.getProvider().catch(()=>null);o&&(o.on("connect",this.onConnect.bind(this)),o.on("session_delete",this.onSessionDelete.bind(this)))},async connect({chainId:o,...a}={}){var c,l;try{const u=await this.getProvider();if(!u)throw new dl;u.on("display_uri",this.onDisplayUri);let f=o;if(!f){const m=await((c=s.storage)==null?void 0:c.getItem("state"))??{};s.chains.some(y=>y.id===m.chainId)?f=m.chainId:f=(l=s.chains[0])==null?void 0:l.id}if(!f)throw new Error("No chains found on connector.");const d=await this.isChainsStale();if(u.session&&d&&await u.disconnect(),!u.session||d){const m=s.chains.filter(v=>v.id!==f).map(v=>v.id);await u.connect({optionalChains:[f,...m],..."pairingTopic"in a?{pairingTopic:a.pairingTopic}:{}}),this.setRequestedChainsIds(s.chains.map(v=>v.id))}const h=(await u.enable()).map(m=>Qn(m)),p=await this.getChainId();return u.removeListener("display_uri",this.onDisplayUri),u.removeListener("connect",this.onConnect.bind(this)),u.on("accountsChanged",this.onAccountsChanged.bind(this)),u.on("chainChanged",this.onChainChanged),u.on("disconnect",this.onDisconnect.bind(this)),u.on("session_delete",this.onSessionDelete.bind(this)),{accounts:h,chainId:p}}catch(u){throw/(user rejected|connection request reset)/i.test(u==null?void 0:u.message)?new At(u):u}},async disconnect(){const o=await this.getProvider();try{await(o==null?void 0:o.disconnect())}catch(a){if(!/No matching key/i.test(a.message))throw a}finally{o==null||o.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),o==null||o.removeListener("chainChanged",this.onChainChanged),o==null||o.removeListener("disconnect",this.onDisconnect.bind(this)),o==null||o.removeListener("session_delete",this.onSessionDelete.bind(this)),o==null||o.on("connect",this.onConnect.bind(this)),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(a=>Qn(a))},async getProvider({chainId:o}={}){var c;async function a(){const l=s.chains.map(f=>f.id);if(!l.length)return;const{EthereumProvider:u}=await zE(()=>import("./index.es-DU7_NjVk.js"),__vite__mapDeps([2,1]),import.meta.url);return await u.init({...t,disableProviderPing:!0,optionalChains:l,projectId:t.projectId,rpcMap:Object.fromEntries(s.chains.map(f=>[f.id,f.rpcUrls.default.http[0]])),showQrModal:t.showQrModal??!0})}return r||(n||(n=a()),r=await n,r==null||r.events.setMaxListeners(1/0)),o&&await((c=this.switchChain)==null?void 0:c.call(this,{chainId:o})),r},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[o,a]=await Promise.all([this.getAccounts(),this.getProvider()]);return o.length?await this.isChainsStale()&&a.session?(await a.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({chainId:o}){var c;const a=s.chains.find(l=>l.id===o);if(!a)throw new Vi(new Xl);try{const l=await this.getProvider(),u=this.getNamespaceChainsIds(),f=this.getNamespaceMethods();if(!u.includes(o)&&f.includes("wallet_addEthereumChain")){await l.request({method:"wallet_addEthereumChain",params:[{chainId:Re(a.id),blockExplorerUrls:[(c=a.blockExplorers)==null?void 0:c.default.url],chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[...a.rpcUrls.default.http]}]});const h=await this.getRequestedChainsIds();this.setRequestedChainsIds([...h,o])}return await l.request({method:"wallet_switchEthereumChain",params:[{chainId:Re(o)}]}),a}catch(l){const u=typeof l=="string"?l:l==null?void 0:l.message;throw/user rejected request/i.test(u)?new At(l):new Vi(l)}},onAccountsChanged(o){o.length===0?this.onDisconnect():s.emitter.emit("change",{accounts:o.map(a=>Qn(a))})},onChainChanged(o){const a=vc(o);s.emitter.emit("change",{chainId:a})},async onConnect(o){const a=vc(o.chainId),c=await this.getAccounts();s.emitter.emit("connect",{accounts:c,chainId:a})},async onDisconnect(o){this.setRequestedChainsIds([]),s.emitter.emit("disconnect");const a=await this.getProvider();a.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),a.removeListener("chainChanged",this.onChainChanged),a.removeListener("disconnect",this.onDisconnect.bind(this)),a.removeListener("session_delete",this.onSessionDelete.bind(this)),a.on("connect",this.onConnect.bind(this))},onDisplayUri(o){s.emitter.emit("message",{type:"display_uri",data:o})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var a,c,l;return r?((l=(c=(a=r.session)==null?void 0:a.namespaces[i])==null?void 0:c.chains)==null?void 0:l.map(u=>parseInt(u.split(":")[1]||"")))??[]:[]},getNamespaceMethods(){var a,c;return r?((c=(a=r.session)==null?void 0:a.namespaces[i])==null?void 0:c.methods)??[]:[]},async getRequestedChainsIds(){var o;return await((o=s.storage)==null?void 0:o.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(this.getNamespaceMethods().includes("wallet_addEthereumChain")||!e)return!1;const a=s.chains.map(u=>u.id),c=this.getNamespaceChainsIds();if(c.length&&!c.some(u=>a.includes(u)))return!1;const l=await this.getRequestedChainsIds();return!a.every(u=>l.includes(u))},async setRequestedChainsIds(o){var a;await((a=s.storage)==null?void 0:a.setItem(this.requestedChainsStorageKey,o))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}function De(){return De=Object.assign?Object.assign.bind():function(t){for(var e=1;e0){const f=c[0];`${a[0].toUpperCase()}${a.slice(1)}`,a=f}return f=>({id:"sequence",name:"Sequence",type:Gc.type,async setup(){const d=await this.getProvider();d.on("chainChanged",h=>{f.emitter.emit("change",{chain:{id:Wu(h),unsupported:!1}})}),d.on("accountsChanged",h=>{f.emitter.emit("accountsChanged",this.onAccountsChanged(h))}),d.on("disconnect",()=>{this.onDisconnect()})},async connect(){const d=await this.getProvider();if(!d.isConnected()){var h,p;const v=localStorage.getItem(rn.Theme),y=localStorage.getItem(rn.EthAuthSettings),g=y?JSON.parse(y):{},x=De({authorize:!0},g,s,{settings:De({theme:v||"dark"},s==null?void 0:s.settings)}),S=await d.connect(x);if(S.error)throw new At(new Error(S.error));if(!S.connected)throw new At(new Error("Wallet connection rejected"));const I=(h=S.proof)==null?void 0:h.proofString,$=(p=S.proof)==null?void 0:p.typedData;if(I){const L=JSON.stringify({proofString:I,typedData:$});localStorage.setItem(rn.EthAuthProof,L)}}return{accounts:[...await this.getAccounts()],chainId:d.getChainId()}},async disconnect(){(await this.getProvider()).disconnect()},async getAccounts(){const d=await this.getProvider();return[Qn(await d.getSigner().getAddress())]},async getProvider(){try{return Yf.getWallet()}catch{const h=localStorage.getItem(rn.ProjectAccessKey);if(!h)throw"projectAccessKey not found";const p=Yf.initWallet(h,{defaultNetwork:i,transports:{walletAppURL:o||"https://sequence.app"},defaultEIP6492:!0,analytics:!1}),m=await p.getChainId();return f.emitter.emit("change",{chainId:Wu(m)}),p}},async isAuthorized(){try{return!!await this.getAccounts()}catch{return!1}},async switchChain({chainId:d}){const h=await this.getProvider(),p=f.chains.find(m=>m.id===d)||f.chains[0];return h.setDefaultChainId(Wu(d)),f.emitter.emit("change",{chainId:d}),p},async getChainId(){return(await this.getProvider()).getChainId()},async onAccountsChanged(d){return{account:d[0]}},async onChainChanged(d){const h=await this.getProvider();f.emitter.emit("change",{chainId:Wu(d)}),h.setDefaultChainId(Wu(d))},async onConnect(d){},async onDisconnect(){localStorage.removeItem(rn.EthAuthProof),f.emitter.emit("disconnect")}})}function Wu(t){return typeof t=="object"?Wu(t.chainId):typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t}function Ji(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const a_=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=De({},(Ji(n),n));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 29 34",fill:"none"},i),w.createElement("path",{d:"M27.702 11.5918C27.5049 11.7448 24.0243 13.7068 24.0243 18.0694C24.0243 23.1155 28.4532 24.9007 28.5858 24.9449C28.5654 25.0537 27.8822 27.3897 26.2506 29.77C24.7958 31.8646 23.2765 33.9558 20.9651 33.9558C18.6538 33.9558 18.0589 32.6127 15.3907 32.6127C12.7904 32.6127 11.8659 34 9.75169 34C7.63748 34 6.1623 32.0618 4.46618 29.6816C2.50154 26.8865 0.914185 22.5443 0.914185 18.423C0.914185 11.8128 5.21057 8.30703 9.43897 8.30703C11.6857 8.30703 13.5586 9.78278 14.9692 9.78278C16.3118 9.78278 18.4056 8.21862 20.9617 8.21862C21.9304 8.21862 25.4111 8.30703 27.702 11.5918ZM19.7483 5.42014C20.8054 4.16542 21.5532 2.42444 21.5532 0.683468C21.5532 0.442044 21.5328 0.19722 21.4886 0C19.7687 0.0646065 17.7224 1.14591 16.4886 2.57746C15.5199 3.67917 14.6157 5.42014 14.6157 7.18492C14.6157 7.45014 14.6599 7.71537 14.6803 7.80038C14.7891 7.82078 14.9658 7.84458 15.1426 7.84458C16.6857 7.84458 18.6266 6.81088 19.7483 5.42014Z",fill:e})))}},c_=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=De({},(Ji(n),n));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),w.createElement("path",{d:"M27.166 20.8774C27.1338 17.335 30.0617 15.633 30.1936 15.5493C28.5463 13.1395 25.9852 12.8113 25.0714 12.7727C22.8932 12.5507 20.8179 14.0565 19.7111 14.0565C18.6043 14.0565 16.8991 12.8049 15.0909 12.8403C12.7131 12.8757 10.5221 14.2205 9.2962 16.3505C6.8284 20.6297 8.66557 26.9777 11.0722 30.4557C12.2498 32.1545 13.6494 34.0689 15.493 33.9981C17.2691 33.9273 17.9383 32.8495 20.0811 32.8495C22.224 32.8495 22.8289 33.9981 24.7014 33.9627C26.6094 33.9241 27.8191 32.2253 28.9871 30.5201C30.3352 28.5478 30.8918 26.6366 30.924 26.5369C30.8822 26.5208 27.2046 25.1116 27.166 20.8774Z",fill:e}),w.createElement("path",{d:"M23.6429 10.4722C24.621 9.28822 25.2806 7.64089 25.1004 6C23.6911 6.05791 21.9859 6.93949 20.9756 8.12351C20.0715 9.16917 19.2768 10.8455 19.4923 12.4542C21.0592 12.5764 22.6648 11.653 23.6429 10.4722Z",fill:e})))}},Ege=t=>({id:"apple",isSequenceBased:!0,logoDark:a_({isDarkMode:!0}),logoLight:a_({isDarkMode:!1}),monochromeLogoDark:c_({isDarkMode:!0}),monochromeLogoLight:c_({isDarkMode:!1}),name:"Apple",createConnector:()=>{var e;return Gc(De({},t,{connect:De({},t==null?void 0:t.connect,{settings:De({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"apple"})})}))}}),l_=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),w.createElement("rect",{width:"28",height:"28",fill:"#2C5FF6"}),w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 23.8C19.4124 23.8 23.8 19.4124 23.8 14C23.8 8.58761 19.4124 4.2 14 4.2C8.58761 4.2 4.2 8.58761 4.2 14C4.2 19.4124 8.58761 23.8 14 23.8ZM11.55 10.8C11.1358 10.8 10.8 11.1358 10.8 11.55V16.45C10.8 16.8642 11.1358 17.2 11.55 17.2H16.45C16.8642 17.2 17.2 16.8642 17.2 16.45V11.55C17.2 11.1358 16.8642 10.8 16.45 10.8H11.55Z",fill:"white"})))},Sge=t=>({id:"coinbase-wallet",logoDark:l_,logoLight:l_,name:"Coinbase Wallet",createConnector:()=>s4(De({},t))}),u_=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=De({},(Ji(n),n));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35 34",fill:"none"},i),w.createElement("path",{d:"M17.0826 16.3805C17.1802 16.4598 17.32 16.4598 17.4176 16.3805L30.1401 6.04341C30.5283 5.72801 30.3053 5.09985 29.8051 5.09985H4.69499C4.19482 5.09985 3.9718 5.72801 4.35998 6.04341L17.0826 16.3805Z",fill:e}),w.createElement("path",{d:"M19.7626 19.2667L33.3838 8.19943C33.731 7.91735 34.2501 8.16441 34.2501 8.61174V24.2249C34.2501 26.5721 32.3473 28.4749 30.0001 28.4749H4.50006C2.15285 28.4749 0.250061 26.5721 0.250061 24.2249V8.61174C0.250061 8.16441 0.769134 7.91735 1.11631 8.19943L14.7375 19.2667C16.2014 20.4561 18.2987 20.4561 19.7626 19.2667Z",fill:e})))}},Q6="@sequence.kit.connector.email",kge=t=>({id:"email",isSequenceBased:!0,logoDark:u_({isDarkMode:!0}),logoLight:u_({isDarkMode:!1}),name:"Email",createConnector:()=>{var e;const r=localStorage.getItem(Q6);return Gc(De({},t,{connect:De({},t==null?void 0:t.connect,{settings:De({},t==null||(e=t.connect)==null?void 0:e.settings,{signInOptions:["email"],signInWithEmail:r||""})})}))}}),f_=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},e),w.createElement("path",{d:"M17.4214 36.9716C9.27855 35.5145 3.10712 28.4859 3.10712 20.0001C3.10712 10.5715 10.8214 2.85718 20.25 2.85718C29.6785 2.85718 37.3928 10.5715 37.3928 20.0001C37.3928 28.4859 31.2214 35.5145 23.0785 36.9716L22.1357 36.2002H18.3643L17.4214 36.9716Z",fill:"url(#paint0_linear_193_14528)"}),w.createElement("path",{d:"M26.9357 24.7999L27.7072 19.9999H23.1643V16.657C23.1643 15.2856 23.6786 14.257 25.7357 14.257H27.9643V9.88558C26.7643 9.71415 25.3929 9.54272 24.1929 9.54272C20.25 9.54272 17.5071 11.9427 17.5071 16.2285V19.9999H13.2214V24.7999H17.5071V36.8857C18.45 37.0571 19.3929 37.1429 20.3357 37.1429C21.2786 37.1429 22.2214 37.0571 23.1643 36.8857V24.7999H26.9357Z",fill:"white"}),w.createElement("defs",null,w.createElement("linearGradient",{id:"paint0_linear_193_14528",x1:"20.2508",y1:"35.9507",x2:"20.2508",y2:"2.85086",gradientUnits:"userSpaceOnUse"},w.createElement("stop",{"stop-color":"#0062E0"}),w.createElement("stop",{offset:"1","stop-color":"#19AFFF"})))))},d_=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=De({},(Ji(n),n));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),w.createElement("path",{d:"M25.8582 10.4398C24.1222 10.4398 23.6288 11.2098 23.6288 12.9073V15.709H28.246L27.791 20.2476H23.6279V34H18.1024V20.2468H14.375V15.7081H18.1042V12.9851C18.1042 8.40625 19.9399 6 25.0891 6C26.1942 6 27.5163 6.0875 28.3055 6.19775V10.459",fill:e})))}},Age=t=>({id:"facebook",isSequenceBased:!0,logoDark:f_,logoLight:f_,monochromeLogoDark:d_({isDarkMode:!0}),monochromeLogoLight:d_({isDarkMode:!1}),name:"Facebook",createConnector:()=>{var e;return Gc(De({},t,{connect:De({},t==null?void 0:t.connect,{settings:De({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"facebook"})})}))}}),h_=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({viewBox:"0 0 41 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),w.createElement("g",{id:"Frame 2114"},w.createElement("g",{id:"Group"},w.createElement("path",{id:"Vector",d:"M20.7497 16.8828V23.5218H29.9756C29.5705 25.6568 28.3548 27.4647 26.5314 28.6803L32.095 32.9972C35.3366 30.0051 37.2068 25.6102 37.2068 20.3895C37.2068 19.1739 37.0977 18.005 36.895 16.883L20.7497 16.8828Z",fill:"#4285F4"}),w.createElement("path",{id:"Vector_2",d:"M11.1424 23.2627L9.88756 24.2232L5.44592 27.6829C8.2667 33.2777 14.0481 37.1427 20.7493 37.1427C25.3778 37.1427 29.2583 35.6154 32.0947 32.9973L26.5311 28.6803C25.0038 29.7089 23.0557 30.3324 20.7493 30.3324C16.2922 30.3324 12.5053 27.3246 11.1494 23.2726L11.1424 23.2627Z",fill:"#34A853"}),w.createElement("path",{id:"Vector_3",d:"M5.44594 12.3169C4.27718 14.6233 3.60712 17.2259 3.60712 19.9999C3.60712 22.7739 4.27718 25.3765 5.44594 27.6829C5.44594 27.6984 11.1499 23.2569 11.1499 23.2569C10.8071 22.2284 10.6044 21.1375 10.6044 19.9997C10.6044 18.8619 10.8071 17.7711 11.1499 16.7425L5.44594 12.3169Z",fill:"#FBBC05"}),w.createElement("path",{id:"Vector_4",d:"M20.7497 9.6829C23.2744 9.6829 25.5185 10.5556 27.3107 12.2387L32.2198 7.32972C29.2431 4.55574 25.3783 2.85693 20.7497 2.85693C14.0484 2.85693 8.2667 6.70628 5.44592 12.3167L11.1497 16.7427C12.5055 12.6907 16.2926 9.6829 20.7497 9.6829Z",fill:"#EA4335"})))))},p_=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=De({},(Ji(n),n));return w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.8355 14.7613C24.5584 13.5329 22.9441 12.9032 21.1356 12.9032C17.9377 12.9032 15.2302 15.0813 14.2595 18.0232L14.2593 18.023C14.0142 18.7662 13.8712 19.5609 13.8712 20.3866C13.8712 21.2124 14.004 22.0072 14.2594 22.7504L14.2587 22.751H14.2595C15.2302 25.6929 17.9377 27.871 21.1356 27.871C22.7907 27.871 24.1904 27.4168 25.2939 26.6736V26.6732C26.5812 25.7958 27.4497 24.5055 27.746 22.9777H21.1355V18.3223H32.6808C32.8034 19.0758 32.875 19.85 32.875 20.6655C32.875 24.4332 31.5467 27.6126 29.2377 29.77L29.2378 29.7703C27.2148 31.6594 24.446 32.7742 21.1356 32.7742C16.3438 32.7742 12.2059 29.9871 10.1931 25.9407V25.94L10.193 25.9401C9.35521 24.2678 8.875 22.3891 8.875 20.3866C8.875 18.384 9.35521 16.5053 10.193 14.833H10.1934C12.2063 10.7869 16.344 8 21.1356 8C24.446 8 27.2148 9.22839 29.3298 11.231L25.8355 14.7613Z",fill:e}))}},_ge=t=>({id:"google",isSequenceBased:!0,logoDark:h_,logoLight:h_,monochromeLogoDark:p_({isDarkMode:!0}),monochromeLogoLight:p_({isDarkMode:!1}),name:"Google",createConnector:()=>{var e;return Gc(De({},t,{connect:De({},t==null?void 0:t.connect,{settings:De({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"google"})})}))}}),m_=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),w.createElement("rect",{width:"28",height:"28"}),w.createElement("path",{d:"M24.0891 3.1199L15.3446 9.61456L16.9617 5.7828L24.0891 3.1199Z",fill:"#E2761B",stroke:"#E2761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M3.90207 3.1199L12.5763 9.67608L11.0383 5.7828L3.90207 3.1199Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M20.9429 18.1745L18.6139 21.7426L23.597 23.1136L25.0295 18.2536L20.9429 18.1745Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M2.97929 18.2536L4.40301 23.1136L9.38607 21.7426L7.05713 18.1745L2.97929 18.2536Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.10483 12.1456L7.71626 14.2461L12.6642 14.4658L12.4884 9.14877L9.10483 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M18.8864 12.1456L15.4589 9.08725L15.3446 14.4658L20.2837 14.2461L18.8864 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.38606 21.7426L12.3566 20.2925L9.79033 18.2888L9.38606 21.7426Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.6347 20.2925L18.6139 21.7426L18.2009 18.2888L15.6347 20.2925Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M18.6139 21.7426L15.6347 20.2925L15.8719 22.2348L15.8456 23.0521L18.6139 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.38606 21.7426L12.1544 23.0521L12.1368 22.2348L12.3566 20.2925L9.38606 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M12.1984 17.0056L9.72002 16.2762L11.4689 15.4765L12.1984 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.7928 17.0056L16.5223 15.4765L18.28 16.2762L15.7928 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.38606 21.7426L9.80791 18.1745L7.05712 18.2536L9.38606 21.7426Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M18.1921 18.1745L18.6139 21.7426L20.9429 18.2536L18.1921 18.1745Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M20.2837 14.2461L15.3446 14.4658L15.8016 17.0057L16.5311 15.4765L18.2888 16.2762L20.2837 14.2461Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.72002 16.2762L11.4777 15.4765L12.1984 17.0057L12.6642 14.4658L7.71626 14.2461L9.72002 16.2762Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M7.71626 14.2461L9.79033 18.2888L9.72002 16.2762L7.71626 14.2461Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M18.2888 16.2762L18.2009 18.2888L20.2837 14.2461L18.2888 16.2762Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M12.6642 14.4658L12.1984 17.0057L12.7784 20.0025L12.9102 16.0565L12.6642 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.3446 14.4658L15.1073 16.0477L15.2128 20.0025L15.8016 17.0057L15.3446 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.8016 17.0056L15.2128 20.0025L15.6347 20.2925L18.2009 18.2888L18.2888 16.2762L15.8016 17.0056Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.72002 16.2762L9.79033 18.2888L12.3566 20.2925L12.7784 20.0025L12.1984 17.0056L9.72002 16.2762Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.8456 23.0521L15.8719 22.2348L15.6522 22.0414H12.339L12.1368 22.2348L12.1544 23.0521L9.38606 21.7426L10.3528 22.5336L12.3126 23.8958H15.6786L17.6472 22.5336L18.6139 21.7426L15.8456 23.0521Z",fill:"#C0AD9E",stroke:"#C0AD9E",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.6347 20.2925L15.2128 20.0025H12.7784L12.3566 20.2925L12.1368 22.2348L12.339 22.0414H15.6522L15.8719 22.2348L15.6347 20.2925Z",fill:"#161616",stroke:"#161616",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M24.4583 10.0364L25.2053 6.45072L24.0891 3.1199L15.6347 9.39485L18.8864 12.1456L23.4827 13.4903L24.5022 12.3038L24.0628 11.9874L24.7658 11.3459L24.221 10.924L24.924 10.3879L24.4583 10.0364Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M2.79472 6.45072L3.54174 10.0364L3.06717 10.3879L3.77024 10.924L3.23415 11.3459L3.93722 11.9874L3.4978 12.3038L4.50847 13.4903L9.10483 12.1456L12.3566 9.39485L3.90207 3.1199L2.79472 6.45072Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M23.4827 13.4903L18.8864 12.1456L20.2837 14.2461L18.2009 18.2888L20.9429 18.2536H25.0295L23.4827 13.4903Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.10484 12.1456L4.50848 13.4903L2.97929 18.2536H7.05713L9.79033 18.2888L7.71626 14.2461L9.10484 12.1456Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.3446 14.4658L15.6347 9.39485L16.9705 5.7828H11.0383L12.3566 9.39485L12.6642 14.4658L12.7696 16.0653L12.7784 20.0025H15.2128L15.2304 16.0653L15.3446 14.4658Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"})))},Ty=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),w.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},w.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},w.createElement("path",{style:{fill:"#111111"},id:"path1232",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),w.createElement("path",{style:{fill:"url(#paint0_linear_5_13"},id:"path1234",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),w.createElement("path",{style:{fill:"url(#paint1_linear_5_131"},id:"path1236",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),w.createElement("path",{style:{fill:"url(#paint2_linear_5_131)"},id:"path1238",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),w.createElement("path",{style:{fill:"url(#paint3_linear_5_131)"},id:"path1240",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),w.createElement("path",{style:{fill:"url(#paint4_linear_5_131)"},id:"path1242",d:"m 98.9999,238.126 c 0,-10.965 -8.8648,-19.854 -19.8,-19.854 -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.966 8.8648,19.855 19.8,19.855 10.9352,0 19.8,-8.889 19.8,-19.855 z"}),w.createElement("path",{style:{fill:"url(#paint5_linear_5_131)"},id:"path1244",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),w.createElement("path",{style:{fill:"url(#paint6_linear_5_131)"},id:"path1246",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),w.createElement("path",{style:{fill:"url(#paint7_linear_5_131)"},id:"path1248",d:"M 316.8,59.5632 H 158.4 c -10.935,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.865,19.8544 19.8,19.8544 h 158.4 c 10.935,0 19.8,-8.8892 19.8,-19.8544 0,-10.9653 -8.865,-19.8544 -19.8,-19.8544 z"}),w.createElement("path",{style:{fill:"url(#paint8_linear_5_131)"},id:"path1250",d:"M 316.8,218.272 H 158.4 c -10.935,0 -19.8,8.889 -19.8,19.854 0,10.966 8.865,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.889 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}),w.createElement("path",{style:{fill:"url(#paint9_linear_5_131)"},id:"path1252",d:"M 237.6,138.981 H 79.2 c -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.965 8.8648,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.89 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}))),w.createElement("defs",{id:"defs1314"},w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},w.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),w.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},w.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),w.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},w.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),w.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},w.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),w.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},w.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),w.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},w.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),w.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},w.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),w.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},w.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),w.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},w.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),w.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},w.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),w.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),w.createElement("clipPath",{id:"clip0_5_131"},w.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),w.createElement("clipPath",{id:"clip1_5_131"},w.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))};window.ethereum=window.ethereum||{};const Pge=()=>({id:"metamask",logoDark:m_,logoLight:m_,name:"Metamask",createConnector:()=>Ab()}),Ige=t=>({id:"mock",isSequenceBased:!0,logoDark:Ty,logoLight:Ty,name:"Mock",createConnector:()=>QE(t)}),Tge=t=>({id:"sequence",isSequenceBased:!0,logoDark:Ty,logoLight:Ty,name:"Sequence",createConnector:()=>Gc(De({},t))}),Xp=({isDarkMode:t})=>{let e;return t===void 0?e="#9146FF":e=t?"white":"black",n=>(De({},(Ji(n),n)),w.createElement(w.Fragment,null,w.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 2400 2800",transform:"scale(0.80)"},w.createElement("g",null,w.createElement("g",{id:"Layer_1-2"},w.createElement("path",{fill:e,d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600 V1300z"}),w.createElement("rect",{x:"1700",y:"550",fill:e,width:"200",height:"600"}),w.createElement("rect",{x:"1150",y:"550",fill:e,width:"200",height:"600"}))))))},Oge=t=>({id:"twitch",isSequenceBased:!0,logoDark:Xp({}),logoLight:Xp({}),monochromeLogoDark:Xp({isDarkMode:!0}),monochromeLogoLight:Xp({isDarkMode:!1}),name:"Twitch",createConnector:()=>{var e;return Gc(De({},t,{connect:De({},t==null?void 0:t.connect,{settings:De({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"twitch"})})}))}}),v_=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({fill:"none",viewBox:"0 0 480 332",xmlns:"http://www.w3.org/2000/svg"},e),w.createElement("path",{d:"m126.613 93.9842c62.622-61.3123 164.152-61.3123 226.775 0l7.536 7.3788c3.131 3.066 3.131 8.036 0 11.102l-25.781 25.242c-1.566 1.533-4.104 1.533-5.67 0l-10.371-10.154c-43.687-42.7734-114.517-42.7734-158.204 0l-11.107 10.874c-1.565 1.533-4.103 1.533-5.669 0l-25.781-25.242c-3.132-3.066-3.132-8.036 0-11.102zm280.093 52.2038 22.946 22.465c3.131 3.066 3.131 8.036 0 11.102l-103.463 101.301c-3.131 3.065-8.208 3.065-11.339 0l-73.432-71.896c-.783-.767-2.052-.767-2.835 0l-73.43 71.896c-3.131 3.065-8.208 3.065-11.339 0l-103.4657-101.302c-3.1311-3.066-3.1311-8.036 0-11.102l22.9456-22.466c3.1311-3.065 8.2077-3.065 11.3388 0l73.4333 71.897c.782.767 2.051.767 2.834 0l73.429-71.897c3.131-3.065 8.208-3.065 11.339 0l73.433 71.897c.783.767 2.052.767 2.835 0l73.431-71.895c3.132-3.066 8.208-3.066 11.339 0z",fill:"#3396ff"})))},Rge=t=>({id:"wallet-connect",logoDark:v_,logoLight:v_,name:"Walletconnect",createConnector:()=>o4(De({},t))}),$ge=({walletConnectProjectId:t,defaultChainId:e,projectAccessKey:r,appName:n})=>fU(r,[Sge({appName:n}),kge({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),_ge({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),Age({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),Oge({defaultNetwork:e,connect:{app:n}}),Ege({defaultNetwork:e,connect:{app:n}}),Pge(),Rge({projectId:t}),Tge({defaultNetwork:e,connect:{app:n,projectAccessKey:r}})]);function a4(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function em(){}function y_(){return typeof WeakMap<"u"?new WeakMap:Mge()}function Mge(){return{add:em,delete:em,get:em,set:em,has:function(t){return!1}}}var Nge=Object.prototype.hasOwnProperty,Y6=function(t,e){return Nge.call(t,e)};function Mx(t,e){for(var r in e)Y6(e,r)&&(t[r]=e[r]);return t}var Dge=/^[ \t]*(?:\r\n|\r|\n)/,Lge=/(?:\r\n|\r|\n)[ \t]*$/,Bge=/^(?:[\r\n]|$)/,Fge=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,jge=/^[ \t]*[\r\n][ \t\r\n]*$/;function g_(t,e,r){var n=0,i=t[0].match(Fge);i&&(n=i[1].length);var s="(\\r\\n|\\r|\\n).{0,"+n+"}",o=new RegExp(s,"g");e&&(t=t.slice(1));var a=r.newline,c=r.trimLeadingNewline,l=r.trimTrailingNewline,u=typeof a=="string",f=t.length,d=t.map(function(h,p){return h=h.replace(o,"$1"),p===0&&c&&(h=h.replace(Dge,"")),p===f-1&&l&&(h=h.replace(Lge,"")),u&&(h=h.replace(/\r\n|\n|\r/g,function(m){return a})),h});return d}function Uge(t,e){for(var r="",n=0,i=t.length;n{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>"short"},Km=[Wge],vu=()=>{if(Km.length<1)throw new Error("No adapter configured");return Km[Km.length-1]},Kj=!1,Hge=t=>{Kj||qge(t)},qge=t=>{if(!t)throw new Error('No adapter provided when calling "setAdapter"');Kj=!0,Km.push(t)},Tb=function(){return vu().appendCss(...arguments)},Qj=function(){return vu().registerClassName(...arguments)},Vge=function(){return vu().registerComposition(...arguments)},Yj=function(){return vu().markCompositionUsed(...arguments)},Gge=function(){for(var e,r,n=arguments.length,i=new Array(n),s=0;stypeof t=="object"&&!Array.isArray(t);function lge(t,e,r=e,n=Rc){const i=E.useRef([]),s=Hj.useSyncExternalStoreWithSelector(t,e,r,o=>o,(o,a)=>{if($x(o)&&$x(a)&&i.current.length){for(const c of i.current)if(!n(o[c],a[c]))return!1;return!0}return n(o,a)});if($x(s)){const o={...s};return Object.defineProperties(o,Object.entries(o).reduce((a,[c,l])=>({...a,[c]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(c)||i.current.push(c),l)}}),{})),o}return s}function ln(t={}){const e=St(t);return lge(r=>rye(e,{onChange:r}),()=>wj(e))}function uge(t){return JSON.stringify(t,(e,r)=>fge(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):typeof r=="bigint"?r.toString():r)}function fge(t){if(!o_(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!o_(r)||!r.hasOwnProperty("isPrototypeOf"))}function o_(t){return Object.prototype.toString.call(t)==="[object Object]"}function dge(t){const{_defaulted:e,behavior:r,gcTime:n,initialData:i,initialDataUpdatedAt:s,maxPages:o,meta:a,networkMode:c,queryFn:l,queryHash:u,queryKey:f,queryKeyHashFn:d,retry:h,retryDelay:p,structuralSharing:m,getPreviousPageParam:v,getNextPageParam:y,initialPageParam:g,_optimisticResults:x,enabled:S,notifyOnChangeProps:I,placeholderData:$,refetchInterval:L,refetchIntervalInBackground:N,refetchOnMount:q,refetchOnReconnect:G,refetchOnWindowFocus:Q,retryOnMount:J,select:U,staleTime:b,suspense:A,throwOnError:M,config:B,connector:k,query:R,...F}=t;return F}function hge(t){return{mutationFn(e){return Qve(t,e)},mutationKey:["connect"]}}function pge(t){return{mutationFn(e){return Yve(t,e)},mutationKey:["disconnect"]}}function mge(t,e={}){return{gcTime:0,async queryFn({queryKey:r}){const{connector:n}=e,{connectorUid:i,scopeKey:s,...o}=r[1];return Xve(t,{...o,connector:n})},queryKey:vge(e)}}function vge(t={}){const{connector:e,...r}=t;return["walletClient",{...dge(r),connectorUid:e==null?void 0:e.uid}]}function yge(t){return{mutationFn(e){return tye(t,e)},mutationKey:["switchChain"]}}function gge(t){const e=Bn({...t,queryKeyHashFn:uge});return e.queryKey=t.queryKey,e}function Ib(t={}){const e=St(t);return E.useSyncExternalStore(r=>nye(e,{onChange:r}),()=>KA(e),()=>KA(e))}function bge(t={}){const e=St(t);return E.useSyncExternalStore(r=>ege(e,{onChange:r}),()=>QA(e),()=>QA(e))}function xge(t={}){const e=St(t);return E.useSyncExternalStore(r=>sye(e,{onChange:r}),()=>YA(e),()=>YA(e))}function qj(t={}){const{mutation:e}=t,r=St(t),n=xge({config:r}),i=hge(r),{mutate:s,mutateAsync:o,...a}=r4({...e,...i});return E.useEffect(()=>r.subscribe(({status:c})=>c,(c,l)=>{l==="connected"&&c==="disconnected"&&a.reset()}),[r,a]),{...a,connect:s,connectAsync:o,connectors:n}}function wge(t={}){const e=St(t);return E.useSyncExternalStore(r=>iye(e,{onChange:r}),()=>U6(e),()=>U6(e))}function Vj(t={}){const{mutation:e}=t,r=St(t),n=pge(r),{mutate:i,mutateAsync:s,...o}=r4({...e,...n});return{...o,connectors:wge({config:r}).map(a=>a.connector),disconnect:i,disconnectAsync:s}}function Cge(t={}){const e=St(t);return Hj.useSyncExternalStoreWithSelector(r=>oye(e,{onChange:r}),()=>z6(e,t),()=>z6(e,t),r=>r,(r,n)=>(r==null?void 0:r.uid)===(n==null?void 0:n.uid))}function n4(t={}){const{mutation:e}=t,r=St(t),n=yge(r),{mutate:i,mutateAsync:s,...o}=r4({...e,...n});return{...o,chains:bge({config:r}),switchChain:i,switchChainAsync:s}}function i4(t={}){const{query:e={},...r}=t,n=St(r),i=e4(),{address:s,connector:o,status:a}=ln(),c=Ib(),{queryKey:l,...u}=mge(n,{...t,chainId:t.chainId??c,connector:t.connector??o}),f=!!(a!=="disconnected"&&(e.enabled??!0));return E.useEffect(()=>{s?i.invalidateQueries({queryKey:l}):i.removeQueries({queryKey:l})},[s,i]),gge({...e,...u,queryKey:l,enabled:f,staleTime:1/0})}s4.type="coinbaseWallet";function s4(t){let r,n;return i=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:s4.type,async connect({chainId:s}={}){try{const o=await this.getProvider(),a=(await o.request({method:"eth_requestAccounts"})).map(l=>Qn(l));o.on("accountsChanged",this.onAccountsChanged),o.on("chainChanged",this.onChainChanged),o.on("disconnect",this.onDisconnect.bind(this));let c=await this.getChainId();if(s&&c!==s){const l=await this.switchChain({chainId:s}).catch(u=>{if(u.code===At.code)throw u;return{id:c}});c=(l==null?void 0:l.id)??c}return{accounts:a,chainId:c}}catch(o){throw/(user closed modal|accounts received is empty|user denied account)/i.test(o.message)?new At(o):o}},async disconnect(){const s=await this.getProvider();s.removeListener("accountsChanged",this.onAccountsChanged),s.removeListener("chainChanged",this.onChainChanged),s.removeListener("disconnect",this.onDisconnect.bind(this)),s.disconnect(),s.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(o=>Qn(o))},async getChainId(){const o=await(await this.getProvider()).request({method:"eth_chainId"});return vc(o)},async getProvider(){var s;if(!n){const{default:o}=await zE(()=>import("./index-Bfd5Ckkn.js").then(d=>d.i),__vite__mapDeps([0,1]),import.meta.url);let a;typeof o!="function"&&typeof o.default=="function"?a=o.default:a=o,r=new a({reloadOnDisconnect:!1,...t});const c=(s=r.walletExtension)==null?void 0:s.getChainId(),l=i.chains.find(d=>t.chainId?d.id===t.chainId:d.id===c)||i.chains[0],u=t.chainId||(l==null?void 0:l.id),f=t.jsonRpcUrl||(l==null?void 0:l.rpcUrls.default.http[0]);n=r.makeWeb3Provider(f,u)}return n},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({chainId:s}){var l,u;const o=i.chains.find(f=>f.id===s);if(!o)throw new Vi(new Xl);const a=await this.getProvider(),c=Re(o.id);try{return await a.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]}),o}catch(f){if(f.code===4902)try{return await a.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:o.name,nativeCurrency:o.nativeCurrency,rpcUrls:[((l=o.rpcUrls.default)==null?void 0:l.http[0])??""],blockExplorerUrls:[(u=o.blockExplorers)==null?void 0:u.default.url]}]}),o}catch(d){throw new At(d)}throw new Vi(f)}},onAccountsChanged(s){s.length===0?i.emitter.emit("disconnect"):i.emitter.emit("change",{accounts:s.map(o=>Qn(o))})},onChainChanged(s){const o=vc(s);i.emitter.emit("change",{chainId:o})},async onDisconnect(s){i.emitter.emit("disconnect");const o=await this.getProvider();o.removeListener("accountsChanged",this.onAccountsChanged),o.removeListener("chainChanged",this.onChainChanged),o.removeListener("disconnect",this.onDisconnect.bind(this))}})}o4.type="walletConnect";function o4(t){const e=t.isNewChainsStale??!0;let r,n;const i="eip155";return s=>({id:"walletConnect",name:"WalletConnect",type:o4.type,async setup(){const o=await this.getProvider().catch(()=>null);o&&(o.on("connect",this.onConnect.bind(this)),o.on("session_delete",this.onSessionDelete.bind(this)))},async connect({chainId:o,...a}={}){var c,l;try{const u=await this.getProvider();if(!u)throw new dl;u.on("display_uri",this.onDisplayUri);let f=o;if(!f){const m=await((c=s.storage)==null?void 0:c.getItem("state"))??{};s.chains.some(y=>y.id===m.chainId)?f=m.chainId:f=(l=s.chains[0])==null?void 0:l.id}if(!f)throw new Error("No chains found on connector.");const d=await this.isChainsStale();if(u.session&&d&&await u.disconnect(),!u.session||d){const m=s.chains.filter(v=>v.id!==f).map(v=>v.id);await u.connect({optionalChains:[f,...m],..."pairingTopic"in a?{pairingTopic:a.pairingTopic}:{}}),this.setRequestedChainsIds(s.chains.map(v=>v.id))}const h=(await u.enable()).map(m=>Qn(m)),p=await this.getChainId();return u.removeListener("display_uri",this.onDisplayUri),u.removeListener("connect",this.onConnect.bind(this)),u.on("accountsChanged",this.onAccountsChanged.bind(this)),u.on("chainChanged",this.onChainChanged),u.on("disconnect",this.onDisconnect.bind(this)),u.on("session_delete",this.onSessionDelete.bind(this)),{accounts:h,chainId:p}}catch(u){throw/(user rejected|connection request reset)/i.test(u==null?void 0:u.message)?new At(u):u}},async disconnect(){const o=await this.getProvider();try{await(o==null?void 0:o.disconnect())}catch(a){if(!/No matching key/i.test(a.message))throw a}finally{o==null||o.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),o==null||o.removeListener("chainChanged",this.onChainChanged),o==null||o.removeListener("disconnect",this.onDisconnect.bind(this)),o==null||o.removeListener("session_delete",this.onSessionDelete.bind(this)),o==null||o.on("connect",this.onConnect.bind(this)),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(a=>Qn(a))},async getProvider({chainId:o}={}){var c;async function a(){const l=s.chains.map(f=>f.id);if(!l.length)return;const{EthereumProvider:u}=await zE(()=>import("./index.es-DgcpHBup.js"),__vite__mapDeps([2,1]),import.meta.url);return await u.init({...t,disableProviderPing:!0,optionalChains:l,projectId:t.projectId,rpcMap:Object.fromEntries(s.chains.map(f=>[f.id,f.rpcUrls.default.http[0]])),showQrModal:t.showQrModal??!0})}return r||(n||(n=a()),r=await n,r==null||r.events.setMaxListeners(1/0)),o&&await((c=this.switchChain)==null?void 0:c.call(this,{chainId:o})),r},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[o,a]=await Promise.all([this.getAccounts(),this.getProvider()]);return o.length?await this.isChainsStale()&&a.session?(await a.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({chainId:o}){var c;const a=s.chains.find(l=>l.id===o);if(!a)throw new Vi(new Xl);try{const l=await this.getProvider(),u=this.getNamespaceChainsIds(),f=this.getNamespaceMethods();if(!u.includes(o)&&f.includes("wallet_addEthereumChain")){await l.request({method:"wallet_addEthereumChain",params:[{chainId:Re(a.id),blockExplorerUrls:[(c=a.blockExplorers)==null?void 0:c.default.url],chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[...a.rpcUrls.default.http]}]});const h=await this.getRequestedChainsIds();this.setRequestedChainsIds([...h,o])}return await l.request({method:"wallet_switchEthereumChain",params:[{chainId:Re(o)}]}),a}catch(l){const u=typeof l=="string"?l:l==null?void 0:l.message;throw/user rejected request/i.test(u)?new At(l):new Vi(l)}},onAccountsChanged(o){o.length===0?this.onDisconnect():s.emitter.emit("change",{accounts:o.map(a=>Qn(a))})},onChainChanged(o){const a=vc(o);s.emitter.emit("change",{chainId:a})},async onConnect(o){const a=vc(o.chainId),c=await this.getAccounts();s.emitter.emit("connect",{accounts:c,chainId:a})},async onDisconnect(o){this.setRequestedChainsIds([]),s.emitter.emit("disconnect");const a=await this.getProvider();a.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),a.removeListener("chainChanged",this.onChainChanged),a.removeListener("disconnect",this.onDisconnect.bind(this)),a.removeListener("session_delete",this.onSessionDelete.bind(this)),a.on("connect",this.onConnect.bind(this))},onDisplayUri(o){s.emitter.emit("message",{type:"display_uri",data:o})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var a,c,l;return r?((l=(c=(a=r.session)==null?void 0:a.namespaces[i])==null?void 0:c.chains)==null?void 0:l.map(u=>parseInt(u.split(":")[1]||"")))??[]:[]},getNamespaceMethods(){var a,c;return r?((c=(a=r.session)==null?void 0:a.namespaces[i])==null?void 0:c.methods)??[]:[]},async getRequestedChainsIds(){var o;return await((o=s.storage)==null?void 0:o.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(this.getNamespaceMethods().includes("wallet_addEthereumChain")||!e)return!1;const a=s.chains.map(u=>u.id),c=this.getNamespaceChainsIds();if(c.length&&!c.some(u=>a.includes(u)))return!1;const l=await this.getRequestedChainsIds();return!a.every(u=>l.includes(u))},async setRequestedChainsIds(o){var a;await((a=s.storage)==null?void 0:a.setItem(this.requestedChainsStorageKey,o))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}function De(){return De=Object.assign?Object.assign.bind():function(t){for(var e=1;e0){const f=c[0];`${a[0].toUpperCase()}${a.slice(1)}`,a=f}return f=>({id:"sequence",name:"Sequence",type:Gc.type,async setup(){const d=await this.getProvider();d.on("chainChanged",h=>{f.emitter.emit("change",{chain:{id:Wu(h),unsupported:!1}})}),d.on("accountsChanged",h=>{f.emitter.emit("accountsChanged",this.onAccountsChanged(h))}),d.on("disconnect",()=>{this.onDisconnect()})},async connect(){const d=await this.getProvider();if(!d.isConnected()){var h,p;const v=localStorage.getItem(rn.Theme),y=localStorage.getItem(rn.EthAuthSettings),g=y?JSON.parse(y):{},x=De({authorize:!0},g,s,{settings:De({theme:v||"dark"},s==null?void 0:s.settings)}),S=await d.connect(x);if(S.error)throw new At(new Error(S.error));if(!S.connected)throw new At(new Error("Wallet connection rejected"));const I=(h=S.proof)==null?void 0:h.proofString,$=(p=S.proof)==null?void 0:p.typedData;if(I){const L=JSON.stringify({proofString:I,typedData:$});localStorage.setItem(rn.EthAuthProof,L)}}return{accounts:[...await this.getAccounts()],chainId:d.getChainId()}},async disconnect(){(await this.getProvider()).disconnect()},async getAccounts(){const d=await this.getProvider();return[Qn(await d.getSigner().getAddress())]},async getProvider(){try{return Yf.getWallet()}catch{const h=localStorage.getItem(rn.ProjectAccessKey);if(!h)throw"projectAccessKey not found";const p=Yf.initWallet(h,{defaultNetwork:i,transports:{walletAppURL:o||"https://sequence.app"},defaultEIP6492:!0,analytics:!1}),m=await p.getChainId();return f.emitter.emit("change",{chainId:Wu(m)}),p}},async isAuthorized(){try{return!!await this.getAccounts()}catch{return!1}},async switchChain({chainId:d}){const h=await this.getProvider(),p=f.chains.find(m=>m.id===d)||f.chains[0];return h.setDefaultChainId(Wu(d)),f.emitter.emit("change",{chainId:d}),p},async getChainId(){return(await this.getProvider()).getChainId()},async onAccountsChanged(d){return{account:d[0]}},async onChainChanged(d){const h=await this.getProvider();f.emitter.emit("change",{chainId:Wu(d)}),h.setDefaultChainId(Wu(d))},async onConnect(d){},async onDisconnect(){localStorage.removeItem(rn.EthAuthProof),f.emitter.emit("disconnect")}})}function Wu(t){return typeof t=="object"?Wu(t.chainId):typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t}function Ji(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const a_=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=De({},(Ji(n),n));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 29 34",fill:"none"},i),w.createElement("path",{d:"M27.702 11.5918C27.5049 11.7448 24.0243 13.7068 24.0243 18.0694C24.0243 23.1155 28.4532 24.9007 28.5858 24.9449C28.5654 25.0537 27.8822 27.3897 26.2506 29.77C24.7958 31.8646 23.2765 33.9558 20.9651 33.9558C18.6538 33.9558 18.0589 32.6127 15.3907 32.6127C12.7904 32.6127 11.8659 34 9.75169 34C7.63748 34 6.1623 32.0618 4.46618 29.6816C2.50154 26.8865 0.914185 22.5443 0.914185 18.423C0.914185 11.8128 5.21057 8.30703 9.43897 8.30703C11.6857 8.30703 13.5586 9.78278 14.9692 9.78278C16.3118 9.78278 18.4056 8.21862 20.9617 8.21862C21.9304 8.21862 25.4111 8.30703 27.702 11.5918ZM19.7483 5.42014C20.8054 4.16542 21.5532 2.42444 21.5532 0.683468C21.5532 0.442044 21.5328 0.19722 21.4886 0C19.7687 0.0646065 17.7224 1.14591 16.4886 2.57746C15.5199 3.67917 14.6157 5.42014 14.6157 7.18492C14.6157 7.45014 14.6599 7.71537 14.6803 7.80038C14.7891 7.82078 14.9658 7.84458 15.1426 7.84458C16.6857 7.84458 18.6266 6.81088 19.7483 5.42014Z",fill:e})))}},c_=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=De({},(Ji(n),n));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),w.createElement("path",{d:"M27.166 20.8774C27.1338 17.335 30.0617 15.633 30.1936 15.5493C28.5463 13.1395 25.9852 12.8113 25.0714 12.7727C22.8932 12.5507 20.8179 14.0565 19.7111 14.0565C18.6043 14.0565 16.8991 12.8049 15.0909 12.8403C12.7131 12.8757 10.5221 14.2205 9.2962 16.3505C6.8284 20.6297 8.66557 26.9777 11.0722 30.4557C12.2498 32.1545 13.6494 34.0689 15.493 33.9981C17.2691 33.9273 17.9383 32.8495 20.0811 32.8495C22.224 32.8495 22.8289 33.9981 24.7014 33.9627C26.6094 33.9241 27.8191 32.2253 28.9871 30.5201C30.3352 28.5478 30.8918 26.6366 30.924 26.5369C30.8822 26.5208 27.2046 25.1116 27.166 20.8774Z",fill:e}),w.createElement("path",{d:"M23.6429 10.4722C24.621 9.28822 25.2806 7.64089 25.1004 6C23.6911 6.05791 21.9859 6.93949 20.9756 8.12351C20.0715 9.16917 19.2768 10.8455 19.4923 12.4542C21.0592 12.5764 22.6648 11.653 23.6429 10.4722Z",fill:e})))}},Ege=t=>({id:"apple",isSequenceBased:!0,logoDark:a_({isDarkMode:!0}),logoLight:a_({isDarkMode:!1}),monochromeLogoDark:c_({isDarkMode:!0}),monochromeLogoLight:c_({isDarkMode:!1}),name:"Apple",createConnector:()=>{var e;return Gc(De({},t,{connect:De({},t==null?void 0:t.connect,{settings:De({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"apple"})})}))}}),l_=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),w.createElement("rect",{width:"28",height:"28",fill:"#2C5FF6"}),w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 23.8C19.4124 23.8 23.8 19.4124 23.8 14C23.8 8.58761 19.4124 4.2 14 4.2C8.58761 4.2 4.2 8.58761 4.2 14C4.2 19.4124 8.58761 23.8 14 23.8ZM11.55 10.8C11.1358 10.8 10.8 11.1358 10.8 11.55V16.45C10.8 16.8642 11.1358 17.2 11.55 17.2H16.45C16.8642 17.2 17.2 16.8642 17.2 16.45V11.55C17.2 11.1358 16.8642 10.8 16.45 10.8H11.55Z",fill:"white"})))},Sge=t=>({id:"coinbase-wallet",logoDark:l_,logoLight:l_,name:"Coinbase Wallet",createConnector:()=>s4(De({},t))}),u_=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=De({},(Ji(n),n));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35 34",fill:"none"},i),w.createElement("path",{d:"M17.0826 16.3805C17.1802 16.4598 17.32 16.4598 17.4176 16.3805L30.1401 6.04341C30.5283 5.72801 30.3053 5.09985 29.8051 5.09985H4.69499C4.19482 5.09985 3.9718 5.72801 4.35998 6.04341L17.0826 16.3805Z",fill:e}),w.createElement("path",{d:"M19.7626 19.2667L33.3838 8.19943C33.731 7.91735 34.2501 8.16441 34.2501 8.61174V24.2249C34.2501 26.5721 32.3473 28.4749 30.0001 28.4749H4.50006C2.15285 28.4749 0.250061 26.5721 0.250061 24.2249V8.61174C0.250061 8.16441 0.769134 7.91735 1.11631 8.19943L14.7375 19.2667C16.2014 20.4561 18.2987 20.4561 19.7626 19.2667Z",fill:e})))}},Q6="@sequence.kit.connector.email",kge=t=>({id:"email",isSequenceBased:!0,logoDark:u_({isDarkMode:!0}),logoLight:u_({isDarkMode:!1}),name:"Email",createConnector:()=>{var e;const r=localStorage.getItem(Q6);return Gc(De({},t,{connect:De({},t==null?void 0:t.connect,{settings:De({},t==null||(e=t.connect)==null?void 0:e.settings,{signInOptions:["email"],signInWithEmail:r||""})})}))}}),f_=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},e),w.createElement("path",{d:"M17.4214 36.9716C9.27855 35.5145 3.10712 28.4859 3.10712 20.0001C3.10712 10.5715 10.8214 2.85718 20.25 2.85718C29.6785 2.85718 37.3928 10.5715 37.3928 20.0001C37.3928 28.4859 31.2214 35.5145 23.0785 36.9716L22.1357 36.2002H18.3643L17.4214 36.9716Z",fill:"url(#paint0_linear_193_14528)"}),w.createElement("path",{d:"M26.9357 24.7999L27.7072 19.9999H23.1643V16.657C23.1643 15.2856 23.6786 14.257 25.7357 14.257H27.9643V9.88558C26.7643 9.71415 25.3929 9.54272 24.1929 9.54272C20.25 9.54272 17.5071 11.9427 17.5071 16.2285V19.9999H13.2214V24.7999H17.5071V36.8857C18.45 37.0571 19.3929 37.1429 20.3357 37.1429C21.2786 37.1429 22.2214 37.0571 23.1643 36.8857V24.7999H26.9357Z",fill:"white"}),w.createElement("defs",null,w.createElement("linearGradient",{id:"paint0_linear_193_14528",x1:"20.2508",y1:"35.9507",x2:"20.2508",y2:"2.85086",gradientUnits:"userSpaceOnUse"},w.createElement("stop",{"stop-color":"#0062E0"}),w.createElement("stop",{offset:"1","stop-color":"#19AFFF"})))))},d_=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=De({},(Ji(n),n));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),w.createElement("path",{d:"M25.8582 10.4398C24.1222 10.4398 23.6288 11.2098 23.6288 12.9073V15.709H28.246L27.791 20.2476H23.6279V34H18.1024V20.2468H14.375V15.7081H18.1042V12.9851C18.1042 8.40625 19.9399 6 25.0891 6C26.1942 6 27.5163 6.0875 28.3055 6.19775V10.459",fill:e})))}},Age=t=>({id:"facebook",isSequenceBased:!0,logoDark:f_,logoLight:f_,monochromeLogoDark:d_({isDarkMode:!0}),monochromeLogoLight:d_({isDarkMode:!1}),name:"Facebook",createConnector:()=>{var e;return Gc(De({},t,{connect:De({},t==null?void 0:t.connect,{settings:De({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"facebook"})})}))}}),h_=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({viewBox:"0 0 41 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),w.createElement("g",{id:"Frame 2114"},w.createElement("g",{id:"Group"},w.createElement("path",{id:"Vector",d:"M20.7497 16.8828V23.5218H29.9756C29.5705 25.6568 28.3548 27.4647 26.5314 28.6803L32.095 32.9972C35.3366 30.0051 37.2068 25.6102 37.2068 20.3895C37.2068 19.1739 37.0977 18.005 36.895 16.883L20.7497 16.8828Z",fill:"#4285F4"}),w.createElement("path",{id:"Vector_2",d:"M11.1424 23.2627L9.88756 24.2232L5.44592 27.6829C8.2667 33.2777 14.0481 37.1427 20.7493 37.1427C25.3778 37.1427 29.2583 35.6154 32.0947 32.9973L26.5311 28.6803C25.0038 29.7089 23.0557 30.3324 20.7493 30.3324C16.2922 30.3324 12.5053 27.3246 11.1494 23.2726L11.1424 23.2627Z",fill:"#34A853"}),w.createElement("path",{id:"Vector_3",d:"M5.44594 12.3169C4.27718 14.6233 3.60712 17.2259 3.60712 19.9999C3.60712 22.7739 4.27718 25.3765 5.44594 27.6829C5.44594 27.6984 11.1499 23.2569 11.1499 23.2569C10.8071 22.2284 10.6044 21.1375 10.6044 19.9997C10.6044 18.8619 10.8071 17.7711 11.1499 16.7425L5.44594 12.3169Z",fill:"#FBBC05"}),w.createElement("path",{id:"Vector_4",d:"M20.7497 9.6829C23.2744 9.6829 25.5185 10.5556 27.3107 12.2387L32.2198 7.32972C29.2431 4.55574 25.3783 2.85693 20.7497 2.85693C14.0484 2.85693 8.2667 6.70628 5.44592 12.3167L11.1497 16.7427C12.5055 12.6907 16.2926 9.6829 20.7497 9.6829Z",fill:"#EA4335"})))))},p_=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=De({},(Ji(n),n));return w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.8355 14.7613C24.5584 13.5329 22.9441 12.9032 21.1356 12.9032C17.9377 12.9032 15.2302 15.0813 14.2595 18.0232L14.2593 18.023C14.0142 18.7662 13.8712 19.5609 13.8712 20.3866C13.8712 21.2124 14.004 22.0072 14.2594 22.7504L14.2587 22.751H14.2595C15.2302 25.6929 17.9377 27.871 21.1356 27.871C22.7907 27.871 24.1904 27.4168 25.2939 26.6736V26.6732C26.5812 25.7958 27.4497 24.5055 27.746 22.9777H21.1355V18.3223H32.6808C32.8034 19.0758 32.875 19.85 32.875 20.6655C32.875 24.4332 31.5467 27.6126 29.2377 29.77L29.2378 29.7703C27.2148 31.6594 24.446 32.7742 21.1356 32.7742C16.3438 32.7742 12.2059 29.9871 10.1931 25.9407V25.94L10.193 25.9401C9.35521 24.2678 8.875 22.3891 8.875 20.3866C8.875 18.384 9.35521 16.5053 10.193 14.833H10.1934C12.2063 10.7869 16.344 8 21.1356 8C24.446 8 27.2148 9.22839 29.3298 11.231L25.8355 14.7613Z",fill:e}))}},_ge=t=>({id:"google",isSequenceBased:!0,logoDark:h_,logoLight:h_,monochromeLogoDark:p_({isDarkMode:!0}),monochromeLogoLight:p_({isDarkMode:!1}),name:"Google",createConnector:()=>{var e;return Gc(De({},t,{connect:De({},t==null?void 0:t.connect,{settings:De({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"google"})})}))}}),m_=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),w.createElement("rect",{width:"28",height:"28"}),w.createElement("path",{d:"M24.0891 3.1199L15.3446 9.61456L16.9617 5.7828L24.0891 3.1199Z",fill:"#E2761B",stroke:"#E2761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M3.90207 3.1199L12.5763 9.67608L11.0383 5.7828L3.90207 3.1199Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M20.9429 18.1745L18.6139 21.7426L23.597 23.1136L25.0295 18.2536L20.9429 18.1745Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M2.97929 18.2536L4.40301 23.1136L9.38607 21.7426L7.05713 18.1745L2.97929 18.2536Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.10483 12.1456L7.71626 14.2461L12.6642 14.4658L12.4884 9.14877L9.10483 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M18.8864 12.1456L15.4589 9.08725L15.3446 14.4658L20.2837 14.2461L18.8864 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.38606 21.7426L12.3566 20.2925L9.79033 18.2888L9.38606 21.7426Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.6347 20.2925L18.6139 21.7426L18.2009 18.2888L15.6347 20.2925Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M18.6139 21.7426L15.6347 20.2925L15.8719 22.2348L15.8456 23.0521L18.6139 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.38606 21.7426L12.1544 23.0521L12.1368 22.2348L12.3566 20.2925L9.38606 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M12.1984 17.0056L9.72002 16.2762L11.4689 15.4765L12.1984 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.7928 17.0056L16.5223 15.4765L18.28 16.2762L15.7928 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.38606 21.7426L9.80791 18.1745L7.05712 18.2536L9.38606 21.7426Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M18.1921 18.1745L18.6139 21.7426L20.9429 18.2536L18.1921 18.1745Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M20.2837 14.2461L15.3446 14.4658L15.8016 17.0057L16.5311 15.4765L18.2888 16.2762L20.2837 14.2461Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.72002 16.2762L11.4777 15.4765L12.1984 17.0057L12.6642 14.4658L7.71626 14.2461L9.72002 16.2762Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M7.71626 14.2461L9.79033 18.2888L9.72002 16.2762L7.71626 14.2461Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M18.2888 16.2762L18.2009 18.2888L20.2837 14.2461L18.2888 16.2762Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M12.6642 14.4658L12.1984 17.0057L12.7784 20.0025L12.9102 16.0565L12.6642 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.3446 14.4658L15.1073 16.0477L15.2128 20.0025L15.8016 17.0057L15.3446 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.8016 17.0056L15.2128 20.0025L15.6347 20.2925L18.2009 18.2888L18.2888 16.2762L15.8016 17.0056Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.72002 16.2762L9.79033 18.2888L12.3566 20.2925L12.7784 20.0025L12.1984 17.0056L9.72002 16.2762Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.8456 23.0521L15.8719 22.2348L15.6522 22.0414H12.339L12.1368 22.2348L12.1544 23.0521L9.38606 21.7426L10.3528 22.5336L12.3126 23.8958H15.6786L17.6472 22.5336L18.6139 21.7426L15.8456 23.0521Z",fill:"#C0AD9E",stroke:"#C0AD9E",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.6347 20.2925L15.2128 20.0025H12.7784L12.3566 20.2925L12.1368 22.2348L12.339 22.0414H15.6522L15.8719 22.2348L15.6347 20.2925Z",fill:"#161616",stroke:"#161616",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M24.4583 10.0364L25.2053 6.45072L24.0891 3.1199L15.6347 9.39485L18.8864 12.1456L23.4827 13.4903L24.5022 12.3038L24.0628 11.9874L24.7658 11.3459L24.221 10.924L24.924 10.3879L24.4583 10.0364Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M2.79472 6.45072L3.54174 10.0364L3.06717 10.3879L3.77024 10.924L3.23415 11.3459L3.93722 11.9874L3.4978 12.3038L4.50847 13.4903L9.10483 12.1456L12.3566 9.39485L3.90207 3.1199L2.79472 6.45072Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M23.4827 13.4903L18.8864 12.1456L20.2837 14.2461L18.2009 18.2888L20.9429 18.2536H25.0295L23.4827 13.4903Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M9.10484 12.1456L4.50848 13.4903L2.97929 18.2536H7.05713L9.79033 18.2888L7.71626 14.2461L9.10484 12.1456Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),w.createElement("path",{d:"M15.3446 14.4658L15.6347 9.39485L16.9705 5.7828H11.0383L12.3566 9.39485L12.6642 14.4658L12.7696 16.0653L12.7784 20.0025H15.2128L15.2304 16.0653L15.3446 14.4658Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"})))},Ty=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),w.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},w.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},w.createElement("path",{style:{fill:"#111111"},id:"path1232",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),w.createElement("path",{style:{fill:"url(#paint0_linear_5_13"},id:"path1234",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),w.createElement("path",{style:{fill:"url(#paint1_linear_5_131"},id:"path1236",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),w.createElement("path",{style:{fill:"url(#paint2_linear_5_131)"},id:"path1238",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),w.createElement("path",{style:{fill:"url(#paint3_linear_5_131)"},id:"path1240",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),w.createElement("path",{style:{fill:"url(#paint4_linear_5_131)"},id:"path1242",d:"m 98.9999,238.126 c 0,-10.965 -8.8648,-19.854 -19.8,-19.854 -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.966 8.8648,19.855 19.8,19.855 10.9352,0 19.8,-8.889 19.8,-19.855 z"}),w.createElement("path",{style:{fill:"url(#paint5_linear_5_131)"},id:"path1244",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),w.createElement("path",{style:{fill:"url(#paint6_linear_5_131)"},id:"path1246",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),w.createElement("path",{style:{fill:"url(#paint7_linear_5_131)"},id:"path1248",d:"M 316.8,59.5632 H 158.4 c -10.935,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.865,19.8544 19.8,19.8544 h 158.4 c 10.935,0 19.8,-8.8892 19.8,-19.8544 0,-10.9653 -8.865,-19.8544 -19.8,-19.8544 z"}),w.createElement("path",{style:{fill:"url(#paint8_linear_5_131)"},id:"path1250",d:"M 316.8,218.272 H 158.4 c -10.935,0 -19.8,8.889 -19.8,19.854 0,10.966 8.865,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.889 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}),w.createElement("path",{style:{fill:"url(#paint9_linear_5_131)"},id:"path1252",d:"M 237.6,138.981 H 79.2 c -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.965 8.8648,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.89 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}))),w.createElement("defs",{id:"defs1314"},w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},w.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),w.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},w.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),w.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},w.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),w.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},w.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),w.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},w.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),w.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},w.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),w.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},w.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),w.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},w.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),w.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},w.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),w.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),w.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},w.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),w.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),w.createElement("clipPath",{id:"clip0_5_131"},w.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),w.createElement("clipPath",{id:"clip1_5_131"},w.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))};window.ethereum=window.ethereum||{};const Pge=()=>({id:"metamask",logoDark:m_,logoLight:m_,name:"Metamask",createConnector:()=>Ab()}),Ige=t=>({id:"mock",isSequenceBased:!0,logoDark:Ty,logoLight:Ty,name:"Mock",createConnector:()=>QE(t)}),Tge=t=>({id:"sequence",isSequenceBased:!0,logoDark:Ty,logoLight:Ty,name:"Sequence",createConnector:()=>Gc(De({},t))}),Xp=({isDarkMode:t})=>{let e;return t===void 0?e="#9146FF":e=t?"white":"black",n=>(De({},(Ji(n),n)),w.createElement(w.Fragment,null,w.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 2400 2800",transform:"scale(0.80)"},w.createElement("g",null,w.createElement("g",{id:"Layer_1-2"},w.createElement("path",{fill:e,d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600 V1300z"}),w.createElement("rect",{x:"1700",y:"550",fill:e,width:"200",height:"600"}),w.createElement("rect",{x:"1150",y:"550",fill:e,width:"200",height:"600"}))))))},Oge=t=>({id:"twitch",isSequenceBased:!0,logoDark:Xp({}),logoLight:Xp({}),monochromeLogoDark:Xp({isDarkMode:!0}),monochromeLogoLight:Xp({isDarkMode:!1}),name:"Twitch",createConnector:()=>{var e;return Gc(De({},t,{connect:De({},t==null?void 0:t.connect,{settings:De({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"twitch"})})}))}}),v_=t=>{let e=De({},(Ji(t),t));return w.createElement(w.Fragment,null,w.createElement("svg",De({fill:"none",viewBox:"0 0 480 332",xmlns:"http://www.w3.org/2000/svg"},e),w.createElement("path",{d:"m126.613 93.9842c62.622-61.3123 164.152-61.3123 226.775 0l7.536 7.3788c3.131 3.066 3.131 8.036 0 11.102l-25.781 25.242c-1.566 1.533-4.104 1.533-5.67 0l-10.371-10.154c-43.687-42.7734-114.517-42.7734-158.204 0l-11.107 10.874c-1.565 1.533-4.103 1.533-5.669 0l-25.781-25.242c-3.132-3.066-3.132-8.036 0-11.102zm280.093 52.2038 22.946 22.465c3.131 3.066 3.131 8.036 0 11.102l-103.463 101.301c-3.131 3.065-8.208 3.065-11.339 0l-73.432-71.896c-.783-.767-2.052-.767-2.835 0l-73.43 71.896c-3.131 3.065-8.208 3.065-11.339 0l-103.4657-101.302c-3.1311-3.066-3.1311-8.036 0-11.102l22.9456-22.466c3.1311-3.065 8.2077-3.065 11.3388 0l73.4333 71.897c.782.767 2.051.767 2.834 0l73.429-71.897c3.131-3.065 8.208-3.065 11.339 0l73.433 71.897c.783.767 2.052.767 2.835 0l73.431-71.895c3.132-3.066 8.208-3.066 11.339 0z",fill:"#3396ff"})))},Rge=t=>({id:"wallet-connect",logoDark:v_,logoLight:v_,name:"Walletconnect",createConnector:()=>o4(De({},t))}),$ge=({walletConnectProjectId:t,defaultChainId:e,projectAccessKey:r,appName:n})=>fU(r,[Sge({appName:n}),kge({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),_ge({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),Age({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),Oge({defaultNetwork:e,connect:{app:n}}),Ege({defaultNetwork:e,connect:{app:n}}),Pge(),Rge({projectId:t}),Tge({defaultNetwork:e,connect:{app:n,projectAccessKey:r}})]);function a4(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function em(){}function y_(){return typeof WeakMap<"u"?new WeakMap:Mge()}function Mge(){return{add:em,delete:em,get:em,set:em,has:function(t){return!1}}}var Nge=Object.prototype.hasOwnProperty,Y6=function(t,e){return Nge.call(t,e)};function Mx(t,e){for(var r in e)Y6(e,r)&&(t[r]=e[r]);return t}var Dge=/^[ \t]*(?:\r\n|\r|\n)/,Lge=/(?:\r\n|\r|\n)[ \t]*$/,Bge=/^(?:[\r\n]|$)/,Fge=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,jge=/^[ \t]*[\r\n][ \t\r\n]*$/;function g_(t,e,r){var n=0,i=t[0].match(Fge);i&&(n=i[1].length);var s="(\\r\\n|\\r|\\n).{0,"+n+"}",o=new RegExp(s,"g");e&&(t=t.slice(1));var a=r.newline,c=r.trimLeadingNewline,l=r.trimTrailingNewline,u=typeof a=="string",f=t.length,d=t.map(function(h,p){return h=h.replace(o,"$1"),p===0&&c&&(h=h.replace(Dge,"")),p===f-1&&l&&(h=h.replace(Lge,"")),u&&(h=h.replace(/\r\n|\n|\r/g,function(m){return a})),h});return d}function Uge(t,e){for(var r="",n=0,i=t.length;n{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>"short"},Km=[Wge],vu=()=>{if(Km.length<1)throw new Error("No adapter configured");return Km[Km.length-1]},Kj=!1,Hge=t=>{Kj||qge(t)},qge=t=>{if(!t)throw new Error('No adapter provided when calling "setAdapter"');Kj=!0,Km.push(t)},Tb=function(){return vu().appendCss(...arguments)},Qj=function(){return vu().registerClassName(...arguments)},Vge=function(){return vu().registerComposition(...arguments)},Yj=function(){return vu().markCompositionUsed(...arguments)},Gge=function(){for(var e,r,n=arguments.length,i=new Array(n),s=0;s{const{theme:t}=z1(),e=N0e("isMobile"),r=s=>{window.open(s)},n=()=>ve.jsx(H,{flexDirection:"row",gap:"4",children:_7e.map((s,o)=>ve.jsx(H,{onClick:()=>r(s.url),className:VP,gap:"4",children:ve.jsx(fe,{fontWeight:"normal",fontSize:"small",color:"text50",children:s.label})},o))}),i=()=>ve.jsx(H,{gap:"4",justifyContent:"center",alignItems:"center",children:P7e.map((s,o)=>ve.jsx(H,{className:VP,onClick:()=>window.open(s.url),children:ve.jsx(mr,{height:"3",src:s.icon,alt:s.id,style:{filter:t==="dark"?"invert(0)":"invert(1)"}})},o))});return e?ve.jsxs(H,{flexDirection:"column",padding:"5",gap:"2",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"center",alignItems:"center",children:[ve.jsx(n,{}),ve.jsx(i,{})]}):ve.jsxs(H,{padding:"5",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"space-between",children:[ve.jsx(n,{}),ve.jsx(i,{})]})},T7e=t=>({cryptoCheckout:{chainId:137,triggerTransaction:async()=>{console.log("triggered transaction")},coinQuantity:{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",amountRequiredRaw:"10000000000"}},orderSummaryItems:[{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",tokenId:"66597",quantityRaw:"100"},{contractAddress:"0x624e4fa6980afcf8ea27bfe08e2fb5979b64df1c",tokenId:"1741",quantityRaw:"100"}]}),O7e=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},R7e=t=>`0x${O7e((t==null?void 0:t.substring(2))||"",8)}`;function $7e(){const{theme:t,setTheme:e}=z1(),{setTheme:r}=ep(),{address:n,connector:i,isConnected:s}=ln(),{setOpenConnectModal:o}=txe(),{setOpenWalletModal:a}=np(),{triggerCheckout:c}=op(),{disconnect:l}=Vj(),{data:u}=i4(),{switchChain:f}=n4(),d=Ib(),h=Cge(),{debug:p}=YN.parse(location.search),m=p==="true",v=async()=>{if(!(!u||!h))try{const q=await U2e(u);console.log("proof:",q);const G=await z2e(u,h,q);console.log("isValid?:",G)}catch(q){console.error(q)}},y=async()=>{if(u)try{const q=A7e,G=await u.signMessage({account:n||"",message:q});console.log("signature:",G);const[Q]=await u.getAddresses(),J=await h.verifyMessage({address:Q,message:q,signature:G});console.log("isValid?",J)}catch(q){console.error(q)}},g=()=>{e(t==="dark"?"light":"dark"),r(t==="dark"?"light":"dark")},x=()=>s?ve.jsxs(H,{padding:"5",justifyContent:"space-between",children:[ve.jsxs(H,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[ve.jsx(mr,{style:{width:"36px"},src:"kit-logo.svg"}),ve.jsx(mr,{style:{width:"24px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),ve.jsx(H,{children:ve.jsxs(H,{flexDirection:"column",children:[ve.jsxs(H,{flexDirection:"row",gap:"2",justifyContent:"flex-end",alignItems:"center",children:[ve.jsx(H,{style:{marginRight:"-12px"},children:ve.jsx(L,{})}),ve.jsx(fe,{fontWeight:"medium",fontSize:"normal",color:"text100",children:R7e(n||"")})]}),ve.jsx(H,{alignItems:"center",justifyContent:"flex-end",flexDirection:"row",children:ve.jsx(fe,{fontWeight:"medium",fontSize:"normal",color:"text50",children:i==null?void 0:i.name})})]})})]}):ve.jsx(H,{padding:"5",justifyContent:"flex-end",children:ve.jsx(H,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:ve.jsx(L,{})})}),S=({title:q,description:G,onClick:Q})=>ve.jsxs(ho,{style:{width:"332px"},clickable:!0,onClick:Q,children:[ve.jsx(fe,{color:"text100",lineHeight:"5",fontSize:"normal",fontWeight:"bold",children:q}),ve.jsx(H,{marginTop:"1",children:ve.jsx(fe,{fontWeight:"medium",lineHeight:"5",color:"text50",fontSize:"normal",children:G})})]}),I=()=>{o(!0)},$=()=>{c(T7e())},L=()=>ve.jsx(it,{variant:"base",style:{color:Se.colors.text100},onClick:g,leftIcon:t==="dark"?Qce:Nce}),N=()=>{f(d===1?{chainId:137}:{chainId:1})};return ve.jsxs(H,{background:"backgroundPrimary",children:[m&&ve.jsx(H,{justifyContent:"center",alignItems:"center",children:ve.jsx(fe,{children:"Debug mode"})}),ve.jsx(H,{style:{height:"72px"},position:"fixed",width:"full",top:"0",children:ve.jsx(x,{})}),ve.jsx(H,{style:{height:"100vh"},flexDirection:"column",justifyContent:"center",alignItems:"center",children:s?ve.jsxs(H,{flexDirection:"column",gap:"4",children:[ve.jsxs(H,{flexDirection:"column",gap:"2",children:[ve.jsx(fe,{color:"text50",fontSize:"small",fontWeight:"medium",children:"Demos"}),ve.jsx(S,{title:"Embedded wallet",description:"Connect a Sequence wallet to view, swap, send, and receive collections",onClick:()=>a(!0)}),ve.jsx(S,{title:"Checkout",description:"Checkout screen before placing a purchase on coins or collections",onClick:$}),ve.jsx(S,{title:"Sign message",description:"Sign a message with your wallet",onClick:y}),m&&ve.jsx(S,{title:"Generate EthAuth proof",description:"Generate EthAuth proof",onClick:v}),m&&ve.jsx(S,{title:"Switch network",description:"Switch network",onClick:N})]}),ve.jsx(H,{width:"full",gap:"2",flexDirection:"row",justifyContent:"flex-end",children:ve.jsx(it,{onClick:()=>l(),leftIcon:FL,label:"Sign out"})})]}):ve.jsx(H,{children:ve.jsxs(H,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5",children:[ve.jsxs(H,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[ve.jsx(mr,{style:{width:"48px"},src:"kit-logo.svg"}),ve.jsx(mr,{style:{width:"32px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),ve.jsx(H,{gap:"2",flexDirection:"row",alignItems:"center",children:ve.jsx(it,{onClick:I,variant:"feature",label:"Connect"})})]})})}),ve.jsx(I7e,{})]})}const M7e=oj({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x8cab227b1162f03b8338331adaad7aadc83b895e",blockCreated:18958930},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),N7e=oj({id:137,name:"Polygon",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),D7e=new ZE;function L7e(){const{debug:t}=YN.parse(location.search),e=t==="true",r=[M7e,N7e],n="iK0DPkHRt0IFo8o4M3fZIIOAAAAAAAAAA",i=[...$ge({walletConnectProjectId:"c65a6cb1aa83c4e24500130f23a437d8",defaultChainId:137,appName:"demo app",projectAccessKey:n}),...e?fU(n,[Ige({accounts:["0xCb88b6315507e9d8c35D81AFB7F190aB6c3227C9"]})]):[]],s={};r.forEach(c=>{const l=Yf.network.findNetworkConfig(Yf.network.allNetworks,c.id);l&&(s[c.id]=Nme(l.rpcUrl))});const o=Kve({transports:s,chains:r,connectors:i}),a={defaultTheme:"dark",signIn:{projectName:"Skyweaver",useMock:e},displayedAssets:[{contractAddress:or,chainId:137},{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",chainId:137},{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",chainId:137}]};return ve.jsx(lye,{config:o,children:ve.jsx(t4,{client:D7e,children:ve.jsx(exe,{config:a,children:ve.jsx(w4e,{children:ve.jsx(S7e,{children:ve.jsx("div",{id:"app",children:ve.jsx(ob,{root:"#app",scope:"app",theme:"dark",children:ve.jsx($7e,{})})})})})})})})}const B7e=nw.createRoot(document.getElementById("root"));B7e.render(ve.jsx(w.StrictMode,{children:ve.jsx(L7e,{})}));export{Uc as B,n0 as H,nd as I,zE as _,bi as a,MV as b,bl as c,$n as d,Mve as e,me as f,uW as g,wE as h,TK as i,ia as j,Mpe as k,Cb as l,na as m,q1 as n,mo as o,Xr as p,$V as r,ei as s,V7e as t}; +And that has made all the difference.`,_7e=[{label:"Terms",url:"https://sequence.xyz/terms"},{label:"About",url:"https://github.com/0xsequence/kit"},{label:"Blog",url:"https://sequence.xyz/blog"},{label:"Builder",url:"https://sequence.build"},{label:"Docs",url:"https://docs.sequence.xyz/wallet/connectors/kit/kit/overview"}],P7e=[{id:"discord",url:"https://discord.gg/sequence",icon:"img/social/discord.svg"},{id:"twitter",url:"https://www.twitter.com/0xsequence",icon:"img/social/twitter.svg"},{id:"youtube",url:"https://www.youtube.com/channel/UC1zHgUyV-doddTcnFNqt62Q",icon:"img/social/youtube.svg"},{id:"github",url:"https://github.com/0xsequence",icon:"img/social/github.svg"}];var VP="u3q5o00";const I7e=()=>{const{theme:t}=z1(),e=N0e("isMobile"),r=s=>{typeof window<"u"&&window.open(s)},n=()=>ve.jsx(H,{flexDirection:"row",gap:"4",children:_7e.map((s,o)=>ve.jsx(H,{onClick:()=>r(s.url),className:VP,gap:"4",children:ve.jsx(fe,{fontWeight:"normal",fontSize:"small",color:"text50",children:s.label})},o))}),i=()=>ve.jsx(H,{gap:"4",justifyContent:"center",alignItems:"center",children:P7e.map((s,o)=>ve.jsx(H,{className:VP,onClick:()=>{typeof window<"u"&&window.open(s.url)},children:ve.jsx(mr,{height:"3",src:s.icon,alt:s.id,style:{filter:t==="dark"?"invert(0)":"invert(1)"}})},o))});return e?ve.jsxs(H,{flexDirection:"column",padding:"5",gap:"2",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"center",alignItems:"center",children:[ve.jsx(n,{}),ve.jsx(i,{})]}):ve.jsxs(H,{padding:"5",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"space-between",children:[ve.jsx(n,{}),ve.jsx(i,{})]})},T7e=t=>({cryptoCheckout:{chainId:137,triggerTransaction:async()=>{console.log("triggered transaction")},coinQuantity:{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",amountRequiredRaw:"10000000000"}},orderSummaryItems:[{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",tokenId:"66597",quantityRaw:"100"},{contractAddress:"0x624e4fa6980afcf8ea27bfe08e2fb5979b64df1c",tokenId:"1741",quantityRaw:"100"}]}),O7e=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},R7e=t=>`0x${O7e((t==null?void 0:t.substring(2))||"",8)}`;function $7e(){const{theme:t,setTheme:e}=z1(),{setTheme:r}=ep(),{address:n,connector:i,isConnected:s}=ln(),{setOpenConnectModal:o}=txe(),{setOpenWalletModal:a}=np(),{triggerCheckout:c}=op(),{disconnect:l}=Vj(),{data:u}=i4(),{switchChain:f}=n4(),d=Ib(),h=Cge(),{debug:p}=YN.parse(location.search),m=p==="true",v=async()=>{if(!(!u||!h))try{const q=await U2e(u);console.log("proof:",q);const G=await z2e(u,h,q);console.log("isValid?:",G)}catch(q){console.error(q)}},y=async()=>{if(u)try{const q=A7e,G=await u.signMessage({account:n||"",message:q});console.log("signature:",G);const[Q]=await u.getAddresses(),J=await h.verifyMessage({address:Q,message:q,signature:G});console.log("isValid?",J)}catch(q){console.error(q)}},g=()=>{e(t==="dark"?"light":"dark"),r(t==="dark"?"light":"dark")},x=()=>s?ve.jsxs(H,{padding:"5",justifyContent:"space-between",children:[ve.jsxs(H,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[ve.jsx(mr,{style:{width:"36px"},src:"kit-logo.svg"}),ve.jsx(mr,{style:{width:"24px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),ve.jsx(H,{children:ve.jsxs(H,{flexDirection:"column",children:[ve.jsxs(H,{flexDirection:"row",gap:"2",justifyContent:"flex-end",alignItems:"center",children:[ve.jsx(H,{style:{marginRight:"-12px"},children:ve.jsx(L,{})}),ve.jsx(fe,{fontWeight:"medium",fontSize:"normal",color:"text100",children:R7e(n||"")})]}),ve.jsx(H,{alignItems:"center",justifyContent:"flex-end",flexDirection:"row",children:ve.jsx(fe,{fontWeight:"medium",fontSize:"normal",color:"text50",children:i==null?void 0:i.name})})]})})]}):ve.jsx(H,{padding:"5",justifyContent:"flex-end",children:ve.jsx(H,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:ve.jsx(L,{})})}),S=({title:q,description:G,onClick:Q})=>ve.jsxs(ho,{style:{width:"332px"},clickable:!0,onClick:Q,children:[ve.jsx(fe,{color:"text100",lineHeight:"5",fontSize:"normal",fontWeight:"bold",children:q}),ve.jsx(H,{marginTop:"1",children:ve.jsx(fe,{fontWeight:"medium",lineHeight:"5",color:"text50",fontSize:"normal",children:G})})]}),I=()=>{o(!0)},$=()=>{c(T7e())},L=()=>ve.jsx(it,{variant:"base",style:{color:Se.colors.text100},onClick:g,leftIcon:t==="dark"?Qce:Nce}),N=()=>{f(d===1?{chainId:137}:{chainId:1})};return ve.jsxs(H,{background:"backgroundPrimary",children:[m&&ve.jsx(H,{justifyContent:"center",alignItems:"center",children:ve.jsx(fe,{children:"Debug mode"})}),ve.jsx(H,{style:{height:"72px"},position:"fixed",width:"full",top:"0",children:ve.jsx(x,{})}),ve.jsx(H,{style:{height:"100vh"},flexDirection:"column",justifyContent:"center",alignItems:"center",children:s?ve.jsxs(H,{flexDirection:"column",gap:"4",children:[ve.jsxs(H,{flexDirection:"column",gap:"2",children:[ve.jsx(fe,{color:"text50",fontSize:"small",fontWeight:"medium",children:"Demos"}),ve.jsx(S,{title:"Embedded wallet",description:"Connect a Sequence wallet to view, swap, send, and receive collections",onClick:()=>a(!0)}),ve.jsx(S,{title:"Checkout",description:"Checkout screen before placing a purchase on coins or collections",onClick:$}),ve.jsx(S,{title:"Sign message",description:"Sign a message with your wallet",onClick:y}),m&&ve.jsx(S,{title:"Generate EthAuth proof",description:"Generate EthAuth proof",onClick:v}),m&&ve.jsx(S,{title:"Switch network",description:"Switch network",onClick:N})]}),ve.jsx(H,{width:"full",gap:"2",flexDirection:"row",justifyContent:"flex-end",children:ve.jsx(it,{onClick:()=>l(),leftIcon:FL,label:"Sign out"})})]}):ve.jsx(H,{children:ve.jsxs(H,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5",children:[ve.jsxs(H,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[ve.jsx(mr,{style:{width:"48px"},src:"kit-logo.svg"}),ve.jsx(mr,{style:{width:"32px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),ve.jsx(H,{gap:"2",flexDirection:"row",alignItems:"center",children:ve.jsx(it,{onClick:I,variant:"feature",label:"Connect"})})]})})}),ve.jsx(I7e,{})]})}const M7e=oj({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x8cab227b1162f03b8338331adaad7aadc83b895e",blockCreated:18958930},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),N7e=oj({id:137,name:"Polygon",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),D7e=new ZE;function L7e(){const{debug:t}=YN.parse(location.search),e=t==="true",r=[M7e,N7e],n="iK0DPkHRt0IFo8o4M3fZIIOAAAAAAAAAA",i=[...$ge({walletConnectProjectId:"c65a6cb1aa83c4e24500130f23a437d8",defaultChainId:137,appName:"demo app",projectAccessKey:n}),...e?fU(n,[Ige({accounts:["0xCb88b6315507e9d8c35D81AFB7F190aB6c3227C9"]})]):[]],s={};r.forEach(c=>{const l=Yf.network.findNetworkConfig(Yf.network.allNetworks,c.id);l&&(s[c.id]=Nme(l.rpcUrl))});const o=Kve({transports:s,chains:r,connectors:i}),a={defaultTheme:"dark",signIn:{projectName:"Skyweaver",useMock:e},displayedAssets:[{contractAddress:or,chainId:137},{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",chainId:137},{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",chainId:137}]};return ve.jsx(lye,{config:o,children:ve.jsx(t4,{client:D7e,children:ve.jsx(exe,{config:a,children:ve.jsx(w4e,{children:ve.jsx(S7e,{children:ve.jsx("div",{id:"app",children:ve.jsx(ob,{root:"#app",scope:"app",theme:"dark",children:ve.jsx($7e,{})})})})})})})})}const B7e=nw.createRoot(document.getElementById("root"));B7e.render(ve.jsx(w.StrictMode,{children:ve.jsx(L7e,{})}));export{Uc as B,n0 as H,nd as I,zE as _,bi as a,MV as b,bl as c,$n as d,Mve as e,me as f,uW as g,wE as h,TK as i,ia as j,Mpe as k,Cb as l,na as m,q1 as n,mo as o,Xr as p,$V as r,ei as s,V7e as t}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./index-CGiSbdNl.js","./___vite-browser-external_commonjs-proxy-_F0zCunc.js","./index.es-DU7_NjVk.js"] + __vite__mapDeps.viteFileDeps = ["./index-Bfd5Ckkn.js","./___vite-browser-external_commonjs-proxy-DoCXvEbS.js","./index.es-DgcpHBup.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/assets/index-C1fKM4j6.js b/assets/index-DUeUg68H.js similarity index 98% rename from assets/index-C1fKM4j6.js rename to assets/index-DUeUg68H.js index d12ae041..107bf6c3 100644 --- a/assets/index-C1fKM4j6.js +++ b/assets/index-DUeUg68H.js @@ -1,7 +1,7 @@ -import{_ as fe}from"./index-BDNLXjIW.js";const me=Symbol(),ee=Object.getPrototypeOf,G=new WeakMap,ge=e=>e&&(G.has(e)?G.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),he=e=>ge(e)&&e[me]||null,te=(e,t=!0)=>{G.set(e,t)};var z={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const q=e=>typeof e=="object"&&e!==null,A=new WeakMap,x=new WeakSet,be=(e=Object.is,t=(n,h)=>new Proxy(n,h),s=n=>q(n)&&!x.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),r=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,h,I=r)=>{const y=l.get(n);if((y==null?void 0:y[0])===h)return y[1];const v=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return te(v,!0),l.set(n,[h,v]),Reflect.ownKeys(n).forEach(S=>{if(Object.getOwnPropertyDescriptor(v,S))return;const E=Reflect.get(n,S),M={value:E,enumerable:!0,configurable:!0};if(x.has(E))te(E,!1);else if(E instanceof Promise)delete M.value,M.get=()=>I(E);else if(A.has(E)){const[b,H]=A.get(E);M.value=c(b,H(),I)}Object.defineProperty(v,S,M)}),Object.preventExtensions(v)},m=new WeakMap,f=[1,1],W=n=>{if(!q(n))throw new Error("object required");const h=m.get(n);if(h)return h;let I=f[0];const y=new Set,v=(a,i=++f[0])=>{I!==i&&(I=i,y.forEach(o=>o(a,i)))};let S=f[1];const E=(a=++f[1])=>(S!==a&&!y.size&&(S=a,b.forEach(([i])=>{const o=i[1](a);o>I&&(I=o)})),I),M=a=>(i,o)=>{const g=[...i];g[1]=[a,...g[1]],v(g,o)},b=new Map,H=(a,i)=>{if((z?"production":void 0)!=="production"&&b.has(a))throw new Error("prop listener already exists");if(y.size){const o=i[3](M(a));b.set(a,[i,o])}else b.set(a,[i])},Z=a=>{var i;const o=b.get(a);o&&(b.delete(a),(i=o[1])==null||i.call(o))},ue=a=>(y.add(a),y.size===1&&b.forEach(([o,g],_)=>{if((z?"production":void 0)!=="production"&&g)throw new Error("remove already exists");const R=o[3](M(_));b.set(_,[o,R])}),()=>{y.delete(a),y.size===0&&b.forEach(([o,g],_)=>{g&&(g(),b.set(_,[o]))})}),J=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(J,{deleteProperty(a,i){const o=Reflect.get(a,i);Z(i);const g=Reflect.deleteProperty(a,i);return g&&v(["delete",[i],o]),g},set(a,i,o,g){const _=Reflect.has(a,i),R=Reflect.get(a,i,g);if(_&&(e(R,o)||m.has(o)&&e(R,m.get(o))))return!0;Z(i),q(o)&&(o=he(o)||o);let V=o;if(o instanceof Promise)o.then(C=>{o.status="fulfilled",o.value=C,v(["resolve",[i],C])}).catch(C=>{o.status="rejected",o.reason=C,v(["reject",[i],C])});else{!A.has(o)&&s(o)&&(V=W(o));const C=!x.has(V)&&A.get(V);C&&H(i,C)}return Reflect.set(a,i,V,g),v(["set",[i],o,R]),!0}});m.set(n,$);const pe=[J,E,c,ue];return A.set($,pe),Reflect.ownKeys(n).forEach(a=>{const i=Object.getOwnPropertyDescriptor(n,a);"value"in i&&($[a]=n[a],delete i.value,delete i.writable),Object.defineProperty(J,a,i)}),$})=>[W,A,x,e,t,s,r,l,c,m,f],[ye]=be();function j(e={}){return ye(e)}function P(e,t,s){const r=A.get(e);(z?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let l;const c=[],m=r[3];let f=!1;const n=m(h=>{if(c.push(h),s){t(c.splice(0));return}l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,n()}}function ve(e,t){const s=A.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[r,l,c]=s;return c(r,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:d,subscribe(e){return P(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=j({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:u,subscribe(e){return P(u.events,()=>e(ve(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},L=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:L,subscribe(e){return P(L,()=>e(L))},setChains(e){L.chains=e},setWalletConnectUri(e){L.walletConnectUri=e},setIsCustomDesktop(e){L.isCustomDesktop=e},setIsCustomMobile(e){L.isCustomMobile=e},setIsDataLoaded(e){L.isDataLoaded=e},setIsUiLoaded(e){L.isUiLoaded=e},setIsAuth(e){L.isAuth=e}},B=j({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),N={state:B,subscribe(e){return P(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(B,e)}};var Le=Object.defineProperty,se=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Ee.call(t,s)&&ne(e,s,t[s]);return e};const Q="https://explorer-api.walletconnect.com",X="wcm",Y="js-2.6.2";async function K(e,t){const s=We({sdkType:X,sdkVersion:Y},t),r=new URL(e,Q);return r.searchParams.append("projectId",N.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const U={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${Q}/w3m/v1/getWalletImage/${e}?projectId=${N.state.projectId}&sdkType=${X}&sdkVersion=${Y}`},getAssetImageUrl(e){return`${Q}/w3m/v1/getAssetImage/${e}?projectId=${N.state.projectId}&sdkType=${X}&sdkVersion=${Y}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Me=(e,t)=>{for(var s in t||(t={}))Ae.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))je.call(t,s)&&re(e,s,t[s]);return e};const ie=p.isMobile(),O=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Te={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=N.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await U.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),O.recomendedWallets=l}else{const{chains:s,isAuth:r}=w.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ie?await U.getMobileListings(m):await U.getDesktopListings(m);O.recomendedWallets=Object.values(f)}return O.recomendedWallets},async getWallets(e){const t=Me({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=N.state,{recomendedWallets:l}=O;if(r==="ALL")return O.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=ie?await U.getMobileListings(t):await U.getDesktopListings(t),n=Object.values(f),h=m?"search":"wallets";return O[h]={listings:[...O[h].listings,...n],total:W,page:c??1},{listings:n,total:W}},getWalletImageUrl(e){return U.getWalletImageUrl(e)},getAssetImageUrl(e){return U.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},k=j({open:!1}),F={state:k,subscribe(e){return P(k,()=>e(k))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=w.state;if(p.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&r)k.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),k.open=!0,t())},200)}})},close(){k.open=!1}};var Ue=Object.defineProperty,ae=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&le(e,s,t[s]);if(ae)for(var s of ae(t))Pe.call(t,s)&&le(e,s,t[s]);return e};function _e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const T=j({themeMode:_e()?"dark":"light"}),ce={state:T,subscribe(e){return P(T,()=>e(T))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(T.themeMode=t),s&&(T.themeVariables=Se({},s))}},D=j({open:!1,message:"",variant:"success"}),$e={state:D,subscribe(e){return P(D,()=>e(D))},openToast(e,t){D.open=!0,D.message=e,D.variant=t},closeToast(){D.open=!1}};class ke{constructor(t){this.openModal=F.open,this.closeModal=F.close,this.subscribeModal=F.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),N.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await fe(()=>import("./index-COTim0wD.js"),__vite__mapDeps([0,1,2]),import.meta.url);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:ke},Symbol.toStringTag,{value:"Module"}));export{Ie as R,de as T,p as a,Ve as i,ce as n,$e as o,w as p,F as s,Te as t,N as y}; +import{_ as fe}from"./index-BliWCjCt.js";const me=Symbol(),ee=Object.getPrototypeOf,G=new WeakMap,ge=e=>e&&(G.has(e)?G.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),he=e=>ge(e)&&e[me]||null,te=(e,t=!0)=>{G.set(e,t)};var z={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const q=e=>typeof e=="object"&&e!==null,A=new WeakMap,x=new WeakSet,be=(e=Object.is,t=(n,h)=>new Proxy(n,h),s=n=>q(n)&&!x.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),r=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,h,I=r)=>{const y=l.get(n);if((y==null?void 0:y[0])===h)return y[1];const v=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return te(v,!0),l.set(n,[h,v]),Reflect.ownKeys(n).forEach(S=>{if(Object.getOwnPropertyDescriptor(v,S))return;const E=Reflect.get(n,S),M={value:E,enumerable:!0,configurable:!0};if(x.has(E))te(E,!1);else if(E instanceof Promise)delete M.value,M.get=()=>I(E);else if(A.has(E)){const[b,H]=A.get(E);M.value=c(b,H(),I)}Object.defineProperty(v,S,M)}),Object.preventExtensions(v)},m=new WeakMap,f=[1,1],W=n=>{if(!q(n))throw new Error("object required");const h=m.get(n);if(h)return h;let I=f[0];const y=new Set,v=(a,i=++f[0])=>{I!==i&&(I=i,y.forEach(o=>o(a,i)))};let S=f[1];const E=(a=++f[1])=>(S!==a&&!y.size&&(S=a,b.forEach(([i])=>{const o=i[1](a);o>I&&(I=o)})),I),M=a=>(i,o)=>{const g=[...i];g[1]=[a,...g[1]],v(g,o)},b=new Map,H=(a,i)=>{if((z?"production":void 0)!=="production"&&b.has(a))throw new Error("prop listener already exists");if(y.size){const o=i[3](M(a));b.set(a,[i,o])}else b.set(a,[i])},Z=a=>{var i;const o=b.get(a);o&&(b.delete(a),(i=o[1])==null||i.call(o))},ue=a=>(y.add(a),y.size===1&&b.forEach(([o,g],_)=>{if((z?"production":void 0)!=="production"&&g)throw new Error("remove already exists");const R=o[3](M(_));b.set(_,[o,R])}),()=>{y.delete(a),y.size===0&&b.forEach(([o,g],_)=>{g&&(g(),b.set(_,[o]))})}),J=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(J,{deleteProperty(a,i){const o=Reflect.get(a,i);Z(i);const g=Reflect.deleteProperty(a,i);return g&&v(["delete",[i],o]),g},set(a,i,o,g){const _=Reflect.has(a,i),R=Reflect.get(a,i,g);if(_&&(e(R,o)||m.has(o)&&e(R,m.get(o))))return!0;Z(i),q(o)&&(o=he(o)||o);let V=o;if(o instanceof Promise)o.then(C=>{o.status="fulfilled",o.value=C,v(["resolve",[i],C])}).catch(C=>{o.status="rejected",o.reason=C,v(["reject",[i],C])});else{!A.has(o)&&s(o)&&(V=W(o));const C=!x.has(V)&&A.get(V);C&&H(i,C)}return Reflect.set(a,i,V,g),v(["set",[i],o,R]),!0}});m.set(n,$);const pe=[J,E,c,ue];return A.set($,pe),Reflect.ownKeys(n).forEach(a=>{const i=Object.getOwnPropertyDescriptor(n,a);"value"in i&&($[a]=n[a],delete i.value,delete i.writable),Object.defineProperty(J,a,i)}),$})=>[W,A,x,e,t,s,r,l,c,m,f],[ye]=be();function j(e={}){return ye(e)}function P(e,t,s){const r=A.get(e);(z?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let l;const c=[],m=r[3];let f=!1;const n=m(h=>{if(c.push(h),s){t(c.splice(0));return}l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,n()}}function ve(e,t){const s=A.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[r,l,c]=s;return c(r,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:d,subscribe(e){return P(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=j({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:u,subscribe(e){return P(u.events,()=>e(ve(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},L=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:L,subscribe(e){return P(L,()=>e(L))},setChains(e){L.chains=e},setWalletConnectUri(e){L.walletConnectUri=e},setIsCustomDesktop(e){L.isCustomDesktop=e},setIsCustomMobile(e){L.isCustomMobile=e},setIsDataLoaded(e){L.isDataLoaded=e},setIsUiLoaded(e){L.isUiLoaded=e},setIsAuth(e){L.isAuth=e}},B=j({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),N={state:B,subscribe(e){return P(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(B,e)}};var Le=Object.defineProperty,se=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Ee.call(t,s)&&ne(e,s,t[s]);return e};const Q="https://explorer-api.walletconnect.com",X="wcm",Y="js-2.6.2";async function K(e,t){const s=We({sdkType:X,sdkVersion:Y},t),r=new URL(e,Q);return r.searchParams.append("projectId",N.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const U={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${Q}/w3m/v1/getWalletImage/${e}?projectId=${N.state.projectId}&sdkType=${X}&sdkVersion=${Y}`},getAssetImageUrl(e){return`${Q}/w3m/v1/getAssetImage/${e}?projectId=${N.state.projectId}&sdkType=${X}&sdkVersion=${Y}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Me=(e,t)=>{for(var s in t||(t={}))Ae.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))je.call(t,s)&&re(e,s,t[s]);return e};const ie=p.isMobile(),O=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Te={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=N.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await U.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),O.recomendedWallets=l}else{const{chains:s,isAuth:r}=w.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ie?await U.getMobileListings(m):await U.getDesktopListings(m);O.recomendedWallets=Object.values(f)}return O.recomendedWallets},async getWallets(e){const t=Me({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=N.state,{recomendedWallets:l}=O;if(r==="ALL")return O.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=ie?await U.getMobileListings(t):await U.getDesktopListings(t),n=Object.values(f),h=m?"search":"wallets";return O[h]={listings:[...O[h].listings,...n],total:W,page:c??1},{listings:n,total:W}},getWalletImageUrl(e){return U.getWalletImageUrl(e)},getAssetImageUrl(e){return U.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},k=j({open:!1}),F={state:k,subscribe(e){return P(k,()=>e(k))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=w.state;if(p.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&r)k.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),k.open=!0,t())},200)}})},close(){k.open=!1}};var Ue=Object.defineProperty,ae=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&le(e,s,t[s]);if(ae)for(var s of ae(t))Pe.call(t,s)&&le(e,s,t[s]);return e};function _e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const T=j({themeMode:_e()?"dark":"light"}),ce={state:T,subscribe(e){return P(T,()=>e(T))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(T.themeMode=t),s&&(T.themeVariables=Se({},s))}},D=j({open:!1,message:"",variant:"success"}),$e={state:D,subscribe(e){return P(D,()=>e(D))},openToast(e,t){D.open=!0,D.message=e,D.variant=t},closeToast(){D.open=!1}};class ke{constructor(t){this.openModal=F.open,this.closeModal=F.close,this.subscribeModal=F.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),N.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await fe(()=>import("./index-Dm7nb9LQ.js"),__vite__mapDeps([0,1,2]),import.meta.url);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:ke},Symbol.toStringTag,{value:"Module"}));export{Ie as R,de as T,p as a,Ve as i,ce as n,$e as o,w as p,F as s,Te as t,N as y}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./index-COTim0wD.js","./index-BDNLXjIW.js","./index-FR7z6tA6.css"] + __vite__mapDeps.viteFileDeps = ["./index-Dm7nb9LQ.js","./index-BliWCjCt.js","./index-FR7z6tA6.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/assets/index-COTim0wD.js b/assets/index-Dm7nb9LQ.js similarity index 99% rename from assets/index-COTim0wD.js rename to assets/index-Dm7nb9LQ.js index b022d94c..32871806 100644 --- a/assets/index-COTim0wD.js +++ b/assets/index-Dm7nb9LQ.js @@ -1,4 +1,4 @@ -import{n as _t,s as ce,T as N,t as W,a as C,o as ot,R as Uo,p as K,y as gt}from"./index-C1fKM4j6.js";import"./index-BDNLXjIW.js";function jo(e,t){e.indexOf(t)===-1&&e.push(t)}const oo=(e,t,r)=>Math.min(Math.max(r,e),t),Z={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},he=e=>typeof e=="number",Et=e=>Array.isArray(e)&&!he(e[0]),Wo=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function Ho(e,t){return Et(e)?e[Wo(0,e.length,t)]:e}const no=(e,t,r)=>-r*e+r*t+e,io=()=>{},it=e=>e,pr=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function so(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=pr(0,t,n);e.push(no(r,1,o))}}function zo(e){const t=[0];return so(t,e-1),t}function Fo(e,t=zo(e.length),r=it){const n=e.length,o=n-t.length;return o>0&&so(t,o),i=>{let s=0;for(;sArray.isArray(e)&&he(e[0]),sr=e=>typeof e=="object"&&!!e.createAnimation,Ot=e=>typeof e=="function",Zo=e=>typeof e=="string",zt={ms:e=>e*1e3,s:e=>e/1e3},lo=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Vo=1e-7,Ko=12;function qo(e,t,r,n,o){let i,s,a=0;do s=t+(r-t)/2,i=lo(s,n,o)-e,i>0?r=s:t=s;while(Math.abs(i)>Vo&&++aqo(i,0,1,e,r);return i=>i===0||i===1?i:lo(o(i),t,n)}const Yo=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,o=t==="end"?Math.floor(n):Math.ceil(n);return oo(0,1,o/e)},Ar={ease:Ht(.25,.1,.25,1),"ease-in":Ht(.42,0,1,1),"ease-in-out":Ht(.42,0,.58,1),"ease-out":Ht(0,0,.58,1)},Jo=/\((.*?)\)/;function _r(e){if(Ot(e))return e;if(ao(e))return Ht(...e);if(Ar[e])return Ar[e];if(e.startsWith("steps")){const t=Jo.exec(e);if(t){const r=t[1].split(",");return Yo(parseFloat(r[0]),r[1].trim())}}return it}class co{constructor(t,r=[0,1],{easing:n,duration:o=Z.duration,delay:i=Z.delay,endDelay:s=Z.endDelay,repeat:a=Z.repeat,offset:l,direction:c="normal",autoplay:d=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=it,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((h,f)=>{this.resolve=h,this.reject=f}),n=n||Z.easing,sr(n)){const h=n.createAnimation(r);n=h.easing,r=h.keyframes||r,o=h.duration||o}this.repeat=a,this.easing=Et(n)?it:_r(n),this.updateDuration(o);const b=Fo(r,l,Et(n)?n.map(_r):it);this.tick=h=>{var f;i=i;let p=0;this.pauseTime!==void 0?p=this.pauseTime:p=(h-this.startTime)*this.rate,this.t=p,p/=1e3,p=Math.max(p-i,0),this.playState==="finished"&&this.pauseTime===void 0&&(p=this.totalDuration);const g=p/this.duration;let _=Math.floor(g),u=g%1;!u&&g>=1&&(u=1),u===1&&_--;const y=_%2;(c==="reverse"||c==="alternate"&&y||c==="alternate-reverse"&&!y)&&(u=1-u);const w=p>=this.totalDuration?1:Math.min(u,1),v=b(this.easing(w));t(v),this.pauseTime===void 0&&(this.playState==="finished"||p>=this.totalDuration+s)?(this.playState="finished",(f=this.resolve)===null||f===void 0||f.call(this,v)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},d&&this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}class Go{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ce=new WeakMap;function ho(e){return Ce.has(e)||Ce.set(e,{transforms:[],values:new Map}),Ce.get(e)}function Qo(e,t){return e.has(t)||e.set(t,new Go),e.get(t)}const Xo=["","X","Y","Z"],tn=["translate","scale","rotate","skew"],ue={x:"translateX",y:"translateY",z:"translateZ"},Or={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},en={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:Or,scale:{syntax:"",initialValue:1,toDefaultUnit:it},skew:Or},Zt=new Map,wr=e=>`--motion-${e}`,me=["x","y","z"];tn.forEach(e=>{Xo.forEach(t=>{me.push(e+t),Zt.set(wr(e+t),en[e])})});const rn=(e,t)=>me.indexOf(e)-me.indexOf(t),on=new Set(me),uo=e=>on.has(e),nn=(e,t)=>{ue[t]&&(t=ue[t]);const{transforms:r}=ho(e);jo(r,t),e.style.transform=sn(r)},sn=e=>e.sort(rn).reduce(an,"").trim(),an=(e,t)=>`${e} ${t}(var(${wr(t)}))`,ar=e=>e.startsWith("--"),kr=new Set;function ln(e){if(!kr.has(e)){kr.add(e);try{const{syntax:t,initialValue:r}=Zt.has(e)?Zt.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch{}}}const Ee=(e,t)=>document.createElement("div").animate(e,t),Ir={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ee({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Ee({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Ee({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Ae={},Ct={};for(const e in Ir)Ct[e]=()=>(Ae[e]===void 0&&(Ae[e]=Ir[e]()),Ae[e]);const cn=.015,dn=(e,t)=>{let r="";const n=Math.round(t/cn);for(let o=0;oOt(e)?Ct.linearEasing()?`linear(${dn(e,t)})`:Z.easing:ao(e)?hn(e):e,hn=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;function un(e,t){for(let r=0;rArray.isArray(e)?e:[e];function lr(e){return ue[e]&&(e=ue[e]),uo(e)?wr(e):e}const Xt={get:(e,t)=>{t=lr(t);let r=ar(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&r!==0){const n=Zt.get(t);n&&(r=n.initialValue)}return r},set:(e,t,r)=>{t=lr(t),ar(t)?e.style.setProperty(t,r):e.style[t]=r}};function mo(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function gn(e,t){var r;let n=(t==null?void 0:t.toDefaultUnit)||it;const o=e[e.length-1];if(Zo(o)){const i=((r=o.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";i&&(n=s=>s+i)}return n}function fn(){return window.__MOTION_DEV_TOOLS_RECORD}function pn(e,t,r,n={},o){const i=fn(),s=n.record!==!1&&i;let a,{duration:l=Z.duration,delay:c=Z.delay,endDelay:d=Z.endDelay,repeat:b=Z.repeat,easing:h=Z.easing,persist:f=!1,direction:p,offset:g,allowWebkitAcceleration:_=!1,autoplay:u=!0}=n;const y=ho(e),w=uo(t);let v=Ct.waapi();w&&nn(e,t);const E=lr(t),M=Qo(y.values,E),S=Zt.get(E);return mo(M.animation,!(sr(h)&&M.generator)&&n.record!==!1),()=>{const U=()=>{var R,Y;return(Y=(R=Xt.get(e,E))!==null&&R!==void 0?R:S==null?void 0:S.initialValue)!==null&&Y!==void 0?Y:0};let P=un(mn(r),U);const z=gn(P,S);if(sr(h)){const R=h.createAnimation(P,t!=="opacity",U,E,M);h=R.easing,P=R.keyframes||P,l=R.duration||l}if(ar(E)&&(Ct.cssRegisterProperty()?ln(E):v=!1),w&&!Ct.linearEasing()&&(Ot(h)||Et(h)&&h.some(Ot))&&(v=!1),v){S&&(P=P.map(D=>he(D)?S.toDefaultUnit(D):D)),P.length===1&&(!Ct.partialKeyframes()||s)&&P.unshift(U());const R={delay:zt.ms(c),duration:zt.ms(l),endDelay:zt.ms(d),easing:Et(h)?void 0:Tr(h,l),direction:p,iterations:b+1,fill:"both"};a=e.animate({[E]:P,offset:g,easing:Et(h)?h.map(D=>Tr(D,l)):void 0},R),a.finished||(a.finished=new Promise((D,Do)=>{a.onfinish=D,a.oncancel=Do}));const Y=P[P.length-1];a.finished.then(()=>{f||(Xt.set(e,E,Y),a.cancel())}).catch(io),_||(a.playbackRate=1.000001)}else if(o&&w)P=P.map(R=>typeof R=="string"?parseFloat(R):R),P.length===1&&P.unshift(parseFloat(U())),a=new o(R=>{Xt.set(e,E,z?z(R):R)},P,Object.assign(Object.assign({},n),{duration:l,easing:h}));else{const R=P[P.length-1];Xt.set(e,E,S&&he(R)?S.toDefaultUnit(R):R)}return s&&i(e,t,P,{duration:l,delay:c,easing:h,repeat:b,offset:g},"motion-one"),M.setAnimation(a),a&&!u&&a.pause(),a}}const wn=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function vn(e,t){var r;return typeof e=="string"?t?((r=t[e])!==null&&r!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const bn=e=>e(),go=(e,t,r=Z.duration)=>new Proxy({animations:e.map(bn).filter(Boolean),duration:r,options:t},xn),yn=e=>e.animations[0],xn={get:(e,t)=>{const r=yn(e);switch(t){case"duration":return e.duration;case"currentTime":return zt.s((r==null?void 0:r[t])||0);case"playbackRate":case"playState":return r==null?void 0:r[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map($n)).catch(io)),e.finished;case"stop":return()=>{e.animations.forEach(n=>mo(n))};case"forEachNative":return n=>{e.animations.forEach(o=>n(o,e))};default:return typeof(r==null?void 0:r[t])>"u"?void 0:()=>e.animations.forEach(n=>n[t]())}},set:(e,t,r)=>{switch(t){case"currentTime":r=zt.ms(r);case"playbackRate":for(let n=0;ne.finished;function Cn(e,t,r){return Ot(e)?e(t,r):e}function En(e){return function(r,n,o={}){r=vn(r);const i=r.length,s=[];for(let a=0;aMath.min(Math.max(r,e),t),Z={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},he=e=>typeof e=="number",Et=e=>Array.isArray(e)&&!he(e[0]),Wo=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function Ho(e,t){return Et(e)?e[Wo(0,e.length,t)]:e}const no=(e,t,r)=>-r*e+r*t+e,io=()=>{},it=e=>e,pr=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function so(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=pr(0,t,n);e.push(no(r,1,o))}}function zo(e){const t=[0];return so(t,e-1),t}function Fo(e,t=zo(e.length),r=it){const n=e.length,o=n-t.length;return o>0&&so(t,o),i=>{let s=0;for(;sArray.isArray(e)&&he(e[0]),sr=e=>typeof e=="object"&&!!e.createAnimation,Ot=e=>typeof e=="function",Zo=e=>typeof e=="string",zt={ms:e=>e*1e3,s:e=>e/1e3},lo=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Vo=1e-7,Ko=12;function qo(e,t,r,n,o){let i,s,a=0;do s=t+(r-t)/2,i=lo(s,n,o)-e,i>0?r=s:t=s;while(Math.abs(i)>Vo&&++aqo(i,0,1,e,r);return i=>i===0||i===1?i:lo(o(i),t,n)}const Yo=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,o=t==="end"?Math.floor(n):Math.ceil(n);return oo(0,1,o/e)},Ar={ease:Ht(.25,.1,.25,1),"ease-in":Ht(.42,0,1,1),"ease-in-out":Ht(.42,0,.58,1),"ease-out":Ht(0,0,.58,1)},Jo=/\((.*?)\)/;function _r(e){if(Ot(e))return e;if(ao(e))return Ht(...e);if(Ar[e])return Ar[e];if(e.startsWith("steps")){const t=Jo.exec(e);if(t){const r=t[1].split(",");return Yo(parseFloat(r[0]),r[1].trim())}}return it}class co{constructor(t,r=[0,1],{easing:n,duration:o=Z.duration,delay:i=Z.delay,endDelay:s=Z.endDelay,repeat:a=Z.repeat,offset:l,direction:c="normal",autoplay:d=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=it,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((h,f)=>{this.resolve=h,this.reject=f}),n=n||Z.easing,sr(n)){const h=n.createAnimation(r);n=h.easing,r=h.keyframes||r,o=h.duration||o}this.repeat=a,this.easing=Et(n)?it:_r(n),this.updateDuration(o);const b=Fo(r,l,Et(n)?n.map(_r):it);this.tick=h=>{var f;i=i;let p=0;this.pauseTime!==void 0?p=this.pauseTime:p=(h-this.startTime)*this.rate,this.t=p,p/=1e3,p=Math.max(p-i,0),this.playState==="finished"&&this.pauseTime===void 0&&(p=this.totalDuration);const g=p/this.duration;let _=Math.floor(g),u=g%1;!u&&g>=1&&(u=1),u===1&&_--;const y=_%2;(c==="reverse"||c==="alternate"&&y||c==="alternate-reverse"&&!y)&&(u=1-u);const w=p>=this.totalDuration?1:Math.min(u,1),v=b(this.easing(w));t(v),this.pauseTime===void 0&&(this.playState==="finished"||p>=this.totalDuration+s)?(this.playState="finished",(f=this.resolve)===null||f===void 0||f.call(this,v)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},d&&this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}class Go{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ce=new WeakMap;function ho(e){return Ce.has(e)||Ce.set(e,{transforms:[],values:new Map}),Ce.get(e)}function Qo(e,t){return e.has(t)||e.set(t,new Go),e.get(t)}const Xo=["","X","Y","Z"],tn=["translate","scale","rotate","skew"],ue={x:"translateX",y:"translateY",z:"translateZ"},Or={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},en={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:Or,scale:{syntax:"",initialValue:1,toDefaultUnit:it},skew:Or},Zt=new Map,wr=e=>`--motion-${e}`,me=["x","y","z"];tn.forEach(e=>{Xo.forEach(t=>{me.push(e+t),Zt.set(wr(e+t),en[e])})});const rn=(e,t)=>me.indexOf(e)-me.indexOf(t),on=new Set(me),uo=e=>on.has(e),nn=(e,t)=>{ue[t]&&(t=ue[t]);const{transforms:r}=ho(e);jo(r,t),e.style.transform=sn(r)},sn=e=>e.sort(rn).reduce(an,"").trim(),an=(e,t)=>`${e} ${t}(var(${wr(t)}))`,ar=e=>e.startsWith("--"),kr=new Set;function ln(e){if(!kr.has(e)){kr.add(e);try{const{syntax:t,initialValue:r}=Zt.has(e)?Zt.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch{}}}const Ee=(e,t)=>document.createElement("div").animate(e,t),Ir={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ee({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Ee({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Ee({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Ae={},Ct={};for(const e in Ir)Ct[e]=()=>(Ae[e]===void 0&&(Ae[e]=Ir[e]()),Ae[e]);const cn=.015,dn=(e,t)=>{let r="";const n=Math.round(t/cn);for(let o=0;oOt(e)?Ct.linearEasing()?`linear(${dn(e,t)})`:Z.easing:ao(e)?hn(e):e,hn=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;function un(e,t){for(let r=0;rArray.isArray(e)?e:[e];function lr(e){return ue[e]&&(e=ue[e]),uo(e)?wr(e):e}const Xt={get:(e,t)=>{t=lr(t);let r=ar(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&r!==0){const n=Zt.get(t);n&&(r=n.initialValue)}return r},set:(e,t,r)=>{t=lr(t),ar(t)?e.style.setProperty(t,r):e.style[t]=r}};function mo(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function gn(e,t){var r;let n=(t==null?void 0:t.toDefaultUnit)||it;const o=e[e.length-1];if(Zo(o)){const i=((r=o.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";i&&(n=s=>s+i)}return n}function fn(){return window.__MOTION_DEV_TOOLS_RECORD}function pn(e,t,r,n={},o){const i=fn(),s=n.record!==!1&&i;let a,{duration:l=Z.duration,delay:c=Z.delay,endDelay:d=Z.endDelay,repeat:b=Z.repeat,easing:h=Z.easing,persist:f=!1,direction:p,offset:g,allowWebkitAcceleration:_=!1,autoplay:u=!0}=n;const y=ho(e),w=uo(t);let v=Ct.waapi();w&&nn(e,t);const E=lr(t),M=Qo(y.values,E),S=Zt.get(E);return mo(M.animation,!(sr(h)&&M.generator)&&n.record!==!1),()=>{const U=()=>{var R,Y;return(Y=(R=Xt.get(e,E))!==null&&R!==void 0?R:S==null?void 0:S.initialValue)!==null&&Y!==void 0?Y:0};let P=un(mn(r),U);const z=gn(P,S);if(sr(h)){const R=h.createAnimation(P,t!=="opacity",U,E,M);h=R.easing,P=R.keyframes||P,l=R.duration||l}if(ar(E)&&(Ct.cssRegisterProperty()?ln(E):v=!1),w&&!Ct.linearEasing()&&(Ot(h)||Et(h)&&h.some(Ot))&&(v=!1),v){S&&(P=P.map(D=>he(D)?S.toDefaultUnit(D):D)),P.length===1&&(!Ct.partialKeyframes()||s)&&P.unshift(U());const R={delay:zt.ms(c),duration:zt.ms(l),endDelay:zt.ms(d),easing:Et(h)?void 0:Tr(h,l),direction:p,iterations:b+1,fill:"both"};a=e.animate({[E]:P,offset:g,easing:Et(h)?h.map(D=>Tr(D,l)):void 0},R),a.finished||(a.finished=new Promise((D,Do)=>{a.onfinish=D,a.oncancel=Do}));const Y=P[P.length-1];a.finished.then(()=>{f||(Xt.set(e,E,Y),a.cancel())}).catch(io),_||(a.playbackRate=1.000001)}else if(o&&w)P=P.map(R=>typeof R=="string"?parseFloat(R):R),P.length===1&&P.unshift(parseFloat(U())),a=new o(R=>{Xt.set(e,E,z?z(R):R)},P,Object.assign(Object.assign({},n),{duration:l,easing:h}));else{const R=P[P.length-1];Xt.set(e,E,S&&he(R)?S.toDefaultUnit(R):R)}return s&&i(e,t,P,{duration:l,delay:c,easing:h,repeat:b,offset:g},"motion-one"),M.setAnimation(a),a&&!u&&a.pause(),a}}const wn=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function vn(e,t){var r;return typeof e=="string"?t?((r=t[e])!==null&&r!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const bn=e=>e(),go=(e,t,r=Z.duration)=>new Proxy({animations:e.map(bn).filter(Boolean),duration:r,options:t},xn),yn=e=>e.animations[0],xn={get:(e,t)=>{const r=yn(e);switch(t){case"duration":return e.duration;case"currentTime":return zt.s((r==null?void 0:r[t])||0);case"playbackRate":case"playState":return r==null?void 0:r[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map($n)).catch(io)),e.finished;case"stop":return()=>{e.animations.forEach(n=>mo(n))};case"forEachNative":return n=>{e.animations.forEach(o=>n(o,e))};default:return typeof(r==null?void 0:r[t])>"u"?void 0:()=>e.animations.forEach(n=>n[t]())}},set:(e,t,r)=>{switch(t){case"currentTime":r=zt.ms(r);case"playbackRate":for(let n=0;ne.finished;function Cn(e,t,r){return Ot(e)?e(t,r):e}function En(e){return function(r,n,o={}){r=vn(r);const i=r.length,s=[];for(let a=0;a>>16&65535,m=f&65535,D=y>>>16&65535,I=y&65535;return m*I+(g*I+m*D<<16>>>0)|0}i.mul=Math.imul||e;function t(f,y){return f+y|0}i.add=t;function s(f,y){return f-y|0}i.sub=s;function o(f,y){return f<>>32-y}i.rotl=o;function c(f,y){return f<<32-y|f>>>y}i.rotr=c;function d(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}i.isInteger=Number.isInteger||d,i.MAX_SAFE_INTEGER=9007199254740991,i.isSafeInteger=function(f){return i.isInteger(f)&&f>=-i.MAX_SAFE_INTEGER&&f<=i.MAX_SAFE_INTEGER}})(Md);Object.defineProperty(Le,"__esModule",{value:!0});var jd=Md;function A_(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])<<16>>16}Le.readInt16BE=A_;function T_(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])>>>0}Le.readUint16BE=T_;function R_(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])<<16>>16}Le.readInt16LE=R_;function N_(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])>>>0}Le.readUint16LE=N_;function qd(i,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=i>>>8,e[t+1]=i>>>0,e}Le.writeUint16BE=qd;Le.writeInt16BE=qd;function Fd(i,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=i>>>0,e[t+1]=i>>>8,e}Le.writeUint16LE=Fd;Le.writeInt16LE=Fd;function ou(i,e){return e===void 0&&(e=0),i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3]}Le.readInt32BE=ou;function au(i,e){return e===void 0&&(e=0),(i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3])>>>0}Le.readUint32BE=au;function cu(i,e){return e===void 0&&(e=0),i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e]}Le.readInt32LE=cu;function uu(i,e){return e===void 0&&(e=0),(i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e])>>>0}Le.readUint32LE=uu;function Yo(i,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=i>>>24,e[t+1]=i>>>16,e[t+2]=i>>>8,e[t+3]=i>>>0,e}Le.writeUint32BE=Yo;Le.writeInt32BE=Yo;function Jo(i,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=i>>>0,e[t+1]=i>>>8,e[t+2]=i>>>16,e[t+3]=i>>>24,e}Le.writeUint32LE=Jo;Le.writeInt32LE=Jo;function U_(i,e){e===void 0&&(e=0);var t=ou(i,e),s=ou(i,e+4);return t*4294967296+s-(s>>31)*4294967296}Le.readInt64BE=U_;function $_(i,e){e===void 0&&(e=0);var t=au(i,e),s=au(i,e+4);return t*4294967296+s}Le.readUint64BE=$_;function L_(i,e){e===void 0&&(e=0);var t=cu(i,e),s=cu(i,e+4);return s*4294967296+t-(t>>31)*4294967296}Le.readInt64LE=L_;function M_(i,e){e===void 0&&(e=0);var t=uu(i,e),s=uu(i,e+4);return s*4294967296+t}Le.readUint64LE=M_;function zd(i,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Yo(i/4294967296>>>0,e,t),Yo(i>>>0,e,t+4),e}Le.writeUint64BE=zd;Le.writeInt64BE=zd;function Bd(i,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Jo(i>>>0,e,t),Jo(i/4294967296>>>0,e,t+4),e}Le.writeUint64LE=Bd;Le.writeInt64LE=Bd;function j_(i,e,t){if(t===void 0&&(t=0),i%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(i/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var s=0,o=1,c=i/8+t-1;c>=t;c--)s+=e[c]*o,o*=256;return s}Le.readUintBE=j_;function q_(i,e,t){if(t===void 0&&(t=0),i%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(i/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var s=0,o=1,c=t;c=s;c--)t[c]=e/o&255,o*=256;return t}Le.writeUintBE=F_;function z_(i,e,t,s){if(t===void 0&&(t=new Uint8Array(i/8)),s===void 0&&(s=0),i%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!jd.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var o=1,c=s;c>>16|C<<16,se=se+C|0,u^=se,u=u>>>20|u<<12,O=O+_|0,ee^=O,ee=ee>>>16|ee<<16,ue=ue+ee|0,_^=ue,_=_>>>20|_<<12,A=A+G|0,Q^=A,Q=Q>>>16|Q<<16,de=de+Q|0,G^=de,G=G>>>20|G<<12,E=E+W|0,k^=E,k=k>>>16|k<<16,b=b+k|0,W^=b,W=W>>>20|W<<12,A=A+G|0,Q^=A,Q=Q>>>24|Q<<8,de=de+Q|0,G^=de,G=G>>>25|G<<7,E=E+W|0,k^=E,k=k>>>24|k<<8,b=b+k|0,W^=b,W=W>>>25|W<<7,O=O+_|0,ee^=O,ee=ee>>>24|ee<<8,ue=ue+ee|0,_^=ue,_=_>>>25|_<<7,j=j+u|0,C^=j,C=C>>>24|C<<8,se=se+C|0,u^=se,u=u>>>25|u<<7,j=j+_|0,k^=j,k=k>>>16|k<<16,de=de+k|0,_^=de,_=_>>>20|_<<12,O=O+G|0,C^=O,C=C>>>16|C<<16,b=b+C|0,G^=b,G=G>>>20|G<<12,A=A+W|0,ee^=A,ee=ee>>>16|ee<<16,se=se+ee|0,W^=se,W=W>>>20|W<<12,E=E+u|0,Q^=E,Q=Q>>>16|Q<<16,ue=ue+Q|0,u^=ue,u=u>>>20|u<<12,A=A+W|0,ee^=A,ee=ee>>>24|ee<<8,se=se+ee|0,W^=se,W=W>>>25|W<<7,E=E+u|0,Q^=E,Q=Q>>>24|Q<<8,ue=ue+Q|0,u^=ue,u=u>>>25|u<<7,O=O+G|0,C^=O,C=C>>>24|C<<8,b=b+C|0,G^=b,G=G>>>25|G<<7,j=j+_|0,k^=j,k=k>>>24|k<<8,de=de+k|0,_^=de,_=_>>>25|_<<7;er.writeUint32LE(j+s|0,i,0),er.writeUint32LE(O+o|0,i,4),er.writeUint32LE(A+c|0,i,8),er.writeUint32LE(E+d|0,i,12),er.writeUint32LE(u+f|0,i,16),er.writeUint32LE(_+y|0,i,20),er.writeUint32LE(G+g|0,i,24),er.writeUint32LE(W+m|0,i,28),er.writeUint32LE(se+D|0,i,32),er.writeUint32LE(ue+I|0,i,36),er.writeUint32LE(de+T|0,i,40),er.writeUint32LE(b+P|0,i,44),er.writeUint32LE(C+z|0,i,48),er.writeUint32LE(ee+H|0,i,52),er.writeUint32LE(Q+ie|0,i,56),er.writeUint32LE(k+U|0,i,60)}function Hd(i,e,t,s,o){if(o===void 0&&(o=0),i.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(s.length>>=8,e++;if(s>0)throw new Error("ChaCha: counter overflow")}var Kd={},Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});function t1(i,e,t){return~(i-1)&e|i-1&t}Bi.select=t1;function r1(i,e){return(i|0)-(e|0)-1>>>31&1}Bi.lessOrEqual=r1;function kd(i,e){if(i.length!==e.length)return 0;for(var t=0,s=0;s>>8}Bi.compare=kd;function i1(i,e){return i.length===0||e.length===0?!1:kd(i,e)!==0}Bi.equal=i1;(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=Bi,t=Ar;i.DIGEST_LENGTH=16;var s=function(){function d(f){this.digestLength=i.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var y=f[0]|f[1]<<8;this._r[0]=y&8191;var g=f[2]|f[3]<<8;this._r[1]=(y>>>13|g<<3)&8191;var m=f[4]|f[5]<<8;this._r[2]=(g>>>10|m<<6)&7939;var D=f[6]|f[7]<<8;this._r[3]=(m>>>7|D<<9)&8191;var I=f[8]|f[9]<<8;this._r[4]=(D>>>4|I<<12)&255,this._r[5]=I>>>1&8190;var T=f[10]|f[11]<<8;this._r[6]=(I>>>14|T<<2)&8191;var P=f[12]|f[13]<<8;this._r[7]=(T>>>11|P<<5)&8065;var z=f[14]|f[15]<<8;this._r[8]=(P>>>8|z<<8)&8191,this._r[9]=z>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return d.prototype._blocks=function(f,y,g){for(var m=this._fin?0:2048,D=this._h[0],I=this._h[1],T=this._h[2],P=this._h[3],z=this._h[4],H=this._h[5],ie=this._h[6],U=this._h[7],j=this._h[8],O=this._h[9],A=this._r[0],E=this._r[1],u=this._r[2],_=this._r[3],G=this._r[4],W=this._r[5],se=this._r[6],ue=this._r[7],de=this._r[8],b=this._r[9];g>=16;){var C=f[y+0]|f[y+1]<<8;D+=C&8191;var ee=f[y+2]|f[y+3]<<8;I+=(C>>>13|ee<<3)&8191;var Q=f[y+4]|f[y+5]<<8;T+=(ee>>>10|Q<<6)&8191;var k=f[y+6]|f[y+7]<<8;P+=(Q>>>7|k<<9)&8191;var V=f[y+8]|f[y+9]<<8;z+=(k>>>4|V<<12)&8191,H+=V>>>1&8191;var J=f[y+10]|f[y+11]<<8;ie+=(V>>>14|J<<2)&8191;var re=f[y+12]|f[y+13]<<8;U+=(J>>>11|re<<5)&8191;var _e=f[y+14]|f[y+15]<<8;j+=(re>>>8|_e<<8)&8191,O+=_e>>>5|m;var oe=0,be=oe;be+=D*A,be+=I*(5*b),be+=T*(5*de),be+=P*(5*ue),be+=z*(5*se),oe=be>>>13,be&=8191,be+=H*(5*W),be+=ie*(5*G),be+=U*(5*_),be+=j*(5*u),be+=O*(5*E),oe+=be>>>13,be&=8191;var le=oe;le+=D*E,le+=I*A,le+=T*(5*b),le+=P*(5*de),le+=z*(5*ue),oe=le>>>13,le&=8191,le+=H*(5*se),le+=ie*(5*W),le+=U*(5*G),le+=j*(5*_),le+=O*(5*u),oe+=le>>>13,le&=8191;var me=oe;me+=D*u,me+=I*E,me+=T*A,me+=P*(5*b),me+=z*(5*de),oe=me>>>13,me&=8191,me+=H*(5*ue),me+=ie*(5*se),me+=U*(5*W),me+=j*(5*G),me+=O*(5*_),oe+=me>>>13,me&=8191;var B=oe;B+=D*_,B+=I*u,B+=T*E,B+=P*A,B+=z*(5*b),oe=B>>>13,B&=8191,B+=H*(5*de),B+=ie*(5*ue),B+=U*(5*se),B+=j*(5*W),B+=O*(5*G),oe+=B>>>13,B&=8191;var F=oe;F+=D*G,F+=I*_,F+=T*u,F+=P*E,F+=z*A,oe=F>>>13,F&=8191,F+=H*(5*b),F+=ie*(5*de),F+=U*(5*ue),F+=j*(5*se),F+=O*(5*W),oe+=F>>>13,F&=8191;var $=oe;$+=D*W,$+=I*G,$+=T*_,$+=P*u,$+=z*E,oe=$>>>13,$&=8191,$+=H*A,$+=ie*(5*b),$+=U*(5*de),$+=j*(5*ue),$+=O*(5*se),oe+=$>>>13,$&=8191;var l=oe;l+=D*se,l+=I*W,l+=T*G,l+=P*_,l+=z*u,oe=l>>>13,l&=8191,l+=H*E,l+=ie*A,l+=U*(5*b),l+=j*(5*de),l+=O*(5*ue),oe+=l>>>13,l&=8191;var R=oe;R+=D*ue,R+=I*se,R+=T*W,R+=P*G,R+=z*_,oe=R>>>13,R&=8191,R+=H*u,R+=ie*E,R+=U*A,R+=j*(5*b),R+=O*(5*de),oe+=R>>>13,R&=8191;var ae=oe;ae+=D*de,ae+=I*ue,ae+=T*se,ae+=P*W,ae+=z*G,oe=ae>>>13,ae&=8191,ae+=H*_,ae+=ie*u,ae+=U*E,ae+=j*A,ae+=O*(5*b),oe+=ae>>>13,ae&=8191;var fe=oe;fe+=D*b,fe+=I*de,fe+=T*ue,fe+=P*se,fe+=z*W,oe=fe>>>13,fe&=8191,fe+=H*G,fe+=ie*_,fe+=U*u,fe+=j*E,fe+=O*A,oe+=fe>>>13,fe&=8191,oe=(oe<<2)+oe|0,oe=oe+be|0,be=oe&8191,oe=oe>>>13,le+=oe,D=be,I=le,T=me,P=B,z=F,H=$,ie=l,U=R,j=ae,O=fe,y+=16,g-=16}this._h[0]=D,this._h[1]=I,this._h[2]=T,this._h[3]=P,this._h[4]=z,this._h[5]=H,this._h[6]=ie,this._h[7]=U,this._h[8]=j,this._h[9]=O},d.prototype.finish=function(f,y){y===void 0&&(y=0);var g=new Uint16Array(10),m,D,I,T;if(this._leftover){for(T=this._leftover,this._buffer[T++]=1;T<16;T++)this._buffer[T]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(m=this._h[1]>>>13,this._h[1]&=8191,T=2;T<10;T++)this._h[T]+=m,m=this._h[T]>>>13,this._h[T]&=8191;for(this._h[0]+=m*5,m=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=m,m=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=m,g[0]=this._h[0]+5,m=g[0]>>>13,g[0]&=8191,T=1;T<10;T++)g[T]=this._h[T]+m,m=g[T]>>>13,g[T]&=8191;for(g[9]-=8192,D=(m^1)-1,T=0;T<10;T++)g[T]&=D;for(D=~D,T=0;T<10;T++)this._h[T]=this._h[T]&D|g[T];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,I=this._h[0]+this._pad[0],this._h[0]=I&65535,T=1;T<8;T++)I=(this._h[T]+this._pad[T]|0)+(I>>>16)|0,this._h[T]=I&65535;return f[y+0]=this._h[0]>>>0,f[y+1]=this._h[0]>>>8,f[y+2]=this._h[1]>>>0,f[y+3]=this._h[1]>>>8,f[y+4]=this._h[2]>>>0,f[y+5]=this._h[2]>>>8,f[y+6]=this._h[3]>>>0,f[y+7]=this._h[3]>>>8,f[y+8]=this._h[4]>>>0,f[y+9]=this._h[4]>>>8,f[y+10]=this._h[5]>>>0,f[y+11]=this._h[5]>>>8,f[y+12]=this._h[6]>>>0,f[y+13]=this._h[6]>>>8,f[y+14]=this._h[7]>>>0,f[y+15]=this._h[7]>>>8,this._finished=!0,this},d.prototype.update=function(f){var y=0,g=f.length,m;if(this._leftover){m=16-this._leftover,m>g&&(m=g);for(var D=0;D=16&&(m=g-g%16,this._blocks(f,y,m),y+=m,g-=m),g){for(var D=0;D16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var T=new Uint8Array(16);T.set(g,T.length-g.length);var P=new Uint8Array(32);e.stream(this._key,T,P,4);var z=m.length+this.tagLength,H;if(I){if(I.length!==z)throw new Error("ChaCha20Poly1305: incorrect destination length");H=I}else H=new Uint8Array(z);return e.streamXOR(this._key,T,m,H,4),this._authenticate(H.subarray(H.length-this.tagLength,H.length),P,H.subarray(0,H.length-this.tagLength),D),s.wipe(T),H},y.prototype.open=function(g,m,D,I){if(g.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(m.length0&&T.update(d.subarray(I.length%16))),T.update(D),D.length%16>0&&T.update(d.subarray(D.length%16));var P=new Uint8Array(8);I&&o.writeUint64LE(I.length,P),T.update(P),o.writeUint64LE(D.length,P),T.update(P);for(var z=T.digest(),H=0;Hthis.blockSize?this._inner.update(t).finish(s).clean():s.set(t);for(var o=0;o1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},i.prototype.expand=function(e){for(var t=new Uint8Array(e),s=0;s256)throw new Error("randomString charset is too long");let I="";const T=m.length,P=256-256%T;for(;g>0;){const z=o(Math.ceil(g*256/P),D);for(let H=0;H0;H++){const ie=z[H];ie0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=y[m++],g--;this._bufferLength===this.blockSize&&(c(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(g>=this.blockSize&&(m=c(this._temp,this._state,y,m,g),g%=this.blockSize);g>0;)this._buffer[this._bufferLength++]=y[m++],g--;return this},f.prototype.finish=function(y){if(!this._finished){var g=this._bytesHashed,m=this._bufferLength,D=g/536870912|0,I=g<<3,T=g%64<56?64:128;this._buffer[m]=128;for(var P=m+1;P0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(y){return this._state.set(y.state),this._bufferLength=y.bufferLength,y.buffer&&this._buffer.set(y.buffer),this._bytesHashed=y.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(y){t.wipe(y.state),y.buffer&&t.wipe(y.buffer),y.bufferLength=0,y.bytesHashed=0},f}();i.SHA256=s;var o=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function c(f,y,g,m,D){for(;D>=64;){for(var I=y[0],T=y[1],P=y[2],z=y[3],H=y[4],ie=y[5],U=y[6],j=y[7],O=0;O<16;O++){var A=m+O*4;f[O]=e.readUint32BE(g,A)}for(var O=16;O<64;O++){var E=f[O-2],u=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10;E=f[O-15];var _=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3;f[O]=(u+f[O-7]|0)+(_+f[O-16]|0)}for(var O=0;O<64;O++){var u=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&ie^~H&U)|0)+(j+(o[O]+f[O]|0)|0)|0,_=((I>>>2|I<<30)^(I>>>13|I<<19)^(I>>>22|I<<10))+(I&T^I&P^T&P)|0;j=U,U=ie,ie=H,H=z+u|0,z=P,P=T,T=I,I=u+_|0}y[0]+=I,y[1]+=T,y[2]+=P,y[3]+=z,y[4]+=H,y[5]+=ie,y[6]+=U,y[7]+=j,m+=64,D-=64}return m}function d(f){var y=new s;y.update(f);var g=y.digest();return y.clean(),g}i.hash=d})(oa);var Uu={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.sharedKey=i.generateKeyPair=i.generateKeyPairFromSeed=i.scalarMultBase=i.scalarMult=i.SHARED_KEY_LENGTH=i.SECRET_KEY_LENGTH=i.PUBLIC_KEY_LENGTH=void 0;const e=Bn,t=Ar;i.PUBLIC_KEY_LENGTH=32,i.SECRET_KEY_LENGTH=32,i.SHARED_KEY_LENGTH=32;function s(O){const A=new Float64Array(16);if(O)for(let E=0;E>16&1),E[W-1]&=65535;E[15]=u[15]-32767-(E[14]>>16&1);const G=E[15]>>16&1;E[14]&=65535,f(u,E,1-G)}for(let _=0;_<16;_++)O[2*_]=u[_]&255,O[2*_+1]=u[_]>>8}function g(O,A){for(let E=0;E<16;E++)O[E]=A[2*E]+(A[2*E+1]<<8);O[15]&=32767}function m(O,A,E){for(let u=0;u<16;u++)O[u]=A[u]+E[u]}function D(O,A,E){for(let u=0;u<16;u++)O[u]=A[u]-E[u]}function I(O,A,E){let u,_,G=0,W=0,se=0,ue=0,de=0,b=0,C=0,ee=0,Q=0,k=0,V=0,J=0,re=0,_e=0,oe=0,be=0,le=0,me=0,B=0,F=0,$=0,l=0,R=0,ae=0,fe=0,Ie=0,Be=0,ke=0,Me=0,gt=0,yt=0,qe=E[0],xe=E[1],Ne=E[2],Ue=E[3],Fe=E[4],Pe=E[5],$e=E[6],Se=E[7],Ce=E[8],He=E[9],Oe=E[10],Ve=E[11],We=E[12],et=E[13],tt=E[14],Qe=E[15];u=A[0],G+=u*qe,W+=u*xe,se+=u*Ne,ue+=u*Ue,de+=u*Fe,b+=u*Pe,C+=u*$e,ee+=u*Se,Q+=u*Ce,k+=u*He,V+=u*Oe,J+=u*Ve,re+=u*We,_e+=u*et,oe+=u*tt,be+=u*Qe,u=A[1],W+=u*qe,se+=u*xe,ue+=u*Ne,de+=u*Ue,b+=u*Fe,C+=u*Pe,ee+=u*$e,Q+=u*Se,k+=u*Ce,V+=u*He,J+=u*Oe,re+=u*Ve,_e+=u*We,oe+=u*et,be+=u*tt,le+=u*Qe,u=A[2],se+=u*qe,ue+=u*xe,de+=u*Ne,b+=u*Ue,C+=u*Fe,ee+=u*Pe,Q+=u*$e,k+=u*Se,V+=u*Ce,J+=u*He,re+=u*Oe,_e+=u*Ve,oe+=u*We,be+=u*et,le+=u*tt,me+=u*Qe,u=A[3],ue+=u*qe,de+=u*xe,b+=u*Ne,C+=u*Ue,ee+=u*Fe,Q+=u*Pe,k+=u*$e,V+=u*Se,J+=u*Ce,re+=u*He,_e+=u*Oe,oe+=u*Ve,be+=u*We,le+=u*et,me+=u*tt,B+=u*Qe,u=A[4],de+=u*qe,b+=u*xe,C+=u*Ne,ee+=u*Ue,Q+=u*Fe,k+=u*Pe,V+=u*$e,J+=u*Se,re+=u*Ce,_e+=u*He,oe+=u*Oe,be+=u*Ve,le+=u*We,me+=u*et,B+=u*tt,F+=u*Qe,u=A[5],b+=u*qe,C+=u*xe,ee+=u*Ne,Q+=u*Ue,k+=u*Fe,V+=u*Pe,J+=u*$e,re+=u*Se,_e+=u*Ce,oe+=u*He,be+=u*Oe,le+=u*Ve,me+=u*We,B+=u*et,F+=u*tt,$+=u*Qe,u=A[6],C+=u*qe,ee+=u*xe,Q+=u*Ne,k+=u*Ue,V+=u*Fe,J+=u*Pe,re+=u*$e,_e+=u*Se,oe+=u*Ce,be+=u*He,le+=u*Oe,me+=u*Ve,B+=u*We,F+=u*et,$+=u*tt,l+=u*Qe,u=A[7],ee+=u*qe,Q+=u*xe,k+=u*Ne,V+=u*Ue,J+=u*Fe,re+=u*Pe,_e+=u*$e,oe+=u*Se,be+=u*Ce,le+=u*He,me+=u*Oe,B+=u*Ve,F+=u*We,$+=u*et,l+=u*tt,R+=u*Qe,u=A[8],Q+=u*qe,k+=u*xe,V+=u*Ne,J+=u*Ue,re+=u*Fe,_e+=u*Pe,oe+=u*$e,be+=u*Se,le+=u*Ce,me+=u*He,B+=u*Oe,F+=u*Ve,$+=u*We,l+=u*et,R+=u*tt,ae+=u*Qe,u=A[9],k+=u*qe,V+=u*xe,J+=u*Ne,re+=u*Ue,_e+=u*Fe,oe+=u*Pe,be+=u*$e,le+=u*Se,me+=u*Ce,B+=u*He,F+=u*Oe,$+=u*Ve,l+=u*We,R+=u*et,ae+=u*tt,fe+=u*Qe,u=A[10],V+=u*qe,J+=u*xe,re+=u*Ne,_e+=u*Ue,oe+=u*Fe,be+=u*Pe,le+=u*$e,me+=u*Se,B+=u*Ce,F+=u*He,$+=u*Oe,l+=u*Ve,R+=u*We,ae+=u*et,fe+=u*tt,Ie+=u*Qe,u=A[11],J+=u*qe,re+=u*xe,_e+=u*Ne,oe+=u*Ue,be+=u*Fe,le+=u*Pe,me+=u*$e,B+=u*Se,F+=u*Ce,$+=u*He,l+=u*Oe,R+=u*Ve,ae+=u*We,fe+=u*et,Ie+=u*tt,Be+=u*Qe,u=A[12],re+=u*qe,_e+=u*xe,oe+=u*Ne,be+=u*Ue,le+=u*Fe,me+=u*Pe,B+=u*$e,F+=u*Se,$+=u*Ce,l+=u*He,R+=u*Oe,ae+=u*Ve,fe+=u*We,Ie+=u*et,Be+=u*tt,ke+=u*Qe,u=A[13],_e+=u*qe,oe+=u*xe,be+=u*Ne,le+=u*Ue,me+=u*Fe,B+=u*Pe,F+=u*$e,$+=u*Se,l+=u*Ce,R+=u*He,ae+=u*Oe,fe+=u*Ve,Ie+=u*We,Be+=u*et,ke+=u*tt,Me+=u*Qe,u=A[14],oe+=u*qe,be+=u*xe,le+=u*Ne,me+=u*Ue,B+=u*Fe,F+=u*Pe,$+=u*$e,l+=u*Se,R+=u*Ce,ae+=u*He,fe+=u*Oe,Ie+=u*Ve,Be+=u*We,ke+=u*et,Me+=u*tt,gt+=u*Qe,u=A[15],be+=u*qe,le+=u*xe,me+=u*Ne,B+=u*Ue,F+=u*Fe,$+=u*Pe,l+=u*$e,R+=u*Se,ae+=u*Ce,fe+=u*He,Ie+=u*Oe,Be+=u*Ve,ke+=u*We,Me+=u*et,gt+=u*tt,yt+=u*Qe,G+=38*le,W+=38*me,se+=38*B,ue+=38*F,de+=38*$,b+=38*l,C+=38*R,ee+=38*ae,Q+=38*fe,k+=38*Ie,V+=38*Be,J+=38*ke,re+=38*Me,_e+=38*gt,oe+=38*yt,_=1,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=se+_+65535,_=Math.floor(u/65536),se=u-_*65536,u=ue+_+65535,_=Math.floor(u/65536),ue=u-_*65536,u=de+_+65535,_=Math.floor(u/65536),de=u-_*65536,u=b+_+65535,_=Math.floor(u/65536),b=u-_*65536,u=C+_+65535,_=Math.floor(u/65536),C=u-_*65536,u=ee+_+65535,_=Math.floor(u/65536),ee=u-_*65536,u=Q+_+65535,_=Math.floor(u/65536),Q=u-_*65536,u=k+_+65535,_=Math.floor(u/65536),k=u-_*65536,u=V+_+65535,_=Math.floor(u/65536),V=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=re+_+65535,_=Math.floor(u/65536),re=u-_*65536,u=_e+_+65535,_=Math.floor(u/65536),_e=u-_*65536,u=oe+_+65535,_=Math.floor(u/65536),oe=u-_*65536,u=be+_+65535,_=Math.floor(u/65536),be=u-_*65536,G+=_-1+37*(_-1),_=1,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=se+_+65535,_=Math.floor(u/65536),se=u-_*65536,u=ue+_+65535,_=Math.floor(u/65536),ue=u-_*65536,u=de+_+65535,_=Math.floor(u/65536),de=u-_*65536,u=b+_+65535,_=Math.floor(u/65536),b=u-_*65536,u=C+_+65535,_=Math.floor(u/65536),C=u-_*65536,u=ee+_+65535,_=Math.floor(u/65536),ee=u-_*65536,u=Q+_+65535,_=Math.floor(u/65536),Q=u-_*65536,u=k+_+65535,_=Math.floor(u/65536),k=u-_*65536,u=V+_+65535,_=Math.floor(u/65536),V=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=re+_+65535,_=Math.floor(u/65536),re=u-_*65536,u=_e+_+65535,_=Math.floor(u/65536),_e=u-_*65536,u=oe+_+65535,_=Math.floor(u/65536),oe=u-_*65536,u=be+_+65535,_=Math.floor(u/65536),be=u-_*65536,G+=_-1+37*(_-1),O[0]=G,O[1]=W,O[2]=se,O[3]=ue,O[4]=de,O[5]=b,O[6]=C,O[7]=ee,O[8]=Q,O[9]=k,O[10]=V,O[11]=J,O[12]=re,O[13]=_e,O[14]=oe,O[15]=be}function T(O,A){I(O,A,A)}function P(O,A){const E=s();for(let u=0;u<16;u++)E[u]=A[u];for(let u=253;u>=0;u--)T(E,E),u!==2&&u!==4&&I(E,E,A);for(let u=0;u<16;u++)O[u]=E[u]}function z(O,A){const E=new Uint8Array(32),u=new Float64Array(80),_=s(),G=s(),W=s(),se=s(),ue=s(),de=s();for(let Q=0;Q<31;Q++)E[Q]=O[Q];E[31]=O[31]&127|64,E[0]&=248,g(u,A);for(let Q=0;Q<16;Q++)G[Q]=u[Q];_[0]=se[0]=1;for(let Q=254;Q>=0;--Q){const k=E[Q>>>3]>>>(Q&7)&1;f(_,G,k),f(W,se,k),m(ue,_,W),D(_,_,W),m(W,G,se),D(G,G,se),T(se,ue),T(de,_),I(_,W,_),I(W,G,ue),m(ue,_,W),D(_,_,W),T(G,_),D(W,se,de),I(_,W,c),m(_,_,se),I(W,W,_),I(_,se,de),I(se,G,u),T(G,ue),f(_,G,k),f(W,se,k)}for(let Q=0;Q<16;Q++)u[Q+16]=_[Q],u[Q+32]=W[Q],u[Q+48]=G[Q],u[Q+64]=se[Q];const b=u.subarray(32),C=u.subarray(16);P(b,b),I(C,C,b);const ee=new Uint8Array(32);return y(ee,C),ee}i.scalarMult=z;function H(O){return z(O,o)}i.scalarMultBase=H;function ie(O){if(O.length!==i.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${i.SECRET_KEY_LENGTH} bytes`);const A=new Uint8Array(O);return{publicKey:H(A),secretKey:A}}i.generateKeyPairFromSeed=ie;function U(O){const A=(0,e.randomBytes)(32,O),E=ie(A);return(0,t.wipe)(A),E}i.generateKeyPair=U;function j(O,A,E=!1){if(O.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(A.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const u=z(O,A);if(E){let _=0;for(let G=0;Go+c.length,0));const t=Wd(e);let s=0;for(const o of i)t.set(o,s),s+=o.length;return $u(t)}function v1(i,e){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),s=0;s>>0,O=new Uint8Array(j);ie!==U;){for(var A=P[ie],E=0,u=j-1;(A!==0||E>>0,O[u]=A%f>>>0,A=A/f>>>0;if(A!==0)throw new Error("Non-zero carry");H=E,ie++}for(var _=j-H;_!==j&&O[_]===0;)_++;for(var G=y.repeat(z);_>>0,j=new Uint8Array(U);P[z];){var O=t[P.charCodeAt(z)];if(O===255)return;for(var A=0,E=U-1;(O!==0||A>>0,j[E]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");ie=A,z++}if(P[z]!==" "){for(var u=U-ie;u!==U&&j[u]===0;)u++;for(var _=new Uint8Array(H+(U-u)),G=H;u!==U;)_[G++]=j[u++];return _}}}function T(P){var z=I(P);if(z)return z;throw new Error(`Non-${e} character`)}return{encode:D,decodeUnsafe:I,decode:T}}var m1=v1,w1=m1;const _1=i=>{if(i instanceof Uint8Array&&i.constructor.name==="Uint8Array")return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new Error("Unknown type, must be binary type")},b1=i=>new TextEncoder().encode(i),E1=i=>new TextDecoder().decode(i);class D1{constructor(e,t,s){this.name=e,this.prefix=t,this.baseEncode=s}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class S1{constructor(e,t,s){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=s}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Yd(this,e)}}class I1{constructor(e){this.decoders=e}or(e){return Yd(this,e)}decode(e){const t=e[0],s=this.decoders[t];if(s)return s.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Yd=(i,e)=>new I1({...i.decoders||{[i.prefix]:i},...e.decoders||{[e.prefix]:e}});class x1{constructor(e,t,s,o){this.name=e,this.prefix=t,this.baseEncode=s,this.baseDecode=o,this.encoder=new D1(e,t,s),this.decoder=new S1(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const aa=({name:i,prefix:e,encode:t,decode:s})=>new x1(i,e,t,s),Cs=({prefix:i,name:e,alphabet:t})=>{const{encode:s,decode:o}=w1(t,e);return aa({prefix:i,name:e,encode:s,decode:c=>_1(o(c))})},O1=(i,e,t,s)=>{const o={};for(let m=0;m=8&&(f-=8,d[g++]=255&y>>f)}if(f>=t||255&y<<8-f)throw new SyntaxError("Unexpected end of data");return d},P1=(i,e,t)=>{const s=e[e.length-1]==="=",o=(1<t;)d-=t,c+=e[o&f>>d];if(d&&(c+=e[o&f<aa({prefix:e,name:i,encode(o){return P1(o,s,t)},decode(o){return O1(o,s,t,i)}}),C1=aa({prefix:"\0",name:"identity",encode:i=>E1(i),decode:i=>b1(i)}),A1=Object.freeze(Object.defineProperty({__proto__:null,identity:C1},Symbol.toStringTag,{value:"Module"})),T1=Jt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),R1=Object.freeze(Object.defineProperty({__proto__:null,base2:T1},Symbol.toStringTag,{value:"Module"})),N1=Jt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),U1=Object.freeze(Object.defineProperty({__proto__:null,base8:N1},Symbol.toStringTag,{value:"Module"})),$1=Cs({prefix:"9",name:"base10",alphabet:"0123456789"}),L1=Object.freeze(Object.defineProperty({__proto__:null,base10:$1},Symbol.toStringTag,{value:"Module"})),M1=Jt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),j1=Jt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),q1=Object.freeze(Object.defineProperty({__proto__:null,base16:M1,base16upper:j1},Symbol.toStringTag,{value:"Module"})),F1=Jt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),z1=Jt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),B1=Jt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),H1=Jt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),K1=Jt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),k1=Jt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),V1=Jt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),G1=Jt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),W1=Jt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Y1=Object.freeze(Object.defineProperty({__proto__:null,base32:F1,base32hex:K1,base32hexpad:V1,base32hexpadupper:G1,base32hexupper:k1,base32pad:B1,base32padupper:H1,base32upper:z1,base32z:W1},Symbol.toStringTag,{value:"Module"})),J1=Cs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Q1=Cs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),X1=Object.freeze(Object.defineProperty({__proto__:null,base36:J1,base36upper:Q1},Symbol.toStringTag,{value:"Module"})),Z1=Cs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),eb=Cs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),tb=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Z1,base58flickr:eb},Symbol.toStringTag,{value:"Module"})),rb=Jt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ib=Jt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),nb=Jt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),sb=Jt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),ob=Object.freeze(Object.defineProperty({__proto__:null,base64:rb,base64pad:ib,base64url:nb,base64urlpad:sb},Symbol.toStringTag,{value:"Module"})),Jd=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),ab=Jd.reduce((i,e,t)=>(i[t]=e,i),[]),cb=Jd.reduce((i,e,t)=>(i[e.codePointAt(0)]=t,i),[]);function ub(i){return i.reduce((e,t)=>(e+=ab[t],e),"")}function hb(i){const e=[];for(const t of i){const s=cb[t.codePointAt(0)];if(s===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(s)}return new Uint8Array(e)}const lb=aa({prefix:"🚀",name:"base256emoji",encode:ub,decode:hb}),fb=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:lb},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const tf={...A1,...R1,...U1,...L1,...q1,...Y1,...X1,...tb,...ob,...fb};function Qd(i,e,t,s){return{name:i,prefix:e,encoder:{name:i,prefix:e,encode:t},decoder:{decode:s}}}const rf=Qd("utf8","u",i=>"u"+new TextDecoder("utf8").decode(i),i=>new TextEncoder().encode(i.substring(1))),Mc=Qd("ascii","a",i=>{let e="a";for(let t=0;t{i=i.substring(1);const e=Wd(i.length);for(let t=0;t"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new vb:typeof navigator<"u"?af(navigator.userAgent):Sb()}function Eb(i){return i!==""&&_b.reduce(function(e,t){var s=t[0],o=t[1];if(e)return e;var c=o.exec(i);return!!c&&[s,c]},!1)}function af(i){var e=Eb(i);if(!e)return null;var t=e[0],s=e[1];if(t==="searchbot")return new yb;var o=s[1]&&s[1].split(".").join("_").split("_").slice(0,3);o?o.length>>16&65535,m=f&65535,D=y>>>16&65535,I=y&65535;return m*I+(g*I+m*D<<16>>>0)|0}i.mul=Math.imul||e;function t(f,y){return f+y|0}i.add=t;function s(f,y){return f-y|0}i.sub=s;function o(f,y){return f<>>32-y}i.rotl=o;function c(f,y){return f<<32-y|f>>>y}i.rotr=c;function d(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}i.isInteger=Number.isInteger||d,i.MAX_SAFE_INTEGER=9007199254740991,i.isSafeInteger=function(f){return i.isInteger(f)&&f>=-i.MAX_SAFE_INTEGER&&f<=i.MAX_SAFE_INTEGER}})(Md);Object.defineProperty(Le,"__esModule",{value:!0});var jd=Md;function A_(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])<<16>>16}Le.readInt16BE=A_;function T_(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])>>>0}Le.readUint16BE=T_;function R_(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])<<16>>16}Le.readInt16LE=R_;function N_(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])>>>0}Le.readUint16LE=N_;function qd(i,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=i>>>8,e[t+1]=i>>>0,e}Le.writeUint16BE=qd;Le.writeInt16BE=qd;function Fd(i,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=i>>>0,e[t+1]=i>>>8,e}Le.writeUint16LE=Fd;Le.writeInt16LE=Fd;function ou(i,e){return e===void 0&&(e=0),i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3]}Le.readInt32BE=ou;function au(i,e){return e===void 0&&(e=0),(i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3])>>>0}Le.readUint32BE=au;function cu(i,e){return e===void 0&&(e=0),i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e]}Le.readInt32LE=cu;function uu(i,e){return e===void 0&&(e=0),(i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e])>>>0}Le.readUint32LE=uu;function Yo(i,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=i>>>24,e[t+1]=i>>>16,e[t+2]=i>>>8,e[t+3]=i>>>0,e}Le.writeUint32BE=Yo;Le.writeInt32BE=Yo;function Jo(i,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=i>>>0,e[t+1]=i>>>8,e[t+2]=i>>>16,e[t+3]=i>>>24,e}Le.writeUint32LE=Jo;Le.writeInt32LE=Jo;function U_(i,e){e===void 0&&(e=0);var t=ou(i,e),s=ou(i,e+4);return t*4294967296+s-(s>>31)*4294967296}Le.readInt64BE=U_;function $_(i,e){e===void 0&&(e=0);var t=au(i,e),s=au(i,e+4);return t*4294967296+s}Le.readUint64BE=$_;function L_(i,e){e===void 0&&(e=0);var t=cu(i,e),s=cu(i,e+4);return s*4294967296+t-(t>>31)*4294967296}Le.readInt64LE=L_;function M_(i,e){e===void 0&&(e=0);var t=uu(i,e),s=uu(i,e+4);return s*4294967296+t}Le.readUint64LE=M_;function zd(i,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Yo(i/4294967296>>>0,e,t),Yo(i>>>0,e,t+4),e}Le.writeUint64BE=zd;Le.writeInt64BE=zd;function Bd(i,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Jo(i>>>0,e,t),Jo(i/4294967296>>>0,e,t+4),e}Le.writeUint64LE=Bd;Le.writeInt64LE=Bd;function j_(i,e,t){if(t===void 0&&(t=0),i%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(i/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var s=0,o=1,c=i/8+t-1;c>=t;c--)s+=e[c]*o,o*=256;return s}Le.readUintBE=j_;function q_(i,e,t){if(t===void 0&&(t=0),i%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(i/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var s=0,o=1,c=t;c=s;c--)t[c]=e/o&255,o*=256;return t}Le.writeUintBE=F_;function z_(i,e,t,s){if(t===void 0&&(t=new Uint8Array(i/8)),s===void 0&&(s=0),i%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!jd.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var o=1,c=s;c>>16|C<<16,se=se+C|0,u^=se,u=u>>>20|u<<12,O=O+_|0,ee^=O,ee=ee>>>16|ee<<16,ue=ue+ee|0,_^=ue,_=_>>>20|_<<12,A=A+G|0,Q^=A,Q=Q>>>16|Q<<16,de=de+Q|0,G^=de,G=G>>>20|G<<12,E=E+W|0,k^=E,k=k>>>16|k<<16,b=b+k|0,W^=b,W=W>>>20|W<<12,A=A+G|0,Q^=A,Q=Q>>>24|Q<<8,de=de+Q|0,G^=de,G=G>>>25|G<<7,E=E+W|0,k^=E,k=k>>>24|k<<8,b=b+k|0,W^=b,W=W>>>25|W<<7,O=O+_|0,ee^=O,ee=ee>>>24|ee<<8,ue=ue+ee|0,_^=ue,_=_>>>25|_<<7,j=j+u|0,C^=j,C=C>>>24|C<<8,se=se+C|0,u^=se,u=u>>>25|u<<7,j=j+_|0,k^=j,k=k>>>16|k<<16,de=de+k|0,_^=de,_=_>>>20|_<<12,O=O+G|0,C^=O,C=C>>>16|C<<16,b=b+C|0,G^=b,G=G>>>20|G<<12,A=A+W|0,ee^=A,ee=ee>>>16|ee<<16,se=se+ee|0,W^=se,W=W>>>20|W<<12,E=E+u|0,Q^=E,Q=Q>>>16|Q<<16,ue=ue+Q|0,u^=ue,u=u>>>20|u<<12,A=A+W|0,ee^=A,ee=ee>>>24|ee<<8,se=se+ee|0,W^=se,W=W>>>25|W<<7,E=E+u|0,Q^=E,Q=Q>>>24|Q<<8,ue=ue+Q|0,u^=ue,u=u>>>25|u<<7,O=O+G|0,C^=O,C=C>>>24|C<<8,b=b+C|0,G^=b,G=G>>>25|G<<7,j=j+_|0,k^=j,k=k>>>24|k<<8,de=de+k|0,_^=de,_=_>>>25|_<<7;er.writeUint32LE(j+s|0,i,0),er.writeUint32LE(O+o|0,i,4),er.writeUint32LE(A+c|0,i,8),er.writeUint32LE(E+d|0,i,12),er.writeUint32LE(u+f|0,i,16),er.writeUint32LE(_+y|0,i,20),er.writeUint32LE(G+g|0,i,24),er.writeUint32LE(W+m|0,i,28),er.writeUint32LE(se+D|0,i,32),er.writeUint32LE(ue+I|0,i,36),er.writeUint32LE(de+T|0,i,40),er.writeUint32LE(b+P|0,i,44),er.writeUint32LE(C+z|0,i,48),er.writeUint32LE(ee+H|0,i,52),er.writeUint32LE(Q+ie|0,i,56),er.writeUint32LE(k+U|0,i,60)}function Hd(i,e,t,s,o){if(o===void 0&&(o=0),i.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(s.length>>=8,e++;if(s>0)throw new Error("ChaCha: counter overflow")}var Kd={},Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});function t1(i,e,t){return~(i-1)&e|i-1&t}Bi.select=t1;function r1(i,e){return(i|0)-(e|0)-1>>>31&1}Bi.lessOrEqual=r1;function kd(i,e){if(i.length!==e.length)return 0;for(var t=0,s=0;s>>8}Bi.compare=kd;function i1(i,e){return i.length===0||e.length===0?!1:kd(i,e)!==0}Bi.equal=i1;(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=Bi,t=Ar;i.DIGEST_LENGTH=16;var s=function(){function d(f){this.digestLength=i.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var y=f[0]|f[1]<<8;this._r[0]=y&8191;var g=f[2]|f[3]<<8;this._r[1]=(y>>>13|g<<3)&8191;var m=f[4]|f[5]<<8;this._r[2]=(g>>>10|m<<6)&7939;var D=f[6]|f[7]<<8;this._r[3]=(m>>>7|D<<9)&8191;var I=f[8]|f[9]<<8;this._r[4]=(D>>>4|I<<12)&255,this._r[5]=I>>>1&8190;var T=f[10]|f[11]<<8;this._r[6]=(I>>>14|T<<2)&8191;var P=f[12]|f[13]<<8;this._r[7]=(T>>>11|P<<5)&8065;var z=f[14]|f[15]<<8;this._r[8]=(P>>>8|z<<8)&8191,this._r[9]=z>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return d.prototype._blocks=function(f,y,g){for(var m=this._fin?0:2048,D=this._h[0],I=this._h[1],T=this._h[2],P=this._h[3],z=this._h[4],H=this._h[5],ie=this._h[6],U=this._h[7],j=this._h[8],O=this._h[9],A=this._r[0],E=this._r[1],u=this._r[2],_=this._r[3],G=this._r[4],W=this._r[5],se=this._r[6],ue=this._r[7],de=this._r[8],b=this._r[9];g>=16;){var C=f[y+0]|f[y+1]<<8;D+=C&8191;var ee=f[y+2]|f[y+3]<<8;I+=(C>>>13|ee<<3)&8191;var Q=f[y+4]|f[y+5]<<8;T+=(ee>>>10|Q<<6)&8191;var k=f[y+6]|f[y+7]<<8;P+=(Q>>>7|k<<9)&8191;var V=f[y+8]|f[y+9]<<8;z+=(k>>>4|V<<12)&8191,H+=V>>>1&8191;var J=f[y+10]|f[y+11]<<8;ie+=(V>>>14|J<<2)&8191;var re=f[y+12]|f[y+13]<<8;U+=(J>>>11|re<<5)&8191;var _e=f[y+14]|f[y+15]<<8;j+=(re>>>8|_e<<8)&8191,O+=_e>>>5|m;var oe=0,be=oe;be+=D*A,be+=I*(5*b),be+=T*(5*de),be+=P*(5*ue),be+=z*(5*se),oe=be>>>13,be&=8191,be+=H*(5*W),be+=ie*(5*G),be+=U*(5*_),be+=j*(5*u),be+=O*(5*E),oe+=be>>>13,be&=8191;var le=oe;le+=D*E,le+=I*A,le+=T*(5*b),le+=P*(5*de),le+=z*(5*ue),oe=le>>>13,le&=8191,le+=H*(5*se),le+=ie*(5*W),le+=U*(5*G),le+=j*(5*_),le+=O*(5*u),oe+=le>>>13,le&=8191;var me=oe;me+=D*u,me+=I*E,me+=T*A,me+=P*(5*b),me+=z*(5*de),oe=me>>>13,me&=8191,me+=H*(5*ue),me+=ie*(5*se),me+=U*(5*W),me+=j*(5*G),me+=O*(5*_),oe+=me>>>13,me&=8191;var B=oe;B+=D*_,B+=I*u,B+=T*E,B+=P*A,B+=z*(5*b),oe=B>>>13,B&=8191,B+=H*(5*de),B+=ie*(5*ue),B+=U*(5*se),B+=j*(5*W),B+=O*(5*G),oe+=B>>>13,B&=8191;var F=oe;F+=D*G,F+=I*_,F+=T*u,F+=P*E,F+=z*A,oe=F>>>13,F&=8191,F+=H*(5*b),F+=ie*(5*de),F+=U*(5*ue),F+=j*(5*se),F+=O*(5*W),oe+=F>>>13,F&=8191;var $=oe;$+=D*W,$+=I*G,$+=T*_,$+=P*u,$+=z*E,oe=$>>>13,$&=8191,$+=H*A,$+=ie*(5*b),$+=U*(5*de),$+=j*(5*ue),$+=O*(5*se),oe+=$>>>13,$&=8191;var l=oe;l+=D*se,l+=I*W,l+=T*G,l+=P*_,l+=z*u,oe=l>>>13,l&=8191,l+=H*E,l+=ie*A,l+=U*(5*b),l+=j*(5*de),l+=O*(5*ue),oe+=l>>>13,l&=8191;var R=oe;R+=D*ue,R+=I*se,R+=T*W,R+=P*G,R+=z*_,oe=R>>>13,R&=8191,R+=H*u,R+=ie*E,R+=U*A,R+=j*(5*b),R+=O*(5*de),oe+=R>>>13,R&=8191;var ae=oe;ae+=D*de,ae+=I*ue,ae+=T*se,ae+=P*W,ae+=z*G,oe=ae>>>13,ae&=8191,ae+=H*_,ae+=ie*u,ae+=U*E,ae+=j*A,ae+=O*(5*b),oe+=ae>>>13,ae&=8191;var fe=oe;fe+=D*b,fe+=I*de,fe+=T*ue,fe+=P*se,fe+=z*W,oe=fe>>>13,fe&=8191,fe+=H*G,fe+=ie*_,fe+=U*u,fe+=j*E,fe+=O*A,oe+=fe>>>13,fe&=8191,oe=(oe<<2)+oe|0,oe=oe+be|0,be=oe&8191,oe=oe>>>13,le+=oe,D=be,I=le,T=me,P=B,z=F,H=$,ie=l,U=R,j=ae,O=fe,y+=16,g-=16}this._h[0]=D,this._h[1]=I,this._h[2]=T,this._h[3]=P,this._h[4]=z,this._h[5]=H,this._h[6]=ie,this._h[7]=U,this._h[8]=j,this._h[9]=O},d.prototype.finish=function(f,y){y===void 0&&(y=0);var g=new Uint16Array(10),m,D,I,T;if(this._leftover){for(T=this._leftover,this._buffer[T++]=1;T<16;T++)this._buffer[T]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(m=this._h[1]>>>13,this._h[1]&=8191,T=2;T<10;T++)this._h[T]+=m,m=this._h[T]>>>13,this._h[T]&=8191;for(this._h[0]+=m*5,m=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=m,m=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=m,g[0]=this._h[0]+5,m=g[0]>>>13,g[0]&=8191,T=1;T<10;T++)g[T]=this._h[T]+m,m=g[T]>>>13,g[T]&=8191;for(g[9]-=8192,D=(m^1)-1,T=0;T<10;T++)g[T]&=D;for(D=~D,T=0;T<10;T++)this._h[T]=this._h[T]&D|g[T];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,I=this._h[0]+this._pad[0],this._h[0]=I&65535,T=1;T<8;T++)I=(this._h[T]+this._pad[T]|0)+(I>>>16)|0,this._h[T]=I&65535;return f[y+0]=this._h[0]>>>0,f[y+1]=this._h[0]>>>8,f[y+2]=this._h[1]>>>0,f[y+3]=this._h[1]>>>8,f[y+4]=this._h[2]>>>0,f[y+5]=this._h[2]>>>8,f[y+6]=this._h[3]>>>0,f[y+7]=this._h[3]>>>8,f[y+8]=this._h[4]>>>0,f[y+9]=this._h[4]>>>8,f[y+10]=this._h[5]>>>0,f[y+11]=this._h[5]>>>8,f[y+12]=this._h[6]>>>0,f[y+13]=this._h[6]>>>8,f[y+14]=this._h[7]>>>0,f[y+15]=this._h[7]>>>8,this._finished=!0,this},d.prototype.update=function(f){var y=0,g=f.length,m;if(this._leftover){m=16-this._leftover,m>g&&(m=g);for(var D=0;D=16&&(m=g-g%16,this._blocks(f,y,m),y+=m,g-=m),g){for(var D=0;D16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var T=new Uint8Array(16);T.set(g,T.length-g.length);var P=new Uint8Array(32);e.stream(this._key,T,P,4);var z=m.length+this.tagLength,H;if(I){if(I.length!==z)throw new Error("ChaCha20Poly1305: incorrect destination length");H=I}else H=new Uint8Array(z);return e.streamXOR(this._key,T,m,H,4),this._authenticate(H.subarray(H.length-this.tagLength,H.length),P,H.subarray(0,H.length-this.tagLength),D),s.wipe(T),H},y.prototype.open=function(g,m,D,I){if(g.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(m.length0&&T.update(d.subarray(I.length%16))),T.update(D),D.length%16>0&&T.update(d.subarray(D.length%16));var P=new Uint8Array(8);I&&o.writeUint64LE(I.length,P),T.update(P),o.writeUint64LE(D.length,P),T.update(P);for(var z=T.digest(),H=0;Hthis.blockSize?this._inner.update(t).finish(s).clean():s.set(t);for(var o=0;o1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},i.prototype.expand=function(e){for(var t=new Uint8Array(e),s=0;s256)throw new Error("randomString charset is too long");let I="";const T=m.length,P=256-256%T;for(;g>0;){const z=o(Math.ceil(g*256/P),D);for(let H=0;H0;H++){const ie=z[H];ie0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=y[m++],g--;this._bufferLength===this.blockSize&&(c(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(g>=this.blockSize&&(m=c(this._temp,this._state,y,m,g),g%=this.blockSize);g>0;)this._buffer[this._bufferLength++]=y[m++],g--;return this},f.prototype.finish=function(y){if(!this._finished){var g=this._bytesHashed,m=this._bufferLength,D=g/536870912|0,I=g<<3,T=g%64<56?64:128;this._buffer[m]=128;for(var P=m+1;P0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(y){return this._state.set(y.state),this._bufferLength=y.bufferLength,y.buffer&&this._buffer.set(y.buffer),this._bytesHashed=y.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(y){t.wipe(y.state),y.buffer&&t.wipe(y.buffer),y.bufferLength=0,y.bytesHashed=0},f}();i.SHA256=s;var o=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function c(f,y,g,m,D){for(;D>=64;){for(var I=y[0],T=y[1],P=y[2],z=y[3],H=y[4],ie=y[5],U=y[6],j=y[7],O=0;O<16;O++){var A=m+O*4;f[O]=e.readUint32BE(g,A)}for(var O=16;O<64;O++){var E=f[O-2],u=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10;E=f[O-15];var _=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3;f[O]=(u+f[O-7]|0)+(_+f[O-16]|0)}for(var O=0;O<64;O++){var u=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&ie^~H&U)|0)+(j+(o[O]+f[O]|0)|0)|0,_=((I>>>2|I<<30)^(I>>>13|I<<19)^(I>>>22|I<<10))+(I&T^I&P^T&P)|0;j=U,U=ie,ie=H,H=z+u|0,z=P,P=T,T=I,I=u+_|0}y[0]+=I,y[1]+=T,y[2]+=P,y[3]+=z,y[4]+=H,y[5]+=ie,y[6]+=U,y[7]+=j,m+=64,D-=64}return m}function d(f){var y=new s;y.update(f);var g=y.digest();return y.clean(),g}i.hash=d})(oa);var Uu={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.sharedKey=i.generateKeyPair=i.generateKeyPairFromSeed=i.scalarMultBase=i.scalarMult=i.SHARED_KEY_LENGTH=i.SECRET_KEY_LENGTH=i.PUBLIC_KEY_LENGTH=void 0;const e=Bn,t=Ar;i.PUBLIC_KEY_LENGTH=32,i.SECRET_KEY_LENGTH=32,i.SHARED_KEY_LENGTH=32;function s(O){const A=new Float64Array(16);if(O)for(let E=0;E>16&1),E[W-1]&=65535;E[15]=u[15]-32767-(E[14]>>16&1);const G=E[15]>>16&1;E[14]&=65535,f(u,E,1-G)}for(let _=0;_<16;_++)O[2*_]=u[_]&255,O[2*_+1]=u[_]>>8}function g(O,A){for(let E=0;E<16;E++)O[E]=A[2*E]+(A[2*E+1]<<8);O[15]&=32767}function m(O,A,E){for(let u=0;u<16;u++)O[u]=A[u]+E[u]}function D(O,A,E){for(let u=0;u<16;u++)O[u]=A[u]-E[u]}function I(O,A,E){let u,_,G=0,W=0,se=0,ue=0,de=0,b=0,C=0,ee=0,Q=0,k=0,V=0,J=0,re=0,_e=0,oe=0,be=0,le=0,me=0,B=0,F=0,$=0,l=0,R=0,ae=0,fe=0,Ie=0,Be=0,ke=0,Me=0,gt=0,yt=0,qe=E[0],xe=E[1],Ne=E[2],Ue=E[3],Fe=E[4],Pe=E[5],$e=E[6],Se=E[7],Ce=E[8],He=E[9],Oe=E[10],Ve=E[11],We=E[12],et=E[13],tt=E[14],Qe=E[15];u=A[0],G+=u*qe,W+=u*xe,se+=u*Ne,ue+=u*Ue,de+=u*Fe,b+=u*Pe,C+=u*$e,ee+=u*Se,Q+=u*Ce,k+=u*He,V+=u*Oe,J+=u*Ve,re+=u*We,_e+=u*et,oe+=u*tt,be+=u*Qe,u=A[1],W+=u*qe,se+=u*xe,ue+=u*Ne,de+=u*Ue,b+=u*Fe,C+=u*Pe,ee+=u*$e,Q+=u*Se,k+=u*Ce,V+=u*He,J+=u*Oe,re+=u*Ve,_e+=u*We,oe+=u*et,be+=u*tt,le+=u*Qe,u=A[2],se+=u*qe,ue+=u*xe,de+=u*Ne,b+=u*Ue,C+=u*Fe,ee+=u*Pe,Q+=u*$e,k+=u*Se,V+=u*Ce,J+=u*He,re+=u*Oe,_e+=u*Ve,oe+=u*We,be+=u*et,le+=u*tt,me+=u*Qe,u=A[3],ue+=u*qe,de+=u*xe,b+=u*Ne,C+=u*Ue,ee+=u*Fe,Q+=u*Pe,k+=u*$e,V+=u*Se,J+=u*Ce,re+=u*He,_e+=u*Oe,oe+=u*Ve,be+=u*We,le+=u*et,me+=u*tt,B+=u*Qe,u=A[4],de+=u*qe,b+=u*xe,C+=u*Ne,ee+=u*Ue,Q+=u*Fe,k+=u*Pe,V+=u*$e,J+=u*Se,re+=u*Ce,_e+=u*He,oe+=u*Oe,be+=u*Ve,le+=u*We,me+=u*et,B+=u*tt,F+=u*Qe,u=A[5],b+=u*qe,C+=u*xe,ee+=u*Ne,Q+=u*Ue,k+=u*Fe,V+=u*Pe,J+=u*$e,re+=u*Se,_e+=u*Ce,oe+=u*He,be+=u*Oe,le+=u*Ve,me+=u*We,B+=u*et,F+=u*tt,$+=u*Qe,u=A[6],C+=u*qe,ee+=u*xe,Q+=u*Ne,k+=u*Ue,V+=u*Fe,J+=u*Pe,re+=u*$e,_e+=u*Se,oe+=u*Ce,be+=u*He,le+=u*Oe,me+=u*Ve,B+=u*We,F+=u*et,$+=u*tt,l+=u*Qe,u=A[7],ee+=u*qe,Q+=u*xe,k+=u*Ne,V+=u*Ue,J+=u*Fe,re+=u*Pe,_e+=u*$e,oe+=u*Se,be+=u*Ce,le+=u*He,me+=u*Oe,B+=u*Ve,F+=u*We,$+=u*et,l+=u*tt,R+=u*Qe,u=A[8],Q+=u*qe,k+=u*xe,V+=u*Ne,J+=u*Ue,re+=u*Fe,_e+=u*Pe,oe+=u*$e,be+=u*Se,le+=u*Ce,me+=u*He,B+=u*Oe,F+=u*Ve,$+=u*We,l+=u*et,R+=u*tt,ae+=u*Qe,u=A[9],k+=u*qe,V+=u*xe,J+=u*Ne,re+=u*Ue,_e+=u*Fe,oe+=u*Pe,be+=u*$e,le+=u*Se,me+=u*Ce,B+=u*He,F+=u*Oe,$+=u*Ve,l+=u*We,R+=u*et,ae+=u*tt,fe+=u*Qe,u=A[10],V+=u*qe,J+=u*xe,re+=u*Ne,_e+=u*Ue,oe+=u*Fe,be+=u*Pe,le+=u*$e,me+=u*Se,B+=u*Ce,F+=u*He,$+=u*Oe,l+=u*Ve,R+=u*We,ae+=u*et,fe+=u*tt,Ie+=u*Qe,u=A[11],J+=u*qe,re+=u*xe,_e+=u*Ne,oe+=u*Ue,be+=u*Fe,le+=u*Pe,me+=u*$e,B+=u*Se,F+=u*Ce,$+=u*He,l+=u*Oe,R+=u*Ve,ae+=u*We,fe+=u*et,Ie+=u*tt,Be+=u*Qe,u=A[12],re+=u*qe,_e+=u*xe,oe+=u*Ne,be+=u*Ue,le+=u*Fe,me+=u*Pe,B+=u*$e,F+=u*Se,$+=u*Ce,l+=u*He,R+=u*Oe,ae+=u*Ve,fe+=u*We,Ie+=u*et,Be+=u*tt,ke+=u*Qe,u=A[13],_e+=u*qe,oe+=u*xe,be+=u*Ne,le+=u*Ue,me+=u*Fe,B+=u*Pe,F+=u*$e,$+=u*Se,l+=u*Ce,R+=u*He,ae+=u*Oe,fe+=u*Ve,Ie+=u*We,Be+=u*et,ke+=u*tt,Me+=u*Qe,u=A[14],oe+=u*qe,be+=u*xe,le+=u*Ne,me+=u*Ue,B+=u*Fe,F+=u*Pe,$+=u*$e,l+=u*Se,R+=u*Ce,ae+=u*He,fe+=u*Oe,Ie+=u*Ve,Be+=u*We,ke+=u*et,Me+=u*tt,gt+=u*Qe,u=A[15],be+=u*qe,le+=u*xe,me+=u*Ne,B+=u*Ue,F+=u*Fe,$+=u*Pe,l+=u*$e,R+=u*Se,ae+=u*Ce,fe+=u*He,Ie+=u*Oe,Be+=u*Ve,ke+=u*We,Me+=u*et,gt+=u*tt,yt+=u*Qe,G+=38*le,W+=38*me,se+=38*B,ue+=38*F,de+=38*$,b+=38*l,C+=38*R,ee+=38*ae,Q+=38*fe,k+=38*Ie,V+=38*Be,J+=38*ke,re+=38*Me,_e+=38*gt,oe+=38*yt,_=1,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=se+_+65535,_=Math.floor(u/65536),se=u-_*65536,u=ue+_+65535,_=Math.floor(u/65536),ue=u-_*65536,u=de+_+65535,_=Math.floor(u/65536),de=u-_*65536,u=b+_+65535,_=Math.floor(u/65536),b=u-_*65536,u=C+_+65535,_=Math.floor(u/65536),C=u-_*65536,u=ee+_+65535,_=Math.floor(u/65536),ee=u-_*65536,u=Q+_+65535,_=Math.floor(u/65536),Q=u-_*65536,u=k+_+65535,_=Math.floor(u/65536),k=u-_*65536,u=V+_+65535,_=Math.floor(u/65536),V=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=re+_+65535,_=Math.floor(u/65536),re=u-_*65536,u=_e+_+65535,_=Math.floor(u/65536),_e=u-_*65536,u=oe+_+65535,_=Math.floor(u/65536),oe=u-_*65536,u=be+_+65535,_=Math.floor(u/65536),be=u-_*65536,G+=_-1+37*(_-1),_=1,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=se+_+65535,_=Math.floor(u/65536),se=u-_*65536,u=ue+_+65535,_=Math.floor(u/65536),ue=u-_*65536,u=de+_+65535,_=Math.floor(u/65536),de=u-_*65536,u=b+_+65535,_=Math.floor(u/65536),b=u-_*65536,u=C+_+65535,_=Math.floor(u/65536),C=u-_*65536,u=ee+_+65535,_=Math.floor(u/65536),ee=u-_*65536,u=Q+_+65535,_=Math.floor(u/65536),Q=u-_*65536,u=k+_+65535,_=Math.floor(u/65536),k=u-_*65536,u=V+_+65535,_=Math.floor(u/65536),V=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=re+_+65535,_=Math.floor(u/65536),re=u-_*65536,u=_e+_+65535,_=Math.floor(u/65536),_e=u-_*65536,u=oe+_+65535,_=Math.floor(u/65536),oe=u-_*65536,u=be+_+65535,_=Math.floor(u/65536),be=u-_*65536,G+=_-1+37*(_-1),O[0]=G,O[1]=W,O[2]=se,O[3]=ue,O[4]=de,O[5]=b,O[6]=C,O[7]=ee,O[8]=Q,O[9]=k,O[10]=V,O[11]=J,O[12]=re,O[13]=_e,O[14]=oe,O[15]=be}function T(O,A){I(O,A,A)}function P(O,A){const E=s();for(let u=0;u<16;u++)E[u]=A[u];for(let u=253;u>=0;u--)T(E,E),u!==2&&u!==4&&I(E,E,A);for(let u=0;u<16;u++)O[u]=E[u]}function z(O,A){const E=new Uint8Array(32),u=new Float64Array(80),_=s(),G=s(),W=s(),se=s(),ue=s(),de=s();for(let Q=0;Q<31;Q++)E[Q]=O[Q];E[31]=O[31]&127|64,E[0]&=248,g(u,A);for(let Q=0;Q<16;Q++)G[Q]=u[Q];_[0]=se[0]=1;for(let Q=254;Q>=0;--Q){const k=E[Q>>>3]>>>(Q&7)&1;f(_,G,k),f(W,se,k),m(ue,_,W),D(_,_,W),m(W,G,se),D(G,G,se),T(se,ue),T(de,_),I(_,W,_),I(W,G,ue),m(ue,_,W),D(_,_,W),T(G,_),D(W,se,de),I(_,W,c),m(_,_,se),I(W,W,_),I(_,se,de),I(se,G,u),T(G,ue),f(_,G,k),f(W,se,k)}for(let Q=0;Q<16;Q++)u[Q+16]=_[Q],u[Q+32]=W[Q],u[Q+48]=G[Q],u[Q+64]=se[Q];const b=u.subarray(32),C=u.subarray(16);P(b,b),I(C,C,b);const ee=new Uint8Array(32);return y(ee,C),ee}i.scalarMult=z;function H(O){return z(O,o)}i.scalarMultBase=H;function ie(O){if(O.length!==i.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${i.SECRET_KEY_LENGTH} bytes`);const A=new Uint8Array(O);return{publicKey:H(A),secretKey:A}}i.generateKeyPairFromSeed=ie;function U(O){const A=(0,e.randomBytes)(32,O),E=ie(A);return(0,t.wipe)(A),E}i.generateKeyPair=U;function j(O,A,E=!1){if(O.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(A.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const u=z(O,A);if(E){let _=0;for(let G=0;Go+c.length,0));const t=Wd(e);let s=0;for(const o of i)t.set(o,s),s+=o.length;return $u(t)}function v1(i,e){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),s=0;s>>0,O=new Uint8Array(j);ie!==U;){for(var A=P[ie],E=0,u=j-1;(A!==0||E>>0,O[u]=A%f>>>0,A=A/f>>>0;if(A!==0)throw new Error("Non-zero carry");H=E,ie++}for(var _=j-H;_!==j&&O[_]===0;)_++;for(var G=y.repeat(z);_>>0,j=new Uint8Array(U);P[z];){var O=t[P.charCodeAt(z)];if(O===255)return;for(var A=0,E=U-1;(O!==0||A>>0,j[E]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");ie=A,z++}if(P[z]!==" "){for(var u=U-ie;u!==U&&j[u]===0;)u++;for(var _=new Uint8Array(H+(U-u)),G=H;u!==U;)_[G++]=j[u++];return _}}}function T(P){var z=I(P);if(z)return z;throw new Error(`Non-${e} character`)}return{encode:D,decodeUnsafe:I,decode:T}}var m1=v1,w1=m1;const _1=i=>{if(i instanceof Uint8Array&&i.constructor.name==="Uint8Array")return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new Error("Unknown type, must be binary type")},b1=i=>new TextEncoder().encode(i),E1=i=>new TextDecoder().decode(i);class D1{constructor(e,t,s){this.name=e,this.prefix=t,this.baseEncode=s}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class S1{constructor(e,t,s){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=s}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Yd(this,e)}}class I1{constructor(e){this.decoders=e}or(e){return Yd(this,e)}decode(e){const t=e[0],s=this.decoders[t];if(s)return s.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Yd=(i,e)=>new I1({...i.decoders||{[i.prefix]:i},...e.decoders||{[e.prefix]:e}});class x1{constructor(e,t,s,o){this.name=e,this.prefix=t,this.baseEncode=s,this.baseDecode=o,this.encoder=new D1(e,t,s),this.decoder=new S1(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const aa=({name:i,prefix:e,encode:t,decode:s})=>new x1(i,e,t,s),Cs=({prefix:i,name:e,alphabet:t})=>{const{encode:s,decode:o}=w1(t,e);return aa({prefix:i,name:e,encode:s,decode:c=>_1(o(c))})},O1=(i,e,t,s)=>{const o={};for(let m=0;m=8&&(f-=8,d[g++]=255&y>>f)}if(f>=t||255&y<<8-f)throw new SyntaxError("Unexpected end of data");return d},P1=(i,e,t)=>{const s=e[e.length-1]==="=",o=(1<t;)d-=t,c+=e[o&f>>d];if(d&&(c+=e[o&f<aa({prefix:e,name:i,encode(o){return P1(o,s,t)},decode(o){return O1(o,s,t,i)}}),C1=aa({prefix:"\0",name:"identity",encode:i=>E1(i),decode:i=>b1(i)}),A1=Object.freeze(Object.defineProperty({__proto__:null,identity:C1},Symbol.toStringTag,{value:"Module"})),T1=Jt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),R1=Object.freeze(Object.defineProperty({__proto__:null,base2:T1},Symbol.toStringTag,{value:"Module"})),N1=Jt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),U1=Object.freeze(Object.defineProperty({__proto__:null,base8:N1},Symbol.toStringTag,{value:"Module"})),$1=Cs({prefix:"9",name:"base10",alphabet:"0123456789"}),L1=Object.freeze(Object.defineProperty({__proto__:null,base10:$1},Symbol.toStringTag,{value:"Module"})),M1=Jt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),j1=Jt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),q1=Object.freeze(Object.defineProperty({__proto__:null,base16:M1,base16upper:j1},Symbol.toStringTag,{value:"Module"})),F1=Jt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),z1=Jt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),B1=Jt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),H1=Jt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),K1=Jt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),k1=Jt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),V1=Jt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),G1=Jt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),W1=Jt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Y1=Object.freeze(Object.defineProperty({__proto__:null,base32:F1,base32hex:K1,base32hexpad:V1,base32hexpadupper:G1,base32hexupper:k1,base32pad:B1,base32padupper:H1,base32upper:z1,base32z:W1},Symbol.toStringTag,{value:"Module"})),J1=Cs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Q1=Cs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),X1=Object.freeze(Object.defineProperty({__proto__:null,base36:J1,base36upper:Q1},Symbol.toStringTag,{value:"Module"})),Z1=Cs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),eb=Cs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),tb=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Z1,base58flickr:eb},Symbol.toStringTag,{value:"Module"})),rb=Jt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ib=Jt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),nb=Jt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),sb=Jt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),ob=Object.freeze(Object.defineProperty({__proto__:null,base64:rb,base64pad:ib,base64url:nb,base64urlpad:sb},Symbol.toStringTag,{value:"Module"})),Jd=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),ab=Jd.reduce((i,e,t)=>(i[t]=e,i),[]),cb=Jd.reduce((i,e,t)=>(i[e.codePointAt(0)]=t,i),[]);function ub(i){return i.reduce((e,t)=>(e+=ab[t],e),"")}function hb(i){const e=[];for(const t of i){const s=cb[t.codePointAt(0)];if(s===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(s)}return new Uint8Array(e)}const lb=aa({prefix:"🚀",name:"base256emoji",encode:ub,decode:hb}),fb=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:lb},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const tf={...A1,...R1,...U1,...L1,...q1,...Y1,...X1,...tb,...ob,...fb};function Qd(i,e,t,s){return{name:i,prefix:e,encoder:{name:i,prefix:e,encode:t},decoder:{decode:s}}}const rf=Qd("utf8","u",i=>"u"+new TextDecoder("utf8").decode(i),i=>new TextEncoder().encode(i.substring(1))),Mc=Qd("ascii","a",i=>{let e="a";for(let t=0;t{i=i.substring(1);const e=Wd(i.length);for(let t=0;t"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new vb:typeof navigator<"u"?af(navigator.userAgent):Sb()}function Eb(i){return i!==""&&_b.reduce(function(e,t){var s=t[0],o=t[1];if(e)return e;var c=o.exec(i);return!!c&&[s,c]},!1)}function af(i){var e=Eb(i);if(!e)return null;var t=e[0],s=e[1];if(t==="searchbot")return new yb;var o=s[1]&&s[1].split(".").join("_").split("_").slice(0,3);o?o.length=w)return r;var N=a-In(h);if(N<1)return h;var q=x?Mi(x,0,N).join(""):r.slice(0,N);if(p===t)return q+h;if(x&&(N+=q.length-N),Oc(p)){if(r.slice(N).search(p)){var X,Z=q;for(p.global||(p=Ha(p.source,it(Tr.exec(p))+"g")),p.lastIndex=0;X=p.exec(Z);)var ne=X.index;q=q.slice(0,ne===t?N:ne)}}else if(r.indexOf(Sr(p),N)!=N){var he=q.lastIndexOf(p);he>-1&&(q=q.slice(0,he))}return q+h}function zw(r){return r=it(r),r&&St.test(r)?r.replace(Pi,yg):r}var Bw=Rn(function(r,n,a){return r+(a?" ":"")+n.toUpperCase()}),Ac=Jh("toUpperCase");function Wl(r,n,a){return r=it(r),n=a?t:n,n===t?lg(r)?wg(r):rg(r):r.match(n)||[]}var Yl=Ke(function(r,n){try{return kt(r,t,n)}catch(a){return xc(a)?a:new Ae(a)}}),Hw=gi(function(r,n){return Nr(n,function(a){a=ri(a),di(r,a,Sc(r[a],r))}),r});function Kw(r){var n=r==null?0:r.length,a=we();return r=n?wt(r,function(h){if(typeof h[1]!="function")throw new Ur(d);return[a(h[0]),h[1]]}):[],Ke(function(h){for(var p=-1;++pk)return[];var a=re,h=Xt(r,re);n=we(n),r-=re;for(var p=Fa(h,n);++a0||n<0)?new Ye(a):(r<0?a=a.takeRight(-r):r&&(a=a.drop(r)),n!==t&&(n=je(n),a=n<0?a.dropRight(-n):a.take(n-r)),a)},Ye.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},Ye.prototype.toArray=function(){return this.take(re)},ei(Ye.prototype,function(r,n){var a=/^(?:filter|find|map|reject)|While$/.test(n),h=/^(?:head|last)$/.test(n),p=v[h?"take"+(n=="last"?"Right":""):n],w=h||/^find/.test(n);p&&(v.prototype[n]=function(){var x=this.__wrapped__,N=h?[1]:arguments,q=x instanceof Ye,X=N[0],Z=q||Re(x),ne=function(Ge){var Ze=p.apply(v,Ti([Ge],N));return h&&he?Ze[0]:Ze};Z&&a&&typeof X=="function"&&X.length!=1&&(q=Z=!1);var he=this.__chain__,ye=!!this.__actions__.length,Ee=w&&!he,ze=q&&!ye;if(!w&&Z){x=ze?x:new Ye(this);var De=r.apply(x,N);return De.__actions__.push({func:Ro,args:[ne],thisArg:t}),new $r(De,he)}return Ee&&ze?r.apply(this,N):(De=this.thru(ne),Ee?h?De.value()[0]:De.value():De)})}),Nr(["pop","push","shift","sort","splice","unshift"],function(r){var n=io[r],a=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",h=/^(?:pop|shift)$/.test(r);v.prototype[r]=function(){var p=arguments;if(h&&!this.__chain__){var w=this.value();return n.apply(Re(w)?w:[],p)}return this[a](function(x){return n.apply(Re(x)?x:[],p)})}}),ei(Ye.prototype,function(r,n){var a=v[n];if(a){var h=a.name+"";nt.call(Cn,h)||(Cn[h]=[]),Cn[h].push({name:n,func:a})}}),Cn[Io(t,ie).name]=[{name:"wrapper",func:t}],Ye.prototype.clone=zg,Ye.prototype.reverse=Bg,Ye.prototype.value=Hg,v.prototype.at=mv,v.prototype.chain=wv,v.prototype.commit=_v,v.prototype.next=bv,v.prototype.plant=Dv,v.prototype.reverse=Sv,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=Iv,v.prototype.first=v.prototype.head,Zn&&(v.prototype[Zn]=Ev),v},xn=_g();Rt?((Rt.exports=xn)._=xn,ut._=xn):Xe._=xn}).call(ws)})(Iu,Iu.exports);var bI=Object.defineProperty,EI=Object.defineProperties,DI=Object.getOwnPropertyDescriptors,Pd=Object.getOwnPropertySymbols,SI=Object.prototype.hasOwnProperty,II=Object.prototype.propertyIsEnumerable,Cd=(i,e,t)=>e in i?bI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ko=(i,e)=>{for(var t in e||(e={}))SI.call(e,t)&&Cd(i,t,e[t]);if(Pd)for(var t of Pd(e))II.call(e,t)&&Cd(i,t,e[t]);return i},xI=(i,e)=>EI(i,DI(e));function zi(i,e,t){var s;const o=wE(i);return((s=e.rpcMap)==null?void 0:s[o.reference])||`${_I}?chainId=${o.namespace}:${o.reference}&projectId=${t}`}function gn(i){return i.includes(":")?i.split(":")[1]:i}function Yp(i){return i.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function OI(i,e){const t=Object.keys(e.namespaces).filter(o=>o.includes(i));if(!t.length)return[];const s=[];return t.forEach(o=>{const c=e.namespaces[o].accounts;s.push(...c)}),s}function Ad(i={},e={}){const t=Td(i),s=Td(e);return Iu.exports.merge(t,s)}function Td(i){var e,t,s,o;const c={};if(!Os(i))return c;for(const[d,f]of Object.entries(i)){const y=Bu(d)?[d]:f.chains,g=f.methods||[],m=f.events||[],D=f.rpcMap||{},I=_s(d);c[I]=xI(Ko(Ko({},c[I]),f),{chains:Bc(y,(e=c[I])==null?void 0:e.chains),methods:Bc(g,(t=c[I])==null?void 0:t.methods),events:Bc(m,(s=c[I])==null?void 0:s.events),rpcMap:Ko(Ko({},D),(o=c[I])==null?void 0:o.rpcMap)})}return c}function PI(i){return i.includes(":")?i.split(":")[2]:i}function CI(i){const e={};for(const[t,s]of Object.entries(i)){const o=s.methods||[],c=s.events||[],d=s.accounts||[],f=Bu(t)?[t]:s.chains?s.chains:Yp(s.accounts);e[t]={chains:f,methods:o,events:c,accounts:d}}return e}function ru(i){return typeof i=="number"?i:i.includes("0x")?parseInt(i,16):(i=i.includes(":")?i.split(":")[1]:i,isNaN(Number(i))?i:Number(i))}const Jp={},bt=i=>Jp[i],iu=(i,e)=>{Jp[i]=e};class AI{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=gn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class TI{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const s=t||zi(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=parseInt(gn(t));e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,s;let o=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const c=parseInt(o,16);if(this.isChainApproved(c))this.setDefaultChain(`${c}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:o}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${c}`);else throw new Error(`Failed to switch to chain 'eip155:${c}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class RI{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=gn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class NI{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=gn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class UI{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const s=this.getCardanoRPCUrl(t),o=gn(t);e[o]=this.createHttpProvider(o,s)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||this.getCardanoRPCUrl(e);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class $I{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=gn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class LI{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=gn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class MI{constructor(e){this.name="near",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const s=t||zi(`${this.name}:${e}`,this.namespace);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,s)}this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;e[t]=this.createHttpProvider(t,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace);return typeof s>"u"?void 0:new xi(new Hi(s,bt("disableProviderPing")))}}var jI=Object.defineProperty,qI=Object.defineProperties,FI=Object.getOwnPropertyDescriptors,Rd=Object.getOwnPropertySymbols,zI=Object.prototype.hasOwnProperty,BI=Object.prototype.propertyIsEnumerable,Nd=(i,e,t)=>e in i?jI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ko=(i,e)=>{for(var t in e||(e={}))zI.call(e,t)&&Nd(i,t,e[t]);if(Rd)for(var t of Rd(e))BI.call(e,t)&&Nd(i,t,e[t]);return i},nu=(i,e)=>qI(i,FI(e));class Qu{constructor(e){this.events=new Tu,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Je.pino(Je.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||xd})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new Qu(e);return await t.initialize(),t}async request(e,t,s){const[o,c]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(o).request({request:ko({},e),chainId:`${o}:${c}`,topic:this.session.topic,expiry:s})}sendAsync(e,t,s,o){const c=new Date().getTime();this.request(e,s,o).then(d=>t(null,ca(c,d))).catch(d=>t(d,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:_t("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:s,approval:o}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});s&&(this.uri=s,this.events.emit("display_uri",s)),await o().then(c=>{this.session=c;const d=CI(c.namespaces);this.namespaces=Ad(this.namespaces,d),this.persist("namespaces",this.namespaces)}).catch(c=>{if(c.message!==Gp)throw c;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[s,o]=this.validateChain(e);this.getProvider(s).setDefaultChain(o,t)}catch(s){if(!/Please call connect/.test(s.message))throw s}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(oi(t)){for(const s of t)e.deletePairings?this.client.core.expirer.set(s.topic,0):await this.client.core.relayer.subscriber.unsubscribe(s.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await dI.init({logger:this.providerOpts.logger||xd,relayUrl:this.providerOpts.relayUrl||vI,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>_s(t)))];iu("client",this.client),iu("events",this.events),iu("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const s=OI(t,this.session),o=Yp(s),c=Ad(this.namespaces,this.optionalNamespaces),d=nu(ko({},c[t]),{accounts:s,chains:o});switch(t){case"eip155":this.rpcProviders[t]=new TI({namespace:d});break;case"solana":this.rpcProviders[t]=new RI({namespace:d});break;case"cosmos":this.rpcProviders[t]=new NI({namespace:d});break;case"polkadot":this.rpcProviders[t]=new AI({namespace:d});break;case"cip34":this.rpcProviders[t]=new UI({namespace:d});break;case"elrond":this.rpcProviders[t]=new $I({namespace:d});break;case"multiversx":this.rpcProviders[t]=new LI({namespace:d});break;case"near":this.rpcProviders[t]=new MI({namespace:d});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:s}=t;if(s.name==="accountsChanged"){const o=s.data;o&&oi(o)&&this.events.emit("accountsChanged",o.map(PI))}else if(s.name==="chainChanged"){const o=t.chainId,c=t.event.data,d=_s(o),f=ru(o)!==ru(c)?`${d}:${ru(c)}`:o;this.onChainChanged(f)}else this.events.emit(s.name,s.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var s;const{namespaces:o}=t,c=(s=this.client)==null?void 0:s.session.get(e);this.session=nu(ko({},c),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",nu(ko({},_t("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Oi.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:s,sessionProperties:o}=e;t&&Object.keys(t).length&&(this.namespaces=t),s&&Object.keys(s).length&&(this.optionalNamespaces=s),this.sessionProperties=o,this.persist("namespaces",t),this.persist("optionalNamespaces",s)}validateChain(e){const[t,s]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,s];if(t&&!Object.keys(this.namespaces||{}).map(d=>_s(d)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&s)return[t,s];const o=_s(Object.keys(this.namespaces)[0]),c=this.rpcProviders[o].getDefaultChain();return[o,c]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[s,o]=this.validateChain(e);o&&(t||this.getProvider(s).setDefaultChain(o),this.namespaces[s]?this.namespaces[s].defaultChain=o:this.namespaces[`${s}:${o}`]?this.namespaces[`${s}:${o}`].defaultChain=o:this.namespaces[`${s}:${o}`]={defaultChain:o},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",o))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Od}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Od}/${e}`)}}const HI=Qu,KI="wc",kI="ethereum_provider",VI=`${KI}@2:${kI}:`,GI="https://rpc.walletconnect.com/v1/",xu=["eth_sendTransaction","personal_sign"],WI=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Ou=["chainChanged","accountsChanged"],YI=["chainChanged","accountsChanged","message","disconnect","connect"];var JI=Object.defineProperty,QI=Object.defineProperties,XI=Object.getOwnPropertyDescriptors,Ud=Object.getOwnPropertySymbols,ZI=Object.prototype.hasOwnProperty,e5=Object.prototype.propertyIsEnumerable,$d=(i,e,t)=>e in i?JI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Es=(i,e)=>{for(var t in e||(e={}))ZI.call(e,t)&&$d(i,t,e[t]);if(Ud)for(var t of Ud(e))e5.call(e,t)&&$d(i,t,e[t]);return i},Ld=(i,e)=>QI(i,XI(e));function ta(i){return Number(i[0].split(":")[1])}function su(i){return`0x${i.toString(16)}`}function t5(i){const{chains:e,optionalChains:t,methods:s,optionalMethods:o,events:c,optionalEvents:d,rpcMap:f}=i;if(!oi(e))throw new Error("Invalid chains");const y={chains:e,methods:s||xu,events:c||Ou,rpcMap:Es({},e.length?{[ta(e)]:f[ta(e)]}:{})},g=c==null?void 0:c.filter(T=>!Ou.includes(T)),m=s==null?void 0:s.filter(T=>!xu.includes(T));if(!t&&!d&&!o&&!(g!=null&&g.length)&&!(m!=null&&m.length))return{required:e.length?y:void 0};const D=(g==null?void 0:g.length)&&(m==null?void 0:m.length)||!t,I={chains:[...new Set(D?y.chains.concat(t||[]):t)],methods:[...new Set(y.methods.concat(o!=null&&o.length?o:WI))],events:[...new Set(y.events.concat(d!=null&&d.length?d:YI))],rpcMap:f};return{required:e.length?y:void 0,optional:t.length?I:void 0}}class Xu{constructor(){this.events=new zr.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=VI,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new Xu;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,s){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),s)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:s}=t5(this.rpc);try{const o=await new Promise(async(d,f)=>{var y;this.rpc.showQrModal&&((y=this.modal)==null||y.subscribeModal(g=>{!g.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Ld(Es({namespaces:Es({},t&&{[this.namespace]:t})},s&&{optionalNamespaces:{[this.namespace]:s}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(g=>{d(g)}).catch(g=>{f(new Error(g.message))})});if(!o)return;const c=_E(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:c),this.setAccounts(c),this.events.emit("connect",{chainId:su(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:s}=t;s.name==="accountsChanged"?(this.accounts=this.parseAccounts(s.data),this.events.emit("accountsChanged",this.accounts)):s.name==="chainChanged"?this.setChainId(this.formatChainId(s.data)):this.events.emit(s.name,s.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",su(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Ld(Es({},_t("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,s;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(s=this.modal)==null||s.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(s=>this.isCompatibleChainId(s)).map(s=>this.parseChainId(s));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",su(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,s,o]=e.split(":");return{chainId:`${t}:${s}`,address:o}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,s;const o=(t=e==null?void 0:e.chains)!=null?t:[],c=(s=e==null?void 0:e.optionalChains)!=null?s:[],d=o.concat(c);if(!d.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const f=o.length?(e==null?void 0:e.methods)||xu:[],y=o.length?(e==null?void 0:e.events)||Ou:[],g=(e==null?void 0:e.optionalMethods)||[],m=(e==null?void 0:e.optionalEvents)||[],D=(e==null?void 0:e.rpcMap)||this.buildRpcMap(d,e.projectId),I=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(T=>this.formatChainId(T)),optionalChains:c.map(T=>this.formatChainId(T)),methods:f,events:y,optionalMethods:g,optionalEvents:m,rpcMap:D,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:I,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const s={};return e.forEach(o=>{s[o]=this.getRpcUrl(o,t)}),s}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?ta(this.rpc.chains):ta(this.rpc.optionalChains),this.signer=await HI.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:s}=await P_(()=>import("./index-C1fKM4j6.js").then(o=>o.i),__vite__mapDeps([0,1,2]),import.meta.url);t=s}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Es({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(s){throw this.signer.logger.error(s),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:s,rpcMap:o}=e;t&&oi(t)&&(this.rpc.chains=t.map(c=>this.formatChainId(c)),t.forEach(c=>{this.rpc.rpcMap[c]=(o==null?void 0:o[c])||this.getRpcUrl(c)})),s&&oi(s)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=s==null?void 0:s.map(c=>this.formatChainId(c)),s.forEach(c=>{this.rpc.rpcMap[c]=(o==null?void 0:o[c])||this.getRpcUrl(c)}))}getRpcUrl(e,t){var s;return((s=this.rpc.rpcMap)==null?void 0:s[e])||`${GI}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const _5=Xu;export{_5 as EthereumProvider,YI as OPTIONAL_EVENTS,WI as OPTIONAL_METHODS,Ou as REQUIRED_EVENTS,xu as REQUIRED_METHODS,Xu as default}; +}`;var ze=Yl(function(){return rt(w,ye+"return "+ne).apply(t,x)});if(ze.source=ne,xc(ze))throw ze;return ze}function $w(r){return it(r).toLowerCase()}function Lw(r){return it(r).toUpperCase()}function Mw(r,n,a){if(r=it(r),r&&(a||n===t))return nh(r);if(!r||!(n=Sr(n)))return r;var h=Kr(r),p=Kr(n),w=sh(h,p),x=oh(h,p)+1;return Mi(h,w,x).join("")}function jw(r,n,a){if(r=it(r),r&&(a||n===t))return r.slice(0,ch(r)+1);if(!r||!(n=Sr(n)))return r;var h=Kr(r),p=oh(h,Kr(n))+1;return Mi(h,0,p).join("")}function qw(r,n,a){if(r=it(r),r&&(a||n===t))return r.replace(Pt,"");if(!r||!(n=Sr(n)))return r;var h=Kr(r),p=sh(h,Kr(n));return Mi(h,p).join("")}function Fw(r,n){var a=W,h=se;if(Dt(n)){var p="separator"in n?n.separator:p;a="length"in n?je(n.length):a,h="omission"in n?Sr(n.omission):h}r=it(r);var w=r.length;if(Sn(r)){var x=Kr(r);w=x.length}if(a>=w)return r;var N=a-In(h);if(N<1)return h;var q=x?Mi(x,0,N).join(""):r.slice(0,N);if(p===t)return q+h;if(x&&(N+=q.length-N),Oc(p)){if(r.slice(N).search(p)){var X,Z=q;for(p.global||(p=Ha(p.source,it(Tr.exec(p))+"g")),p.lastIndex=0;X=p.exec(Z);)var ne=X.index;q=q.slice(0,ne===t?N:ne)}}else if(r.indexOf(Sr(p),N)!=N){var he=q.lastIndexOf(p);he>-1&&(q=q.slice(0,he))}return q+h}function zw(r){return r=it(r),r&&St.test(r)?r.replace(Pi,yg):r}var Bw=Rn(function(r,n,a){return r+(a?" ":"")+n.toUpperCase()}),Ac=Jh("toUpperCase");function Wl(r,n,a){return r=it(r),n=a?t:n,n===t?lg(r)?wg(r):rg(r):r.match(n)||[]}var Yl=Ke(function(r,n){try{return kt(r,t,n)}catch(a){return xc(a)?a:new Ae(a)}}),Hw=gi(function(r,n){return Nr(n,function(a){a=ri(a),di(r,a,Sc(r[a],r))}),r});function Kw(r){var n=r==null?0:r.length,a=we();return r=n?wt(r,function(h){if(typeof h[1]!="function")throw new Ur(d);return[a(h[0]),h[1]]}):[],Ke(function(h){for(var p=-1;++pk)return[];var a=re,h=Xt(r,re);n=we(n),r-=re;for(var p=Fa(h,n);++a0||n<0)?new Ye(a):(r<0?a=a.takeRight(-r):r&&(a=a.drop(r)),n!==t&&(n=je(n),a=n<0?a.dropRight(-n):a.take(n-r)),a)},Ye.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},Ye.prototype.toArray=function(){return this.take(re)},ei(Ye.prototype,function(r,n){var a=/^(?:filter|find|map|reject)|While$/.test(n),h=/^(?:head|last)$/.test(n),p=v[h?"take"+(n=="last"?"Right":""):n],w=h||/^find/.test(n);p&&(v.prototype[n]=function(){var x=this.__wrapped__,N=h?[1]:arguments,q=x instanceof Ye,X=N[0],Z=q||Re(x),ne=function(Ge){var Ze=p.apply(v,Ti([Ge],N));return h&&he?Ze[0]:Ze};Z&&a&&typeof X=="function"&&X.length!=1&&(q=Z=!1);var he=this.__chain__,ye=!!this.__actions__.length,Ee=w&&!he,ze=q&&!ye;if(!w&&Z){x=ze?x:new Ye(this);var De=r.apply(x,N);return De.__actions__.push({func:Ro,args:[ne],thisArg:t}),new $r(De,he)}return Ee&&ze?r.apply(this,N):(De=this.thru(ne),Ee?h?De.value()[0]:De.value():De)})}),Nr(["pop","push","shift","sort","splice","unshift"],function(r){var n=io[r],a=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",h=/^(?:pop|shift)$/.test(r);v.prototype[r]=function(){var p=arguments;if(h&&!this.__chain__){var w=this.value();return n.apply(Re(w)?w:[],p)}return this[a](function(x){return n.apply(Re(x)?x:[],p)})}}),ei(Ye.prototype,function(r,n){var a=v[n];if(a){var h=a.name+"";nt.call(Cn,h)||(Cn[h]=[]),Cn[h].push({name:n,func:a})}}),Cn[Io(t,ie).name]=[{name:"wrapper",func:t}],Ye.prototype.clone=zg,Ye.prototype.reverse=Bg,Ye.prototype.value=Hg,v.prototype.at=mv,v.prototype.chain=wv,v.prototype.commit=_v,v.prototype.next=bv,v.prototype.plant=Dv,v.prototype.reverse=Sv,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=Iv,v.prototype.first=v.prototype.head,Zn&&(v.prototype[Zn]=Ev),v},xn=_g();Rt?((Rt.exports=xn)._=xn,ut._=xn):Xe._=xn}).call(ws)})(Iu,Iu.exports);var bI=Object.defineProperty,EI=Object.defineProperties,DI=Object.getOwnPropertyDescriptors,Pd=Object.getOwnPropertySymbols,SI=Object.prototype.hasOwnProperty,II=Object.prototype.propertyIsEnumerable,Cd=(i,e,t)=>e in i?bI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ko=(i,e)=>{for(var t in e||(e={}))SI.call(e,t)&&Cd(i,t,e[t]);if(Pd)for(var t of Pd(e))II.call(e,t)&&Cd(i,t,e[t]);return i},xI=(i,e)=>EI(i,DI(e));function zi(i,e,t){var s;const o=wE(i);return((s=e.rpcMap)==null?void 0:s[o.reference])||`${_I}?chainId=${o.namespace}:${o.reference}&projectId=${t}`}function gn(i){return i.includes(":")?i.split(":")[1]:i}function Yp(i){return i.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function OI(i,e){const t=Object.keys(e.namespaces).filter(o=>o.includes(i));if(!t.length)return[];const s=[];return t.forEach(o=>{const c=e.namespaces[o].accounts;s.push(...c)}),s}function Ad(i={},e={}){const t=Td(i),s=Td(e);return Iu.exports.merge(t,s)}function Td(i){var e,t,s,o;const c={};if(!Os(i))return c;for(const[d,f]of Object.entries(i)){const y=Bu(d)?[d]:f.chains,g=f.methods||[],m=f.events||[],D=f.rpcMap||{},I=_s(d);c[I]=xI(Ko(Ko({},c[I]),f),{chains:Bc(y,(e=c[I])==null?void 0:e.chains),methods:Bc(g,(t=c[I])==null?void 0:t.methods),events:Bc(m,(s=c[I])==null?void 0:s.events),rpcMap:Ko(Ko({},D),(o=c[I])==null?void 0:o.rpcMap)})}return c}function PI(i){return i.includes(":")?i.split(":")[2]:i}function CI(i){const e={};for(const[t,s]of Object.entries(i)){const o=s.methods||[],c=s.events||[],d=s.accounts||[],f=Bu(t)?[t]:s.chains?s.chains:Yp(s.accounts);e[t]={chains:f,methods:o,events:c,accounts:d}}return e}function ru(i){return typeof i=="number"?i:i.includes("0x")?parseInt(i,16):(i=i.includes(":")?i.split(":")[1]:i,isNaN(Number(i))?i:Number(i))}const Jp={},bt=i=>Jp[i],iu=(i,e)=>{Jp[i]=e};class AI{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=gn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class TI{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const s=t||zi(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=parseInt(gn(t));e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,s;let o=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const c=parseInt(o,16);if(this.isChainApproved(c))this.setDefaultChain(`${c}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:o}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${c}`);else throw new Error(`Failed to switch to chain 'eip155:${c}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class RI{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=gn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class NI{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=gn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class UI{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const s=this.getCardanoRPCUrl(t),o=gn(t);e[o]=this.createHttpProvider(o,s)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||this.getCardanoRPCUrl(e);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class $I{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=gn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class LI{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=gn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new xi(new Hi(s,bt("disableProviderPing")))}}class MI{constructor(e){this.name="near",this.namespace=e.namespace,this.events=bt("events"),this.client=bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const s=t||zi(`${this.name}:${e}`,this.namespace);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,s)}this.events.emit(Oi.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;e[t]=this.createHttpProvider(t,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||zi(e,this.namespace);return typeof s>"u"?void 0:new xi(new Hi(s,bt("disableProviderPing")))}}var jI=Object.defineProperty,qI=Object.defineProperties,FI=Object.getOwnPropertyDescriptors,Rd=Object.getOwnPropertySymbols,zI=Object.prototype.hasOwnProperty,BI=Object.prototype.propertyIsEnumerable,Nd=(i,e,t)=>e in i?jI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ko=(i,e)=>{for(var t in e||(e={}))zI.call(e,t)&&Nd(i,t,e[t]);if(Rd)for(var t of Rd(e))BI.call(e,t)&&Nd(i,t,e[t]);return i},nu=(i,e)=>qI(i,FI(e));class Qu{constructor(e){this.events=new Tu,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Je.pino(Je.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||xd})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new Qu(e);return await t.initialize(),t}async request(e,t,s){const[o,c]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(o).request({request:ko({},e),chainId:`${o}:${c}`,topic:this.session.topic,expiry:s})}sendAsync(e,t,s,o){const c=new Date().getTime();this.request(e,s,o).then(d=>t(null,ca(c,d))).catch(d=>t(d,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:_t("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:s,approval:o}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});s&&(this.uri=s,this.events.emit("display_uri",s)),await o().then(c=>{this.session=c;const d=CI(c.namespaces);this.namespaces=Ad(this.namespaces,d),this.persist("namespaces",this.namespaces)}).catch(c=>{if(c.message!==Gp)throw c;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[s,o]=this.validateChain(e);this.getProvider(s).setDefaultChain(o,t)}catch(s){if(!/Please call connect/.test(s.message))throw s}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(oi(t)){for(const s of t)e.deletePairings?this.client.core.expirer.set(s.topic,0):await this.client.core.relayer.subscriber.unsubscribe(s.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await dI.init({logger:this.providerOpts.logger||xd,relayUrl:this.providerOpts.relayUrl||vI,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>_s(t)))];iu("client",this.client),iu("events",this.events),iu("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const s=OI(t,this.session),o=Yp(s),c=Ad(this.namespaces,this.optionalNamespaces),d=nu(ko({},c[t]),{accounts:s,chains:o});switch(t){case"eip155":this.rpcProviders[t]=new TI({namespace:d});break;case"solana":this.rpcProviders[t]=new RI({namespace:d});break;case"cosmos":this.rpcProviders[t]=new NI({namespace:d});break;case"polkadot":this.rpcProviders[t]=new AI({namespace:d});break;case"cip34":this.rpcProviders[t]=new UI({namespace:d});break;case"elrond":this.rpcProviders[t]=new $I({namespace:d});break;case"multiversx":this.rpcProviders[t]=new LI({namespace:d});break;case"near":this.rpcProviders[t]=new MI({namespace:d});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:s}=t;if(s.name==="accountsChanged"){const o=s.data;o&&oi(o)&&this.events.emit("accountsChanged",o.map(PI))}else if(s.name==="chainChanged"){const o=t.chainId,c=t.event.data,d=_s(o),f=ru(o)!==ru(c)?`${d}:${ru(c)}`:o;this.onChainChanged(f)}else this.events.emit(s.name,s.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var s;const{namespaces:o}=t,c=(s=this.client)==null?void 0:s.session.get(e);this.session=nu(ko({},c),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",nu(ko({},_t("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Oi.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:s,sessionProperties:o}=e;t&&Object.keys(t).length&&(this.namespaces=t),s&&Object.keys(s).length&&(this.optionalNamespaces=s),this.sessionProperties=o,this.persist("namespaces",t),this.persist("optionalNamespaces",s)}validateChain(e){const[t,s]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,s];if(t&&!Object.keys(this.namespaces||{}).map(d=>_s(d)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&s)return[t,s];const o=_s(Object.keys(this.namespaces)[0]),c=this.rpcProviders[o].getDefaultChain();return[o,c]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[s,o]=this.validateChain(e);o&&(t||this.getProvider(s).setDefaultChain(o),this.namespaces[s]?this.namespaces[s].defaultChain=o:this.namespaces[`${s}:${o}`]?this.namespaces[`${s}:${o}`].defaultChain=o:this.namespaces[`${s}:${o}`]={defaultChain:o},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",o))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Od}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Od}/${e}`)}}const HI=Qu,KI="wc",kI="ethereum_provider",VI=`${KI}@2:${kI}:`,GI="https://rpc.walletconnect.com/v1/",xu=["eth_sendTransaction","personal_sign"],WI=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],Ou=["chainChanged","accountsChanged"],YI=["chainChanged","accountsChanged","message","disconnect","connect"];var JI=Object.defineProperty,QI=Object.defineProperties,XI=Object.getOwnPropertyDescriptors,Ud=Object.getOwnPropertySymbols,ZI=Object.prototype.hasOwnProperty,e5=Object.prototype.propertyIsEnumerable,$d=(i,e,t)=>e in i?JI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Es=(i,e)=>{for(var t in e||(e={}))ZI.call(e,t)&&$d(i,t,e[t]);if(Ud)for(var t of Ud(e))e5.call(e,t)&&$d(i,t,e[t]);return i},Ld=(i,e)=>QI(i,XI(e));function ta(i){return Number(i[0].split(":")[1])}function su(i){return`0x${i.toString(16)}`}function t5(i){const{chains:e,optionalChains:t,methods:s,optionalMethods:o,events:c,optionalEvents:d,rpcMap:f}=i;if(!oi(e))throw new Error("Invalid chains");const y={chains:e,methods:s||xu,events:c||Ou,rpcMap:Es({},e.length?{[ta(e)]:f[ta(e)]}:{})},g=c==null?void 0:c.filter(T=>!Ou.includes(T)),m=s==null?void 0:s.filter(T=>!xu.includes(T));if(!t&&!d&&!o&&!(g!=null&&g.length)&&!(m!=null&&m.length))return{required:e.length?y:void 0};const D=(g==null?void 0:g.length)&&(m==null?void 0:m.length)||!t,I={chains:[...new Set(D?y.chains.concat(t||[]):t)],methods:[...new Set(y.methods.concat(o!=null&&o.length?o:WI))],events:[...new Set(y.events.concat(d!=null&&d.length?d:YI))],rpcMap:f};return{required:e.length?y:void 0,optional:t.length?I:void 0}}class Xu{constructor(){this.events=new zr.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=VI,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new Xu;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,s){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),s)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:s}=t5(this.rpc);try{const o=await new Promise(async(d,f)=>{var y;this.rpc.showQrModal&&((y=this.modal)==null||y.subscribeModal(g=>{!g.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Ld(Es({namespaces:Es({},t&&{[this.namespace]:t})},s&&{optionalNamespaces:{[this.namespace]:s}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(g=>{d(g)}).catch(g=>{f(new Error(g.message))})});if(!o)return;const c=_E(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:c),this.setAccounts(c),this.events.emit("connect",{chainId:su(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:s}=t;s.name==="accountsChanged"?(this.accounts=this.parseAccounts(s.data),this.events.emit("accountsChanged",this.accounts)):s.name==="chainChanged"?this.setChainId(this.formatChainId(s.data)):this.events.emit(s.name,s.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",su(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Ld(Es({},_t("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,s;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(s=this.modal)==null||s.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(s=>this.isCompatibleChainId(s)).map(s=>this.parseChainId(s));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",su(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,s,o]=e.split(":");return{chainId:`${t}:${s}`,address:o}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,s;const o=(t=e==null?void 0:e.chains)!=null?t:[],c=(s=e==null?void 0:e.optionalChains)!=null?s:[],d=o.concat(c);if(!d.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const f=o.length?(e==null?void 0:e.methods)||xu:[],y=o.length?(e==null?void 0:e.events)||Ou:[],g=(e==null?void 0:e.optionalMethods)||[],m=(e==null?void 0:e.optionalEvents)||[],D=(e==null?void 0:e.rpcMap)||this.buildRpcMap(d,e.projectId),I=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(T=>this.formatChainId(T)),optionalChains:c.map(T=>this.formatChainId(T)),methods:f,events:y,optionalMethods:g,optionalEvents:m,rpcMap:D,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:I,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const s={};return e.forEach(o=>{s[o]=this.getRpcUrl(o,t)}),s}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?ta(this.rpc.chains):ta(this.rpc.optionalChains),this.signer=await HI.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:s}=await P_(()=>import("./index-DUeUg68H.js").then(o=>o.i),__vite__mapDeps([0,1,2]),import.meta.url);t=s}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Es({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(s){throw this.signer.logger.error(s),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:s,rpcMap:o}=e;t&&oi(t)&&(this.rpc.chains=t.map(c=>this.formatChainId(c)),t.forEach(c=>{this.rpc.rpcMap[c]=(o==null?void 0:o[c])||this.getRpcUrl(c)})),s&&oi(s)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=s==null?void 0:s.map(c=>this.formatChainId(c)),s.forEach(c=>{this.rpc.rpcMap[c]=(o==null?void 0:o[c])||this.getRpcUrl(c)}))}getRpcUrl(e,t){var s;return((s=this.rpc.rpcMap)==null?void 0:s[e])||`${GI}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const _5=Xu;export{_5 as EthereumProvider,YI as OPTIONAL_EVENTS,WI as OPTIONAL_METHODS,Ou as REQUIRED_EVENTS,xu as REQUIRED_METHODS,Xu as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./index-C1fKM4j6.js","./index-BDNLXjIW.js","./index-FR7z6tA6.css"] + __vite__mapDeps.viteFileDeps = ["./index-DUeUg68H.js","./index-BliWCjCt.js","./index-FR7z6tA6.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/index.html b/index.html index b1940515..0098b599 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Sequence Kit Demo - +