From f6a1db3f2070c0afb994301ebc2df6cff2b1c550 Mon Sep 17 00:00:00 2001 From: tolgahan-arikan Date: Fri, 12 Apr 2024 20:17:14 +0000 Subject: [PATCH] Build: (62fc524) version 2.1.0 (#18) * version 2.1.0 * Update demo deps --- ...owser-external_commonjs-proxy-CJKNagiQ.js} | 2 +- assets/{ccip-BM2b4VbN.js => ccip-BXjLXZcK.js} | 2 +- .../{index-BphuedKL.js => index-BBfF6sxO.js} | 4 +- .../{index-B4v1t5IB.js => index-CDfblNjf.js} | 2 +- .../{index-W6ajGusF.js => index-dcWuyPKz.js} | 2 +- .../{index-DwS12Swv.js => index-uA4vqshg.js} | 216 +++++++++--------- ...ex.es-DEIq-t2i.js => index.es-BzNvGBBU.js} | 6 +- index.html | 2 +- 8 files changed, 118 insertions(+), 118 deletions(-) rename assets/{___vite-browser-external_commonjs-proxy-DBU2Szs-.js => ___vite-browser-external_commonjs-proxy-CJKNagiQ.js} (98%) rename assets/{ccip-BM2b4VbN.js => ccip-BXjLXZcK.js} (97%) rename assets/{index-BphuedKL.js => index-BBfF6sxO.js} (98%) rename assets/{index-B4v1t5IB.js => index-CDfblNjf.js} (99%) rename assets/{index-W6ajGusF.js => index-dcWuyPKz.js} (99%) rename assets/{index-DwS12Swv.js => index-uA4vqshg.js} (59%) rename assets/{index.es-DEIq-t2i.js => index.es-BzNvGBBU.js} (99%) diff --git a/assets/___vite-browser-external_commonjs-proxy-DBU2Szs-.js b/assets/___vite-browser-external_commonjs-proxy-CJKNagiQ.js similarity index 98% rename from assets/___vite-browser-external_commonjs-proxy-DBU2Szs-.js rename to assets/___vite-browser-external_commonjs-proxy-CJKNagiQ.js index 9a3d368b..db81be7f 100644 --- a/assets/___vite-browser-external_commonjs-proxy-DBU2Szs-.js +++ b/assets/___vite-browser-external_commonjs-proxy-CJKNagiQ.js @@ -1 +1 @@ -import{a as j,g as C}from"./index-DwS12Swv.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;de&&(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-W6ajGusF.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-uA4vqshg.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-dcWuyPKz.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-W6ajGusF.js","./index-DwS12Swv.js","./index-hzRzMXhE.css"] + __vite__mapDeps.viteFileDeps = ["./index-dcWuyPKz.js","./index-uA4vqshg.js","./index-hzRzMXhE.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/assets/index-B4v1t5IB.js b/assets/index-CDfblNjf.js similarity index 99% rename from assets/index-B4v1t5IB.js rename to assets/index-CDfblNjf.js index 06c0ae3e..825bea29 100644 --- a/assets/index-B4v1t5IB.js +++ b/assets/index-CDfblNjf.js @@ -1,4 +1,4 @@ -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-DwS12Swv.js";import{e as Un,r as fl}from"./___vite-browser-external_commonjs-proxy-DBU2Szs-.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 +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-uA4vqshg.js";import{e as Un,r as fl}from"./___vite-browser-external_commonjs-proxy-CJKNagiQ.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-W6ajGusF.js b/assets/index-dcWuyPKz.js similarity index 99% rename from assets/index-W6ajGusF.js rename to assets/index-dcWuyPKz.js index b58be641..a4c49138 100644 --- a/assets/index-W6ajGusF.js +++ b/assets/index-dcWuyPKz.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-BphuedKL.js";import"./index-DwS12Swv.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;ae in t?FW(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ct=(t,e,r)=>(UW(t,typeof e!="symbol"?e+"":e,r),r),tx=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var pr=(t,e,r)=>(tx(t,e,"read from private field"),r?r.call(t):e.get(t)),Cl=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Bu=(t,e,r,n)=>(tx(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var Fu=(t,e,r)=>(tx(t,e,"access private method"),r);function zW(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ti(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Er(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var nT={exports:{}},Dg={},iT={exports:{}},nt={};/** +var yW=Object.defineProperty;var gW=(t,e,r)=>e in t?yW(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ct=(t,e,r)=>(gW(t,typeof e!="symbol"?e+"":e,r),r);function bW(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var mi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var jI={exports:{}},Sg={},BI={exports:{}},nt={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var FW=Object.defineProperty;var UW=(t,e,r)=>e in t?FW(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var K1=Symbol.for("react.element"),qW=Symbol.for("react.portal"),WW=Symbol.for("react.fragment"),HW=Symbol.for("react.strict_mode"),VW=Symbol.for("react.profiler"),GW=Symbol.for("react.provider"),KW=Symbol.for("react.context"),QW=Symbol.for("react.forward_ref"),YW=Symbol.for("react.suspense"),JW=Symbol.for("react.memo"),XW=Symbol.for("react.lazy"),G9=Symbol.iterator;function ZW(t){return t===null||typeof t!="object"?null:(t=G9&&t[G9]||t["@@iterator"],typeof t=="function"?t:null)}var sT={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},oT=Object.assign,aT={};function $d(t,e,r){this.props=t,this.context=e,this.refs=aT,this.updater=r||sT}$d.prototype.isReactComponent={};$d.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};$d.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function cT(){}cT.prototype=$d.prototype;function y8(t,e,r){this.props=t,this.context=e,this.refs=aT,this.updater=r||sT}var g8=y8.prototype=new cT;g8.constructor=y8;oT(g8,$d.prototype);g8.isPureReactComponent=!0;var K9=Array.isArray,lT=Object.prototype.hasOwnProperty,b8={current:null},uT={key:!0,ref:!0,__self:!0,__source:!0};function fT(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)lT.call(e,n)&&!uT.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1e in t?FW(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var iH=x,sH=Symbol.for("react.element"),oH=Symbol.for("react.fragment"),aH=Object.prototype.hasOwnProperty,cH=iH.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lH={key:!0,ref:!0,__self:!0,__source:!0};function hT(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)aH.call(e,n)&&!lH.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:sH,type:t,key:s,ref:o,props:i,_owner:cH.current}}Dg.Fragment=oH;Dg.jsx=hT;Dg.jsxs=hT;nT.exports=Dg;var pe=nT.exports,r5={},pT={exports:{}},Oi={},mT={exports:{}},vT={};/** + */var NW=w,DW=Symbol.for("react.element"),LW=Symbol.for("react.fragment"),jW=Object.prototype.hasOwnProperty,BW=NW.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,FW={key:!0,ref:!0,__self:!0,__source:!0};function KI(t,e,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)jW.call(e,n)&&!FW.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:DW,type:t,key:s,ref:o,props:i,_owner:BW.current}}Sg.Fragment=LW;Sg.jsx=KI;Sg.jsxs=KI;jI.exports=Sg;var pe=jI.exports,zw={},QI={exports:{}},Ii={},YI={exports:{}},JI={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var FW=Object.defineProperty;var UW=(t,e,r)=>e in t?FW(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(A,O){var B=A.length;A.push(O);e:for(;0>>1,C=A[I];if(0>>1;Ii(_,B))Wi(G,_)?(A[I]=G,A[W]=B,I=W):(A[I]=_,A[z]=B,I=z);else if(Wi(G,B))A[I]=G,A[W]=B,I=W;else break e}}return O}function i(A,O){var B=A.sortIndex-O.sortIndex;return B!==0?B:A.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,f=null,d=3,h=!1,p=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(A){for(var O=r(l);O!==null;){if(O.callback===null)n(l);else if(O.startTime<=A)n(l),O.sortIndex=O.expirationTime,e(c,O);else break;O=r(l)}}function S(A){if(m=!1,E(A),!p)if(r(c)!==null)p=!0,R(P);else{var O=r(l);O!==null&&N(S,O.startTime-A)}}function P(A,O){p=!1,m&&(m=!1,y(j),j=-1),h=!0;var B=d;try{for(E(O),f=r(c);f!==null&&(!(f.expirationTime>O)||A&&!Q());){var I=f.callback;if(typeof I=="function"){f.callback=null,d=f.priorityLevel;var C=I(f.expirationTime<=O);O=t.unstable_now(),typeof C=="function"?f.callback=C:f===r(c)&&n(c),E(O)}else n(c);f=r(c)}if(f!==null)var D=!0;else{var z=r(l);z!==null&&N(S,z.startTime-O),D=!1}return D}finally{f=null,d=B,h=!1}}var M=!1,L=null,j=-1,H=5,K=-1;function Q(){return!(t.unstable_now()-KA||125I?(A.sortIndex=B,e(l,A),r(c)===null&&A===r(l)&&(m?(y(j),j=-1):m=!0,N(S,B-I))):(A.sortIndex=C,e(c,A),p||h||(p=!0,R(P))),A},t.unstable_shouldYield=Q,t.unstable_wrapCallback=function(A){var O=d;return function(){var B=d;d=O;try{return A.apply(this,arguments)}finally{d=B}}}})(vT);mT.exports=vT;var uH=mT.exports;/** + */(function(t){function e(A,O){var B=A.length;A.push(O);e:for(;0>>1,C=A[I];if(0>>1;Ii(_,B))Wi(G,_)?(A[I]=G,A[W]=B,I=W):(A[I]=_,A[z]=B,I=z);else if(Wi(G,B))A[I]=G,A[W]=B,I=W;else break e}}return O}function i(A,O){var B=A.sortIndex-O.sortIndex;return B!==0?B:A.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,f=null,d=3,h=!1,p=!1,m=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(A){for(var O=r(l);O!==null;){if(O.callback===null)n(l);else if(O.startTime<=A)n(l),O.sortIndex=O.expirationTime,e(c,O);else break;O=r(l)}}function S(A){if(m=!1,E(A),!p)if(r(c)!==null)p=!0,R(P);else{var O=r(l);O!==null&&N(S,O.startTime-A)}}function P(A,O){p=!1,m&&(m=!1,y(j),j=-1),h=!0;var B=d;try{for(E(O),f=r(c);f!==null&&(!(f.expirationTime>O)||A&&!Q());){var I=f.callback;if(typeof I=="function"){f.callback=null,d=f.priorityLevel;var C=I(f.expirationTime<=O);O=t.unstable_now(),typeof C=="function"?f.callback=C:f===r(c)&&n(c),E(O)}else n(c);f=r(c)}if(f!==null)var D=!0;else{var z=r(l);z!==null&&N(S,z.startTime-O),D=!1}return D}finally{f=null,d=B,h=!1}}var M=!1,L=null,j=-1,H=5,K=-1;function Q(){return!(t.unstable_now()-KA||125I?(A.sortIndex=B,e(l,A),r(c)===null&&A===r(l)&&(m?(y(j),j=-1):m=!0,N(S,B-I))):(A.sortIndex=C,e(c,A),p||h||(p=!0,R(P))),A},t.unstable_shouldYield=Q,t.unstable_wrapCallback=function(A){var O=d;return function(){var B=d;d=O;try{return A.apply(this,arguments)}finally{d=B}}}})(JI);YI.exports=JI;var UW=YI.exports;/** * @license React * react-dom.production.min.js * @@ -30,40 +30,40 @@ var FW=Object.defineProperty;var UW=(t,e,r)=>e in t?FW(t,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var yT=x,Ai=uH;function me(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),n5=Object.prototype.hasOwnProperty,fH=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Y9={},J9={};function dH(t){return n5.call(J9,t)?!0:n5.call(Y9,t)?!1:fH.test(t)?J9[t]=!0:(Y9[t]=!0,!1)}function hH(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function pH(t,e,r,n){if(e===null||typeof e>"u"||hH(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function zn(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var ln={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ln[t]=new zn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ln[e]=new zn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ln[t]=new zn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ln[t]=new zn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ln[t]=new zn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ln[t]=new zn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ln[t]=new zn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ln[t]=new zn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ln[t]=new zn(t,5,!1,t.toLowerCase(),null,!1,!1)});var w8=/[\-:]([a-z])/g;function E8(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(w8,E8);ln[e]=new zn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(w8,E8);ln[e]=new zn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(w8,E8);ln[e]=new zn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ln[t]=new zn(t,1,!1,t.toLowerCase(),null,!1,!1)});ln.xlinkHref=new zn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ln[t]=new zn(t,1,!1,t.toLowerCase(),null,!0,!0)});function C8(t,e,r,n){var i=ln.hasOwnProperty(e)?ln[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qw=Object.prototype.hasOwnProperty,zW=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,M9={},N9={};function qW(t){return qw.call(N9,t)?!0:qw.call(M9,t)?!1:zW.test(t)?N9[t]=!0:(M9[t]=!0,!1)}function WW(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function HW(t,e,r,n){if(e===null||typeof e>"u"||WW(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function zn(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var cn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){cn[t]=new zn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];cn[e]=new zn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){cn[t]=new zn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){cn[t]=new zn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){cn[t]=new zn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){cn[t]=new zn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){cn[t]=new zn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){cn[t]=new zn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){cn[t]=new zn(t,5,!1,t.toLowerCase(),null,!1,!1)});var a8=/[\-:]([a-z])/g;function c8(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(a8,c8);cn[e]=new zn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(a8,c8);cn[e]=new zn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(a8,c8);cn[e]=new zn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){cn[t]=new zn(t,1,!1,t.toLowerCase(),null,!1,!1)});cn.xlinkHref=new zn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){cn[t]=new zn(t,1,!1,t.toLowerCase(),null,!0,!0)});function l8(t,e,r,n){var i=cn.hasOwnProperty(e)?cn[e]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var c=` -`+i[o].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{ix=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Vh(t):""}function mH(t){switch(t.tag){case 5:return Vh(t.type);case 16:return Vh("Lazy");case 13:return Vh("Suspense");case 19:return Vh("SuspenseList");case 0:case 2:case 15:return t=sx(t.type,!1),t;case 11:return t=sx(t.type.render,!1),t;case 1:return t=sx(t.type,!0),t;default:return""}}function a5(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case mf:return"Fragment";case pf:return"Portal";case i5:return"Profiler";case S8:return"StrictMode";case s5:return"Suspense";case o5:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case xT:return(t.displayName||"Context")+".Consumer";case bT:return(t._context.displayName||"Context")+".Provider";case k8:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case A8:return e=t.displayName||null,e!==null?e:a5(t.type)||"Memo";case rc:e=t._payload,t=t._init;try{return a5(t(e))}catch{}}return null}function vH(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return a5(e);case 8:return e===S8?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Mc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ET(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function yH(t){var e=ET(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Up(t){t._valueTracker||(t._valueTracker=yH(t))}function CT(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=ET(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Nv(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function c5(t,e){var r=e.checked;return hr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Z9(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Mc(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ST(t,e){e=e.checked,e!=null&&C8(t,"checked",e,!1)}function l5(t,e){ST(t,e);var r=Mc(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?u5(t,e.type,r):e.hasOwnProperty("defaultValue")&&u5(t,e.type,Mc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function e7(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function u5(t,e,r){(e!=="number"||Nv(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Gh=Array.isArray;function Df(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=zp.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function $0(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Zh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},gH=["Webkit","ms","Moz","O"];Object.keys(Zh).forEach(function(t){gH.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Zh[e]=Zh[t]})});function PT(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Zh.hasOwnProperty(t)&&Zh[t]?(""+e).trim():e+"px"}function IT(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=PT(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var bH=hr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function h5(t,e){if(e){if(bH[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(me(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(me(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(me(61))}if(e.style!=null&&typeof e.style!="object")throw Error(me(62))}}function p5(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var m5=null;function _8(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var v5=null,Lf=null,jf=null;function n7(t){if(t=J1(t)){if(typeof v5!="function")throw Error(me(280));var e=t.stateNode;e&&(e=Ug(e),v5(t.stateNode,t.type,e))}}function TT(t){Lf?jf?jf.push(t):jf=[t]:Lf=t}function OT(){if(Lf){var t=Lf,e=jf;if(jf=Lf=null,n7(t),e)for(t=0;t>>=0,t===0?32:31-(TH(t)/OH|0)|0}var qp=64,Wp=4194304;function Kh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Bv(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Kh(a):(s&=o,s!==0&&(n=Kh(s)))}else o=r&~i,o!==0?n=Kh(o):s!==0&&(n=Kh(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function Q1(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Os(e),t[e]=r}function NH(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=t0),d7=" ",h7=!1;function JT(t,e){switch(t){case"keyup":return lV.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function XT(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var vf=!1;function fV(t,e){switch(t){case"compositionend":return XT(e);case"keypress":return e.which!==32?null:(h7=!0,d7);case"textInput":return t=e.data,t===d7&&h7?null:t;default:return null}}function dV(t,e){if(vf)return t==="compositionend"||!N8&&JT(t,e)?(t=QT(),Vm=R8=fc=null,vf=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=y7(r)}}function rO(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?rO(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function nO(){for(var t=window,e=Nv();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Nv(t.document)}return e}function D8(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function wV(t){var e=nO(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&rO(r.ownerDocument.documentElement,r)){if(n!==null&&D8(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=g7(r,s);var o=g7(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,yf=null,E5=null,n0=null,C5=!1;function b7(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;C5||yf==null||yf!==Nv(n)||(n=yf,"selectionStart"in n&&D8(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),n0&&B0(n0,n)||(n0=n,n=zv(E5,"onSelect"),0xf||(t.current=I5[xf],I5[xf]=null,xf--)}function $t(t,e){xf++,I5[xf]=t.current,t.current=e}var Nc={},An=rl(Nc),ni=rl(!1),tu=Nc;function sd(t,e){var r=t.type.contextTypes;if(!r)return Nc;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ii(t){return t=t.childContextTypes,t!=null}function Wv(){ir(ni),ir(An)}function A7(t,e,r){if(An.current!==Nc)throw Error(me(168));$t(An,e),$t(ni,r)}function dO(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(me(108,vH(t)||"Unknown",i));return hr({},r,n)}function Hv(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Nc,tu=An.current,$t(An,t),$t(ni,ni.current),!0}function _7(t,e,r){var n=t.stateNode;if(!n)throw Error(me(169));r?(t=dO(t,e,tu),n.__reactInternalMemoizedMergedChildContext=t,ir(ni),ir(An),$t(An,t)):ir(ni),$t(ni,r)}var zo=null,zg=!1,bx=!1;function hO(t){zo===null?zo=[t]:zo.push(t)}function $V(t){zg=!0,hO(t)}function nl(){if(!bx&&zo!==null){bx=!0;var t=0,e=Et;try{var r=zo;for(Et=1;t>=o,i-=o,Go=1<<32-Os(e)+i|r<j?(H=L,L=null):H=L.sibling;var K=d(y,L,E[j],S);if(K===null){L===null&&(L=H);break}t&&L&&K.alternate===null&&e(y,L),b=s(K,b,j),M===null?P=K:M.sibling=K,M=K,L=H}if(j===E.length)return r(y,L),sr&&_l(y,j),P;if(L===null){for(;jj?(H=L,L=null):H=L.sibling;var Q=d(y,L,K.value,S);if(Q===null){L===null&&(L=H);break}t&&L&&Q.alternate===null&&e(y,L),b=s(Q,b,j),M===null?P=Q:M.sibling=Q,M=Q,L=H}if(K.done)return r(y,L),sr&&_l(y,j),P;if(L===null){for(;!K.done;j++,K=E.next())K=f(y,K.value,S),K!==null&&(b=s(K,b,j),M===null?P=K:M.sibling=K,M=K);return sr&&_l(y,j),P}for(L=n(y,L);!K.done;j++,K=E.next())K=h(L,y,j,K.value,S),K!==null&&(t&&K.alternate!==null&&L.delete(K.key===null?j:K.key),b=s(K,b,j),M===null?P=K:M.sibling=K,M=K);return t&&L.forEach(function(Y){return e(y,Y)}),sr&&_l(y,j),P}function v(y,b,E,S){if(typeof E=="object"&&E!==null&&E.type===mf&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Fp:e:{for(var P=E.key,M=b;M!==null;){if(M.key===P){if(P=E.type,P===mf){if(M.tag===7){r(y,M.sibling),b=i(M,E.props.children),b.return=y,y=b;break e}}else if(M.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===rc&&M7(P)===M.type){r(y,M.sibling),b=i(M,E.props),b.ref=xh(y,M,E),b.return=y,y=b;break e}r(y,M);break}else e(y,M);M=M.sibling}E.type===mf?(b=Gl(E.props.children,y.mode,S,E.key),b.return=y,y=b):(S=ev(E.type,E.key,E.props,null,y.mode,S),S.ref=xh(y,b,E),S.return=y,y=S)}return o(y);case pf:e:{for(M=E.key;b!==null;){if(b.key===M)if(b.tag===4&&b.stateNode.containerInfo===E.containerInfo&&b.stateNode.implementation===E.implementation){r(y,b.sibling),b=i(b,E.children||[]),b.return=y,y=b;break e}else{r(y,b);break}else e(y,b);b=b.sibling}b=_x(E,y.mode,S),b.return=y,y=b}return o(y);case rc:return M=E._init,v(y,b,M(E._payload),S)}if(Gh(E))return p(y,b,E,S);if(mh(E))return m(y,b,E,S);Jp(y,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,b!==null&&b.tag===6?(r(y,b.sibling),b=i(b,E),b.return=y,y=b):(r(y,b),b=Ax(E,y.mode,S),b.return=y,y=b),o(y)):r(y,b)}return v}var ad=wO(!0),EO=wO(!1),X1={},po=rl(X1),q0=rl(X1),W0=rl(X1);function Ul(t){if(t===X1)throw Error(me(174));return t}function H8(t,e){switch($t(W0,e),$t(q0,t),$t(po,X1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:d5(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=d5(e,t)}ir(po),$t(po,e)}function cd(){ir(po),ir(q0),ir(W0)}function CO(t){Ul(W0.current);var e=Ul(po.current),r=d5(e,t.type);e!==r&&($t(q0,t),$t(po,r))}function V8(t){q0.current===t&&(ir(po),ir(q0))}var ur=rl(0);function Jv(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var xx=[];function G8(){for(var t=0;tr?r:4,t(!0);var n=wx.transition;wx.transition={};try{t(!1),e()}finally{Et=r,wx.transition=n}}function BO(){return rs().memoizedState}function LV(t,e,r){var n=Cc(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},FO(t))UO(e,r);else if(r=yO(t,e,r,n),r!==null){var i=jn();Rs(r,t,n,i),zO(r,e,n)}}function jV(t,e,r){var n=Cc(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(FO(t))UO(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Ns(a,o)){var c=e.interleaved;c===null?(i.next=i,q8(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=yO(t,e,i,n),r!==null&&(i=jn(),Rs(r,t,n,i),zO(r,e,n))}}function FO(t){var e=t.alternate;return t===dr||e!==null&&e===dr}function UO(t,e){i0=Xv=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function zO(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,I8(t,r)}}var Zv={readContext:ts,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useInsertionEffect:hn,useLayoutEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useMutableSource:hn,useSyncExternalStore:hn,useId:hn,unstable_isNewReconciler:!1},BV={readContext:ts,useCallback:function(t,e){return Ys().memoizedState=[t,e===void 0?null:e],t},useContext:ts,useEffect:D7,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Ym(4194308,4,MO.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Ym(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ym(4,2,t,e)},useMemo:function(t,e){var r=Ys();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Ys();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=LV.bind(null,dr,t),[n.memoizedState,t]},useRef:function(t){var e=Ys();return t={current:t},e.memoizedState=t},useState:N7,useDebugValue:X8,useDeferredValue:function(t){return Ys().memoizedState=t},useTransition:function(){var t=N7(!1),e=t[0];return t=DV.bind(null,t[1]),Ys().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=dr,i=Ys();if(sr){if(r===void 0)throw Error(me(407));r=r()}else{if(r=e(),Yr===null)throw Error(me(349));nu&30||AO(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,D7(PO.bind(null,n,s,t),[t]),n.flags|=2048,G0(9,_O.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Ys(),e=Yr.identifierPrefix;if(sr){var r=Ko,n=Go;r=(n&~(1<<32-Os(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=H0++,0")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{H2=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Dh(t):""}function VW(t){switch(t.tag){case 5:return Dh(t.type);case 16:return Dh("Lazy");case 13:return Dh("Suspense");case 19:return Dh("SuspenseList");case 0:case 2:case 15:return t=V2(t.type,!1),t;case 11:return t=V2(t.type.render,!1),t;case 1:return t=V2(t.type,!0),t;default:return""}}function Gw(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case af:return"Fragment";case of:return"Portal";case Ww:return"Profiler";case u8:return"StrictMode";case Hw:return"Suspense";case Vw:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case tT:return(t.displayName||"Context")+".Consumer";case eT:return(t._context.displayName||"Context")+".Provider";case f8:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case d8:return e=t.displayName||null,e!==null?e:Gw(t.type)||"Memo";case Xa:e=t._payload,t=t._init;try{return Gw(t(e))}catch{}}return null}function GW(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Gw(e);case 8:return e===u8?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Pc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function nT(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function KW(t){var e=nT(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Tp(t){t._valueTracker||(t._valueTracker=KW(t))}function iT(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=nT(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Cv(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Kw(t,e){var r=e.checked;return hr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function L9(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Pc(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function sT(t,e){e=e.checked,e!=null&&l8(t,"checked",e,!1)}function Qw(t,e){sT(t,e);var r=Pc(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Yw(t,e.type,r):e.hasOwnProperty("defaultValue")&&Yw(t,e.type,Pc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function j9(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Yw(t,e,r){(e!=="number"||Cv(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Lh=Array.isArray;function Pf(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Op.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function C0(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var qh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},QW=["Webkit","ms","Moz","O"];Object.keys(qh).forEach(function(t){QW.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),qh[e]=qh[t]})});function lT(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||qh.hasOwnProperty(t)&&qh[t]?(""+e).trim():e+"px"}function uT(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=lT(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var YW=hr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zw(t,e){if(e){if(YW[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(me(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(me(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(me(61))}if(e.style!=null&&typeof e.style!="object")throw Error(me(62))}}function e5(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var t5=null;function h8(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var r5=null,If=null,Tf=null;function U9(t){if(t=B1(t)){if(typeof r5!="function")throw Error(me(280));var e=t.stateNode;e&&(e=Ig(e),r5(t.stateNode,t.type,e))}}function fT(t){If?Tf?Tf.push(t):Tf=[t]:If=t}function dT(){if(If){var t=If,e=Tf;if(Tf=If=null,U9(t),e)for(t=0;t>>=0,t===0?32:31-(aH(t)/cH|0)|0}var Rp=64,$p=4194304;function jh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function _v(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=jh(a):(s&=o,s!==0&&(n=jh(s)))}else o=r&~i,o!==0?n=jh(o):s!==0&&(n=jh(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function L1(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Is(e),t[e]=r}function dH(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Hh),Y9=" ",J9=!1;function RT(t,e){switch(t){case"keyup":return FH.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $T(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var cf=!1;function zH(t,e){switch(t){case"compositionend":return $T(e);case"keypress":return e.which!==32?null:(J9=!0,Y9);case"textInput":return t=e.data,t===Y9&&J9?null:t;default:return null}}function qH(t,e){if(cf)return t==="compositionend"||!w8&&RT(t,e)?(t=TT(),Nm=g8=sc=null,cf=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=t7(r)}}function LT(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?LT(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function jT(){for(var t=window,e=Cv();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Cv(t.document)}return e}function E8(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function XH(t){var e=jT(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&<(r.ownerDocument.documentElement,r)){if(n!==null&&E8(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=r7(r,s);var o=r7(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,lf=null,c5=null,Gh=null,l5=!1;function n7(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;l5||lf==null||lf!==Cv(n)||(n=lf,"selectionStart"in n&&E8(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Gh&&I0(Gh,n)||(Gh=n,n=Tv(c5,"onSelect"),0df||(t.current=m5[df],m5[df]=null,df--)}function $t(t,e){df++,m5[df]=t.current,t.current=e}var Ic={},An=Jc(Ic),ri=Jc(!1),Kl=Ic;function Yf(t,e){var r=t.type.contextTypes;if(!r)return Ic;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ni(t){return t=t.childContextTypes,t!=null}function Rv(){ir(ri),ir(An)}function u7(t,e,r){if(An.current!==Ic)throw Error(me(168));$t(An,e),$t(ri,r)}function GT(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(me(108,GW(t)||"Unknown",i));return hr({},r,n)}function $v(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ic,Kl=An.current,$t(An,t),$t(ri,ri.current),!0}function f7(t,e,r){var n=t.stateNode;if(!n)throw Error(me(169));r?(t=GT(t,e,Kl),n.__reactInternalMemoizedMergedChildContext=t,ir(ri),ir(An),$t(An,t)):ir(ri),$t(ri,r)}var Fo=null,Tg=!1,ox=!1;function KT(t){Fo===null?Fo=[t]:Fo.push(t)}function uV(t){Tg=!0,KT(t)}function Xc(){if(!ox&&Fo!==null){ox=!0;var t=0,e=Ct;try{var r=Fo;for(Ct=1;t>=o,i-=o,Wo=1<<32-Is(e)+i|r<j?(H=L,L=null):H=L.sibling;var K=d(y,L,E[j],S);if(K===null){L===null&&(L=H);break}t&&L&&K.alternate===null&&e(y,L),b=s(K,b,j),M===null?P=K:M.sibling=K,M=K,L=H}if(j===E.length)return r(y,L),sr&&xl(y,j),P;if(L===null){for(;jj?(H=L,L=null):H=L.sibling;var Q=d(y,L,K.value,S);if(Q===null){L===null&&(L=H);break}t&&L&&Q.alternate===null&&e(y,L),b=s(Q,b,j),M===null?P=Q:M.sibling=Q,M=Q,L=H}if(K.done)return r(y,L),sr&&xl(y,j),P;if(L===null){for(;!K.done;j++,K=E.next())K=f(y,K.value,S),K!==null&&(b=s(K,b,j),M===null?P=K:M.sibling=K,M=K);return sr&&xl(y,j),P}for(L=n(y,L);!K.done;j++,K=E.next())K=h(L,y,j,K.value,S),K!==null&&(t&&K.alternate!==null&&L.delete(K.key===null?j:K.key),b=s(K,b,j),M===null?P=K:M.sibling=K,M=K);return t&&L.forEach(function(Y){return e(y,Y)}),sr&&xl(y,j),P}function v(y,b,E,S){if(typeof E=="object"&&E!==null&&E.type===af&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case Ip:e:{for(var P=E.key,M=b;M!==null;){if(M.key===P){if(P=E.type,P===af){if(M.tag===7){r(y,M.sibling),b=i(M,E.props.children),b.return=y,y=b;break e}}else if(M.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Xa&&g7(P)===M.type){r(y,M.sibling),b=i(M,E.props),b.ref=uh(y,M,E),b.return=y,y=b;break e}r(y,M);break}else e(y,M);M=M.sibling}E.type===af?(b=Fl(E.props.children,y.mode,S,E.key),b.return=y,y=b):(S=qm(E.type,E.key,E.props,null,y.mode,S),S.ref=uh(y,b,E),S.return=y,y=S)}return o(y);case of:e:{for(M=E.key;b!==null;){if(b.key===M)if(b.tag===4&&b.stateNode.containerInfo===E.containerInfo&&b.stateNode.implementation===E.implementation){r(y,b.sibling),b=i(b,E.children||[]),b.return=y,y=b;break e}else{r(y,b);break}else e(y,b);b=b.sibling}b=px(E,y.mode,S),b.return=y,y=b}return o(y);case Xa:return M=E._init,v(y,b,M(E._payload),S)}if(Lh(E))return p(y,b,E,S);if(sh(E))return m(y,b,E,S);Fp(y,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,b!==null&&b.tag===6?(r(y,b.sibling),b=i(b,E),b.return=y,y=b):(r(y,b),b=hx(E,y.mode,S),b.return=y,y=b),o(y)):r(y,b)}return v}var Xf=rO(!0),nO=rO(!1),F1={},fo=Jc(F1),$0=Jc(F1),M0=Jc(F1);function Ml(t){if(t===F1)throw Error(me(174));return t}function O8(t,e){switch($t(M0,e),$t($0,t),$t(fo,F1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Xw(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Xw(e,t)}ir(fo),$t(fo,e)}function Zf(){ir(fo),ir($0),ir(M0)}function iO(t){Ml(M0.current);var e=Ml(fo.current),r=Xw(e,t.type);e!==r&&($t($0,t),$t(fo,r))}function R8(t){$0.current===t&&(ir(fo),ir($0))}var ur=Jc(0);function Bv(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var ax=[];function $8(){for(var t=0;tr?r:4,t(!0);var n=cx.transition;cx.transition={};try{t(!1),e()}finally{Ct=r,cx.transition=n}}function xO(){return es().memoizedState}function pV(t,e,r){var n=yc(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},wO(t))EO(e,r);else if(r=XT(t,e,r,n),r!==null){var i=jn();Ts(r,t,n,i),CO(r,e,n)}}function mV(t,e,r){var n=yc(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(wO(t))EO(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,$s(a,o)){var c=e.interleaved;c===null?(i.next=i,I8(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=XT(t,e,i,n),r!==null&&(i=jn(),Ts(r,t,n,i),CO(r,e,n))}}function wO(t){var e=t.alternate;return t===dr||e!==null&&e===dr}function EO(t,e){Kh=Fv=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function CO(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,m8(t,r)}}var Uv={readContext:Zi,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useInsertionEffect:hn,useLayoutEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useMutableSource:hn,useSyncExternalStore:hn,useId:hn,unstable_isNewReconciler:!1},vV={readContext:Zi,useCallback:function(t,e){return Ks().memoizedState=[t,e===void 0?null:e],t},useContext:Zi,useEffect:x7,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Bm(4194308,4,mO.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Bm(4194308,4,t,e)},useInsertionEffect:function(t,e){return Bm(4,2,t,e)},useMemo:function(t,e){var r=Ks();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Ks();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=pV.bind(null,dr,t),[n.memoizedState,t]},useRef:function(t){var e=Ks();return t={current:t},e.memoizedState=t},useState:b7,useDebugValue:j8,useDeferredValue:function(t){return Ks().memoizedState=t},useTransition:function(){var t=b7(!1),e=t[0];return t=hV.bind(null,t[1]),Ks().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=dr,i=Ks();if(sr){if(r===void 0)throw Error(me(407));r=r()}else{if(r=e(),Qr===null)throw Error(me(349));Yl&30||aO(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,x7(lO.bind(null,n,s,t),[t]),n.flags|=2048,L0(9,cO.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=Ks(),e=Qr.identifierPrefix;if(sr){var r=Ho,n=Wo;r=(n&~(1<<32-Is(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=N0++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[so]=e,t[z0]=n,JO(t,e,!1,!1),e.stateNode=t;e:{switch(o=p5(r,n),r){case"dialog":Zt("cancel",t),Zt("close",t),i=n;break;case"iframe":case"object":case"embed":Zt("load",t),i=n;break;case"video":case"audio":for(i=0;iud&&(e.flags|=128,n=!0,wh(s,!1),e.lanes=4194304)}else{if(!n)if(t=Jv(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),wh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!sr)return pn(e),null}else 2*Pr()-s.renderingStartTime>ud&&r!==1073741824&&(e.flags|=128,n=!0,wh(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Pr(),e.sibling=null,r=ur.current,$t(ur,n?r&1|2:r&1),e):(pn(e),null);case 22:case 23:return iE(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?mi&1073741824&&(pn(e),e.subtreeFlags&6&&(e.flags|=8192)):pn(e),null;case 24:return null;case 25:return null}throw Error(me(156,e.tag))}function GV(t,e){switch(j8(e),e.tag){case 1:return ii(e.type)&&Wv(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return cd(),ir(ni),ir(An),G8(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return V8(e),null;case 13:if(ir(ur),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(me(340));od()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ir(ur),null;case 4:return cd(),null;case 10:return z8(e.type._context),null;case 22:case 23:return iE(),null;case 24:return null;default:return null}}var Zp=!1,gn=!1,KV=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Sf(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){vr(t,e,n)}else r.current=null}function U5(t,e,r){try{r()}catch(n){vr(t,e,n)}}var H7=!1;function QV(t,e){if(S5=Fv,t=nO(),D8(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==r||i!==0&&f.nodeType!==3||(a=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===r&&++l===i&&(a=o),d===s&&++u===n&&(c=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(k5={focusedElem:t,selectionRange:r},Fv=!1,xe=e;xe!==null;)if(e=xe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,xe=t;else for(;xe!==null;){e=xe;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,v=p.memoizedState,y=e.stateNode,b=y.getSnapshotBeforeUpdate(e.elementType===e.type?m:Es(e.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var E=e.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(me(163))}}catch(S){vr(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,xe=t;break}xe=e.return}return p=H7,H7=!1,p}function s0(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&U5(e,r,s)}i=i.next}while(i!==n)}}function Hg(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function z5(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function eR(t){var e=t.alternate;e!==null&&(t.alternate=null,eR(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[so],delete e[z0],delete e[P5],delete e[OV],delete e[RV])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function tR(t){return t.tag===5||t.tag===3||t.tag===4}function V7(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||tR(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function q5(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=qv));else if(n!==4&&(t=t.child,t!==null))for(q5(t,e,r),t=t.sibling;t!==null;)q5(t,e,r),t=t.sibling}function W5(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(W5(t,e,r),t=t.sibling;t!==null;)W5(t,e,r),t=t.sibling}var tn=null,Ss=!1;function Ha(t,e,r){for(r=r.child;r!==null;)rR(t,e,r),r=r.sibling}function rR(t,e,r){if(ho&&typeof ho.onCommitFiberUnmount=="function")try{ho.onCommitFiberUnmount(Lg,r)}catch{}switch(r.tag){case 5:gn||Sf(r,e);case 6:var n=tn,i=Ss;tn=null,Ha(t,e,r),tn=n,Ss=i,tn!==null&&(Ss?(t=tn,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):tn.removeChild(r.stateNode));break;case 18:tn!==null&&(Ss?(t=tn,r=r.stateNode,t.nodeType===8?gx(t.parentNode,r):t.nodeType===1&&gx(t,r),L0(t)):gx(tn,r.stateNode));break;case 4:n=tn,i=Ss,tn=r.stateNode.containerInfo,Ss=!0,Ha(t,e,r),tn=n,Ss=i;break;case 0:case 11:case 14:case 15:if(!gn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&U5(r,e,o),i=i.next}while(i!==n)}Ha(t,e,r);break;case 1:if(!gn&&(Sf(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){vr(r,e,a)}Ha(t,e,r);break;case 21:Ha(t,e,r);break;case 22:r.mode&1?(gn=(n=gn)||r.memoizedState!==null,Ha(t,e,r),gn=n):Ha(t,e,r);break;default:Ha(t,e,r)}}function G7(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new KV),e.forEach(function(n){var i=iG.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ps(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Pr()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*JV(n/1960))-n,10t?16:t,dc===null)var n=!1;else{if(t=dc,dc=null,ry=0,ut&6)throw Error(me(331));var i=ut;for(ut|=4,xe=t.current;xe!==null;){var s=xe,o=s.child;if(xe.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cPr()-rE?Vl(t,0):tE|=r),si(t,e)}function uR(t,e){e===0&&(t.mode&1?(e=Wp,Wp<<=1,!(Wp&130023424)&&(Wp=4194304)):e=1);var r=jn();t=la(t,e),t!==null&&(Q1(t,e,r),si(t,r))}function nG(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),uR(t,r)}function iG(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(me(314))}n!==null&&n.delete(e),uR(t,r)}var fR;fR=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||ni.current)Zn=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Zn=!1,HV(t,e,r);Zn=!!(t.flags&131072)}else Zn=!1,sr&&e.flags&1048576&&pO(e,Gv,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Jm(t,e),t=e.pendingProps;var i=sd(e,An.current);Ff(e,r),i=Q8(null,e,n,t,i,r);var s=Y8();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ii(n)?(s=!0,Hv(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,W8(e),i.updater=qg,e.stateNode=i,i._reactInternals=e,M5(e,n,t,r),e=L5(null,e,n,!0,s,r)):(e.tag=0,sr&&s&&L8(e),Mn(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Jm(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=oG(n),t=Es(n,t),i){case 0:e=D5(null,e,n,t,r);break e;case 1:e=z7(null,e,n,t,r);break e;case 11:e=F7(null,e,n,t,r);break e;case 14:e=U7(null,e,n,Es(n.type,t),r);break e}throw Error(me(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Es(n,i),D5(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Es(n,i),z7(t,e,n,i,r);case 3:e:{if(KO(e),t===null)throw Error(me(387));n=e.pendingProps,s=e.memoizedState,i=s.element,gO(t,e),Yv(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=ld(Error(me(423)),e),e=q7(t,e,n,r,i);break e}else if(n!==i){i=ld(Error(me(424)),e),e=q7(t,e,n,r,i);break e}else for(wi=xc(e.stateNode.containerInfo.firstChild),Ei=e,sr=!0,ks=null,r=EO(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(od(),n===i){e=ua(t,e,r);break e}Mn(t,e,n,r)}e=e.child}return e;case 5:return CO(e),t===null&&O5(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,A5(n,i)?o=null:s!==null&&A5(n,s)&&(e.flags|=32),GO(t,e),Mn(t,e,o,r),e.child;case 6:return t===null&&O5(e),null;case 13:return QO(t,e,r);case 4:return H8(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=ad(e,null,n,r):Mn(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Es(n,i),F7(t,e,n,i,r);case 7:return Mn(t,e,e.pendingProps,r),e.child;case 8:return Mn(t,e,e.pendingProps.children,r),e.child;case 12:return Mn(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,$t(Kv,n._currentValue),n._currentValue=o,s!==null)if(Ns(s.value,o)){if(s.children===i.children&&!ni.current){e=ua(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=ea(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var u=l.pending;u===null?c.next=c:(c.next=u.next,u.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),R5(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(me(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),R5(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Mn(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Ff(e,r),i=ts(i),n=n(i),e.flags|=1,Mn(t,e,n,r),e.child;case 14:return n=e.type,i=Es(n,e.pendingProps),i=Es(n.type,i),U7(t,e,n,i,r);case 15:return HO(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Es(n,i),Jm(t,e),e.tag=1,ii(n)?(t=!0,Hv(e)):t=!1,Ff(e,r),xO(e,n,i),M5(e,n,i,r),L5(null,e,n,!0,t,r);case 19:return YO(t,e,r);case 22:return VO(t,e,r)}throw Error(me(156,e.tag))};function dR(t,e){return jT(t,e)}function sG(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yi(t,e,r,n){return new sG(t,e,r,n)}function oE(t){return t=t.prototype,!(!t||!t.isReactComponent)}function oG(t){if(typeof t=="function")return oE(t)?1:0;if(t!=null){if(t=t.$$typeof,t===k8)return 11;if(t===A8)return 14}return 2}function Sc(t,e){var r=t.alternate;return r===null?(r=Yi(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function ev(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")oE(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case mf:return Gl(r.children,i,s,e);case S8:o=8,i|=8;break;case i5:return t=Yi(12,r,e,i|2),t.elementType=i5,t.lanes=s,t;case s5:return t=Yi(13,r,e,i),t.elementType=s5,t.lanes=s,t;case o5:return t=Yi(19,r,e,i),t.elementType=o5,t.lanes=s,t;case wT:return Gg(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case bT:o=10;break e;case xT:o=9;break e;case k8:o=11;break e;case A8:o=14;break e;case rc:o=16,n=null;break e}throw Error(me(130,t==null?t:typeof t,""))}return e=Yi(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Gl(t,e,r,n){return t=Yi(7,t,n,e),t.lanes=r,t}function Gg(t,e,r,n){return t=Yi(22,t,n,e),t.elementType=wT,t.lanes=r,t.stateNode={isHidden:!1},t}function Ax(t,e,r){return t=Yi(6,t,null,e),t.lanes=r,t}function _x(t,e,r){return e=Yi(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function aG(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ax(0),this.expirationTimes=ax(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ax(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function aE(t,e,r,n,i,s,o,a,c){return t=new aG(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Yi(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},W8(s),t}function cG(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vR)}catch(t){console.error(t)}}vR(),pT.exports=Oi;var zs=pT.exports;const hG=Ti(zs);var tS=zs;r5.createRoot=tS.createRoot,r5.hydrateRoot=tS.hydrateRoot;const pG=[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}];var mG=Object.freeze({__proto__:null,abi:pG});const vG=[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],yG={isValidSignatureBytes32:"0x1626ba7e"};var gG=Object.freeze({__proto__:null,abi:vG,returns:yG});const bG=[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var xG=Object.freeze({__proto__:null,abi:bG});const wG=[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}];var EG=Object.freeze({__proto__:null,abi:wG});const CG=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"},{type:"function",name:"setExtraImageHash",constant:!1,inputs:[{type:"bytes32",name:"imageHash"},{type:"uint256",name:"expiration"}],outputs:[],payable:!1,stateMutability:"nonpayable"}];var SG=Object.freeze({__proto__:null,abi:CG});const kG=[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}];var AG=Object.freeze({__proto__:null,abi:kG});const _G=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];var PG=Object.freeze({__proto__:null,abi:_G});const IG=[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}];var TG=Object.freeze({__proto__:null,abi:IG});const Jr={erc6492:xG,erc5719:mG,erc1271:gG,factory:EG,mainModule:SG,mainModuleUpgradable:AG,sequenceUtils:PG,requireFreshSigner:TG},OG=Object.freeze(Object.defineProperty({__proto__:null,walletContracts:Jr},Symbol.toStringTag,{value:"Module"})),Bn=globalThis||void 0||self;function sy(){return sy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),We({},n)).then(i=>He(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),We({},n)).then(i=>He(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),We({},n)).then(i=>He(i).then(s=>({status:s.status}))),this.clock=n=>this.fetch(this.url("Clock"),We({},n)).then(i=>He(i).then(s=>({serverTime:s.serverTime}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),We({},n)).then(i=>He(i).then(s=>({data:s.data}))),this.getAuthToken=(n,i)=>this.fetch(this.url("GetAuthToken"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,jwtToken:o.jwtToken,address:o.address,user:o.user}))),this.getAuthToken2=(n,i)=>this.fetch(this.url("GetAuthToken2"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,jwtToken:o.jwtToken,address:o.address,user:o.user}))),this.sendPasswordlessLink=(n,i)=>this.fetch(this.url("SendPasswordlessLink"),We(n,i)).then(s=>He(s).then(o=>({status:o.status}))),this.friendList=(n,i)=>this.fetch(this.url("FriendList"),We(n,i)).then(s=>He(s).then(o=>({page:o.page,friends:o.friends}))),this.getFriendByAddress=(n,i)=>this.fetch(this.url("GetFriendByAddress"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,friend:o.friend}))),this.searchFriends=(n,i)=>this.fetch(this.url("SearchFriends"),We(n,i)).then(s=>He(s).then(o=>({friends:o.friends}))),this.addFriend=(n,i)=>this.fetch(this.url("AddFriend"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,friend:o.friend}))),this.updateFriendNickname=(n,i)=>this.fetch(this.url("UpdateFriendNickname"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,friend:o.friend}))),this.removeFriend=(n,i)=>this.fetch(this.url("RemoveFriend"),We(n,i)).then(s=>He(s).then(o=>({status:o.status}))),this.contractCall=(n,i)=>this.fetch(this.url("ContractCall"),We(n,i)).then(s=>He(s).then(o=>({returns:o.returns}))),this.decodeContractCall=(n,i)=>this.fetch(this.url("DecodeContractCall"),We(n,i)).then(s=>He(s).then(o=>({call:o.call}))),this.lookupContractCallSelectors=(n,i)=>this.fetch(this.url("LookupContractCallSelectors"),We(n,i)).then(s=>He(s).then(o=>({signatures:o.signatures}))),this.userStorageFetch=(n,i)=>this.fetch(this.url("UserStorageFetch"),We(n,i)).then(s=>He(s).then(o=>({object:o.object}))),this.userStorageSave=(n,i)=>this.fetch(this.url("UserStorageSave"),We(n,i)).then(s=>He(s).then(o=>({ok:o.ok}))),this.userStorageDelete=(n,i)=>this.fetch(this.url("UserStorageDelete"),We(n,i)).then(s=>He(s).then(o=>({ok:o.ok}))),this.userStorageFetchAll=(n,i)=>this.fetch(this.url("UserStorageFetchAll"),We(n,i)).then(s=>He(s).then(o=>({objects:o.objects}))),this.getMoonpayLink=(n,i)=>this.fetch(this.url("GetMoonpayLink"),We(n,i)).then(s=>He(s).then(o=>({signedUrl:o.signedUrl}))),this.getSardineClientToken=n=>this.fetch(this.url("GetSardineClientToken"),We({},n)).then(i=>He(i).then(s=>({token:s.token}))),this.resolveENSAddress=(n,i)=>this.fetch(this.url("ResolveENSAddress"),We(n,i)).then(s=>He(s).then(o=>({address:o.address,ok:o.ok}))),this.isValidSignature=(n,i)=>this.fetch(this.url("IsValidSignature"),We(n,i)).then(s=>He(s).then(o=>({isValid:o.isValid}))),this.isValidMessageSignature=(n,i)=>this.fetch(this.url("IsValidMessageSignature"),We(n,i)).then(s=>He(s).then(o=>({isValid:o.isValid}))),this.isValidTypedDataSignature=(n,i)=>this.fetch(this.url("IsValidTypedDataSignature"),We(n,i)).then(s=>He(s).then(o=>({isValid:o.isValid}))),this.isValidETHAuthProof=(n,i)=>this.fetch(this.url("IsValidETHAuthProof"),We(n,i)).then(s=>He(s).then(o=>({isValid:o.isValid}))),this.getCoinPrices=(n,i)=>this.fetch(this.url("GetCoinPrices"),We(n,i)).then(s=>He(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getCollectiblePrices=(n,i)=>this.fetch(this.url("GetCollectiblePrices"),We(n,i)).then(s=>He(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getExchangeRate=(n,i)=>this.fetch(this.url("GetExchangeRate"),We(n,i)).then(s=>He(s).then(o=>({exchangeRate:o.exchangeRate}))),this.memoryStore=(n,i)=>this.fetch(this.url("MemoryStore"),We(n,i)).then(s=>He(s).then(o=>({ok:o.ok}))),this.memoryLoad=(n,i)=>this.fetch(this.url("MemoryLoad"),We(n,i)).then(s=>He(s).then(o=>({value:o.value}))),this.getInviteInfo=n=>this.fetch(this.url("GetInviteInfo"),We({},n)).then(i=>He(i).then(s=>({inviteInfo:s.inviteInfo}))),this.isValidAccessCode=(n,i)=>this.fetch(this.url("IsValidAccessCode"),We(n,i)).then(s=>He(s).then(o=>({status:o.status}))),this.internalClaimAccessCode=(n,i)=>this.fetch(this.url("InternalClaimAccessCode"),We(n,i)).then(s=>He(s).then(o=>({status:o.status}))),this.blockNumberAtTime=(n,i)=>this.fetch(this.url("BlockNumberAtTime"),We(n,i)).then(s=>He(s).then(o=>({blocks:o.blocks}))),this.paperSessionSecret=(n,i)=>this.fetch(this.url("PaperSessionSecret"),We(n,i)).then(s=>He(s).then(o=>({secret:o.secret}))),this.paperSessionSecret2=(n,i)=>this.fetch(this.url("PaperSessionSecret2"),We(n,i)).then(s=>He(s).then(o=>({secret:o.secret}))),this.linkWallet=(n,i)=>this.fetch(this.url("LinkWallet"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,linkedWalletAddress:o.linkedWalletAddress}))),this.getLinkedWallets=(n,i)=>this.fetch(this.url("GetLinkedWallets"),We(n,i)).then(s=>He(s).then(o=>({linkedWallets:o.linkedWallets}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const We=(t={},e={})=>({method:"POST",headers:sy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),He=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),rS=typeof Bn=="object"?Bn.fetch:window.fetch;class c0 extends yR{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,rS),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=sy({},s.headers,o),rS(i,s)},this.fetch=this._fetch}}const DG=Object.freeze(Object.defineProperty({__proto__:null,API:yR,SequenceAPIClient:c0,SortOrder:NG,WebRPCSchemaHash:MG,WebRPCSchemaVersion:$G,WebRPCVersion:RG},Symbol.toStringTag,{value:"Module"}));var fE={exports:{}},Hr={},Xg={};Xg.byteLength=BG;Xg.toByteArray=UG;Xg.fromByteArray=WG;var oo=[],Bi=[],LG=typeof Uint8Array<"u"?Uint8Array:Array,Px="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var zu=0,jG=Px.length;zu0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function BG(t){var e=gR(t),r=e[0],n=e[1];return(r+n)*3/4-n}function FG(t,e,r){return(e+r)*3/4-r}function UG(t){var e,r=gR(t),n=r[0],i=r[1],s=new LG(FG(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Bi[t.charCodeAt(c)]<<2|Bi[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Bi[t.charCodeAt(c)]<<10|Bi[t.charCodeAt(c+1)]<<4|Bi[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function zG(t){return oo[t>>18&63]+oo[t>>12&63]+oo[t>>6&63]+oo[t&63]}function qG(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(oo[e>>2]+oo[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(oo[e>>10]+oo[e>>4&63]+oo[e<<2&63]+"=")),i.join("")}var dE={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */dE.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,u=-7,f=r?i-1:0,d=r?-1:1,h=t[e+f];for(f+=d,s=h&(1<<-u)-1,h>>=-u,u+=a;u>0;s=s*256+t[e+f],f+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=n;u>0;o=o*256+t[e+f],f+=d,u-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(h?-1:1)*o*Math.pow(2,s-n)};dE.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,u=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:s-1,p=n?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=d/c:e+=d*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=u?(a=0,o=u):o+f>=1?(a=(e*c-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+h]=a&255,h+=p,a/=256,i-=8);for(o=o<0;t[r+h]=o&255,h+=p,o/=256,l-=8);t[r+h-p]|=m*128};/*! +`+s.stack}return{value:t,source:e,stack:i,digest:null}}function fx(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function w5(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var bV=typeof WeakMap=="function"?WeakMap:Map;function SO(t,e,r){r=Jo(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){qv||(qv=!0,O5=n),w5(t,e)},r}function kO(t,e,r){r=Jo(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){w5(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){w5(t,e),typeof n!="function"&&(vc===null?vc=new Set([this]):vc.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function w7(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new bV;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=$V.bind(null,t,e,r),e.then(t,t))}function E7(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function C7(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=Jo(-1,1),e.tag=2,mc(r,e,1))),r.lanes|=1),t)}var xV=Sa.ReactCurrentOwner,Xn=!1;function Mn(t,e,r,n){e.child=t===null?nO(e,null,r,n):Xf(e,t.child,r,n)}function S7(t,e,r,n,i){r=r.render;var s=e.ref;return Rf(e,i),n=N8(t,e,r,n,s,i),r=D8(),t!==null&&!Xn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,aa(t,e,i)):(sr&&r&&C8(e),e.flags|=1,Mn(t,e,n,i),e.child)}function k7(t,e,r,n,i){if(t===null){var s=r.type;return typeof s=="function"&&!V8(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=s,AO(t,e,s,n,i)):(t=qm(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:I0,r(o,n)&&t.ref===e.ref)return aa(t,e,i)}return e.flags|=1,t=gc(s,n),t.ref=e.ref,t.return=e,e.child=t}function AO(t,e,r,n,i){if(t!==null){var s=t.memoizedProps;if(I0(s,n)&&t.ref===e.ref)if(Xn=!1,e.pendingProps=n=s,(t.lanes&i)!==0)t.flags&131072&&(Xn=!0);else return e.lanes=t.lanes,aa(t,e,i)}return E5(t,e,r,n,i)}function _O(t,e,r){var n=e.pendingProps,i=n.children,s=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},$t(yf,hi),hi|=r;else{if(!(r&1073741824))return t=s!==null?s.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,$t(yf,hi),hi|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,$t(yf,hi),hi|=n}else s!==null?(n=s.baseLanes|r,e.memoizedState=null):n=r,$t(yf,hi),hi|=n;return Mn(t,e,i,r),e.child}function PO(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function E5(t,e,r,n,i){var s=ni(r)?Kl:An.current;return s=Yf(e,s),Rf(e,i),r=N8(t,e,r,n,s,i),n=D8(),t!==null&&!Xn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,aa(t,e,i)):(sr&&n&&C8(e),e.flags|=1,Mn(t,e,r,i),e.child)}function A7(t,e,r,n,i){if(ni(r)){var s=!0;$v(e)}else s=!1;if(Rf(e,i),e.stateNode===null)Fm(t,e),tO(e,r,n),x5(e,r,n,i),n=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var c=o.context,l=r.contextType;typeof l=="object"&&l!==null?l=Zi(l):(l=ni(r)?Kl:An.current,l=Yf(e,l));var u=r.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||c!==l)&&y7(e,o,n,l),Za=!1;var d=e.memoizedState;o.state=d,jv(e,n,o,i),c=e.memoizedState,a!==n||d!==c||ri.current||Za?(typeof u=="function"&&(b5(e,r,u,n),c=e.memoizedState),(a=Za||v7(e,r,a,n,d,c,l))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),o.props=n,o.state=c,o.context=l,n=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,ZT(t,e),a=e.memoizedProps,l=e.type===e.elementType?a:xs(e.type,a),o.props=l,f=e.pendingProps,d=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Zi(c):(c=ni(r)?Kl:An.current,c=Yf(e,c));var h=r.getDerivedStateFromProps;(u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||d!==c)&&y7(e,o,n,c),Za=!1,d=e.memoizedState,o.state=d,jv(e,n,o,i);var p=e.memoizedState;a!==f||d!==p||ri.current||Za?(typeof h=="function"&&(b5(e,r,h,n),p=e.memoizedState),(l=Za||v7(e,r,l,n,d,p,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,p,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,p,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=p),o.props=n,o.state=p,o.context=c,n=l):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),n=!1)}return C5(t,e,r,n,s,i)}function C5(t,e,r,n,i,s){PO(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return i&&f7(e,r,!1),aa(t,e,s);n=e.stateNode,xV.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=Xf(e,t.child,null,s),e.child=Xf(e,null,a,s)):Mn(t,e,a,s),e.memoizedState=n.state,i&&f7(e,r,!0),e.child}function IO(t){var e=t.stateNode;e.pendingContext?u7(t,e.pendingContext,e.pendingContext!==e.context):e.context&&u7(t,e.context,!1),O8(t,e.containerInfo)}function _7(t,e,r,n,i){return Jf(),k8(i),e.flags|=256,Mn(t,e,r,n),e.child}var S5={dehydrated:null,treeContext:null,retryLane:0};function k5(t){return{baseLanes:t,cachePool:null,transitions:null}}function TO(t,e,r){var n=e.pendingProps,i=ur.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),$t(ur,i&1),t===null)return y5(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,s?(n=e.mode,s=e.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Ng(o,n,0,null),t=Fl(t,n,r,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=k5(r),e.memoizedState=S5,t):B8(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return wV(t,e,o,n,a,i,r);if(s){s=n.fallback,o=e.mode,i=t.child,a=i.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=c,e.deletions=null):(n=gc(i,c),n.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=gc(a,s):(s=Fl(s,o,r,null),s.flags|=2),s.return=e,n.return=e,n.sibling=s,e.child=n,n=s,s=e.child,o=t.child.memoizedState,o=o===null?k5(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~r,e.memoizedState=S5,n}return s=t.child,t=s.sibling,n=gc(s,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function B8(t,e){return e=Ng({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Up(t,e,r,n){return n!==null&&k8(n),Xf(e,t.child,null,r),t=B8(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function wV(t,e,r,n,i,s,o){if(r)return e.flags&256?(e.flags&=-257,n=fx(Error(me(422))),Up(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=n.fallback,i=e.mode,n=Ng({mode:"visible",children:n.children},i,0,null),s=Fl(s,i,o,null),s.flags|=2,n.return=e,s.return=e,n.sibling=s,e.child=n,e.mode&1&&Xf(e,t.child,null,o),e.child.memoizedState=k5(o),e.memoizedState=S5,s);if(!(e.mode&1))return Up(t,e,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var a=n.dgst;return n=a,s=Error(me(419)),n=fx(s,n,void 0),Up(t,e,o,n)}if(a=(o&t.childLanes)!==0,Xn||a){if(n=Qr,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,oa(t,i),Ts(n,t,i,-1))}return H8(),n=fx(Error(me(421))),Up(t,e,o,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=MV.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,bi=pc(i.nextSibling),xi=e,sr=!0,Cs=null,t!==null&&(Ui[zi++]=Wo,Ui[zi++]=Ho,Ui[zi++]=Ql,Wo=t.id,Ho=t.overflow,Ql=e),e=B8(e,n.children),e.flags|=4096,e)}function P7(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),g5(t.return,e,r)}function dx(t,e,r,n,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function OO(t,e,r){var n=e.pendingProps,i=n.revealOrder,s=n.tail;if(Mn(t,e,n.children,r),n=ur.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&P7(t,r,e);else if(t.tag===19)P7(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if($t(ur,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&Bv(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),dx(e,!1,i,r,s);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Bv(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}dx(e,!0,r,null,s);break;case"together":dx(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Fm(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function aa(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Jl|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(me(153));if(e.child!==null){for(t=e.child,r=gc(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=gc(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function EV(t,e,r){switch(e.tag){case 3:IO(e),Jf();break;case 5:iO(e);break;case 1:ni(e.type)&&$v(e);break;case 4:O8(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;$t(Dv,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?($t(ur,ur.current&1),e.flags|=128,null):r&e.child.childLanes?TO(t,e,r):($t(ur,ur.current&1),t=aa(t,e,r),t!==null?t.sibling:null);$t(ur,ur.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return OO(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),$t(ur,ur.current),n)break;return null;case 22:case 23:return e.lanes=0,_O(t,e,r)}return aa(t,e,r)}var RO,A5,$O,MO;RO=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};A5=function(){};$O=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,Ml(fo.current);var s=null;switch(r){case"input":i=Kw(t,i),n=Kw(t,n),s=[];break;case"select":i=hr({},i,{value:void 0}),n=hr({},n,{value:void 0}),s=[];break;case"textarea":i=Jw(t,i),n=Jw(t,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Ov)}Zw(r,n);var o;r=null;for(l in i)if(!n.hasOwnProperty(l)&&i.hasOwnProperty(l)&&i[l]!=null)if(l==="style"){var a=i[l];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else l!=="dangerouslySetInnerHTML"&&l!=="children"&&l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(E0.hasOwnProperty(l)?s||(s=[]):(s=s||[]).push(l,null));for(l in n){var c=n[l];if(a=i!=null?i[l]:void 0,n.hasOwnProperty(l)&&c!==a&&(c!=null||a!=null))if(l==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(s||(s=[]),s.push(l,r)),r=c;else l==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(l,c)):l==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(l,""+c):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&(E0.hasOwnProperty(l)?(c!=null&&l==="onScroll"&&Zt("scroll",t),s||a===c||(s=[])):(s=s||[]).push(l,c))}r&&(s=s||[]).push("style",r);var l=s;(e.updateQueue=l)&&(e.flags|=4)}};MO=function(t,e,r,n){r!==n&&(e.flags|=4)};function fh(t,e){if(!sr)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function pn(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function CV(t,e,r){var n=e.pendingProps;switch(S8(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(e),null;case 1:return ni(e.type)&&Rv(),pn(e),null;case 3:return n=e.stateNode,Zf(),ir(ri),ir(An),$8(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Bp(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Cs!==null&&(M5(Cs),Cs=null))),A5(t,e),pn(e),null;case 5:R8(e);var i=Ml(M0.current);if(r=e.type,t!==null&&e.stateNode!=null)$O(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(me(166));return pn(e),null}if(t=Ml(fo.current),Bp(e)){n=e.stateNode,r=e.type;var s=e.memoizedProps;switch(n[no]=e,n[R0]=s,t=(e.mode&1)!==0,r){case"dialog":Zt("cancel",n),Zt("close",n);break;case"iframe":case"object":case"embed":Zt("load",n);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[no]=e,t[R0]=n,RO(t,e,!1,!1),e.stateNode=t;e:{switch(o=e5(r,n),r){case"dialog":Zt("cancel",t),Zt("close",t),i=n;break;case"iframe":case"object":case"embed":Zt("load",t),i=n;break;case"video":case"audio":for(i=0;itd&&(e.flags|=128,n=!0,fh(s,!1),e.lanes=4194304)}else{if(!n)if(t=Bv(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),fh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!sr)return pn(e),null}else 2*_r()-s.renderingStartTime>td&&r!==1073741824&&(e.flags|=128,n=!0,fh(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=_r(),e.sibling=null,r=ur.current,$t(ur,n?r&1|2:r&1),e):(pn(e),null);case 22:case 23:return W8(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?hi&1073741824&&(pn(e),e.subtreeFlags&6&&(e.flags|=8192)):pn(e),null;case 24:return null;case 25:return null}throw Error(me(156,e.tag))}function SV(t,e){switch(S8(e),e.tag){case 1:return ni(e.type)&&Rv(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Zf(),ir(ri),ir(An),$8(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return R8(e),null;case 13:if(ir(ur),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(me(340));Jf()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ir(ur),null;case 4:return Zf(),null;case 10:return P8(e.type._context),null;case 22:case 23:return W8(),null;case 24:return null;default:return null}}var zp=!1,gn=!1,kV=typeof WeakSet=="function"?WeakSet:Set,xe=null;function vf(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){mr(t,e,n)}else r.current=null}function _5(t,e,r){try{r()}catch(n){mr(t,e,n)}}var I7=!1;function AV(t,e){if(u5=Pv,t=jT(),E8(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==r||i!==0&&f.nodeType!==3||(a=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===r&&++l===i&&(a=o),d===s&&++u===n&&(c=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(f5={focusedElem:t,selectionRange:r},Pv=!1,xe=e;xe!==null;)if(e=xe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,xe=t;else for(;xe!==null;){e=xe;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,v=p.memoizedState,y=e.stateNode,b=y.getSnapshotBeforeUpdate(e.elementType===e.type?m:xs(e.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var E=e.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(me(163))}}catch(S){mr(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,xe=t;break}xe=e.return}return p=I7,I7=!1,p}function Qh(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&_5(e,r,s)}i=i.next}while(i!==n)}}function $g(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function P5(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function NO(t){var e=t.alternate;e!==null&&(t.alternate=null,NO(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[no],delete e[R0],delete e[p5],delete e[cV],delete e[lV])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function DO(t){return t.tag===5||t.tag===3||t.tag===4}function T7(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||DO(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function I5(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Ov));else if(n!==4&&(t=t.child,t!==null))for(I5(t,e,r),t=t.sibling;t!==null;)I5(t,e,r),t=t.sibling}function T5(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(T5(t,e,r),t=t.sibling;t!==null;)T5(t,e,r),t=t.sibling}var en=null,Es=!1;function Ua(t,e,r){for(r=r.child;r!==null;)LO(t,e,r),r=r.sibling}function LO(t,e,r){if(uo&&typeof uo.onCommitFiberUnmount=="function")try{uo.onCommitFiberUnmount(kg,r)}catch{}switch(r.tag){case 5:gn||vf(r,e);case 6:var n=en,i=Es;en=null,Ua(t,e,r),en=n,Es=i,en!==null&&(Es?(t=en,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):en.removeChild(r.stateNode));break;case 18:en!==null&&(Es?(t=en,r=r.stateNode,t.nodeType===8?sx(t.parentNode,r):t.nodeType===1&&sx(t,r),_0(t)):sx(en,r.stateNode));break;case 4:n=en,i=Es,en=r.stateNode.containerInfo,Es=!0,Ua(t,e,r),en=n,Es=i;break;case 0:case 11:case 14:case 15:if(!gn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&_5(r,e,o),i=i.next}while(i!==n)}Ua(t,e,r);break;case 1:if(!gn&&(vf(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){mr(r,e,a)}Ua(t,e,r);break;case 21:Ua(t,e,r);break;case 22:r.mode&1?(gn=(n=gn)||r.memoizedState!==null,Ua(t,e,r),gn=n):Ua(t,e,r);break;default:Ua(t,e,r)}}function O7(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new kV),e.forEach(function(n){var i=NV.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ds(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=_r()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*PV(n/1960))-n,10t?16:t,oc===null)var n=!1;else{if(t=oc,oc=null,Wv=0,ut&6)throw Error(me(331));var i=ut;for(ut|=4,xe=t.current;xe!==null;){var s=xe,o=s.child;if(xe.flags&16){var a=s.deletions;if(a!==null){for(var c=0;c_r()-z8?Bl(t,0):U8|=r),ii(t,e)}function HO(t,e){e===0&&(t.mode&1?(e=$p,$p<<=1,!($p&130023424)&&($p=4194304)):e=1);var r=jn();t=oa(t,e),t!==null&&(L1(t,e,r),ii(t,r))}function MV(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),HO(t,r)}function NV(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(me(314))}n!==null&&n.delete(e),HO(t,r)}var VO;VO=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||ri.current)Xn=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Xn=!1,EV(t,e,r);Xn=!!(t.flags&131072)}else Xn=!1,sr&&e.flags&1048576&&QT(e,Nv,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Fm(t,e),t=e.pendingProps;var i=Yf(e,An.current);Rf(e,r),i=N8(null,e,n,t,i,r);var s=D8();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ni(n)?(s=!0,$v(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,T8(e),i.updater=Og,e.stateNode=i,i._reactInternals=e,x5(e,n,t,r),e=C5(null,e,n,!0,s,r)):(e.tag=0,sr&&s&&C8(e),Mn(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Fm(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=LV(n),t=xs(n,t),i){case 0:e=E5(null,e,n,t,r);break e;case 1:e=A7(null,e,n,t,r);break e;case 11:e=S7(null,e,n,t,r);break e;case 14:e=k7(null,e,n,xs(n.type,t),r);break e}throw Error(me(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:xs(n,i),E5(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:xs(n,i),A7(t,e,n,i,r);case 3:e:{if(IO(e),t===null)throw Error(me(387));n=e.pendingProps,s=e.memoizedState,i=s.element,ZT(t,e),jv(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=ed(Error(me(423)),e),e=_7(t,e,n,r,i);break e}else if(n!==i){i=ed(Error(me(424)),e),e=_7(t,e,n,r,i);break e}else for(bi=pc(e.stateNode.containerInfo.firstChild),xi=e,sr=!0,Cs=null,r=nO(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Jf(),n===i){e=aa(t,e,r);break e}Mn(t,e,n,r)}e=e.child}return e;case 5:return iO(e),t===null&&y5(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,d5(n,i)?o=null:s!==null&&d5(n,s)&&(e.flags|=32),PO(t,e),Mn(t,e,o,r),e.child;case 6:return t===null&&y5(e),null;case 13:return TO(t,e,r);case 4:return O8(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Xf(e,null,n,r):Mn(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:xs(n,i),S7(t,e,n,i,r);case 7:return Mn(t,e,e.pendingProps,r),e.child;case 8:return Mn(t,e,e.pendingProps.children,r),e.child;case 12:return Mn(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,$t(Dv,n._currentValue),n._currentValue=o,s!==null)if($s(s.value,o)){if(s.children===i.children&&!ri.current){e=aa(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=Jo(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var u=l.pending;u===null?c.next=c:(c.next=u.next,u.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),g5(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(me(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),g5(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Mn(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,Rf(e,r),i=Zi(i),n=n(i),e.flags|=1,Mn(t,e,n,r),e.child;case 14:return n=e.type,i=xs(n,e.pendingProps),i=xs(n.type,i),k7(t,e,n,i,r);case 15:return AO(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:xs(n,i),Fm(t,e),e.tag=1,ni(n)?(t=!0,$v(e)):t=!1,Rf(e,r),tO(e,n,i),x5(e,n,i,r),C5(null,e,n,!0,t,r);case 19:return OO(t,e,r);case 22:return _O(t,e,r)}throw Error(me(156,e.tag))};function GO(t,e){return bT(t,e)}function DV(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ki(t,e,r,n){return new DV(t,e,r,n)}function V8(t){return t=t.prototype,!(!t||!t.isReactComponent)}function LV(t){if(typeof t=="function")return V8(t)?1:0;if(t!=null){if(t=t.$$typeof,t===f8)return 11;if(t===d8)return 14}return 2}function gc(t,e){var r=t.alternate;return r===null?(r=Ki(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function qm(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")V8(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case af:return Fl(r.children,i,s,e);case u8:o=8,i|=8;break;case Ww:return t=Ki(12,r,e,i|2),t.elementType=Ww,t.lanes=s,t;case Hw:return t=Ki(13,r,e,i),t.elementType=Hw,t.lanes=s,t;case Vw:return t=Ki(19,r,e,i),t.elementType=Vw,t.lanes=s,t;case rT:return Ng(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case eT:o=10;break e;case tT:o=9;break e;case f8:o=11;break e;case d8:o=14;break e;case Xa:o=16,n=null;break e}throw Error(me(130,t==null?t:typeof t,""))}return e=Ki(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function Fl(t,e,r,n){return t=Ki(7,t,n,e),t.lanes=r,t}function Ng(t,e,r,n){return t=Ki(22,t,n,e),t.elementType=rT,t.lanes=r,t.stateNode={isHidden:!1},t}function hx(t,e,r){return t=Ki(6,t,null,e),t.lanes=r,t}function px(t,e,r){return e=Ki(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function jV(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=K2(0),this.expirationTimes=K2(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=K2(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function G8(t,e,r,n,i,s,o,a,c){return t=new jV(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ki(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},T8(s),t}function BV(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(JO)}catch(t){console.error(t)}}JO(),QI.exports=Ii;var Fs=QI.exports;const WV=Pi(Fs);var B7=Fs;zw.createRoot=B7.createRoot,zw.hydrateRoot=B7.hydrateRoot;const HV=[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}];var VV=Object.freeze({__proto__:null,abi:HV});const GV=[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],KV={isValidSignatureBytes32:"0x1626ba7e"};var QV=Object.freeze({__proto__:null,abi:GV,returns:KV});const YV=[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var JV=Object.freeze({__proto__:null,abi:YV});const XV=[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}];var ZV=Object.freeze({__proto__:null,abi:XV});const eG=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"},{type:"function",name:"setExtraImageHash",constant:!1,inputs:[{type:"bytes32",name:"imageHash"},{type:"uint256",name:"expiration"}],outputs:[],payable:!1,stateMutability:"nonpayable"}];var tG=Object.freeze({__proto__:null,abi:eG});const rG=[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}];var nG=Object.freeze({__proto__:null,abi:rG});const iG=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];var sG=Object.freeze({__proto__:null,abi:iG});const oG=[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}];var aG=Object.freeze({__proto__:null,abi:oG});const Yr={erc6492:JV,erc5719:VV,erc1271:QV,factory:ZV,mainModule:tG,mainModuleUpgradable:nG,sequenceUtils:sG,requireFreshSigner:aG},cG=Object.freeze(Object.defineProperty({__proto__:null,walletContracts:Yr},Symbol.toStringTag,{value:"Module"})),Bn=globalThis||void 0||self;function Gv(){return Gv=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),We({},n)).then(i=>He(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),We({},n)).then(i=>He(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),We({},n)).then(i=>He(i).then(s=>({status:s.status}))),this.clock=n=>this.fetch(this.url("Clock"),We({},n)).then(i=>He(i).then(s=>({serverTime:s.serverTime}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),We({},n)).then(i=>He(i).then(s=>({data:s.data}))),this.getAuthToken=(n,i)=>this.fetch(this.url("GetAuthToken"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,jwtToken:o.jwtToken,address:o.address,user:o.user}))),this.getAuthToken2=(n,i)=>this.fetch(this.url("GetAuthToken2"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,jwtToken:o.jwtToken,address:o.address,user:o.user}))),this.sendPasswordlessLink=(n,i)=>this.fetch(this.url("SendPasswordlessLink"),We(n,i)).then(s=>He(s).then(o=>({status:o.status}))),this.friendList=(n,i)=>this.fetch(this.url("FriendList"),We(n,i)).then(s=>He(s).then(o=>({page:o.page,friends:o.friends}))),this.getFriendByAddress=(n,i)=>this.fetch(this.url("GetFriendByAddress"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,friend:o.friend}))),this.searchFriends=(n,i)=>this.fetch(this.url("SearchFriends"),We(n,i)).then(s=>He(s).then(o=>({friends:o.friends}))),this.addFriend=(n,i)=>this.fetch(this.url("AddFriend"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,friend:o.friend}))),this.updateFriendNickname=(n,i)=>this.fetch(this.url("UpdateFriendNickname"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,friend:o.friend}))),this.removeFriend=(n,i)=>this.fetch(this.url("RemoveFriend"),We(n,i)).then(s=>He(s).then(o=>({status:o.status}))),this.contractCall=(n,i)=>this.fetch(this.url("ContractCall"),We(n,i)).then(s=>He(s).then(o=>({returns:o.returns}))),this.decodeContractCall=(n,i)=>this.fetch(this.url("DecodeContractCall"),We(n,i)).then(s=>He(s).then(o=>({call:o.call}))),this.lookupContractCallSelectors=(n,i)=>this.fetch(this.url("LookupContractCallSelectors"),We(n,i)).then(s=>He(s).then(o=>({signatures:o.signatures}))),this.userStorageFetch=(n,i)=>this.fetch(this.url("UserStorageFetch"),We(n,i)).then(s=>He(s).then(o=>({object:o.object}))),this.userStorageSave=(n,i)=>this.fetch(this.url("UserStorageSave"),We(n,i)).then(s=>He(s).then(o=>({ok:o.ok}))),this.userStorageDelete=(n,i)=>this.fetch(this.url("UserStorageDelete"),We(n,i)).then(s=>He(s).then(o=>({ok:o.ok}))),this.userStorageFetchAll=(n,i)=>this.fetch(this.url("UserStorageFetchAll"),We(n,i)).then(s=>He(s).then(o=>({objects:o.objects}))),this.getMoonpayLink=(n,i)=>this.fetch(this.url("GetMoonpayLink"),We(n,i)).then(s=>He(s).then(o=>({signedUrl:o.signedUrl}))),this.getSardineClientToken=n=>this.fetch(this.url("GetSardineClientToken"),We({},n)).then(i=>He(i).then(s=>({token:s.token}))),this.resolveENSAddress=(n,i)=>this.fetch(this.url("ResolveENSAddress"),We(n,i)).then(s=>He(s).then(o=>({address:o.address,ok:o.ok}))),this.isValidSignature=(n,i)=>this.fetch(this.url("IsValidSignature"),We(n,i)).then(s=>He(s).then(o=>({isValid:o.isValid}))),this.isValidMessageSignature=(n,i)=>this.fetch(this.url("IsValidMessageSignature"),We(n,i)).then(s=>He(s).then(o=>({isValid:o.isValid}))),this.isValidTypedDataSignature=(n,i)=>this.fetch(this.url("IsValidTypedDataSignature"),We(n,i)).then(s=>He(s).then(o=>({isValid:o.isValid}))),this.isValidETHAuthProof=(n,i)=>this.fetch(this.url("IsValidETHAuthProof"),We(n,i)).then(s=>He(s).then(o=>({isValid:o.isValid}))),this.getCoinPrices=(n,i)=>this.fetch(this.url("GetCoinPrices"),We(n,i)).then(s=>He(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getCollectiblePrices=(n,i)=>this.fetch(this.url("GetCollectiblePrices"),We(n,i)).then(s=>He(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getExchangeRate=(n,i)=>this.fetch(this.url("GetExchangeRate"),We(n,i)).then(s=>He(s).then(o=>({exchangeRate:o.exchangeRate}))),this.memoryStore=(n,i)=>this.fetch(this.url("MemoryStore"),We(n,i)).then(s=>He(s).then(o=>({ok:o.ok}))),this.memoryLoad=(n,i)=>this.fetch(this.url("MemoryLoad"),We(n,i)).then(s=>He(s).then(o=>({value:o.value}))),this.getInviteInfo=n=>this.fetch(this.url("GetInviteInfo"),We({},n)).then(i=>He(i).then(s=>({inviteInfo:s.inviteInfo}))),this.isValidAccessCode=(n,i)=>this.fetch(this.url("IsValidAccessCode"),We(n,i)).then(s=>He(s).then(o=>({status:o.status}))),this.internalClaimAccessCode=(n,i)=>this.fetch(this.url("InternalClaimAccessCode"),We(n,i)).then(s=>He(s).then(o=>({status:o.status}))),this.blockNumberAtTime=(n,i)=>this.fetch(this.url("BlockNumberAtTime"),We(n,i)).then(s=>He(s).then(o=>({blocks:o.blocks}))),this.paperSessionSecret=(n,i)=>this.fetch(this.url("PaperSessionSecret"),We(n,i)).then(s=>He(s).then(o=>({secret:o.secret}))),this.paperSessionSecret2=(n,i)=>this.fetch(this.url("PaperSessionSecret2"),We(n,i)).then(s=>He(s).then(o=>({secret:o.secret}))),this.linkWallet=(n,i)=>this.fetch(this.url("LinkWallet"),We(n,i)).then(s=>He(s).then(o=>({status:o.status,linkedWalletAddress:o.linkedWalletAddress}))),this.getLinkedWallets=(n,i)=>this.fetch(this.url("GetLinkedWallets"),We(n,i)).then(s=>He(s).then(o=>({linkedWallets:o.linkedWallets}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const We=(t={},e={})=>({method:"POST",headers:Gv({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),He=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),F7=typeof Bn=="object"?Bn.fetch:window.fetch;class Xh extends XO{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,F7),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=Gv({},s.headers,o),F7(i,s)},this.fetch=this._fetch}}const hG=Object.freeze(Object.defineProperty({__proto__:null,API:XO,SequenceAPIClient:Xh,SortOrder:dG,WebRPCSchemaHash:fG,WebRPCSchemaVersion:uG,WebRPCVersion:lG},Symbol.toStringTag,{value:"Module"}));var J8={exports:{}},Wr={},Fg={};Fg.byteLength=vG;Fg.toByteArray=gG;Fg.fromByteArray=wG;var io=[],Li=[],pG=typeof Uint8Array<"u"?Uint8Array:Array,mx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Mu=0,mG=mx.length;Mu0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function vG(t){var e=ZO(t),r=e[0],n=e[1];return(r+n)*3/4-n}function yG(t,e,r){return(e+r)*3/4-r}function gG(t){var e,r=ZO(t),n=r[0],i=r[1],s=new pG(yG(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Li[t.charCodeAt(c)]<<2|Li[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=Li[t.charCodeAt(c)]<<10|Li[t.charCodeAt(c+1)]<<4|Li[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function bG(t){return io[t>>18&63]+io[t>>12&63]+io[t>>6&63]+io[t&63]}function xG(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(io[e>>2]+io[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(io[e>>10]+io[e>>4&63]+io[e<<2&63]+"=")),i.join("")}var X8={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */X8.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,u=-7,f=r?i-1:0,d=r?-1:1,h=t[e+f];for(f+=d,s=h&(1<<-u)-1,h>>=-u,u+=a;u>0;s=s*256+t[e+f],f+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=n;u>0;o=o*256+t[e+f],f+=d,u-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(h?-1:1)*o*Math.pow(2,s-n)};X8.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,u=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:s-1,p=n?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=d/c:e+=d*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=u?(a=0,o=u):o+f>=1?(a=(e*c-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+h]=a&255,h+=p,a/=256,i-=8);for(o=o<0;t[r+h]=o&255,h+=p,o/=256,l-=8);t[r+h-p]|=m*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */(function(t){const e=Xg,r=dE,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=P,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i;const{Uint8Array:s,ArrayBuffer:o,SharedArrayBuffer:a}=globalThis;u.TYPED_ARRAY_SUPPORT=c(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const U=new s(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,s.prototype),Object.setPrototypeOf(U,T),U.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(U){if(U>i)throw new RangeError('The value "'+U+'" is invalid for option "size"');const T=new s(U);return Object.setPrototypeOf(T,u.prototype),T}function u(U,T,$){if(typeof U=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(U)}return f(U,T,$)}u.poolSize=8192;function f(U,T,$){if(typeof U=="string")return m(U,T);if(o.isView(U))return y(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(Gr(U,o)||U&&Gr(U.buffer,o)||typeof a<"u"&&(Gr(U,a)||U&&Gr(U.buffer,a)))return b(U,T,$);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const V=U.valueOf&&U.valueOf();if(V!=null&&V!==U)return u.from(V,T,$);const Z=E(U);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return u.from(U[Symbol.toPrimitive]("string"),T,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}u.from=function(U,T,$){return f(U,T,$)},Object.setPrototypeOf(u.prototype,s.prototype),Object.setPrototypeOf(u,s);function d(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function h(U,T,$){return d(U),U<=0?l(U):T!==void 0?typeof $=="string"?l(U).fill(T,$):l(U).fill(T):l(U)}u.alloc=function(U,T,$){return h(U,T,$)};function p(U){return d(U),l(U<0?0:S(U)|0)}u.allocUnsafe=function(U){return p(U)},u.allocUnsafeSlow=function(U){return p(U)};function m(U,T){if((typeof T!="string"||T==="")&&(T="utf8"),!u.isEncoding(T))throw new TypeError("Unknown encoding: "+T);const $=M(U,T)|0;let V=l($);const Z=V.write(U,T);return Z!==$&&(V=V.slice(0,Z)),V}function v(U){const T=U.length<0?0:S(U.length)|0,$=l(T);for(let V=0;V=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return U|0}function P(U){return+U!=U&&(U=0),u.alloc(+U)}u.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==u.prototype},u.compare=function(T,$){if(Gr(T,s)&&(T=u.from(T,T.offset,T.byteLength)),Gr($,s)&&($=u.from($,$.offset,$.byteLength)),!u.isBuffer(T)||!u.isBuffer($))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===$)return 0;let V=T.length,Z=$.length;for(let re=0,ce=Math.min(V,Z);reZ.length?(u.isBuffer(ce)||(ce=u.from(ce)),ce.copy(Z,re)):s.prototype.set.call(Z,ce,re);else if(u.isBuffer(ce))ce.copy(Z,re);else throw new TypeError('"list" argument must be an Array of Buffers');re+=ce.length}return Z};function M(U,T){if(u.isBuffer(U))return U.length;if(o.isView(U)||Gr(U,o))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const $=U.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&$===0)return 0;let Z=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return Ke(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return kt(U).length;default:if(Z)return V?-1:Ke(U).length;T=(""+T).toLowerCase(),Z=!0}}u.byteLength=M;function L(U,T,$){let V=!1;if((T===void 0||T<0)&&(T=0),T>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,T>>>=0,$<=T))return"";for(U||(U="utf8");;)switch(U){case"hex":return C(this,T,$);case"utf8":case"utf-8":return N(this,T,$);case"ascii":return B(this,T,$);case"latin1":case"binary":return I(this,T,$);case"base64":return R(this,T,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,T,$);default:if(V)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),V=!0}}u.prototype._isBuffer=!0;function j(U,T,$){const V=U[T];U[T]=U[$],U[$]=V}u.prototype.swap16=function(){const T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let $=0;$$&&(T+=" ... "),""},n&&(u.prototype[n]=u.prototype.inspect),u.prototype.compare=function(T,$,V,Z,re){if(Gr(T,s)&&(T=u.from(T,T.offset,T.byteLength)),!u.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if($===void 0&&($=0),V===void 0&&(V=T?T.length:0),Z===void 0&&(Z=0),re===void 0&&(re=this.length),$<0||V>T.length||Z<0||re>this.length)throw new RangeError("out of range index");if(Z>=re&&$>=V)return 0;if(Z>=re)return-1;if($>=V)return 1;if($>>>=0,V>>>=0,Z>>>=0,re>>>=0,this===T)return 0;let ce=re-Z,Ne=V-$;const Ie=Math.min(ce,Ne),Ae=this.slice(Z,re),yt=T.slice($,V);for(let ke=0;ke2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,gt($)&&($=Z?0:U.length-1),$<0&&($=U.length+$),$>=U.length){if(Z)return-1;$=U.length-1}else if($<0)if(Z)$=0;else return-1;if(typeof T=="string"&&(T=u.from(T,V)),u.isBuffer(T))return T.length===0?-1:K(U,T,$,V,Z);if(typeof T=="number")return T=T&255,typeof s.prototype.indexOf=="function"?Z?s.prototype.indexOf.call(U,T,$):s.prototype.lastIndexOf.call(U,T,$):K(U,[T],$,V,Z);throw new TypeError("val must be string, number or Buffer")}function K(U,T,$,V,Z){let re=1,ce=U.length,Ne=T.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(U.length<2||T.length<2)return-1;re=2,ce/=2,Ne/=2,$/=2}function Ie(yt,ke){return re===1?yt[ke]:yt.readUInt16BE(ke*re)}let Ae;if(Z){let yt=-1;for(Ae=$;Aece&&($=ce-Ne),Ae=$;Ae>=0;Ae--){let yt=!0;for(let ke=0;keZ&&(V=Z)):V=Z;const re=T.length;V>re/2&&(V=re/2);let ce;for(ce=0;ce>>0,isFinite(V)?(V=V>>>0,Z===void 0&&(Z="utf8")):(Z=V,V=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const re=this.length-$;if((V===void 0||V>re)&&(V=re),T.length>0&&(V<0||$<0)||$>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");let ce=!1;for(;;)switch(Z){case"hex":return Q(this,T,$,V);case"utf8":case"utf-8":return Y(this,T,$,V);case"ascii":case"latin1":case"binary":return F(this,T,$,V);case"base64":return w(this,T,$,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,T,$,V);default:if(ce)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),ce=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(U,T,$){return T===0&&$===U.length?e.fromByteArray(U):e.fromByteArray(U.slice(T,$))}function N(U,T,$){$=Math.min(U.length,$);const V=[];let Z=T;for(;Z<$;){const re=U[Z];let ce=null,Ne=re>239?4:re>223?3:re>191?2:1;if(Z+Ne<=$){let Ie,Ae,yt,ke;switch(Ne){case 1:re<128&&(ce=re);break;case 2:Ie=U[Z+1],(Ie&192)===128&&(ke=(re&31)<<6|Ie&63,ke>127&&(ce=ke));break;case 3:Ie=U[Z+1],Ae=U[Z+2],(Ie&192)===128&&(Ae&192)===128&&(ke=(re&15)<<12|(Ie&63)<<6|Ae&63,ke>2047&&(ke<55296||ke>57343)&&(ce=ke));break;case 4:Ie=U[Z+1],Ae=U[Z+2],yt=U[Z+3],(Ie&192)===128&&(Ae&192)===128&&(yt&192)===128&&(ke=(re&15)<<18|(Ie&63)<<12|(Ae&63)<<6|yt&63,ke>65535&&ke<1114112&&(ce=ke))}}ce===null?(ce=65533,Ne=1):ce>65535&&(ce-=65536,V.push(ce>>>10&1023|55296),ce=56320|ce&1023),V.push(ce),Z+=Ne}return O(V)}const A=4096;function O(U){const T=U.length;if(T<=A)return String.fromCharCode.apply(String,U);let $="",V=0;for(;VV)&&($=V);let Z="";for(let re=T;re<$;++re)Z+=_t[U[re]];return Z}function D(U,T,$){const V=U.slice(T,$);let Z="";for(let re=0;reV&&(T=V),$<0?($+=V,$<0&&($=0)):$>V&&($=V),$$)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(T,$,V){T=T>>>0,$=$>>>0,V||z(T,$,this.length);let Z=this[T],re=1,ce=0;for(;++ce<$&&(re*=256);)Z+=this[T+ce]*re;return Z},u.prototype.readUintBE=u.prototype.readUIntBE=function(T,$,V){T=T>>>0,$=$>>>0,V||z(T,$,this.length);let Z=this[T+--$],re=1;for(;$>0&&(re*=256);)Z+=this[T+--$]*re;return Z},u.prototype.readUint8=u.prototype.readUInt8=function(T,$){return T=T>>>0,$||z(T,1,this.length),this[T]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(T,$){return T=T>>>0,$||z(T,2,this.length),this[T]|this[T+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(T,$){return T=T>>>0,$||z(T,2,this.length),this[T]<<8|this[T+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(T,$){return T=T>>>0,$||z(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(T,$){return T=T>>>0,$||z(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},u.prototype.readBigUInt64LE=dn(function(T){T=T>>>0,$e(T,"offset");const $=this[T],V=this[T+7];($===void 0||V===void 0)&&ge(T,this.length-8);const Z=$+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,re=this[++T]+this[++T]*2**8+this[++T]*2**16+V*2**24;return BigInt(Z)+(BigInt(re)<>>0,$e(T,"offset");const $=this[T],V=this[T+7];($===void 0||V===void 0)&&ge(T,this.length-8);const Z=$*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],re=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+V;return(BigInt(Z)<>>0,$=$>>>0,V||z(T,$,this.length);let Z=this[T],re=1,ce=0;for(;++ce<$&&(re*=256);)Z+=this[T+ce]*re;return re*=128,Z>=re&&(Z-=Math.pow(2,8*$)),Z},u.prototype.readIntBE=function(T,$,V){T=T>>>0,$=$>>>0,V||z(T,$,this.length);let Z=$,re=1,ce=this[T+--Z];for(;Z>0&&(re*=256);)ce+=this[T+--Z]*re;return re*=128,ce>=re&&(ce-=Math.pow(2,8*$)),ce},u.prototype.readInt8=function(T,$){return T=T>>>0,$||z(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},u.prototype.readInt16LE=function(T,$){T=T>>>0,$||z(T,2,this.length);const V=this[T]|this[T+1]<<8;return V&32768?V|4294901760:V},u.prototype.readInt16BE=function(T,$){T=T>>>0,$||z(T,2,this.length);const V=this[T+1]|this[T]<<8;return V&32768?V|4294901760:V},u.prototype.readInt32LE=function(T,$){return T=T>>>0,$||z(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},u.prototype.readInt32BE=function(T,$){return T=T>>>0,$||z(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},u.prototype.readBigInt64LE=dn(function(T){T=T>>>0,$e(T,"offset");const $=this[T],V=this[T+7];($===void 0||V===void 0)&&ge(T,this.length-8);const Z=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(V<<24);return(BigInt(Z)<>>0,$e(T,"offset");const $=this[T],V=this[T+7];($===void 0||V===void 0)&&ge(T,this.length-8);const Z=($<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(Z)<>>0,$||z(T,4,this.length),r.read(this,T,!0,23,4)},u.prototype.readFloatBE=function(T,$){return T=T>>>0,$||z(T,4,this.length),r.read(this,T,!1,23,4)},u.prototype.readDoubleLE=function(T,$){return T=T>>>0,$||z(T,8,this.length),r.read(this,T,!0,52,8)},u.prototype.readDoubleBE=function(T,$){return T=T>>>0,$||z(T,8,this.length),r.read(this,T,!1,52,8)};function _(U,T,$,V,Z,re){if(!u.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>Z||TU.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(T,$,V,Z){if(T=+T,$=$>>>0,V=V>>>0,!Z){const Ne=Math.pow(2,8*V)-1;_(this,T,$,V,Ne,0)}let re=1,ce=0;for(this[$]=T&255;++ce>>0,V=V>>>0,!Z){const Ne=Math.pow(2,8*V)-1;_(this,T,$,V,Ne,0)}let re=V-1,ce=1;for(this[$+re]=T&255;--re>=0&&(ce*=256);)this[$+re]=T/ce&255;return $+V},u.prototype.writeUint8=u.prototype.writeUInt8=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,1,255,0),this[$]=T&255,$+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,2,65535,0),this[$]=T&255,this[$+1]=T>>>8,$+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,2,65535,0),this[$]=T>>>8,this[$+1]=T&255,$+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,4,4294967295,0),this[$+3]=T>>>24,this[$+2]=T>>>16,this[$+1]=T>>>8,this[$]=T&255,$+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,4,4294967295,0),this[$]=T>>>24,this[$+1]=T>>>16,this[$+2]=T>>>8,this[$+3]=T&255,$+4};function W(U,T,$,V,Z){ve(T,V,Z,U,$,7);let re=Number(T&BigInt(4294967295));U[$++]=re,re=re>>8,U[$++]=re,re=re>>8,U[$++]=re,re=re>>8,U[$++]=re;let ce=Number(T>>BigInt(32)&BigInt(4294967295));return U[$++]=ce,ce=ce>>8,U[$++]=ce,ce=ce>>8,U[$++]=ce,ce=ce>>8,U[$++]=ce,$}function G(U,T,$,V,Z){ve(T,V,Z,U,$,7);let re=Number(T&BigInt(4294967295));U[$+7]=re,re=re>>8,U[$+6]=re,re=re>>8,U[$+5]=re,re=re>>8,U[$+4]=re;let ce=Number(T>>BigInt(32)&BigInt(4294967295));return U[$+3]=ce,ce=ce>>8,U[$+2]=ce,ce=ce>>8,U[$+1]=ce,ce=ce>>8,U[$]=ce,$+8}u.prototype.writeBigUInt64LE=dn(function(T,$=0){return W(this,T,$,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=dn(function(T,$=0){return G(this,T,$,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(T,$,V,Z){if(T=+T,$=$>>>0,!Z){const Ie=Math.pow(2,8*V-1);_(this,T,$,V,Ie-1,-Ie)}let re=0,ce=1,Ne=0;for(this[$]=T&255;++re>0)-Ne&255;return $+V},u.prototype.writeIntBE=function(T,$,V,Z){if(T=+T,$=$>>>0,!Z){const Ie=Math.pow(2,8*V-1);_(this,T,$,V,Ie-1,-Ie)}let re=V-1,ce=1,Ne=0;for(this[$+re]=T&255;--re>=0&&(ce*=256);)T<0&&Ne===0&&this[$+re+1]!==0&&(Ne=1),this[$+re]=(T/ce>>0)-Ne&255;return $+V},u.prototype.writeInt8=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,1,127,-128),T<0&&(T=255+T+1),this[$]=T&255,$+1},u.prototype.writeInt16LE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,2,32767,-32768),this[$]=T&255,this[$+1]=T>>>8,$+2},u.prototype.writeInt16BE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,2,32767,-32768),this[$]=T>>>8,this[$+1]=T&255,$+2},u.prototype.writeInt32LE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,4,2147483647,-2147483648),this[$]=T&255,this[$+1]=T>>>8,this[$+2]=T>>>16,this[$+3]=T>>>24,$+4},u.prototype.writeInt32BE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[$]=T>>>24,this[$+1]=T>>>16,this[$+2]=T>>>8,this[$+3]=T&255,$+4},u.prototype.writeBigInt64LE=dn(function(T,$=0){return W(this,T,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=dn(function(T,$=0){return G(this,T,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function J(U,T,$,V,Z,re){if($+V>U.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function ee(U,T,$,V,Z){return T=+T,$=$>>>0,Z||J(U,T,$,4),r.write(U,T,$,V,23,4),$+4}u.prototype.writeFloatLE=function(T,$,V){return ee(this,T,$,!0,V)},u.prototype.writeFloatBE=function(T,$,V){return ee(this,T,$,!1,V)};function se(U,T,$,V,Z){return T=+T,$=$>>>0,Z||J(U,T,$,8),r.write(U,T,$,V,52,8),$+8}u.prototype.writeDoubleLE=function(T,$,V){return se(this,T,$,!0,V)},u.prototype.writeDoubleBE=function(T,$,V){return se(this,T,$,!1,V)},u.prototype.copy=function(T,$,V,Z){if(!u.isBuffer(T))throw new TypeError("argument should be a Buffer");if(V||(V=0),!Z&&Z!==0&&(Z=this.length),$>=T.length&&($=T.length),$||($=0),Z>0&&Z=this.length)throw new RangeError("Index out of range");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),T.length-$>>0,V=V===void 0?this.length:V>>>0,T||(T=0);let re;if(typeof T=="number")for(re=$;re2**32?Z=be(String($)):typeof $=="bigint"&&(Z=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(Z=be(Z)),Z+="n"),V+=` It must be ${T}. Received ${Z}`,V},RangeError);function be(U){let T="",$=U.length;const V=U[0]==="-"?1:0;for(;$>=V+4;$-=3)T=`_${U.slice($-3,$)}${T}`;return`${U.slice(0,$)}${T}`}function he(U,T,$){$e(T,"offset"),(U[T]===void 0||U[T+$]===void 0)&&ge(T,U.length-($+1))}function ve(U,T,$,V,Z,re){if(U>$||U3?T===0||T===BigInt(0)?Ne=`>= 0${ce} and < 2${ce} ** ${(re+1)*8}${ce}`:Ne=`>= -(2${ce} ** ${(re+1)*8-1}${ce}) and < 2 ** ${(re+1)*8-1}${ce}`:Ne=`>= ${T}${ce} and <= ${$}${ce}`,new ie.ERR_OUT_OF_RANGE("value",Ne,U)}he(V,Z,re)}function $e(U,T){if(typeof U!="number")throw new ie.ERR_INVALID_ARG_TYPE(T,"number",U)}function ge(U,T,$){throw Math.floor(U)!==U?($e(U,$),new ie.ERR_OUT_OF_RANGE($||"offset","an integer",U)):T<0?new ie.ERR_BUFFER_OUT_OF_BOUNDS:new ie.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${T}`,U)}const Ee=/[^+/0-9A-Za-z-_]/g;function Ue(U){if(U=U.split("=")[0],U=U.trim().replace(Ee,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function Ke(U,T){T=T||1/0;let $;const V=U.length;let Z=null;const re=[];for(let ce=0;ce55295&&$<57344){if(!Z){if($>56319){(T-=3)>-1&&re.push(239,191,189);continue}else if(ce+1===V){(T-=3)>-1&&re.push(239,191,189);continue}Z=$;continue}if($<56320){(T-=3)>-1&&re.push(239,191,189),Z=$;continue}$=(Z-55296<<10|$-56320)+65536}else Z&&(T-=3)>-1&&re.push(239,191,189);if(Z=null,$<128){if((T-=1)<0)break;re.push($)}else if($<2048){if((T-=2)<0)break;re.push($>>6|192,$&63|128)}else if($<65536){if((T-=3)<0)break;re.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((T-=4)<0)break;re.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return re}function Ye(U){const T=[];for(let $=0;$>8,Z=$%256,re.push(Z),re.push(V);return re}function kt(U){return e.toByteArray(Ue(U))}function vt(U,T,$,V){let Z;for(Z=0;Z=T.length||Z>=U.length);++Z)T[Z+$]=U[Z];return Z}function Gr(U,T){return U instanceof T||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===T.name}function gt(U){return U!==U}const _t=function(){const U="0123456789abcdef",T=new Array(256);for(let $=0;$<16;++$){const V=$*16;for(let Z=0;Z<16;++Z)T[V+Z]=U[$]+U[Z]}return T}();function dn(U){return typeof BigInt>"u"?Pt:U}function Pt(){throw new Error("BigInt not supported")}})(Hr);const il=Hr.Buffer,HG=Hr.Blob,VG=Hr.BlobOptions,GG=Hr.Buffer,KG=Hr.File,QG=Hr.FileOptions,YG=Hr.INSPECT_MAX_BYTES,JG=Hr.SlowBuffer,XG=Hr.TranscodeEncoding,ZG=Hr.atob,eK=Hr.btoa,tK=Hr.constants,rK=Hr.isAscii,nK=Hr.isUtf8,iK=Hr.kMaxLength,sK=Hr.kStringMaxLength,oK=Hr.resolveObjectURL,aK=Hr.transcode,cK=Object.freeze(Object.defineProperty({__proto__:null,Blob:HG,BlobOptions:VG,Buffer:GG,File:KG,FileOptions:QG,INSPECT_MAX_BYTES:YG,SlowBuffer:JG,TranscodeEncoding:XG,atob:ZG,btoa:eK,constants:tK,default:il,isAscii:rK,isUtf8:nK,kMaxLength:iK,kStringMaxLength:sK,resolveObjectURL:oK,transcode:aK},Symbol.toStringTag,{value:"Module"})),lK=Er(cK);fE.exports;(function(t){(function(e,r){function n(F,w){if(!F)throw new Error(w||"Assertion failed")}function i(F,w){F.super_=w;var k=function(){};k.prototype=w.prototype,F.prototype=new k,F.prototype.constructor=F}function s(F,w,k){if(s.isBN(F))return F;this.negative=0,this.words=null,this.length=0,this.red=null,F!==null&&((w==="le"||w==="be")&&(k=w,w=10),this._init(F||0,w||10,k||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=lK.Buffer}catch{}s.isBN=function(w){return w instanceof s?!0:w!==null&&typeof w=="object"&&w.constructor.wordSize===s.wordSize&&Array.isArray(w.words)},s.max=function(w,k){return w.cmp(k)>0?w:k},s.min=function(w,k){return w.cmp(k)<0?w:k},s.prototype._init=function(w,k,R){if(typeof w=="number")return this._initNumber(w,k,R);if(typeof w=="object")return this._initArray(w,k,R);k==="hex"&&(k=16),n(k===(k|0)&&k>=2&&k<=36),w=w.toString().replace(/\s+/g,"");var N=0;w[0]==="-"&&(N++,this.negative=1),N=0;N-=3)O=w[N]|w[N-1]<<8|w[N-2]<<16,this.words[A]|=O<>>26-B&67108863,B+=24,B>=26&&(B-=26,A++);else if(R==="le")for(N=0,A=0;N>>26-B&67108863,B+=24,B>=26&&(B-=26,A++);return this._strip()};function a(F,w){var k=F.charCodeAt(w);if(k>=48&&k<=57)return k-48;if(k>=65&&k<=70)return k-55;if(k>=97&&k<=102)return k-87;n(!1,"Invalid character in "+F)}function c(F,w,k){var R=a(F,k);return k-1>=w&&(R|=a(F,k-1)<<4),R}s.prototype._parseHex=function(w,k,R){this.length=Math.ceil((w.length-k)/6),this.words=new Array(this.length);for(var N=0;N=k;N-=2)B=c(w,k,N)<=18?(A-=18,O+=1,this.words[O]|=B>>>26):A+=8;else{var I=w.length-k;for(N=I%2===0?k+1:k;N=18?(A-=18,O+=1,this.words[O]|=B>>>26):A+=8}this._strip()};function l(F,w,k,R){for(var N=0,A=0,O=Math.min(F.length,k),B=w;B=49?A=I-49+10:I>=17?A=I-17+10:A=I,n(I>=0&&A1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(w,k){w=w||10,k=k|0||1;var R;if(w===16||w==="hex"){R="";for(var N=0,A=0,O=0;O>>24-N&16777215,N+=2,N>=26&&(N-=26,O--),A!==0||O!==this.length-1?R=d[6-I.length]+I+R:R=I+R}for(A!==0&&(R=A.toString(16)+R);R.length%k!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}if(w===(w|0)&&w>=2&&w<=36){var C=h[w],D=p[w];R="";var z=this.clone();for(z.negative=0;!z.isZero();){var _=z.modrn(D).toString(w);z=z.idivn(D),z.isZero()?R=_+R:R=d[C-_.length]+_+R}for(this.isZero()&&(R="0"+R);R.length%k!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var w=this.words[0];return this.length===2?w+=this.words[1]*67108864:this.length===3&&this.words[2]===1?w+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-w:w},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(w,k){return this.toArrayLike(o,w,k)}),s.prototype.toArray=function(w,k){return this.toArrayLike(Array,w,k)};var m=function(w,k){return w.allocUnsafe?w.allocUnsafe(k):new w(k)};s.prototype.toArrayLike=function(w,k,R){this._strip();var N=this.byteLength(),A=R||Math.max(1,N);n(N<=A,"byte array longer than desired length"),n(A>0,"Requested array length <= 0");var O=m(w,A),B=k==="le"?"LE":"BE";return this["_toArrayLike"+B](O,N),O},s.prototype._toArrayLikeLE=function(w,k){for(var R=0,N=0,A=0,O=0;A>8&255),R>16&255),O===6?(R>24&255),N=0,O=0):(N=B>>>24,O+=2)}if(R=0&&(w[R--]=B>>8&255),R>=0&&(w[R--]=B>>16&255),O===6?(R>=0&&(w[R--]=B>>24&255),N=0,O=0):(N=B>>>24,O+=2)}if(R>=0)for(w[R--]=N;R>=0;)w[R--]=0},Math.clz32?s.prototype._countBits=function(w){return 32-Math.clz32(w)}:s.prototype._countBits=function(w){var k=w,R=0;return k>=4096&&(R+=13,k>>>=13),k>=64&&(R+=7,k>>>=7),k>=8&&(R+=4,k>>>=4),k>=2&&(R+=2,k>>>=2),R+k},s.prototype._zeroBits=function(w){if(w===0)return 26;var k=w,R=0;return k&8191||(R+=13,k>>>=13),k&127||(R+=7,k>>>=7),k&15||(R+=4,k>>>=4),k&3||(R+=2,k>>>=2),k&1||R++,R},s.prototype.bitLength=function(){var w=this.words[this.length-1],k=this._countBits(w);return(this.length-1)*26+k};function v(F){for(var w=new Array(F.bitLength()),k=0;k>>N&1}return w}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var w=0,k=0;kw.length?this.clone().ior(w):w.clone().ior(this)},s.prototype.uor=function(w){return this.length>w.length?this.clone().iuor(w):w.clone().iuor(this)},s.prototype.iuand=function(w){var k;this.length>w.length?k=w:k=this;for(var R=0;Rw.length?this.clone().iand(w):w.clone().iand(this)},s.prototype.uand=function(w){return this.length>w.length?this.clone().iuand(w):w.clone().iuand(this)},s.prototype.iuxor=function(w){var k,R;this.length>w.length?(k=this,R=w):(k=w,R=this);for(var N=0;Nw.length?this.clone().ixor(w):w.clone().ixor(this)},s.prototype.uxor=function(w){return this.length>w.length?this.clone().iuxor(w):w.clone().iuxor(this)},s.prototype.inotn=function(w){n(typeof w=="number"&&w>=0);var k=Math.ceil(w/26)|0,R=w%26;this._expand(k),R>0&&k--;for(var N=0;N0&&(this.words[N]=~this.words[N]&67108863>>26-R),this._strip()},s.prototype.notn=function(w){return this.clone().inotn(w)},s.prototype.setn=function(w,k){n(typeof w=="number"&&w>=0);var R=w/26|0,N=w%26;return this._expand(R+1),k?this.words[R]=this.words[R]|1<w.length?(R=this,N=w):(R=w,N=this);for(var A=0,O=0;O>>26;for(;A!==0&&O>>26;if(this.length=R.length,A!==0)this.words[this.length]=A,this.length++;else if(R!==this)for(;Ow.length?this.clone().iadd(w):w.clone().iadd(this)},s.prototype.isub=function(w){if(w.negative!==0){w.negative=0;var k=this.iadd(w);return w.negative=1,k._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(w),this.negative=1,this._normSign();var R=this.cmp(w);if(R===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,A;R>0?(N=this,A=w):(N=w,A=this);for(var O=0,B=0;B>26,this.words[B]=k&67108863;for(;O!==0&&B>26,this.words[B]=k&67108863;if(O===0&&B>>26,z=I&67108863,_=Math.min(C,w.length-1),W=Math.max(0,C-F.length+1);W<=_;W++){var G=C-W|0;N=F.words[G]|0,A=w.words[W]|0,O=N*A+z,D+=O/67108864|0,z=O&67108863}k.words[C]=z|0,I=D|0}return I!==0?k.words[C]=I|0:k.length--,k._strip()}var b=function(w,k,R){var N=w.words,A=k.words,O=R.words,B=0,I,C,D,z=N[0]|0,_=z&8191,W=z>>>13,G=N[1]|0,J=G&8191,ee=G>>>13,se=N[2]|0,ie=se&8191,oe=se>>>13,be=N[3]|0,he=be&8191,ve=be>>>13,$e=N[4]|0,ge=$e&8191,Ee=$e>>>13,Ue=N[5]|0,Ke=Ue&8191,Ye=Ue>>>13,Mo=N[6]|0,kt=Mo&8191,vt=Mo>>>13,Gr=N[7]|0,gt=Gr&8191,_t=Gr>>>13,dn=N[8]|0,Pt=dn&8191,U=dn>>>13,T=N[9]|0,$=T&8191,V=T>>>13,Z=A[0]|0,re=Z&8191,ce=Z>>>13,Ne=A[1]|0,Ie=Ne&8191,Ae=Ne>>>13,yt=A[2]|0,ke=yt&8191,jt=yt>>>13,vl=A[3]|0,Bt=vl&8191,Ft=vl>>>13,yl=A[4]|0,Ut=yl&8191,zt=yl>>>13,gl=A[5]|0,qt=gl&8191,Wt=gl>>>13,bl=A[6]|0,Ht=bl&8191,Vt=bl>>>13,xl=A[7]|0,Gt=xl&8191,Kt=xl>>>13,wl=A[8]|0,Qt=wl&8191,Yt=wl>>>13,El=A[9]|0,Jt=El&8191,Xt=El>>>13;R.negative=w.negative^k.negative,R.length=19,I=Math.imul(_,re),C=Math.imul(_,ce),C=C+Math.imul(W,re)|0,D=Math.imul(W,ce);var Fa=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,I=Math.imul(J,re),C=Math.imul(J,ce),C=C+Math.imul(ee,re)|0,D=Math.imul(ee,ce),I=I+Math.imul(_,Ie)|0,C=C+Math.imul(_,Ae)|0,C=C+Math.imul(W,Ie)|0,D=D+Math.imul(W,Ae)|0;var Ua=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(Ua>>>26)|0,Ua&=67108863,I=Math.imul(ie,re),C=Math.imul(ie,ce),C=C+Math.imul(oe,re)|0,D=Math.imul(oe,ce),I=I+Math.imul(J,Ie)|0,C=C+Math.imul(J,Ae)|0,C=C+Math.imul(ee,Ie)|0,D=D+Math.imul(ee,Ae)|0,I=I+Math.imul(_,ke)|0,C=C+Math.imul(_,jt)|0,C=C+Math.imul(W,ke)|0,D=D+Math.imul(W,jt)|0;var za=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(za>>>26)|0,za&=67108863,I=Math.imul(he,re),C=Math.imul(he,ce),C=C+Math.imul(ve,re)|0,D=Math.imul(ve,ce),I=I+Math.imul(ie,Ie)|0,C=C+Math.imul(ie,Ae)|0,C=C+Math.imul(oe,Ie)|0,D=D+Math.imul(oe,Ae)|0,I=I+Math.imul(J,ke)|0,C=C+Math.imul(J,jt)|0,C=C+Math.imul(ee,ke)|0,D=D+Math.imul(ee,jt)|0,I=I+Math.imul(_,Bt)|0,C=C+Math.imul(_,Ft)|0,C=C+Math.imul(W,Bt)|0,D=D+Math.imul(W,Ft)|0;var qa=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(qa>>>26)|0,qa&=67108863,I=Math.imul(ge,re),C=Math.imul(ge,ce),C=C+Math.imul(Ee,re)|0,D=Math.imul(Ee,ce),I=I+Math.imul(he,Ie)|0,C=C+Math.imul(he,Ae)|0,C=C+Math.imul(ve,Ie)|0,D=D+Math.imul(ve,Ae)|0,I=I+Math.imul(ie,ke)|0,C=C+Math.imul(ie,jt)|0,C=C+Math.imul(oe,ke)|0,D=D+Math.imul(oe,jt)|0,I=I+Math.imul(J,Bt)|0,C=C+Math.imul(J,Ft)|0,C=C+Math.imul(ee,Bt)|0,D=D+Math.imul(ee,Ft)|0,I=I+Math.imul(_,Ut)|0,C=C+Math.imul(_,zt)|0,C=C+Math.imul(W,Ut)|0,D=D+Math.imul(W,zt)|0;var Wa=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(Wa>>>26)|0,Wa&=67108863,I=Math.imul(Ke,re),C=Math.imul(Ke,ce),C=C+Math.imul(Ye,re)|0,D=Math.imul(Ye,ce),I=I+Math.imul(ge,Ie)|0,C=C+Math.imul(ge,Ae)|0,C=C+Math.imul(Ee,Ie)|0,D=D+Math.imul(Ee,Ae)|0,I=I+Math.imul(he,ke)|0,C=C+Math.imul(he,jt)|0,C=C+Math.imul(ve,ke)|0,D=D+Math.imul(ve,jt)|0,I=I+Math.imul(ie,Bt)|0,C=C+Math.imul(ie,Ft)|0,C=C+Math.imul(oe,Bt)|0,D=D+Math.imul(oe,Ft)|0,I=I+Math.imul(J,Ut)|0,C=C+Math.imul(J,zt)|0,C=C+Math.imul(ee,Ut)|0,D=D+Math.imul(ee,zt)|0,I=I+Math.imul(_,qt)|0,C=C+Math.imul(_,Wt)|0,C=C+Math.imul(W,qt)|0,D=D+Math.imul(W,Wt)|0;var U2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(U2>>>26)|0,U2&=67108863,I=Math.imul(kt,re),C=Math.imul(kt,ce),C=C+Math.imul(vt,re)|0,D=Math.imul(vt,ce),I=I+Math.imul(Ke,Ie)|0,C=C+Math.imul(Ke,Ae)|0,C=C+Math.imul(Ye,Ie)|0,D=D+Math.imul(Ye,Ae)|0,I=I+Math.imul(ge,ke)|0,C=C+Math.imul(ge,jt)|0,C=C+Math.imul(Ee,ke)|0,D=D+Math.imul(Ee,jt)|0,I=I+Math.imul(he,Bt)|0,C=C+Math.imul(he,Ft)|0,C=C+Math.imul(ve,Bt)|0,D=D+Math.imul(ve,Ft)|0,I=I+Math.imul(ie,Ut)|0,C=C+Math.imul(ie,zt)|0,C=C+Math.imul(oe,Ut)|0,D=D+Math.imul(oe,zt)|0,I=I+Math.imul(J,qt)|0,C=C+Math.imul(J,Wt)|0,C=C+Math.imul(ee,qt)|0,D=D+Math.imul(ee,Wt)|0,I=I+Math.imul(_,Ht)|0,C=C+Math.imul(_,Vt)|0,C=C+Math.imul(W,Ht)|0,D=D+Math.imul(W,Vt)|0;var z2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(z2>>>26)|0,z2&=67108863,I=Math.imul(gt,re),C=Math.imul(gt,ce),C=C+Math.imul(_t,re)|0,D=Math.imul(_t,ce),I=I+Math.imul(kt,Ie)|0,C=C+Math.imul(kt,Ae)|0,C=C+Math.imul(vt,Ie)|0,D=D+Math.imul(vt,Ae)|0,I=I+Math.imul(Ke,ke)|0,C=C+Math.imul(Ke,jt)|0,C=C+Math.imul(Ye,ke)|0,D=D+Math.imul(Ye,jt)|0,I=I+Math.imul(ge,Bt)|0,C=C+Math.imul(ge,Ft)|0,C=C+Math.imul(Ee,Bt)|0,D=D+Math.imul(Ee,Ft)|0,I=I+Math.imul(he,Ut)|0,C=C+Math.imul(he,zt)|0,C=C+Math.imul(ve,Ut)|0,D=D+Math.imul(ve,zt)|0,I=I+Math.imul(ie,qt)|0,C=C+Math.imul(ie,Wt)|0,C=C+Math.imul(oe,qt)|0,D=D+Math.imul(oe,Wt)|0,I=I+Math.imul(J,Ht)|0,C=C+Math.imul(J,Vt)|0,C=C+Math.imul(ee,Ht)|0,D=D+Math.imul(ee,Vt)|0,I=I+Math.imul(_,Gt)|0,C=C+Math.imul(_,Kt)|0,C=C+Math.imul(W,Gt)|0,D=D+Math.imul(W,Kt)|0;var q2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(q2>>>26)|0,q2&=67108863,I=Math.imul(Pt,re),C=Math.imul(Pt,ce),C=C+Math.imul(U,re)|0,D=Math.imul(U,ce),I=I+Math.imul(gt,Ie)|0,C=C+Math.imul(gt,Ae)|0,C=C+Math.imul(_t,Ie)|0,D=D+Math.imul(_t,Ae)|0,I=I+Math.imul(kt,ke)|0,C=C+Math.imul(kt,jt)|0,C=C+Math.imul(vt,ke)|0,D=D+Math.imul(vt,jt)|0,I=I+Math.imul(Ke,Bt)|0,C=C+Math.imul(Ke,Ft)|0,C=C+Math.imul(Ye,Bt)|0,D=D+Math.imul(Ye,Ft)|0,I=I+Math.imul(ge,Ut)|0,C=C+Math.imul(ge,zt)|0,C=C+Math.imul(Ee,Ut)|0,D=D+Math.imul(Ee,zt)|0,I=I+Math.imul(he,qt)|0,C=C+Math.imul(he,Wt)|0,C=C+Math.imul(ve,qt)|0,D=D+Math.imul(ve,Wt)|0,I=I+Math.imul(ie,Ht)|0,C=C+Math.imul(ie,Vt)|0,C=C+Math.imul(oe,Ht)|0,D=D+Math.imul(oe,Vt)|0,I=I+Math.imul(J,Gt)|0,C=C+Math.imul(J,Kt)|0,C=C+Math.imul(ee,Gt)|0,D=D+Math.imul(ee,Kt)|0,I=I+Math.imul(_,Qt)|0,C=C+Math.imul(_,Yt)|0,C=C+Math.imul(W,Qt)|0,D=D+Math.imul(W,Yt)|0;var W2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(W2>>>26)|0,W2&=67108863,I=Math.imul($,re),C=Math.imul($,ce),C=C+Math.imul(V,re)|0,D=Math.imul(V,ce),I=I+Math.imul(Pt,Ie)|0,C=C+Math.imul(Pt,Ae)|0,C=C+Math.imul(U,Ie)|0,D=D+Math.imul(U,Ae)|0,I=I+Math.imul(gt,ke)|0,C=C+Math.imul(gt,jt)|0,C=C+Math.imul(_t,ke)|0,D=D+Math.imul(_t,jt)|0,I=I+Math.imul(kt,Bt)|0,C=C+Math.imul(kt,Ft)|0,C=C+Math.imul(vt,Bt)|0,D=D+Math.imul(vt,Ft)|0,I=I+Math.imul(Ke,Ut)|0,C=C+Math.imul(Ke,zt)|0,C=C+Math.imul(Ye,Ut)|0,D=D+Math.imul(Ye,zt)|0,I=I+Math.imul(ge,qt)|0,C=C+Math.imul(ge,Wt)|0,C=C+Math.imul(Ee,qt)|0,D=D+Math.imul(Ee,Wt)|0,I=I+Math.imul(he,Ht)|0,C=C+Math.imul(he,Vt)|0,C=C+Math.imul(ve,Ht)|0,D=D+Math.imul(ve,Vt)|0,I=I+Math.imul(ie,Gt)|0,C=C+Math.imul(ie,Kt)|0,C=C+Math.imul(oe,Gt)|0,D=D+Math.imul(oe,Kt)|0,I=I+Math.imul(J,Qt)|0,C=C+Math.imul(J,Yt)|0,C=C+Math.imul(ee,Qt)|0,D=D+Math.imul(ee,Yt)|0,I=I+Math.imul(_,Jt)|0,C=C+Math.imul(_,Xt)|0,C=C+Math.imul(W,Jt)|0,D=D+Math.imul(W,Xt)|0;var H2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(H2>>>26)|0,H2&=67108863,I=Math.imul($,Ie),C=Math.imul($,Ae),C=C+Math.imul(V,Ie)|0,D=Math.imul(V,Ae),I=I+Math.imul(Pt,ke)|0,C=C+Math.imul(Pt,jt)|0,C=C+Math.imul(U,ke)|0,D=D+Math.imul(U,jt)|0,I=I+Math.imul(gt,Bt)|0,C=C+Math.imul(gt,Ft)|0,C=C+Math.imul(_t,Bt)|0,D=D+Math.imul(_t,Ft)|0,I=I+Math.imul(kt,Ut)|0,C=C+Math.imul(kt,zt)|0,C=C+Math.imul(vt,Ut)|0,D=D+Math.imul(vt,zt)|0,I=I+Math.imul(Ke,qt)|0,C=C+Math.imul(Ke,Wt)|0,C=C+Math.imul(Ye,qt)|0,D=D+Math.imul(Ye,Wt)|0,I=I+Math.imul(ge,Ht)|0,C=C+Math.imul(ge,Vt)|0,C=C+Math.imul(Ee,Ht)|0,D=D+Math.imul(Ee,Vt)|0,I=I+Math.imul(he,Gt)|0,C=C+Math.imul(he,Kt)|0,C=C+Math.imul(ve,Gt)|0,D=D+Math.imul(ve,Kt)|0,I=I+Math.imul(ie,Qt)|0,C=C+Math.imul(ie,Yt)|0,C=C+Math.imul(oe,Qt)|0,D=D+Math.imul(oe,Yt)|0,I=I+Math.imul(J,Jt)|0,C=C+Math.imul(J,Xt)|0,C=C+Math.imul(ee,Jt)|0,D=D+Math.imul(ee,Xt)|0;var V2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(V2>>>26)|0,V2&=67108863,I=Math.imul($,ke),C=Math.imul($,jt),C=C+Math.imul(V,ke)|0,D=Math.imul(V,jt),I=I+Math.imul(Pt,Bt)|0,C=C+Math.imul(Pt,Ft)|0,C=C+Math.imul(U,Bt)|0,D=D+Math.imul(U,Ft)|0,I=I+Math.imul(gt,Ut)|0,C=C+Math.imul(gt,zt)|0,C=C+Math.imul(_t,Ut)|0,D=D+Math.imul(_t,zt)|0,I=I+Math.imul(kt,qt)|0,C=C+Math.imul(kt,Wt)|0,C=C+Math.imul(vt,qt)|0,D=D+Math.imul(vt,Wt)|0,I=I+Math.imul(Ke,Ht)|0,C=C+Math.imul(Ke,Vt)|0,C=C+Math.imul(Ye,Ht)|0,D=D+Math.imul(Ye,Vt)|0,I=I+Math.imul(ge,Gt)|0,C=C+Math.imul(ge,Kt)|0,C=C+Math.imul(Ee,Gt)|0,D=D+Math.imul(Ee,Kt)|0,I=I+Math.imul(he,Qt)|0,C=C+Math.imul(he,Yt)|0,C=C+Math.imul(ve,Qt)|0,D=D+Math.imul(ve,Yt)|0,I=I+Math.imul(ie,Jt)|0,C=C+Math.imul(ie,Xt)|0,C=C+Math.imul(oe,Jt)|0,D=D+Math.imul(oe,Xt)|0;var G2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(G2>>>26)|0,G2&=67108863,I=Math.imul($,Bt),C=Math.imul($,Ft),C=C+Math.imul(V,Bt)|0,D=Math.imul(V,Ft),I=I+Math.imul(Pt,Ut)|0,C=C+Math.imul(Pt,zt)|0,C=C+Math.imul(U,Ut)|0,D=D+Math.imul(U,zt)|0,I=I+Math.imul(gt,qt)|0,C=C+Math.imul(gt,Wt)|0,C=C+Math.imul(_t,qt)|0,D=D+Math.imul(_t,Wt)|0,I=I+Math.imul(kt,Ht)|0,C=C+Math.imul(kt,Vt)|0,C=C+Math.imul(vt,Ht)|0,D=D+Math.imul(vt,Vt)|0,I=I+Math.imul(Ke,Gt)|0,C=C+Math.imul(Ke,Kt)|0,C=C+Math.imul(Ye,Gt)|0,D=D+Math.imul(Ye,Kt)|0,I=I+Math.imul(ge,Qt)|0,C=C+Math.imul(ge,Yt)|0,C=C+Math.imul(Ee,Qt)|0,D=D+Math.imul(Ee,Yt)|0,I=I+Math.imul(he,Jt)|0,C=C+Math.imul(he,Xt)|0,C=C+Math.imul(ve,Jt)|0,D=D+Math.imul(ve,Xt)|0;var K2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(K2>>>26)|0,K2&=67108863,I=Math.imul($,Ut),C=Math.imul($,zt),C=C+Math.imul(V,Ut)|0,D=Math.imul(V,zt),I=I+Math.imul(Pt,qt)|0,C=C+Math.imul(Pt,Wt)|0,C=C+Math.imul(U,qt)|0,D=D+Math.imul(U,Wt)|0,I=I+Math.imul(gt,Ht)|0,C=C+Math.imul(gt,Vt)|0,C=C+Math.imul(_t,Ht)|0,D=D+Math.imul(_t,Vt)|0,I=I+Math.imul(kt,Gt)|0,C=C+Math.imul(kt,Kt)|0,C=C+Math.imul(vt,Gt)|0,D=D+Math.imul(vt,Kt)|0,I=I+Math.imul(Ke,Qt)|0,C=C+Math.imul(Ke,Yt)|0,C=C+Math.imul(Ye,Qt)|0,D=D+Math.imul(Ye,Yt)|0,I=I+Math.imul(ge,Jt)|0,C=C+Math.imul(ge,Xt)|0,C=C+Math.imul(Ee,Jt)|0,D=D+Math.imul(Ee,Xt)|0;var Q2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(Q2>>>26)|0,Q2&=67108863,I=Math.imul($,qt),C=Math.imul($,Wt),C=C+Math.imul(V,qt)|0,D=Math.imul(V,Wt),I=I+Math.imul(Pt,Ht)|0,C=C+Math.imul(Pt,Vt)|0,C=C+Math.imul(U,Ht)|0,D=D+Math.imul(U,Vt)|0,I=I+Math.imul(gt,Gt)|0,C=C+Math.imul(gt,Kt)|0,C=C+Math.imul(_t,Gt)|0,D=D+Math.imul(_t,Kt)|0,I=I+Math.imul(kt,Qt)|0,C=C+Math.imul(kt,Yt)|0,C=C+Math.imul(vt,Qt)|0,D=D+Math.imul(vt,Yt)|0,I=I+Math.imul(Ke,Jt)|0,C=C+Math.imul(Ke,Xt)|0,C=C+Math.imul(Ye,Jt)|0,D=D+Math.imul(Ye,Xt)|0;var Y2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(Y2>>>26)|0,Y2&=67108863,I=Math.imul($,Ht),C=Math.imul($,Vt),C=C+Math.imul(V,Ht)|0,D=Math.imul(V,Vt),I=I+Math.imul(Pt,Gt)|0,C=C+Math.imul(Pt,Kt)|0,C=C+Math.imul(U,Gt)|0,D=D+Math.imul(U,Kt)|0,I=I+Math.imul(gt,Qt)|0,C=C+Math.imul(gt,Yt)|0,C=C+Math.imul(_t,Qt)|0,D=D+Math.imul(_t,Yt)|0,I=I+Math.imul(kt,Jt)|0,C=C+Math.imul(kt,Xt)|0,C=C+Math.imul(vt,Jt)|0,D=D+Math.imul(vt,Xt)|0;var J2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(J2>>>26)|0,J2&=67108863,I=Math.imul($,Gt),C=Math.imul($,Kt),C=C+Math.imul(V,Gt)|0,D=Math.imul(V,Kt),I=I+Math.imul(Pt,Qt)|0,C=C+Math.imul(Pt,Yt)|0,C=C+Math.imul(U,Qt)|0,D=D+Math.imul(U,Yt)|0,I=I+Math.imul(gt,Jt)|0,C=C+Math.imul(gt,Xt)|0,C=C+Math.imul(_t,Jt)|0,D=D+Math.imul(_t,Xt)|0;var X2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(X2>>>26)|0,X2&=67108863,I=Math.imul($,Qt),C=Math.imul($,Yt),C=C+Math.imul(V,Qt)|0,D=Math.imul(V,Yt),I=I+Math.imul(Pt,Jt)|0,C=C+Math.imul(Pt,Xt)|0,C=C+Math.imul(U,Jt)|0,D=D+Math.imul(U,Xt)|0;var Z2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(Z2>>>26)|0,Z2&=67108863,I=Math.imul($,Jt),C=Math.imul($,Xt),C=C+Math.imul(V,Jt)|0,D=Math.imul(V,Xt);var ex=(B+I|0)+((C&8191)<<13)|0;return B=(D+(C>>>13)|0)+(ex>>>26)|0,ex&=67108863,O[0]=Fa,O[1]=Ua,O[2]=za,O[3]=qa,O[4]=Wa,O[5]=U2,O[6]=z2,O[7]=q2,O[8]=W2,O[9]=H2,O[10]=V2,O[11]=G2,O[12]=K2,O[13]=Q2,O[14]=Y2,O[15]=J2,O[16]=X2,O[17]=Z2,O[18]=ex,B!==0&&(O[19]=B,R.length++),R};Math.imul||(b=y);function E(F,w,k){k.negative=w.negative^F.negative,k.length=F.length+w.length;for(var R=0,N=0,A=0;A>>26)|0,N+=O>>>26,O&=67108863}k.words[A]=B,R=O,O=N}return R!==0?k.words[A]=R:k.length--,k._strip()}function S(F,w,k){return E(F,w,k)}s.prototype.mulTo=function(w,k){var R,N=this.length+w.length;return this.length===10&&w.length===10?R=b(this,w,k):N<63?R=y(this,w,k):N<1024?R=E(this,w,k):R=S(this,w,k),R},s.prototype.mul=function(w){var k=new s(null);return k.words=new Array(this.length+w.length),this.mulTo(w,k)},s.prototype.mulf=function(w){var k=new s(null);return k.words=new Array(this.length+w.length),S(this,w,k)},s.prototype.imul=function(w){return this.clone().mulTo(w,this)},s.prototype.imuln=function(w){var k=w<0;k&&(w=-w),n(typeof w=="number"),n(w<67108864);for(var R=0,N=0;N>=26,R+=A/67108864|0,R+=O>>>26,this.words[N]=O&67108863}return R!==0&&(this.words[N]=R,this.length++),k?this.ineg():this},s.prototype.muln=function(w){return this.clone().imuln(w)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(w){var k=v(w);if(k.length===0)return new s(1);for(var R=this,N=0;N=0);var k=w%26,R=(w-k)/26,N=67108863>>>26-k<<26-k,A;if(k!==0){var O=0;for(A=0;A>>26-k}O&&(this.words[A]=O,this.length++)}if(R!==0){for(A=this.length-1;A>=0;A--)this.words[A+R]=this.words[A];for(A=0;A=0);var N;k?N=(k-k%26)/26:N=0;var A=w%26,O=Math.min((w-A)/26,this.length),B=67108863^67108863>>>A<O)for(this.length-=O,C=0;C=0&&(D!==0||C>=N);C--){var z=this.words[C]|0;this.words[C]=D<<26-A|z>>>A,D=z&B}return I&&D!==0&&(I.words[I.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(w,k,R){return n(this.negative===0),this.iushrn(w,k,R)},s.prototype.shln=function(w){return this.clone().ishln(w)},s.prototype.ushln=function(w){return this.clone().iushln(w)},s.prototype.shrn=function(w){return this.clone().ishrn(w)},s.prototype.ushrn=function(w){return this.clone().iushrn(w)},s.prototype.testn=function(w){n(typeof w=="number"&&w>=0);var k=w%26,R=(w-k)/26,N=1<=0);var k=w%26,R=(w-k)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=R)return this;if(k!==0&&R++,this.length=Math.min(R,this.length),k!==0){var N=67108863^67108863>>>k<=67108864;k++)this.words[k]-=67108864,k===this.length-1?this.words[k+1]=1:this.words[k+1]++;return this.length=Math.max(this.length,k+1),this},s.prototype.isubn=function(w){if(n(typeof w=="number"),n(w<67108864),w<0)return this.iaddn(-w);if(this.negative!==0)return this.negative=0,this.iaddn(w),this.negative=1,this;if(this.words[0]-=w,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var k=0;k>26)-(I/67108864|0),this.words[A+R]=O&67108863}for(;A>26,this.words[A+R]=O&67108863;if(B===0)return this._strip();for(n(B===-1),B=0,A=0;A>26,this.words[A]=O&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(w,k){var R=this.length-w.length,N=this.clone(),A=w,O=A.words[A.length-1]|0,B=this._countBits(O);R=26-B,R!==0&&(A=A.ushln(R),N.iushln(R),O=A.words[A.length-1]|0);var I=N.length-A.length,C;if(k!=="mod"){C=new s(null),C.length=I+1,C.words=new Array(C.length);for(var D=0;D=0;_--){var W=(N.words[A.length+_]|0)*67108864+(N.words[A.length+_-1]|0);for(W=Math.min(W/O|0,67108863),N._ishlnsubmul(A,W,_);N.negative!==0;)W--,N.negative=0,N._ishlnsubmul(A,1,_),N.isZero()||(N.negative^=1);C&&(C.words[_]=W)}return C&&C._strip(),N._strip(),k!=="div"&&R!==0&&N.iushrn(R),{div:C||null,mod:N}},s.prototype.divmod=function(w,k,R){if(n(!w.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var N,A,O;return this.negative!==0&&w.negative===0?(O=this.neg().divmod(w,k),k!=="mod"&&(N=O.div.neg()),k!=="div"&&(A=O.mod.neg(),R&&A.negative!==0&&A.iadd(w)),{div:N,mod:A}):this.negative===0&&w.negative!==0?(O=this.divmod(w.neg(),k),k!=="mod"&&(N=O.div.neg()),{div:N,mod:O.mod}):this.negative&w.negative?(O=this.neg().divmod(w.neg(),k),k!=="div"&&(A=O.mod.neg(),R&&A.negative!==0&&A.isub(w)),{div:O.div,mod:A}):w.length>this.length||this.cmp(w)<0?{div:new s(0),mod:this}:w.length===1?k==="div"?{div:this.divn(w.words[0]),mod:null}:k==="mod"?{div:null,mod:new s(this.modrn(w.words[0]))}:{div:this.divn(w.words[0]),mod:new s(this.modrn(w.words[0]))}:this._wordDiv(w,k)},s.prototype.div=function(w){return this.divmod(w,"div",!1).div},s.prototype.mod=function(w){return this.divmod(w,"mod",!1).mod},s.prototype.umod=function(w){return this.divmod(w,"mod",!0).mod},s.prototype.divRound=function(w){var k=this.divmod(w);if(k.mod.isZero())return k.div;var R=k.div.negative!==0?k.mod.isub(w):k.mod,N=w.ushrn(1),A=w.andln(1),O=R.cmp(N);return O<0||A===1&&O===0?k.div:k.div.negative!==0?k.div.isubn(1):k.div.iaddn(1)},s.prototype.modrn=function(w){var k=w<0;k&&(w=-w),n(w<=67108863);for(var R=(1<<26)%w,N=0,A=this.length-1;A>=0;A--)N=(R*N+(this.words[A]|0))%w;return k?-N:N},s.prototype.modn=function(w){return this.modrn(w)},s.prototype.idivn=function(w){var k=w<0;k&&(w=-w),n(w<=67108863);for(var R=0,N=this.length-1;N>=0;N--){var A=(this.words[N]|0)+R*67108864;this.words[N]=A/w|0,R=A%w}return this._strip(),k?this.ineg():this},s.prototype.divn=function(w){return this.clone().idivn(w)},s.prototype.egcd=function(w){n(w.negative===0),n(!w.isZero());var k=this,R=w.clone();k.negative!==0?k=k.umod(w):k=k.clone();for(var N=new s(1),A=new s(0),O=new s(0),B=new s(1),I=0;k.isEven()&&R.isEven();)k.iushrn(1),R.iushrn(1),++I;for(var C=R.clone(),D=k.clone();!k.isZero();){for(var z=0,_=1;!(k.words[0]&_)&&z<26;++z,_<<=1);if(z>0)for(k.iushrn(z);z-- >0;)(N.isOdd()||A.isOdd())&&(N.iadd(C),A.isub(D)),N.iushrn(1),A.iushrn(1);for(var W=0,G=1;!(R.words[0]&G)&&W<26;++W,G<<=1);if(W>0)for(R.iushrn(W);W-- >0;)(O.isOdd()||B.isOdd())&&(O.iadd(C),B.isub(D)),O.iushrn(1),B.iushrn(1);k.cmp(R)>=0?(k.isub(R),N.isub(O),A.isub(B)):(R.isub(k),O.isub(N),B.isub(A))}return{a:O,b:B,gcd:R.iushln(I)}},s.prototype._invmp=function(w){n(w.negative===0),n(!w.isZero());var k=this,R=w.clone();k.negative!==0?k=k.umod(w):k=k.clone();for(var N=new s(1),A=new s(0),O=R.clone();k.cmpn(1)>0&&R.cmpn(1)>0;){for(var B=0,I=1;!(k.words[0]&I)&&B<26;++B,I<<=1);if(B>0)for(k.iushrn(B);B-- >0;)N.isOdd()&&N.iadd(O),N.iushrn(1);for(var C=0,D=1;!(R.words[0]&D)&&C<26;++C,D<<=1);if(C>0)for(R.iushrn(C);C-- >0;)A.isOdd()&&A.iadd(O),A.iushrn(1);k.cmp(R)>=0?(k.isub(R),N.isub(A)):(R.isub(k),A.isub(N))}var z;return k.cmpn(1)===0?z=N:z=A,z.cmpn(0)<0&&z.iadd(w),z},s.prototype.gcd=function(w){if(this.isZero())return w.abs();if(w.isZero())return this.abs();var k=this.clone(),R=w.clone();k.negative=0,R.negative=0;for(var N=0;k.isEven()&&R.isEven();N++)k.iushrn(1),R.iushrn(1);do{for(;k.isEven();)k.iushrn(1);for(;R.isEven();)R.iushrn(1);var A=k.cmp(R);if(A<0){var O=k;k=R,R=O}else if(A===0||R.cmpn(1)===0)break;k.isub(R)}while(!0);return R.iushln(N)},s.prototype.invm=function(w){return this.egcd(w).a.umod(w)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(w){return this.words[0]&w},s.prototype.bincn=function(w){n(typeof w=="number");var k=w%26,R=(w-k)/26,N=1<>>26,B&=67108863,this.words[O]=B}return A!==0&&(this.words[O]=A,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(w){var k=w<0;if(this.negative!==0&&!k)return-1;if(this.negative===0&&k)return 1;this._strip();var R;if(this.length>1)R=1;else{k&&(w=-w),n(w<=67108863,"Number is too big");var N=this.words[0]|0;R=N===w?0:Nw.length)return 1;if(this.length=0;R--){var N=this.words[R]|0,A=w.words[R]|0;if(N!==A){NA&&(k=1);break}}return k},s.prototype.gtn=function(w){return this.cmpn(w)===1},s.prototype.gt=function(w){return this.cmp(w)===1},s.prototype.gten=function(w){return this.cmpn(w)>=0},s.prototype.gte=function(w){return this.cmp(w)>=0},s.prototype.ltn=function(w){return this.cmpn(w)===-1},s.prototype.lt=function(w){return this.cmp(w)===-1},s.prototype.lten=function(w){return this.cmpn(w)<=0},s.prototype.lte=function(w){return this.cmp(w)<=0},s.prototype.eqn=function(w){return this.cmpn(w)===0},s.prototype.eq=function(w){return this.cmp(w)===0},s.red=function(w){return new Q(w)},s.prototype.toRed=function(w){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),w.convertTo(this)._forceRed(w)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(w){return this.red=w,this},s.prototype.forceRed=function(w){return n(!this.red,"Already a number in reduction context"),this._forceRed(w)},s.prototype.redAdd=function(w){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,w)},s.prototype.redIAdd=function(w){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,w)},s.prototype.redSub=function(w){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,w)},s.prototype.redISub=function(w){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,w)},s.prototype.redShl=function(w){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,w)},s.prototype.redMul=function(w){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.mul(this,w)},s.prototype.redIMul=function(w){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.imul(this,w)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(w){return n(this.red&&!w.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,w)};var P={k256:null,p224:null,p192:null,p25519:null};function M(F,w){this.name=F,this.p=new s(w,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}M.prototype._tmp=function(){var w=new s(null);return w.words=new Array(Math.ceil(this.n/13)),w},M.prototype.ireduce=function(w){var k=w,R;do this.split(k,this.tmp),k=this.imulK(k),k=k.iadd(this.tmp),R=k.bitLength();while(R>this.n);var N=R0?k.isub(this.p):k.strip!==void 0?k.strip():k._strip(),k},M.prototype.split=function(w,k){w.iushrn(this.n,0,k)},M.prototype.imulK=function(w){return w.imul(this.k)};function L(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(L,M),L.prototype.split=function(w,k){for(var R=4194303,N=Math.min(w.length,9),A=0;A>>22,O=B}O>>>=22,w.words[A-10]=O,O===0&&w.length>10?w.length-=10:w.length-=9},L.prototype.imulK=function(w){w.words[w.length]=0,w.words[w.length+1]=0,w.length+=2;for(var k=0,R=0;R>>=26,w.words[R]=A,k=N}return k!==0&&(w.words[w.length++]=k),w},s._prime=function(w){if(P[w])return P[w];var k;if(w==="k256")k=new L;else if(w==="p224")k=new j;else if(w==="p192")k=new H;else if(w==="p25519")k=new K;else throw new Error("Unknown prime "+w);return P[w]=k,k};function Q(F){if(typeof F=="string"){var w=s._prime(F);this.m=w.p,this.prime=w}else n(F.gtn(1),"modulus must be greater than 1"),this.m=F,this.prime=null}Q.prototype._verify1=function(w){n(w.negative===0,"red works only with positives"),n(w.red,"red works only with red numbers")},Q.prototype._verify2=function(w,k){n((w.negative|k.negative)===0,"red works only with positives"),n(w.red&&w.red===k.red,"red works only with red numbers")},Q.prototype.imod=function(w){return this.prime?this.prime.ireduce(w)._forceRed(this):(u(w,w.umod(this.m)._forceRed(this)),w)},Q.prototype.neg=function(w){return w.isZero()?w.clone():this.m.sub(w)._forceRed(this)},Q.prototype.add=function(w,k){this._verify2(w,k);var R=w.add(k);return R.cmp(this.m)>=0&&R.isub(this.m),R._forceRed(this)},Q.prototype.iadd=function(w,k){this._verify2(w,k);var R=w.iadd(k);return R.cmp(this.m)>=0&&R.isub(this.m),R},Q.prototype.sub=function(w,k){this._verify2(w,k);var R=w.sub(k);return R.cmpn(0)<0&&R.iadd(this.m),R._forceRed(this)},Q.prototype.isub=function(w,k){this._verify2(w,k);var R=w.isub(k);return R.cmpn(0)<0&&R.iadd(this.m),R},Q.prototype.shl=function(w,k){return this._verify1(w),this.imod(w.ushln(k))},Q.prototype.imul=function(w,k){return this._verify2(w,k),this.imod(w.imul(k))},Q.prototype.mul=function(w,k){return this._verify2(w,k),this.imod(w.mul(k))},Q.prototype.isqr=function(w){return this.imul(w,w.clone())},Q.prototype.sqr=function(w){return this.mul(w,w)},Q.prototype.sqrt=function(w){if(w.isZero())return w.clone();var k=this.m.andln(3);if(n(k%2===1),k===3){var R=this.m.add(new s(1)).iushrn(2);return this.pow(w,R)}for(var N=this.m.subn(1),A=0;!N.isZero()&&N.andln(1)===0;)A++,N.iushrn(1);n(!N.isZero());var O=new s(1).toRed(this),B=O.redNeg(),I=this.m.subn(1).iushrn(1),C=this.m.bitLength();for(C=new s(2*C*C).toRed(this);this.pow(C,I).cmp(B)!==0;)C.redIAdd(B);for(var D=this.pow(C,N),z=this.pow(w,N.addn(1).iushrn(1)),_=this.pow(w,N),W=A;_.cmp(O)!==0;){for(var G=_,J=0;G.cmp(O)!==0;J++)G=G.redSqr();n(J=0;A--){for(var D=k.words[A],z=C-1;z>=0;z--){var _=D>>z&1;if(O!==N[0]&&(O=this.sqr(O)),_===0&&B===0){I=0;continue}B<<=1,B|=_,I++,!(I!==R&&(A!==0||z!==0))&&(O=this.mul(O,N[B]),I=0,B=0)}C=26}return O},Q.prototype.convertTo=function(w){var k=w.umod(this.m);return k===w?k.clone():k},Q.prototype.convertFrom=function(w){var k=w.clone();return k.red=null,k},s.mont=function(w){return new Y(w)};function Y(F){Q.call(this,F),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(Y,Q),Y.prototype.convertTo=function(w){return this.imod(w.ushln(this.shift))},Y.prototype.convertFrom=function(w){var k=this.imod(w.mul(this.rinv));return k.red=null,k},Y.prototype.imul=function(w,k){if(w.isZero()||k.isZero())return w.words[0]=0,w.length=1,w;var R=w.imul(k),N=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=R.isub(N).iushrn(this.shift),O=A;return A.cmp(this.m)>=0?O=A.isub(this.m):A.cmpn(0)<0&&(O=A.iadd(this.m)),O._forceRed(this)},Y.prototype.mul=function(w,k){if(w.isZero()||k.isZero())return new s(0)._forceRed(this);var R=w.mul(k),N=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=R.isub(N).iushrn(this.shift),O=A;return A.cmp(this.m)>=0?O=A.isub(this.m):A.cmpn(0)<0&&(O=A.iadd(this.m)),O._forceRed(this)},Y.prototype.invm=function(w){var k=this.imod(w._invmp(this.m).mul(this.r2));return k._forceRed(this)}})(t,yi)})(fE);var uK=fE.exports;const ze=Ti(uK),fK="logger/5.7.0";let nS=!1,iS=!1;const tv={debug:1,default:2,info:2,warning:3,error:4,off:5};let sS=tv.default,Ix=null;function dK(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const oS=dK();var oy;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(oy||(oy={}));var Fi;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Fi||(Fi={}));const aS="0123456789abcdef";let ne=class jr{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();tv[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(sS>tv[n])&&console.log.apply(console,r)}debug(...e){this._log(jr.levels.DEBUG,e)}info(...e){this._log(jr.levels.INFO,e)}warn(...e){this._log(jr.levels.WARNING,e)}makeError(e,r,n){if(iS)return this.makeError("censored error",r,{});r||(r=jr.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let u="";for(let f=0;f>4],u+=aS[l[f]&15];i.push(c+"=Uint8Array(0x"+u+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case Fi.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Fi.CALL_EXCEPTION:case Fi.INSUFFICIENT_FUNDS:case Fi.MISSING_NEW:case Fi.NONCE_EXPIRED:case Fi.REPLACEMENT_UNDERPRICED:case Fi.TRANSACTION_REPLACED:case Fi.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,jr.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){oS&&this.throwError("platform missing String.prototype.normalize",jr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:oS})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,jr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,jr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,jr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",jr.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",jr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",jr.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Ix||(Ix=new jr(fK)),Ix}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",jr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),nS){if(!e)return;this.globalLogger().throwError("error censorship permanent",jr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}iS=!!e,nS=!!r}static setLogLevel(e){const r=tv[e.toLowerCase()];if(r==null){jr.globalLogger().warn("invalid log level - "+e);return}sS=r}static from(e){return new jr(e)}};ne.errors=Fi;ne.levels=oy;const hK=Object.freeze(Object.defineProperty({__proto__:null,get ErrorCode(){return Fi},get LogLevel(){return oy},Logger:ne},Symbol.toStringTag,{value:"Module"})),pK="bytes/5.7.0",mr=new ne(pK);function bR(t){return!!t.toHexString}function zf(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return zf(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Ds(t){return qe(t)&&!(t.length%2)||Ia(t)}function cS(t){return typeof t=="number"&&t==t&&t%1===0}function Ia(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!cS(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function fe(t,e){if(e||(e={}),typeof t=="number"){mr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),zf(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),bR(t)&&(t=t.toHexString()),qe(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":mr.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ife(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),zf(n)}function $s(t){let e=fe(t);if(e.length===0)return e;let r=0;for(;re&&mr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),zf(r)}function qe(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const Tx="0123456789abcdef";function le(t,e){if(e||(e={}),typeof t=="number"){mr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=Tx[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),bR(t))return t.toHexString();if(qe(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":mr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Ia(t)){let r="0x";for(let n=0;n>4]+Tx[i&15]}return r}return mr.throwArgumentError("invalid hexlify value","value",t)}function Ls(t){if(typeof t!="string")t=le(t);else if(!qe(t)||t.length%2)return null;return(t.length-2)/2}function rr(t,e,r){return typeof t!="string"?t=le(t):(!qe(t)||t.length%2)&&mr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function xn(t){let e="0x";return t.forEach(r=>{e+=le(r).substring(2)}),e}function Zi(t){const e=hE(le(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function hE(t){typeof t!="string"&&(t=le(t)),qe(t)||mr.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&mr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function sl(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Ds(t)){let r=fe(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=le(r.slice(0,32)),e.s=le(r.slice(32,64))):r.length===65?(e.r=le(r.slice(0,32)),e.s=le(r.slice(32,64)),e.v=r[64]):mr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:mr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=le(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=qf(fe(e._vs),32);e._vs=le(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&mr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=le(i);e.s==null?e.s=o:e.s!==o&&mr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?mr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&mr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!qe(e.r)?mr.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ct(e.r,32),e.s==null||!qe(e.s)?mr.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ct(e.s,32);const r=fe(e.s);r[0]>=128&&mr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=le(r);e._vs&&(qe(e._vs)||mr.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ct(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&mr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function ay(t){return t=sl(t),le(wt([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const mK=Object.freeze(Object.defineProperty({__proto__:null,arrayify:fe,concat:wt,hexConcat:xn,hexDataLength:Ls,hexDataSlice:rr,hexStripZeros:hE,hexValue:Zi,hexZeroPad:Ct,hexlify:le,isBytes:Ia,isBytesLike:Ds,isHexString:qe,joinSignature:ay,splitSignature:sl,stripZeros:$s,zeroPad:qf},Symbol.toStringTag,{value:"Module"})),xR="bignumber/5.7.0";var Q0=ze.BN;const jo=new ne(xR),Ox={},lS=9007199254740991;function vK(t){return t!=null&&(te.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||qe(t)||typeof t=="bigint"||Ia(t))}let uS=!1;class te{constructor(e,r){e!==Ox&&jo.throwError("cannot call constructor directly; use BigNumber.from",ne.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Gn(et(this).fromTwos(e))}toTwos(e){return Gn(et(this).toTwos(e))}abs(){return this._hex[0]==="-"?te.from(this._hex.substring(1)):this}add(e){return Gn(et(this).add(et(e)))}sub(e){return Gn(et(this).sub(et(e)))}div(e){return te.from(e).isZero()&&Li("division-by-zero","div"),Gn(et(this).div(et(e)))}mul(e){return Gn(et(this).mul(et(e)))}mod(e){const r=et(e);return r.isNeg()&&Li("division-by-zero","mod"),Gn(et(this).umod(r))}pow(e){const r=et(e);return r.isNeg()&&Li("negative-power","pow"),Gn(et(this).pow(r))}and(e){const r=et(e);return(this.isNegative()||r.isNeg())&&Li("unbound-bitwise-result","and"),Gn(et(this).and(r))}or(e){const r=et(e);return(this.isNegative()||r.isNeg())&&Li("unbound-bitwise-result","or"),Gn(et(this).or(r))}xor(e){const r=et(e);return(this.isNegative()||r.isNeg())&&Li("unbound-bitwise-result","xor"),Gn(et(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Li("negative-width","mask"),Gn(et(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Li("negative-width","shl"),Gn(et(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Li("negative-width","shr"),Gn(et(this).shrn(e))}eq(e){return et(this).eq(et(e))}lt(e){return et(this).lt(et(e))}lte(e){return et(this).lte(et(e))}gt(e){return et(this).gt(et(e))}gte(e){return et(this).gte(et(e))}isNegative(){return this._hex[0]==="-"}isZero(){return et(this).isZero()}toNumber(){try{return et(this).toNumber()}catch{Li("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return jo.throwError("this platform does not support BigInt",ne.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?uS||(uS=!0,jo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?jo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ne.errors.UNEXPECTED_ARGUMENT,{}):jo.throwError("BigNumber.toString does not accept parameters",ne.errors.UNEXPECTED_ARGUMENT,{})),et(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof te)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new te(Ox,Y0(e)):e.match(/^-?[0-9]+$/)?new te(Ox,Y0(new Q0(e))):jo.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Li("underflow","BigNumber.from",e),(e>=lS||e<=-lS)&&Li("overflow","BigNumber.from",e),te.from(String(e));const r=e;if(typeof r=="bigint")return te.from(r.toString());if(Ia(r))return te.from(le(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return te.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(qe(n)||n[0]==="-"&&qe(n.substring(1))))return te.from(n)}return jo.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function Y0(t){if(typeof t!="string")return Y0(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&jo.throwArgumentError("invalid hex","value",t),t=Y0(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Gn(t){return te.from(Y0(t))}function et(t){const e=te.from(t).toHexString();return e[0]==="-"?new Q0("-"+e.substring(3),16):new Q0(e.substring(2),16)}function Li(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),jo.throwError(t,ne.errors.NUMERIC_FAULT,n)}function yK(t){return new Q0(t,36).toString(16)}function gK(t){return new Q0(t,16).toString(36)}const Dn=new ne(xR),l0={},wR=te.from(0),ER=te.from(-1);function CR(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Dn.throwError(t,ne.errors.NUMERIC_FAULT,i)}let u0="0";for(;u0.length<256;)u0+=u0;function pE(t){if(typeof t!="number")try{t=te.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+u0.substring(0,t):Dn.throwArgumentError("invalid decimal size","decimals",t)}function rv(t,e){e==null&&(e=0);const r=pE(e);t=te.from(t);const n=t.lt(wR);n&&(t=t.mul(ER));let i=t.mod(r).toString();for(;i.length2&&Dn.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&CR("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?c:(typeof e[o]!==a&&Dn.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Dn.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Dn.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new Wf(l0,r,n,i)}}class en{constructor(e,r,n,i){e!==l0&&Dn.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ne.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Dn.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Qs(this._value,this.format.decimals),n=Qs(e._value,e.format.decimals);return en.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Qs(this._value,this.format.decimals),n=Qs(e._value,e.format.decimals);return en.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Qs(this._value,this.format.decimals),n=Qs(e._value,e.format.decimals);return en.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Qs(this._value,this.format.decimals),n=Qs(e._value,e.format.decimals);return en.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=en.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(fS.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=en.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(fS.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Dn.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=en.from("1"+u0.substring(0,e),this.format),i=bK.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Dn.throwArgumentError("invalid byte width","width",e);const r=te.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Ct(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return en.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!vK(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),en.fromString(rv(e,r),Wf.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=Wf.from(r),i=Qs(e,n.decimals);!n.signed&&i.lt(wR)&&CR("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=Ct(s,n.width/8));const o=rv(i,n.decimals);return new en(l0,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=Wf.from(r);if(fe(e).length>n.width/8)throw new Error("overflow");let i=te.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=rv(i,n.decimals);return new en(l0,s,o,n)}static from(e,r){if(typeof e=="string")return en.fromString(e,r);if(Ia(e))return en.fromBytes(e,r);try{return en.fromValue(e,0,r)}catch(n){if(n.code!==ne.errors.INVALID_ARGUMENT)throw n}return Dn.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const fS=en.from(1),bK=en.from("0.5"),xK="properties/5.7.0";var wK=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const cy=new ne(xK);function de(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Ji(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function At(t){return wK(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function Zg(t,e){(!t||typeof t!="object")&&cy.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||cy.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Mt(t){const e={};for(const r in t)e[r]=t[r];return e}const EK={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function SR(t){if(t==null||EK[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;roi(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&de(e,r,oi(n))}return e}return cy.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function oi(t){return CK(t)}class ol{constructor(e){for(const r in e)this[r]=oi(e[r])}}const SK=Object.freeze(Object.defineProperty({__proto__:null,Description:ol,checkProperties:Zg,deepCopy:oi,defineReadOnly:de,getStatic:Ji,resolveProperties:At,shallowCopy:Mt},Symbol.toStringTag,{value:"Module"})),Z1="abi/5.7.0",st=new ne(Z1),ou={};let dS={calldata:!0,memory:!0,storage:!0},kK={calldata:!0,memory:!0};function rm(t,e){if(t==="bytes"||t==="string"){if(dS[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&kK[e])return!0;return(dS[e]||e==="payable")&&st.throwArgumentError("invalid modifier","name",e),!1}function AK(t,e){let r=t;function n(a){st.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let c={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(c.indexed=!1),c}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==at.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===at.full?", ":",")+")"):r+=this.type,e!==at.sighash&&(this.indexed===!0&&(r+=" indexed"),e===at.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Nr.fromString(e,r):Nr.fromObject(e)}static fromObject(e){return Nr.isParamType(e)?e:new Nr(ou,{name:e.name||null,type:of(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Nr.fromObject):null})}static fromString(e,r){function n(i){return Nr.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(AK(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function J0(t,e){return IK(t).map(r=>Nr.fromString(r,e))}class Ps{constructor(e,r){e!==ou&&st.throwError("use a static from method",ne.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),nv(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Ps.isFragment(e)?e:typeof e=="string"?Ps.fromString(e):Ps.fromObject(e)}static fromObject(e){if(Ps.isFragment(e))return e;switch(e.type){case"function":return Gi.fromObject(e);case"event":return As.fromObject(e);case"constructor":return Vi.fromObject(e);case"error":return ao.fromObject(e);case"fallback":case"receive":return null}return st.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?As.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Gi.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Vi.fromString(e.trim()):e.split(" ")[0]==="error"?ao.fromString(e.substring(5).trim()):st.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class As extends Ps{format(e){if(e||(e=at.sighash),at[e]||st.throwArgumentError("invalid format type","format",e),e===at.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==at.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===at.full?", ":",")+") ",e!==at.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?As.fromString(e):As.fromObject(e)}static fromObject(e){if(As.isEventFragment(e))return e;e.type!=="event"&&st.throwArgumentError("invalid event object","value",e);const r={name:X0(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Nr.fromObject):[],type:"event"};return new As(ou,r)}static fromString(e){let r=e.match(Z0);r||st.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:st.warn("unknown modifier: "+i)}}),As.fromObject({name:r[1].trim(),anonymous:n,inputs:J0(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function kR(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&st.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||st.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=te.from(r[1]),r[0]):t}function AR(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function _R(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&st.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&st.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&st.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&st.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&st.throwArgumentError("unable to determine stateMutability","value",t),e}class Vi extends Ps{format(e){if(e||(e=at.sighash),at[e]||st.throwArgumentError("invalid format type","format",e),e===at.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===at.sighash&&st.throwError("cannot format a constructor for sighash",ne.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===at.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Vi.fromString(e):Vi.fromObject(e)}static fromObject(e){if(Vi.isConstructorFragment(e))return e;e.type!=="constructor"&&st.throwArgumentError("invalid constructor object","value",e);let r=_R(e);r.constant&&st.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Nr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?te.from(e.gas):null};return new Vi(ou,n)}static fromString(e){let r={type:"constructor"};e=kR(e,r);let n=e.match(Z0);return(!n||n[1].trim()!=="constructor")&&st.throwArgumentError("invalid constructor string","value",e),r.inputs=J0(n[2].trim(),!1),AR(n[3].trim(),r),Vi.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class Gi extends Vi{format(e){if(e||(e=at.sighash),at[e]||st.throwArgumentError("invalid format type","format",e),e===at.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==at.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===at.full?", ":",")+") ",e!==at.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Gi.fromString(e):Gi.fromObject(e)}static fromObject(e){if(Gi.isFunctionFragment(e))return e;e.type!=="function"&&st.throwArgumentError("invalid function object","value",e);let r=_R(e);const n={type:e.type,name:X0(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Nr.fromObject):[],outputs:e.outputs?e.outputs.map(Nr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?te.from(e.gas):null};return new Gi(ou,n)}static fromString(e){let r={type:"function"};e=kR(e,r);let n=e.split(" returns ");n.length>2&&st.throwArgumentError("invalid function string","value",e);let i=n[0].match(Z0);if(i||st.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&X0(r.name),r.inputs=J0(i[2],!1),AR(i[3].trim(),r),n.length>1){let s=n[1].match(Z0);(s[1].trim()!=""||s[3].trim()!="")&&st.throwArgumentError("unexpected tokens","value",e),r.outputs=J0(s[2],!1)}else r.outputs=[];return Gi.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function hS(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&st.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class ao extends Ps{format(e){if(e||(e=at.sighash),at[e]||st.throwArgumentError("invalid format type","format",e),e===at.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==at.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===at.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?ao.fromString(e):ao.fromObject(e)}static fromObject(e){if(ao.isErrorFragment(e))return e;e.type!=="error"&&st.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:X0(e.name),inputs:e.inputs?e.inputs.map(Nr.fromObject):[]};return hS(new ao(ou,r))}static fromString(e){let r={type:"error"},n=e.match(Z0);return n||st.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&X0(r.name),r.inputs=J0(n[2],!1),hS(ao.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function of(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const PK=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function X0(t){return(!t||!t.match(PK))&&st.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const Z0=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function IK(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&mE.throwError("value out-of-bounds",ne.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=wt([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class ly{constructor(e,r,n,i){de(this,"_data",fe(e)),de(this,"wordSize",r||32),de(this,"_coerceFunc",n),de(this,"allowLoose",i),this._offset=0}get data(){return le(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):ly.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:mE.throwError("data out-of-bounds",ne.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new ly(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return te.from(this.readBytes(this.wordSize))}}function TK(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var PR={exports:{}},Tr=PR.exports={},Xs,Zs;function Y5(){throw new Error("setTimeout has not been defined")}function J5(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Xs=setTimeout:Xs=Y5}catch{Xs=Y5}try{typeof clearTimeout=="function"?Zs=clearTimeout:Zs=J5}catch{Zs=J5}})();function IR(t){if(Xs===setTimeout)return setTimeout(t,0);if((Xs===Y5||!Xs)&&setTimeout)return Xs=setTimeout,setTimeout(t,0);try{return Xs(t,0)}catch{try{return Xs.call(null,t,0)}catch{return Xs.call(this,t,0)}}}function OK(t){if(Zs===clearTimeout)return clearTimeout(t);if((Zs===J5||!Zs)&&clearTimeout)return Zs=clearTimeout,clearTimeout(t);try{return Zs(t)}catch{try{return Zs.call(null,t)}catch{return Zs.call(this,t)}}}var Qo=[],Hf=!1,zl,iv=-1;function RK(){!Hf||!zl||(Hf=!1,zl.length?Qo=zl.concat(Qo):iv=-1,Qo.length&&TR())}function TR(){if(!Hf){var t=IR(RK);Hf=!0;for(var e=Qo.length;e;){for(zl=Qo,Qo=[];++iv1)for(var r=1;r>5,this.byteCount=this.blockCount<<2,this.outputBlocks=G>>5,this.extraBytes=(G&31)>>3;for(var J=0;J<50;++J)this.s[J]=0}C.prototype.update=function(_){if(this.finalized)throw new Error(r);var W,G=typeof _;if(G!=="string"){if(G==="object"){if(_===null)throw new Error(e);if(c&&_.constructor===ArrayBuffer)_=new Uint8Array(_);else if(!Array.isArray(_)&&(!c||!ArrayBuffer.isView(_)))throw new Error(e)}else throw new Error(e);W=!0}for(var J=this.blocks,ee=this.byteCount,se=_.length,ie=this.blockCount,oe=0,be=this.s,he,ve;oe>2]|=_[oe]<>2]|=ve<>2]|=(192|ve>>6)<>2]|=(128|ve&63)<=57344?(J[he>>2]|=(224|ve>>12)<>2]|=(128|ve>>6&63)<>2]|=(128|ve&63)<>2]|=(240|ve>>18)<>2]|=(128|ve>>12&63)<>2]|=(128|ve>>6&63)<>2]|=(128|ve&63)<=ee){for(this.start=he-ee,this.block=J[ie],he=0;he>8,G=_&255;G>0;)ee.unshift(G),_=_>>8,G=_&255,++J;return W?ee.push(J):ee.unshift(J),this.update(ee),ee.length},C.prototype.encodeString=function(_){var W,G=typeof _;if(G!=="string"){if(G==="object"){if(_===null)throw new Error(e);if(c&&_.constructor===ArrayBuffer)_=new Uint8Array(_);else if(!Array.isArray(_)&&(!c||!ArrayBuffer.isView(_)))throw new Error(e)}else throw new Error(e);W=!0}var J=0,ee=_.length;if(W)J=ee;else for(var se=0;se<_.length;++se){var ie=_.charCodeAt(se);ie<128?J+=1:ie<2048?J+=2:ie<55296||ie>=57344?J+=3:(ie=65536+((ie&1023)<<10|_.charCodeAt(++se)&1023),J+=4)}return J+=this.encode(J*8),this.update(_),J},C.prototype.bytepad=function(_,W){for(var G=this.encode(W),J=0;J<_.length;++J)G+=this.encodeString(_[J]);var ee=W-G%W,se=[];return se.length=ee,this.update(se),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var _=this.blocks,W=this.lastByteIndex,G=this.blockCount,J=this.s;if(_[W>>2]|=this.padding[W&3],this.lastByteIndex===this.byteCount)for(_[0]=_[G],W=1;W>4&15]+l[oe&15]+l[oe>>12&15]+l[oe>>8&15]+l[oe>>20&15]+l[oe>>16&15]+l[oe>>28&15]+l[oe>>24&15];se%_===0&&(z(W),ee=0)}return J&&(oe=W[ee],ie+=l[oe>>4&15]+l[oe&15],J>1&&(ie+=l[oe>>12&15]+l[oe>>8&15]),J>2&&(ie+=l[oe>>20&15]+l[oe>>16&15])),ie},C.prototype.arrayBuffer=function(){this.finalize();var _=this.blockCount,W=this.s,G=this.outputBlocks,J=this.extraBytes,ee=0,se=0,ie=this.outputBits>>3,oe;J?oe=new ArrayBuffer(G+1<<2):oe=new ArrayBuffer(ie);for(var be=new Uint32Array(oe);se>8&255,ie[oe+2]=be>>16&255,ie[oe+3]=be>>24&255;se%_===0&&z(W)}return J&&(oe=se<<2,be=W[ee],ie[oe]=be&255,J>1&&(ie[oe+1]=be>>8&255),J>2&&(ie[oe+2]=be>>16&255)),ie};function D(_,W,G){C.call(this,_,W,G)}D.prototype=new C,D.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var z=function(_){var W,G,J,ee,se,ie,oe,be,he,ve,$e,ge,Ee,Ue,Ke,Ye,Mo,kt,vt,Gr,gt,_t,dn,Pt,U,T,$,V,Z,re,ce,Ne,Ie,Ae,yt,ke,jt,vl,Bt,Ft,yl,Ut,zt,gl,qt,Wt,bl,Ht,Vt,xl,Gt,Kt,wl,Qt,Yt,El,Jt,Xt,Fa,Ua,za,qa,Wa;for(J=0;J<48;J+=2)ee=_[0]^_[10]^_[20]^_[30]^_[40],se=_[1]^_[11]^_[21]^_[31]^_[41],ie=_[2]^_[12]^_[22]^_[32]^_[42],oe=_[3]^_[13]^_[23]^_[33]^_[43],be=_[4]^_[14]^_[24]^_[34]^_[44],he=_[5]^_[15]^_[25]^_[35]^_[45],ve=_[6]^_[16]^_[26]^_[36]^_[46],$e=_[7]^_[17]^_[27]^_[37]^_[47],ge=_[8]^_[18]^_[28]^_[38]^_[48],Ee=_[9]^_[19]^_[29]^_[39]^_[49],W=ge^(ie<<1|oe>>>31),G=Ee^(oe<<1|ie>>>31),_[0]^=W,_[1]^=G,_[10]^=W,_[11]^=G,_[20]^=W,_[21]^=G,_[30]^=W,_[31]^=G,_[40]^=W,_[41]^=G,W=ee^(be<<1|he>>>31),G=se^(he<<1|be>>>31),_[2]^=W,_[3]^=G,_[12]^=W,_[13]^=G,_[22]^=W,_[23]^=G,_[32]^=W,_[33]^=G,_[42]^=W,_[43]^=G,W=ie^(ve<<1|$e>>>31),G=oe^($e<<1|ve>>>31),_[4]^=W,_[5]^=G,_[14]^=W,_[15]^=G,_[24]^=W,_[25]^=G,_[34]^=W,_[35]^=G,_[44]^=W,_[45]^=G,W=be^(ge<<1|Ee>>>31),G=he^(Ee<<1|ge>>>31),_[6]^=W,_[7]^=G,_[16]^=W,_[17]^=G,_[26]^=W,_[27]^=G,_[36]^=W,_[37]^=G,_[46]^=W,_[47]^=G,W=ve^(ee<<1|se>>>31),G=$e^(se<<1|ee>>>31),_[8]^=W,_[9]^=G,_[18]^=W,_[19]^=G,_[28]^=W,_[29]^=G,_[38]^=W,_[39]^=G,_[48]^=W,_[49]^=G,Ue=_[0],Ke=_[1],Wt=_[11]<<4|_[10]>>>28,bl=_[10]<<4|_[11]>>>28,V=_[20]<<3|_[21]>>>29,Z=_[21]<<3|_[20]>>>29,Ua=_[31]<<9|_[30]>>>23,za=_[30]<<9|_[31]>>>23,Ut=_[40]<<18|_[41]>>>14,zt=_[41]<<18|_[40]>>>14,Ae=_[2]<<1|_[3]>>>31,yt=_[3]<<1|_[2]>>>31,Ye=_[13]<<12|_[12]>>>20,Mo=_[12]<<12|_[13]>>>20,Ht=_[22]<<10|_[23]>>>22,Vt=_[23]<<10|_[22]>>>22,re=_[33]<<13|_[32]>>>19,ce=_[32]<<13|_[33]>>>19,qa=_[42]<<2|_[43]>>>30,Wa=_[43]<<2|_[42]>>>30,Qt=_[5]<<30|_[4]>>>2,Yt=_[4]<<30|_[5]>>>2,ke=_[14]<<6|_[15]>>>26,jt=_[15]<<6|_[14]>>>26,kt=_[25]<<11|_[24]>>>21,vt=_[24]<<11|_[25]>>>21,xl=_[34]<<15|_[35]>>>17,Gt=_[35]<<15|_[34]>>>17,Ne=_[45]<<29|_[44]>>>3,Ie=_[44]<<29|_[45]>>>3,Pt=_[6]<<28|_[7]>>>4,U=_[7]<<28|_[6]>>>4,El=_[17]<<23|_[16]>>>9,Jt=_[16]<<23|_[17]>>>9,vl=_[26]<<25|_[27]>>>7,Bt=_[27]<<25|_[26]>>>7,Gr=_[36]<<21|_[37]>>>11,gt=_[37]<<21|_[36]>>>11,Kt=_[47]<<24|_[46]>>>8,wl=_[46]<<24|_[47]>>>8,gl=_[8]<<27|_[9]>>>5,qt=_[9]<<27|_[8]>>>5,T=_[18]<<20|_[19]>>>12,$=_[19]<<20|_[18]>>>12,Xt=_[29]<<7|_[28]>>>25,Fa=_[28]<<7|_[29]>>>25,Ft=_[38]<<8|_[39]>>>24,yl=_[39]<<8|_[38]>>>24,_t=_[48]<<14|_[49]>>>18,dn=_[49]<<14|_[48]>>>18,_[0]=Ue^~Ye&kt,_[1]=Ke^~Mo&vt,_[10]=Pt^~T&V,_[11]=U^~$&Z,_[20]=Ae^~ke&vl,_[21]=yt^~jt&Bt,_[30]=gl^~Wt&Ht,_[31]=qt^~bl&Vt,_[40]=Qt^~El&Xt,_[41]=Yt^~Jt&Fa,_[2]=Ye^~kt&Gr,_[3]=Mo^~vt>,_[12]=T^~V&re,_[13]=$^~Z&ce,_[22]=ke^~vl&Ft,_[23]=jt^~Bt&yl,_[32]=Wt^~Ht&xl,_[33]=bl^~Vt&Gt,_[42]=El^~Xt&Ua,_[43]=Jt^~Fa&za,_[4]=kt^~Gr&_t,_[5]=vt^~gt&dn,_[14]=V^~re&Ne,_[15]=Z^~ce&Ie,_[24]=vl^~Ft&Ut,_[25]=Bt^~yl&zt,_[34]=Ht^~xl&Kt,_[35]=Vt^~Gt&wl,_[44]=Xt^~Ua&qa,_[45]=Fa^~za&Wa,_[6]=Gr^~_t&Ue,_[7]=gt^~dn&Ke,_[16]=re^~Ne&Pt,_[17]=ce^~Ie&U,_[26]=Ft^~Ut&Ae,_[27]=yl^~zt&yt,_[36]=xl^~Kt&gl,_[37]=Gt^~wl&qt,_[46]=Ua^~qa&Qt,_[47]=za^~Wa&Yt,_[8]=_t^~Ue&Ye,_[9]=dn^~Ke&Mo,_[18]=Ne^~Pt&T,_[19]=Ie^~U&$,_[28]=Ut^~Ae&ke,_[29]=zt^~yt&jt,_[38]=Kt^~gl&Wt,_[39]=wl^~qt&bl,_[48]=qa^~Qt&El,_[49]=Wa^~Yt&Jt,_[0]^=m[J],_[1]^=m[J+1]};if(a)t.exports=w;else for(R=0;R>=8;return e}function mS(t,e,r){let n=0;for(let i=0;ie+1+n&&eo.throwError("child data too short",ne.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function MR(t,e){if(t.length===0&&eo.throwError("data too short",ne.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&eo.throwError("data short segment too short",ne.errors.BUFFER_OVERRUN,{});const n=mS(t,e+1,r);return e+1+r+n>t.length&&eo.throwError("data long segment too short",ne.errors.BUFFER_OVERRUN,{}),vS(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&eo.throwError("data array too short",ne.errors.BUFFER_OVERRUN,{}),vS(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&eo.throwError("data array too short",ne.errors.BUFFER_OVERRUN,{});const n=mS(t,e+1,r);e+1+r+n>t.length&&eo.throwError("data array too short",ne.errors.BUFFER_OVERRUN,{});const i=le(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&eo.throwError("data too short",ne.errors.BUFFER_OVERRUN,{});const n=le(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:le(t[e])}}function eb(t){const e=fe(t),r=MR(e,0);return r.consumed!==e.length&&eo.throwArgumentError("invalid rlp data","data",t),r.result}const NR=Object.freeze(Object.defineProperty({__proto__:null,decode:eb,encode:au},Symbol.toStringTag,{value:"Module"})),jK="address/5.7.0",hc=new ne(jK);function yS(t){qe(t,20)||hc.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=fe(Oe(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const BK=9007199254740991;function FK(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const yE={};for(let t=0;t<10;t++)yE[String(t)]=String(t);for(let t=0;t<26;t++)yE[String.fromCharCode(65+t)]=String(10+t);const gS=Math.floor(FK(BK));function DR(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>yE[n]).join("");for(;e.length>=gS;){let n=e.substring(0,gS);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Be(t){let e=null;if(typeof t!="string"&&hc.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=yS(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&hc.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==DR(t)&&hc.throwArgumentError("bad icap checksum","address",t),e=yK(t.substring(4));e.length<40;)e="0"+e;e=yS("0x"+e)}else hc.throwArgumentError("invalid address","address",t);return e}function gE(t){try{return Be(t),!0}catch{}return!1}function LR(t){let e=gK(Be(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+DR("XE00"+e)+e}function tb(t){let e=null;try{e=Be(t.from)}catch{hc.throwArgumentError("missing from address","transaction",t)}const r=$s(fe(te.from(t.nonce).toHexString()));return Be(rr(Oe(au([e,r])),12))}function jR(t,e,r){return Ls(e)!==32&&hc.throwArgumentError("salt must be 32 bytes","salt",e),Ls(r)!==32&&hc.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Be(rr(Oe(wt(["0xff",Be(t),e,r])),12))}const UK=Object.freeze(Object.defineProperty({__proto__:null,getAddress:Be,getContractAddress:tb,getCreate2Address:jR,getIcapAddress:LR,isAddress:gE},Symbol.toStringTag,{value:"Module"}));class zK extends Ta{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Be(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Be(Ct(e.readValue().toHexString(),20))}}class qK extends Ta{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const Af=new ne(Z1);function BR(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const u=l.localName;return u||Af.throwError("cannot encode object for signature with missing names",ne.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]&&Af.throwError("cannot encode object for signature with duplicate names",ne.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]=!0,r[u]})}else Af.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Af.throwArgumentError("types/value length mismatch","tuple",r);let i=new Q5(t.wordSize),s=new Q5(t.wordSize),o=[];e.forEach((c,l)=>{let u=n[l];if(c.dynamic){let f=s.length;c.encode(s,u);let d=i.writeUpdatableValue();o.push(h=>{d(h+f)})}else c.encode(i,u)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function FR(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),c=n.subReader(a.toNumber());try{o=s.decode(c)}catch(l){if(l.code===ne.errors.BUFFER_OVERRUN)throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===ne.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const c=r[o];c instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw c}}):r[a]=c});for(let s=0;s{throw o}})}return Object.freeze(r)}class WK extends Ta{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Af.throwError("insufficient data length",ne.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===Nn.OVERRUN?r.length-e-1:0}function eQ(t,e,r,n,i){return t===Nn.OVERLONG?(n.push(i),0):(n.push(65533),HR(t,e,r))}const bE=Object.freeze({error:ZK,ignore:HR,replace:eQ});function xE(t,e){e==null&&(e=bE.error),t=fe(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(Nn.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(Nn.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(Nn.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let c=0;c1114111){n+=e(Nn.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(Nn.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(Nn.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function St(t,e=js.current){e!=js.current&&(WR.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return fe(r)}function Rx(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function VR(t,e){return'"'+xE(t,e).map(r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?Rx(r):(r-=65536,Rx((r>>10&1023)+55296)+Rx((r&1023)+56320))}).join("")+'"'}function X5(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function cs(t,e){return X5(xE(t,e))}function e1(t,e=js.current){return xE(St(t,e))}function GR(t){const e=St(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return le(wt([e,uy]).slice(0,32))}function KR(t){const e=fe(t);if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;e[r-1]===0;)r--;return cs(e.slice(0,r))}function tQ(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r{let s=i.split(":");r+=parseInt(s[0],16),n[r]=e(s[1])}),n}function QR(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}function EE(t,e){let r=0;for(let n=0;n=r&&t<=r+i.h&&(t-r)%(i.d||1)===0){if(i.e&&i.e.indexOf(t-r)!==-1)continue;return i}}return null}const rQ=QR("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),nQ="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),iQ=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],sQ=wE("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),oQ=wE("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),aQ=wE("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",tQ),cQ=QR("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function lQ(t){return t.reduce((e,r)=>(r.forEach(n=>{e.push(n)}),e),[])}function uQ(t){return!!EE(t,rQ)}function fQ(t){let e=EE(t,iQ);if(e)return[t+e.s];let r=sQ[t];if(r)return r;let n=oQ[t];if(n)return[t+n[0]];let i=aQ[t];return i||null}function dQ(t){return!!EE(t,cQ)}function YR(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=e1(t);e=lQ(e.map(n=>{if(nQ.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let i=fQ(n);return i||[n]})),e=e1(X5(e),js.NFKC),e.forEach(n=>{if(dQ(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),e.forEach(n=>{if(uQ(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=X5(e);if(r.substring(0,1)==="-"||r.substring(2,4)==="--"||r.substring(r.length-1)==="-")throw new Error("invalid hyphen");return r}const hQ=Object.freeze(Object.defineProperty({__proto__:null,get UnicodeNormalizationForm(){return js},Utf8ErrorFuncs:bE,get Utf8ErrorReason(){return Nn},_toEscapedUtf8String:VR,formatBytes32String:GR,nameprep:YR,parseBytes32String:KR,toUtf8Bytes:St,toUtf8CodePoints:e1,toUtf8String:cs},Symbol.toStringTag,{value:"Module"}));class pQ extends UR{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,St(r))}decode(e){return cs(super.decode(e))}}class nm extends Ta{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return BR(e,this.coders,r)}decode(e){return e.coerce(this.name,FR(e,this.coders))}}const im=new ne(Z1),mQ=new RegExp(/^bytes([0-9]*)$/),vQ=new RegExp(/^(u?int)([0-9]*)$/);class rb{constructor(e){de(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new zK(e.name);case"bool":return new HK(e.name);case"string":return new pQ(e.name);case"bytes":return new VK(e.name);case"array":return new WK(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new nm((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new KK(e.name)}let r=e.type.match(vQ);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&im.throwArgumentError("invalid "+r[1]+" bit length","param",e),new JK(n/8,r[1]==="int",e.name)}if(r=e.type.match(mQ),r){let n=parseInt(r[1]);return(n===0||n>32)&&im.throwArgumentError("invalid bytes length","param",e),new GK(n,e.name)}return im.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new ly(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Q5(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Nr.from(i)));return new nm(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&im.throwError("types/values length mismatch",ne.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(Nr.from(o))),i=new nm(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(Nr.from(o)));return new nm(i,"_").decode(this._getReader(fe(r),n))}}const _n=new rb;function Yo(t){return Oe(St(t))}const JR="hash/5.7.0";function CE(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function yQ(t){const e={};for(let r=0;r>--c&1}const f=31,d=Math.pow(2,f),h=d>>>1,p=h>>1,m=d-1;let v=0;for(let P=0;P1;){let K=M+L>>>1;P>>1|u(),j=j<<1^h,H=(H^h)<<1|h|1;b=j,E=1+H-j}let S=n-4;return y.map(P=>{switch(P-S){case 3:return S+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return S+256+(t[a++]<<8|t[a++]);case 1:return S+t[a++];default:return P-1}})}function bQ(t){let e=0;return()=>t[e++]}function xQ(t){return bQ(gQ(t))}function wQ(t){return t&1?~t>>1:t>>1}function EQ(t,e){let r=Array(t);for(let n=0;ne[o]):r}function SQ(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(AQ(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(_Q(r,t))}return yQ(ZR(e))}function kQ(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function e$(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function AQ(t,e){let r=1+e(),n=e(),i=kQ(e),s=e$(i.length,1+t,e);return ZR(s.map((o,a)=>{const c=o[0],l=o.slice(1);return Array(i[a]).fill(void 0).map((u,f)=>{let d=f*n;return[c+f*r,l.map(h=>h+d)]})}))}function _Q(t,e){let r=1+e();return e$(r,1+t,e).map(i=>[i[0],i.slice(1)])}function PQ(t){let e=fy(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let l=fy(t,e);if(l.length==0)break;n.push({set:new Set(l),node:r()})}n.sort((l,u)=>u.set.size-l.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,c=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:c}}}function IQ(){return xQ(CE("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const nb=IQ(),TQ=new Set(fy(nb)),OQ=new Set(fy(nb)),RQ=SQ(nb),$Q=PQ(nb),xS=45,wS=95;function t$(t){return e1(t)}function MQ(t){return t.filter(e=>e!=65039)}function r$(t){for(let e of t.split(".")){let r=t$(e);try{for(let n=r.lastIndexOf(wS)-1;n>=0;n--)if(r[n]!==wS)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===xS&&r[3]===xS)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function NQ(t){return r$(DQ(t,MQ))}function DQ(t,e){let r=t$(t).reverse(),n=[];for(;r.length;){let i=jQ(r);if(i){n.push(...e(i));continue}let s=r.pop();if(TQ.has(s)){n.push(s);continue}if(OQ.has(s))continue;let o=RQ[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return r$(LQ(String.fromCodePoint(...n)))}function LQ(t){return t.normalize("NFC")}function jQ(t,e){var r;let n=$Q,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let c=t[--a];if(n=(r=n.branches.find(l=>l.set.has(c)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=c;else if(n.check&&c===s)break;o.push(c),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const BQ=new ne(JR),n$=new Uint8Array(32);n$.fill(0);function ES(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function ib(t){const e=St(NQ(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(ES(e.slice(n))),r}function FQ(t){return ib(t).map(e=>cs(e)).join(".")}function i$(t){try{return ib(t).length!==0}catch{}return!1}function Vf(t){typeof t!="string"&&BQ.throwArgumentError("invalid ENS name; not a string","name",t);let e=n$;const r=ib(t);for(;r.length;)e=Oe(wt([e,Oe(r.pop())]));return le(e)}function kE(t){return le(wt(ib(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const s$=`Ethereum Signed Message: -`;function ep(t){return typeof t=="string"&&(t=St(t)),Oe(wt([St(s$),St(String(t.length)),t]))}var UQ=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const cr=new ne(JR),o$=new Uint8Array(32);o$.fill(0);const zQ=te.from(-1),a$=te.from(0),c$=te.from(1),qQ=te.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function WQ(t){const e=fe(t),r=e.length%32;return r?xn([e,o$.slice(r)]):le(e)}const HQ=Ct(c$.toHexString(),32),VQ=Ct(a$.toHexString(),32),CS={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},$x=["name","version","chainId","verifyingContract","salt"];function SS(t){return function(e){return typeof e!="string"&&cr.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const GQ={name:SS("name"),version:SS("version"),chainId:function(t){try{return te.from(t).toString()}catch{}return cr.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Be(t).toLowerCase()}catch{}return cr.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=fe(t);if(e.length!==32)throw new Error("bad length");return le(e)}catch{}return cr.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Mx(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&cr.throwArgumentError("invalid numeric width","type",t);const i=qQ.mask(r?n-1:n),s=r?i.add(c$).mul(zQ):a$;return function(o){const a=te.from(o);return(a.lt(s)||a.gt(i))&&cr.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),Ct(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&cr.throwArgumentError("invalid bytes width","type",t),function(n){return fe(n).length!==r&&cr.throwArgumentError(`invalid length for ${t}`,"value",n),WQ(n)}}}switch(t){case"address":return function(e){return Ct(Be(e),32)};case"bool":return function(e){return e?HQ:VQ};case"bytes":return function(e){return Oe(e)};case"string":return function(e){return Yo(e)}}return null}function kS(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class kr{constructor(e){de(this,"types",Object.freeze(oi(e))),de(this,"_encoderCache",{}),de(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const c={};e[a].forEach(l=>{c[l.name]&&cr.throwArgumentError(`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(a)}`,"types",e),c[l.name]=!0;const u=l.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===a&&cr.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!Mx(u)&&(n[u]||cr.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(a),r[a][u]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?cr.throwArgumentError("missing primary type","types",e):s.length>1&&cr.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),de(this,"primaryType",s[0]);function o(a,c){c[a]&&cr.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),c[a]=!0,Object.keys(r[a]).forEach(l=>{n[l]&&(o(l,c),Object.keys(c).forEach(u=>{i[u][l]=!0}))}),delete c[a]}o(this.primaryType,{});for(const a in i){const c=Object.keys(i[a]);c.sort(),this._types[a]=kS(a,e[a])+c.map(l=>kS(l,e[l])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Mx(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&cr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let c=a.map(s);return this._types[i]&&(c=c.map(Oe)),Oe(xn(c))}}const n=this.types[e];if(n){const i=Yo(this._types[e]);return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return this._types[c]?Oe(l):l});return o.unshift(i),xn(o)}}return cr.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||cr.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Oe(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Mx(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&cr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(c=>this._visit(o,c,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{}):cr.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new kr(e)}static getPrimaryType(e){return kr.from(e).primaryType}static hashStruct(e,r,n){return kr.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=CS[n];i||cr.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>$x.indexOf(n.name)-$x.indexOf(i.name)),kr.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return xn(["0x1901",kr.hashDomain(e),kr.from(r).hash(n)])}static hash(e,r,n){return Oe(kr.encode(e,r,n))}static resolveNames(e,r,n,i){return UQ(this,void 0,void 0,function*(){e=Mt(e);const s={};e.verifyingContract&&!qe(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=kr.from(r);o.visit(n,(a,c)=>(a==="address"&&!qe(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}})}static getPayload(e,r,n){kr.hashDomain(e);const i={},s=[];$x.forEach(c=>{const l=e[c];l!=null&&(i[c]=GQ[c](l),s.push({name:c,type:CS[c]}))});const o=kr.from(r),a=Mt(r);return a.EIP712Domain?cr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return le(fe(l));if(c.match(/^u?int/))return te.from(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return typeof l!="string"&&cr.throwArgumentError("invalid string","value",l),l}return cr.throwArgumentError("unsupported type","type",c)})}}}const KQ=Object.freeze(Object.defineProperty({__proto__:null,_TypedDataEncoder:kr,dnsEncode:kE,ensNormalize:FQ,hashMessage:ep,id:Yo,isValidName:i$,messagePrefix:s$,namehash:Vf},Symbol.toStringTag,{value:"Module"})),ar=new ne(Z1);class AE extends ol{}class _E extends ol{}class QQ extends ol{}class t1 extends ol{static isIndexed(e){return!!(e&&e._isIndexed)}}const YQ={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function AS(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class wr{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,de(this,"fragments",r.map(n=>Ps.from(n)).filter(n=>n!=null)),de(this,"_abiCoder",Ji(new.target,"getAbiCoder")()),de(this,"functions",{}),de(this,"errors",{}),de(this,"events",{}),de(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){ar.warn("duplicate definition - constructor");return}de(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){ar.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||de(this,"deploy",Vi.from({payable:!1,type:"constructor"})),de(this,"_isInterface",!0)}format(e){e||(e=at.full),e===at.sighash&&ar.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===at.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return _n}static getAddress(e){return Be(e)}static getSighash(e){return rr(Yo(e.format()),0,4)}static getEventTopic(e){return Yo(e.format())}getFunction(e){if(qe(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];ar.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?ar.throwArgumentError("no matching function","name",n):i.length>1&&ar.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Gi.fromString(e).format()];return r||ar.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(qe(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];ar.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?ar.throwArgumentError("no matching event","name",n):i.length>1&&ar.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[As.fromString(e).format()];return r||ar.throwArgumentError("no matching event","signature",e),r}getError(e){if(qe(e)){const n=Ji(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}ar.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?ar.throwArgumentError("no matching error","name",n):i.length>1&&ar.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Gi.fromString(e).format()];return r||ar.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return Ji(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Ji(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=fe(r);return le(n.slice(0,4))!==this.getSighash(e)&&ar.throwArgumentError(`data signature does not match error ${e.name}.`,"data",le(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),le(wt([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=fe(r);return le(n.slice(0,4))!==this.getSighash(e)&&ar.throwArgumentError(`data signature does not match function ${e.name}.`,"data",le(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),le(wt([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=fe(r),i=null,s="",o=null,a=null,c=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const l=le(n.slice(0,4)),u=YQ[l];if(u)o=this._abiCoder.decode(u.inputs,n.slice(4)),a=u.name,c=u.signature,u.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const f=this.getError(l);o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,c=f.format()}catch{}break}}return ar.throwError("call revert exception"+s,ne.errors.CALL_EXCEPTION,{method:e.format(),data:le(r),errorArgs:o,errorName:a,errorSignature:c,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),le(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&ar.throwError("too many arguments for "+e.format(),ne.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?Yo(o):s.type==="bytes"?Oe(le(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=te.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),Ct(le(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&ar.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?ar.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&ar.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(Yo(c));else if(o.type==="bytes")n.push(Oe(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let d=this.getEventTopic(e);(!qe(n[0],32)||n[0].toLowerCase()!==d)&&ar.throwError("fragment/topic mismatch",ne.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((d,h)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Nr.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(s.push(d),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,wt(n)):null,c=this._abiCoder.decode(s,r,!0),l=[],u=0,f=0;e.inputs.forEach((d,h)=>{if(d.indexed)if(a==null)l[h]=new t1({_isIndexed:!0,hash:null});else if(o[h])l[h]=new t1({_isIndexed:!0,hash:a[f++]});else try{l[h]=a[f++]}catch(p){l[h]=p}else try{l[h]=c[u++]}catch(p){l[h]=p}if(d.name&&l[d.name]==null){const p=l[h];p instanceof Error?Object.defineProperty(l,d.name,{enumerable:!0,get:()=>{throw AS(`property ${JSON.stringify(d.name)}`,p)}}):l[d.name]=p}});for(let d=0;d{throw AS(`index ${d}`,h)}})}return Object.freeze(l)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new _E({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:te.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new AE({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=le(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new QQ({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const JQ=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:rb,ConstructorFragment:Vi,ErrorFragment:ao,EventFragment:As,FormatTypes:at,Fragment:Ps,FunctionFragment:Gi,Indexed:t1,Interface:wr,LogDescription:AE,ParamType:Nr,TransactionDescription:_E,checkResultErrors:vE,defaultAbiCoder:_n},Symbol.toStringTag,{value:"Module"})),XQ="abstract-provider/5.7.0";var ZQ=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const eY=new ne(XQ);class tY extends ol{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class Ra{constructor(){eY.checkAbstract(new.target,Ra),de(this,"_isProvider",!0)}getFeeData(){return ZQ(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield At({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=te.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const rY="abstract-signer/5.7.0";var ms=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const ji=new ne(rY),nY=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],iY=[ne.errors.INSUFFICIENT_FUNDS,ne.errors.NONCE_EXPIRED,ne.errors.REPLACEMENT_UNDERPRICED];let Dc=class l${constructor(){ji.checkAbstract(new.target,l$),de(this,"_isSigner",!0)}getBalance(e){return ms(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return ms(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return ms(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield At(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return ms(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield At(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return ms(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return ms(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return ms(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return ms(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return ms(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)nY.indexOf(n)===-1&&ji.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Mt(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&ji.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return ms(this,void 0,void 0,function*(){const r=yield At(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>ms(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&ji.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?ji.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&ji.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&ji.throwError("network does not support EIP-1559",ne.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):ji.throwError("failed to get consistent fee data",ne.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(iY.indexOf(i.code)>=0)throw i;return ji.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ne.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&ji.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield At(r)})}_checkProvider(e){this.provider||ji.throwError("missing provider",ne.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};class PE extends Dc{constructor(e,r){super(),de(this,"address",e),de(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{ji.throwError(e,ne.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new PE(this.address,e)}}var u$={},it={},tp=f$;function f$(t,e){if(!t)throw new Error(e||"Assertion failed")}f$.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Z5={exports:{}};typeof Object.create=="function"?Z5.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Z5.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var sY=Z5.exports,oY=tp,aY=sY;it.inherits=aY;function cY(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function lY(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):cY(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}it.htonl=d$;function fY(t,e){for(var r="",n=0;n>>0}return s}it.join32=dY;function hY(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}it.split32=hY;function pY(t,e){return t>>>e|t<<32-e}it.rotr32=pY;function mY(t,e){return t<>>32-e}it.rotl32=mY;function vY(t,e){return t+e>>>0}it.sum32=vY;function yY(t,e,r){return t+e+r>>>0}it.sum32_3=yY;function gY(t,e,r,n){return t+e+r+n>>>0}it.sum32_4=gY;function bY(t,e,r,n,i){return t+e+r+n+i>>>0}it.sum32_5=bY;function xY(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}it.sum64=xY;function wY(t,e,r,n){var i=e+n>>>0,s=(i>>0}it.sum64_hi=wY;function EY(t,e,r,n){var i=e+n;return i>>>0}it.sum64_lo=EY;function CY(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l>>0,c+=l>>0,c+=l>>0}it.sum64_4_hi=CY;function SY(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}it.sum64_4_lo=SY;function kY(t,e,r,n,i,s,o,a,c,l){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}it.sum64_5_hi=kY;function AY(t,e,r,n,i,s,o,a,c,l){var u=e+n+s+a+l;return u>>>0}it.sum64_5_lo=AY;function _Y(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}it.rotr64_hi=_Y;function PY(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}it.rotr64_lo=PY;function IY(t,e,r){return t>>>r}it.shr64_hi=IY;function TY(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}it.shr64_lo=TY;var Dd={},_S=it,OY=tp;function sb(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Dd.BlockHash=sb;sb.prototype.update=function(e,r){if(e=_S.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=_S.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}$o.g0_256=DY;function LY(t){return mo(t,17)^mo(t,19)^t>>>10}$o.g1_256=LY;var fd=it,jY=Dd,BY=$o,Nx=fd.rotl32,Ch=fd.sum32,FY=fd.sum32_5,UY=BY.ft_1,g$=jY.BlockHash,zY=[1518500249,1859775393,2400959708,3395469782];function Co(){if(!(this instanceof Co))return new Co;g$.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}fd.inherits(Co,g$);var qY=Co;Co.blockSize=512;Co.outSize=160;Co.hmacStrength=80;Co.padLength=64;Co.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),TJ(e.length<=this.blockSize);for(var r=e.length;r>8,d=u&255;f?c.push(f,d):c.push(d)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c(d>>1)-1?m=(d>>1)-v:m=v,h.isubn(m)):m=0,f[p]=m,h.iushrn(1)}return f}r.getNAF=n;function i(c,l){var u=[[],[]];c=c.clone(),l=l.clone();for(var f=0,d=0,h;c.cmpn(-f)>0||l.cmpn(-d)>0;){var p=c.andln(3)+f&3,m=l.andln(3)+d&3;p===3&&(p=-1),m===3&&(m=-1);var v;p&1?(h=c.andln(7)+f&7,(h===3||h===5)&&m===2?v=-p:v=p):v=0,u[0].push(v);var y;m&1?(h=l.andln(7)+d&7,(h===3||h===5)&&p===2?y=-m:y=m):y=0,u[1].push(y),2*f===v+1&&(f=1-f),2*d===y+1&&(d=1-d),c.iushrn(1),l.iushrn(1)}return u}r.getJSF=i;function s(c,l,u){var f="_"+l;c.prototype[l]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new ze(c,"hex","le")}r.intFromLE=a}),dy=$i.getNAF,$J=$i.getJSF,hy=$i.assert;function al(t,e){this.type=t,this.p=new ze(e.p,16),this.red=e.prime?ze.red(e.prime):ze.mont(this.p),this.zero=new ze(0).toRed(this.red),this.one=new ze(1).toRed(this.red),this.two=new ze(2).toRed(this.red),this.n=e.n&&new ze(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var _u=al;al.prototype.point=function(){throw new Error("Not implemented")};al.prototype.validate=function(){throw new Error("Not implemented")};al.prototype._fixedNafMul=function(e,r){hy(e.precomputed);var n=e._getDoubles(),i=dy(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var u=o[c];hy(u!==0),e.type==="affine"?u>0?a=a.mixedAdd(s[u-1>>1]):a=a.mixedAdd(s[-u-1>>1].neg()):u>0?a=a.add(s[u-1>>1]):a=a.add(s[-u-1>>1].neg())}return e.type==="affine"?a.toP():a};al.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,u,f,d;for(u=0;u=1;u-=2){var p=u-1,m=u;if(o[p]!==1||o[m]!==1){c[p]=dy(n[p],o[p],this._bitLength),c[m]=dy(n[m],o[m],this._bitLength),l=Math.max(c[p].length,l),l=Math.max(c[m].length,l);continue}var v=[r[p],null,null,r[m]];r[p].y.cmp(r[m].y)===0?(v[1]=r[p].add(r[m]),v[2]=r[p].toJ().mixedAdd(r[m].neg())):r[p].y.cmp(r[m].y.redNeg())===0?(v[1]=r[p].toJ().mixedAdd(r[m]),v[2]=r[p].add(r[m].neg())):(v[1]=r[p].toJ().mixedAdd(r[m]),v[2]=r[p].toJ().mixedAdd(r[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],b=$J(n[p],n[m]);for(l=Math.max(b[0].length,l),c[p]=new Array(l),c[m]=new Array(l),f=0;f=0;u--){for(var L=0;u>=0;){var j=!0;for(f=0;f=0&&L++,P=P.dblp(L),u<0)break;for(f=0;f0?d=a[f][H-1>>1]:H<0&&(d=a[f][-H-1>>1].neg()),d.type==="affine"?P=P.mixedAdd(d):P=P.add(d))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};ls.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(h=l,p=u),f.negative&&(f=f.neg(),d=d.neg()),h.negative&&(h=h.neg(),p=p.neg()),[{a:f,b:d},{a:h,b:p}]};us.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),u=o.mul(i.b),f=e.sub(a).sub(c),d=l.add(u).neg();return{k1:f,k2:d}};us.prototype.pointFromX=function(e,r){e=new ze(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};us.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};us.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Xr.prototype.isInfinity=function(){return this.inf};Xr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Xr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Xr.prototype.getX=function(){return this.x.fromRed()};Xr.prototype.getY=function(){return this.y.fromRed()};Xr.prototype.mul=function(e){return e=new ze(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Xr.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Xr.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Xr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Xr.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Xr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function fn(t,e,r,n){_u.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ze(0)):(this.x=new ze(e,16),this.y=new ze(r,16),this.z=new ze(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}TE(fn,_u.BasePoint);us.prototype.jpoint=function(e,r,n){return new fn(this,e,r,n)};fn.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};fn.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};fn.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),f=u.redMul(c),d=i.redMul(u),h=l.redSqr().redIAdd(f).redISub(d).redISub(d),p=l.redMul(d.redISub(h)).redISub(o.redMul(f)),m=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,p,m)};fn.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),f=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(s.redMul(u)),p=this.z.redMul(a);return this.curve.jpoint(d,h,p)};fn.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};fn.prototype.inspect=function(){return this.isInfinity()?"":""};fn.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var sv=Bd(function(t,e){var r=e;r.base=_u,r.short=NJ,r.mont=null,r.edwards=null}),ov=Bd(function(t,e){var r=e,n=$i.assert;function i(a){a.type==="short"?this.curve=new sv.short(a):a.type==="edwards"?this.curve=new sv.edwards(a):this.curve=new sv.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Yn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Yn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Yn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Yn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Yn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Yn.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Yn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Yn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Lc(t){if(!(this instanceof Lc))return new Lc(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Is.toArray(t.entropy,t.entropyEnc||"hex"),r=Is.toArray(t.nonce,t.nonceEnc||"hex"),n=Is.toArray(t.pers,t.persEnc||"hex");IE(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var T$=Lc;Lc.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Lc.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Is.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var DJ=$i.assert;function ob(t,e){if(t instanceof ob)return t;this._importDER(t,e)||(DJ(t.r&&t.s,"Signature without r or s"),this.r=new ze(t.r,16),this.s=new ze(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var ab=ob;function LJ(){this.place=0}function jx(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function OS(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}ob.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=OS(r),n=OS(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Bx(i,r.length),i=i.concat(r),i.push(2),Bx(i,n.length);var s=i.concat(n),o=[48];return Bx(o,s.length),o=o.concat(s),$i.encode(o,e)};var jJ=function(){throw new Error("unsupported")},O$=$i.assert;function ns(t){if(!(this instanceof ns))return new ns(t);typeof t=="string"&&(O$(Object.prototype.hasOwnProperty.call(ov,t),"Unknown curve "+t),t=ov[t]),t instanceof ov.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var BJ=ns;ns.prototype.keyPair=function(e){return new OE(this,e)};ns.prototype.keyFromPrivate=function(e,r){return OE.fromPrivate(this,e,r)};ns.prototype.keyFromPublic=function(e,r){return OE.fromPublic(this,e,r)};ns.prototype.genKeyPair=function(e){e||(e={});for(var r=new T$({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||jJ(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ze(2));;){var s=new ze(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};ns.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};ns.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ze(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new T$({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new ze(1)),u=0;;u++){var f=i.k?i.k(u):new ze(c.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(l)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var m=f.invm(this.n).mul(p.mul(r.getPrivate()).iadd(e));if(m=m.umod(this.n),m.cmpn(0)!==0){var v=(d.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return i.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),v^=1),new ab({r:p,s:m,recoveryParam:v})}}}}}};ns.prototype.verify=function(e,r,n,i){e=this._truncateToN(new ze(e,16)),n=this.keyFromPublic(n,i),r=new ab(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.eqXToP(s)):(u=this.g.mulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.getX().umod(this.n).cmp(s)===0)};ns.prototype.recoverPubKey=function(t,e,r,n){O$((3&r)===r,"The recovery param is more than two bits"),e=new ab(e,n);var i=this.n,s=new ze(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),d=a.mul(u).umod(i);return this.g.mulAdd(f,o,d)};ns.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new ab(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var FJ=Bd(function(t,e){var r=e;r.version="6.5.4",r.utils=$i,r.rand=function(){throw new Error("unsupported")},r.curve=sv,r.curves=ov,r.ec=BJ,r.eddsa=null}),UJ=FJ.ec;const zJ="signing-key/5.7.0",n6=new ne(zJ);let Fx=null;function to(){return Fx||(Fx=new UJ("secp256k1")),Fx}class kc{constructor(e){de(this,"curve","secp256k1"),de(this,"privateKey",le(e)),Ls(this.privateKey)!==32&&n6.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=to().keyFromPrivate(fe(this.privateKey));de(this,"publicKey","0x"+r.getPublic(!1,"hex")),de(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),de(this,"_isSigningKey",!0)}_addPoint(e){const r=to().keyFromPublic(fe(this.publicKey)),n=to().keyFromPublic(fe(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=to().keyFromPrivate(fe(this.privateKey)),n=fe(e);n.length!==32&&n6.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return sl({recoveryParam:i.recoveryParam,r:Ct("0x"+i.r.toString(16),32),s:Ct("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=to().keyFromPrivate(fe(this.privateKey)),n=to().keyFromPublic(fe(cb(e)));return Ct("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function RE(t,e){const r=sl(e),n={r:fe(r.r),s:fe(r.s)};return"0x"+to().recoverPubKey(fe(t),n,r.recoveryParam).encode("hex",!1)}function cb(t,e){const r=fe(t);if(r.length===32){const n=new kc(r);return e?"0x"+to().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?le(r):"0x"+to().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+to().keyFromPublic(r).getPublic(!0,"hex"):le(r)}return n6.throwArgumentError("invalid public or private key","key","[REDACTED]")}const qJ=Object.freeze(Object.defineProperty({__proto__:null,SigningKey:kc,computePublicKey:cb,recoverPublicKey:RE},Symbol.toStringTag,{value:"Module"})),WJ="transactions/5.7.0",wn=new ne(WJ);var py;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(py||(py={}));function $E(t){return t==="0x"?null:Be(t)}function bn(t){return t==="0x"?or:te.from(t)}const HJ=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],VJ={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function ta(t){const e=cb(t);return Be(rr(Oe(rr(e,1)),12))}function jc(t,e){return ta(RE(fe(t),e))}function vi(t,e){const r=$s(te.from(t).toHexString());return r.length>32&&wn.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function Ux(t,e){return{address:Be(t),storageKeys:(e||[]).map((r,n)=>(Ls(r)!==32&&wn.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function cl(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&wn.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),Ux(r[0],r[1])):Ux(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return Ux(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function R$(t){return cl(t).map(e=>[e.address,e.storageKeys])}function $$(t,e){if(t.gasPrice!=null){const n=te.from(t.gasPrice),i=te.from(t.maxFeePerGas||0);n.eq(i)||wn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[vi(t.chainId||0,"chainId"),vi(t.nonce||0,"nonce"),vi(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),vi(t.maxFeePerGas||0,"maxFeePerGas"),vi(t.gasLimit||0,"gasLimit"),t.to!=null?Be(t.to):"0x",vi(t.value||0,"value"),t.data||"0x",R$(t.accessList||[])];if(e){const n=sl(e);r.push(vi(n.recoveryParam,"recoveryParam")),r.push($s(n.r)),r.push($s(n.s))}return xn(["0x02",au(r)])}function M$(t,e){const r=[vi(t.chainId||0,"chainId"),vi(t.nonce||0,"nonce"),vi(t.gasPrice||0,"gasPrice"),vi(t.gasLimit||0,"gasLimit"),t.to!=null?Be(t.to):"0x",vi(t.value||0,"value"),t.data||"0x",R$(t.accessList||[])];if(e){const n=sl(e);r.push(vi(n.recoveryParam,"recoveryParam")),r.push($s(n.r)),r.push($s(n.s))}return xn(["0x01",au(r)])}function GJ(t,e){Zg(t,VJ);const r=[];HJ.forEach(function(o){let a=t[o.name]||[];const c={};o.numeric&&(c.hexPad="left"),a=fe(le(a,c)),o.length&&a.length!==o.length&&a.length>0&&wn.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a),o.maxLength&&(a=$s(a),a.length>o.maxLength&&wn.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a)),r.push(le(a))});let n=0;if(t.chainId!=null?(n=t.chainId,typeof n!="number"&&wn.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!Ds(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),n!==0&&(r.push(le(n)),r.push("0x"),r.push("0x")),!e)return au(r);const i=sl(e);let s=27+i.recoveryParam;return n!==0?(r.pop(),r.pop(),r.pop(),s+=n*2+8,i.v>28&&i.v!==s&&wn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==s&&wn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(le(s)),r.push($s(fe(i.r))),r.push($s(fe(i.s))),au(r)}function my(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&wn.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),GJ(t,e);switch(t.type){case 1:return M$(t,e);case 2:return $$(t,e)}return wn.throwError(`unsupported transaction type: ${t.type}`,ne.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function N$(t,e,r){try{const n=bn(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{wn.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Ct(e[1],32),t.s=Ct(e[2],32);try{const n=Oe(r(t));t.from=jc(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function KJ(t){const e=eb(t.slice(1));e.length!==9&&e.length!==12&&wn.throwArgumentError("invalid component count for transaction type: 2","payload",le(t));const r=bn(e[2]),n=bn(e[3]),i={type:2,chainId:bn(e[0]).toNumber(),nonce:bn(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:bn(e[4]),to:$E(e[5]),value:bn(e[6]),data:e[7],accessList:cl(e[8])};return e.length===9||(i.hash=Oe(t),N$(i,e.slice(9),$$)),i}function QJ(t){const e=eb(t.slice(1));e.length!==8&&e.length!==11&&wn.throwArgumentError("invalid component count for transaction type: 1","payload",le(t));const r={type:1,chainId:bn(e[0]).toNumber(),nonce:bn(e[1]).toNumber(),gasPrice:bn(e[2]),gasLimit:bn(e[3]),to:$E(e[4]),value:bn(e[5]),data:e[6],accessList:cl(e[7])};return e.length===8||(r.hash=Oe(t),N$(r,e.slice(8),M$)),r}function YJ(t){const e=eb(t);e.length!==9&&e.length!==6&&wn.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:bn(e[0]).toNumber(),gasPrice:bn(e[1]),gasLimit:bn(e[2]),to:$E(e[3]),value:bn(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=te.from(e[6]).toNumber()}catch{return r}if(r.r=Ct(e[7],32),r.s=Ct(e[8],32),te.from(r.r).isZero()&&te.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(le(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Oe(au(i));try{r.from=jc(s,{r:le(r.r),s:le(r.s),recoveryParam:n})}catch{}r.hash=Oe(t)}return r.type=null,r}function ME(t){const e=fe(t);if(e[0]>127)return YJ(e);switch(e[0]){case 1:return QJ(e);case 2:return KJ(e)}return wn.throwError(`unsupported transaction type: ${e[0]}`,ne.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const JJ=Object.freeze(Object.defineProperty({__proto__:null,get TransactionTypes(){return py},accessListify:cl,computeAddress:ta,parse:ME,recoverAddress:jc,serialize:my},Symbol.toStringTag,{value:"Module"})),XJ="contracts/5.7.0";var lu=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Ar=new ne(XJ);function vy(t,e){return lu(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&Ar.throwArgumentError("invalid address or ENS name","name",r);try{return Be(r)}catch{}t||Ar.throwError("a provider or signer is needed to resolve ENS names",ne.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&Ar.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function av(t,e,r){return lu(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>av(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield vy(t,e):r.type==="tuple"?yield av(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>av(t,n,r.arrayChildren))):Promise.reject(Ar.makeError("invalid value for array",ne.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function lb(t,e,r){return lu(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Mt(r.pop())),Ar.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=At({override:vy(t.signer,n.from),signer:t.signer.getAddress()}).then(l=>lu(this,void 0,void 0,function*(){return Be(l.signer)!==l.override&&Ar.throwError("Contract with a Signer cannot override from",ne.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),l.override})):n.from=t.signer.getAddress():n.from&&(n.from=vy(t.provider,n.from));const i=yield At({args:av(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:At(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=te.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=te.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=te.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=te.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=te.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=cl(a.accessList)),o.gasLimit==null&&e.gas!=null){let l=21e3;const u=fe(s);for(let f=0;fn[l]!=null);return c.length&&Ar.throwError(`cannot override ${c.map(l=>JSON.stringify(l)).join(",")}`,ne.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),o})}function ZJ(t,e){return function(...r){return lb(t,e,r)}}function eX(t,e){const r=t.signer||t.provider;return function(...n){return lu(this,void 0,void 0,function*(){r||Ar.throwError("estimate require a provider or signer",ne.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield lb(t,e,n);return yield r.estimateGas(i)})}}function tX(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=oi(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(c,l)=>t.interface.decodeEventLog(a.eventFragment,c,l),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function D$(t,e,r){const n=t.signer||t.provider;return function(...i){return lu(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const c=Mt(i.pop());c.blockTag!=null&&(s=yield c.blockTag),delete c.blockTag,i.push(c)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield lb(t,e,i),a=yield n.call(o,s);try{let c=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(c=c[0]),c}catch(c){throw c.code===ne.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=o),c}})}}function rX(t,e){return function(...r){return lu(this,void 0,void 0,function*(){t.signer||Ar.throwError("sending a transaction requires a signer",ne.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield lb(t,e,r),i=yield t.signer.sendTransaction(n);return tX(t,i),i})}}function RS(t,e,r){return e.constant?D$(t,e,r):rX(t,e)}function L$(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class r1{constructor(e,r){de(this,"tag",e),de(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class nX extends r1{constructor(){super("error",null)}}class $S extends r1{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&Ar.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(L$(s),s),de(this,"address",e),de(this,"interface",r),de(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=vE(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class MS extends r1{constructor(e,r){super("*",{address:e}),de(this,"address",e),de(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class iX{constructor(e,r,n){de(this,"interface",Ji(new.target,"getInterface")(r)),n==null?(de(this,"provider",null),de(this,"signer",null)):Dc.isSigner(n)?(de(this,"provider",n.provider||null),de(this,"signer",n)):Ra.isProvider(n)?(de(this,"provider",n),de(this,"signer",null)):Ar.throwArgumentError("invalid signer or provider","signerOrProvider",n),de(this,"callStatic",{}),de(this,"estimateGas",{}),de(this,"functions",{}),de(this,"populateTransaction",{}),de(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const c=this.interface.events[a];de(this.filters,a,(...l)=>({address:this.address,topics:this.interface.encodeFilterTopics(c,l)})),o[c.name]||(o[c.name]=[]),o[c.name].push(a)}),Object.keys(o).forEach(a=>{const c=o[a];c.length===1?de(this.filters,a,this.filters[c[0]]):Ar.warn(`Duplicate definition of ${a} (${c.join(", ")})`)})}if(de(this,"_runningEvents",{}),de(this,"_wrappedEmits",{}),e==null&&Ar.throwArgumentError("invalid contract address or ENS name","addressOrName",e),de(this,"address",e),this.provider)de(this,"resolvedAddress",vy(this.provider,e));else try{de(this,"resolvedAddress",Promise.resolve(Be(e)))}catch{Ar.throwError("provider is required to use ENS name as contract address",ne.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){Ar.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const c=a.name;i[`%${c}`]||(i[`%${c}`]=[]),i[`%${c}`].push(o)}this[o]==null&&de(this,o,RS(this,a,!0)),this.functions[o]==null&&de(this.functions,o,RS(this,a,!1)),this.callStatic[o]==null&&de(this.callStatic,o,D$(this,a,!0)),this.populateTransaction[o]==null&&de(this.populateTransaction,o,ZJ(this,a)),this.estimateGas[o]==null&&de(this.estimateGas,o,eX(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const c=a[0];try{this[o]==null&&de(this,o,this[c])}catch{}this.functions[o]==null&&de(this.functions,o,this.functions[c]),this.callStatic[o]==null&&de(this.callStatic,o,this.callStatic[c]),this.populateTransaction[o]==null&&de(this.populateTransaction,o,this.populateTransaction[c]),this.estimateGas[o]==null&&de(this.estimateGas,o,this.estimateGas[c])})}static getContractAddress(e){return tb(e)}static getInterface(e){return wr.isInterface(e)?e:new wr(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&Ar.throwError("contract not deployed",ne.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||Ar.throwError("sending a transactions require a signer",ne.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Mt(e||{});return["from","to"].forEach(function(n){r[n]!=null&&Ar.throwError("cannot override "+n,ne.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new PE(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&de(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return t1.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new nX);if(e==="event")return this._normalizeRunningEvent(new r1("event",null));if(e==="*")return this._normalizeRunningEvent(new MS(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new $S(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new $S(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new r1(L$(r),r))}return this._normalizeRunningEvent(new MS(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=oi(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||Ar.throwError("events require a provider or a signer with a provider",ne.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=Mt(i.filter);return typeof r=="string"&&qe(r,32)?(n!=null&&Ar.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class Fd extends iX{}class NE{constructor(e){de(this,"alphabet",e),de(this,"base",e.length),de(this,"_alphabetMap",{}),de(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n>24&255,c[e.length+1]=f>>16&255,c[e.length+2]=f>>8&255,c[e.length+3]=f&255;let d=fe(pd(i,t,c));s||(s=d.length,u=new Uint8Array(s),o=Math.ceil(n/s),l=n-(o-1)*s),u.set(d);for(let m=1;mi)throw new RangeError('The value "'+U+'" is invalid for option "size"');const T=new s(U);return Object.setPrototypeOf(T,u.prototype),T}function u(U,T,$){if(typeof U=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(U)}return f(U,T,$)}u.poolSize=8192;function f(U,T,$){if(typeof U=="string")return m(U,T);if(o.isView(U))return y(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(Vr(U,o)||U&&Vr(U.buffer,o)||typeof a<"u"&&(Vr(U,a)||U&&Vr(U.buffer,a)))return b(U,T,$);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const V=U.valueOf&&U.valueOf();if(V!=null&&V!==U)return u.from(V,T,$);const Z=E(U);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return u.from(U[Symbol.toPrimitive]("string"),T,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}u.from=function(U,T,$){return f(U,T,$)},Object.setPrototypeOf(u.prototype,s.prototype),Object.setPrototypeOf(u,s);function d(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function h(U,T,$){return d(U),U<=0?l(U):T!==void 0?typeof $=="string"?l(U).fill(T,$):l(U).fill(T):l(U)}u.alloc=function(U,T,$){return h(U,T,$)};function p(U){return d(U),l(U<0?0:S(U)|0)}u.allocUnsafe=function(U){return p(U)},u.allocUnsafeSlow=function(U){return p(U)};function m(U,T){if((typeof T!="string"||T==="")&&(T="utf8"),!u.isEncoding(T))throw new TypeError("Unknown encoding: "+T);const $=M(U,T)|0;let V=l($);const Z=V.write(U,T);return Z!==$&&(V=V.slice(0,Z)),V}function v(U){const T=U.length<0?0:S(U.length)|0,$=l(T);for(let V=0;V=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return U|0}function P(U){return+U!=U&&(U=0),u.alloc(+U)}u.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==u.prototype},u.compare=function(T,$){if(Vr(T,s)&&(T=u.from(T,T.offset,T.byteLength)),Vr($,s)&&($=u.from($,$.offset,$.byteLength)),!u.isBuffer(T)||!u.isBuffer($))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===$)return 0;let V=T.length,Z=$.length;for(let re=0,ce=Math.min(V,Z);reZ.length?(u.isBuffer(ce)||(ce=u.from(ce)),ce.copy(Z,re)):s.prototype.set.call(Z,ce,re);else if(u.isBuffer(ce))ce.copy(Z,re);else throw new TypeError('"list" argument must be an Array of Buffers');re+=ce.length}return Z};function M(U,T){if(u.isBuffer(U))return U.length;if(o.isView(U)||Vr(U,o))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const $=U.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&$===0)return 0;let Z=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return Ke(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return At(U).length;default:if(Z)return V?-1:Ke(U).length;T=(""+T).toLowerCase(),Z=!0}}u.byteLength=M;function L(U,T,$){let V=!1;if((T===void 0||T<0)&&(T=0),T>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,T>>>=0,$<=T))return"";for(U||(U="utf8");;)switch(U){case"hex":return C(this,T,$);case"utf8":case"utf-8":return N(this,T,$);case"ascii":return B(this,T,$);case"latin1":case"binary":return I(this,T,$);case"base64":return R(this,T,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,T,$);default:if(V)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),V=!0}}u.prototype._isBuffer=!0;function j(U,T,$){const V=U[T];U[T]=U[$],U[$]=V}u.prototype.swap16=function(){const T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let $=0;$$&&(T+=" ... "),""},n&&(u.prototype[n]=u.prototype.inspect),u.prototype.compare=function(T,$,V,Z,re){if(Vr(T,s)&&(T=u.from(T,T.offset,T.byteLength)),!u.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if($===void 0&&($=0),V===void 0&&(V=T?T.length:0),Z===void 0&&(Z=0),re===void 0&&(re=this.length),$<0||V>T.length||Z<0||re>this.length)throw new RangeError("out of range index");if(Z>=re&&$>=V)return 0;if(Z>=re)return-1;if($>=V)return 1;if($>>>=0,V>>>=0,Z>>>=0,re>>>=0,this===T)return 0;let ce=re-Z,Ne=V-$;const Ie=Math.min(ce,Ne),Ae=this.slice(Z,re),gt=T.slice($,V);for(let ke=0;ke2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,bt($)&&($=Z?0:U.length-1),$<0&&($=U.length+$),$>=U.length){if(Z)return-1;$=U.length-1}else if($<0)if(Z)$=0;else return-1;if(typeof T=="string"&&(T=u.from(T,V)),u.isBuffer(T))return T.length===0?-1:K(U,T,$,V,Z);if(typeof T=="number")return T=T&255,typeof s.prototype.indexOf=="function"?Z?s.prototype.indexOf.call(U,T,$):s.prototype.lastIndexOf.call(U,T,$):K(U,[T],$,V,Z);throw new TypeError("val must be string, number or Buffer")}function K(U,T,$,V,Z){let re=1,ce=U.length,Ne=T.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(U.length<2||T.length<2)return-1;re=2,ce/=2,Ne/=2,$/=2}function Ie(gt,ke){return re===1?gt[ke]:gt.readUInt16BE(ke*re)}let Ae;if(Z){let gt=-1;for(Ae=$;Aece&&($=ce-Ne),Ae=$;Ae>=0;Ae--){let gt=!0;for(let ke=0;keZ&&(V=Z)):V=Z;const re=T.length;V>re/2&&(V=re/2);let ce;for(ce=0;ce>>0,isFinite(V)?(V=V>>>0,Z===void 0&&(Z="utf8")):(Z=V,V=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const re=this.length-$;if((V===void 0||V>re)&&(V=re),T.length>0&&(V<0||$<0)||$>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");let ce=!1;for(;;)switch(Z){case"hex":return Q(this,T,$,V);case"utf8":case"utf-8":return Y(this,T,$,V);case"ascii":case"latin1":case"binary":return F(this,T,$,V);case"base64":return x(this,T,$,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,T,$,V);default:if(ce)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),ce=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(U,T,$){return T===0&&$===U.length?e.fromByteArray(U):e.fromByteArray(U.slice(T,$))}function N(U,T,$){$=Math.min(U.length,$);const V=[];let Z=T;for(;Z<$;){const re=U[Z];let ce=null,Ne=re>239?4:re>223?3:re>191?2:1;if(Z+Ne<=$){let Ie,Ae,gt,ke;switch(Ne){case 1:re<128&&(ce=re);break;case 2:Ie=U[Z+1],(Ie&192)===128&&(ke=(re&31)<<6|Ie&63,ke>127&&(ce=ke));break;case 3:Ie=U[Z+1],Ae=U[Z+2],(Ie&192)===128&&(Ae&192)===128&&(ke=(re&15)<<12|(Ie&63)<<6|Ae&63,ke>2047&&(ke<55296||ke>57343)&&(ce=ke));break;case 4:Ie=U[Z+1],Ae=U[Z+2],gt=U[Z+3],(Ie&192)===128&&(Ae&192)===128&&(gt&192)===128&&(ke=(re&15)<<18|(Ie&63)<<12|(Ae&63)<<6|gt&63,ke>65535&&ke<1114112&&(ce=ke))}}ce===null?(ce=65533,Ne=1):ce>65535&&(ce-=65536,V.push(ce>>>10&1023|55296),ce=56320|ce&1023),V.push(ce),Z+=Ne}return O(V)}const A=4096;function O(U){const T=U.length;if(T<=A)return String.fromCharCode.apply(String,U);let $="",V=0;for(;VV)&&($=V);let Z="";for(let re=T;re<$;++re)Z+=Pt[U[re]];return Z}function D(U,T,$){const V=U.slice(T,$);let Z="";for(let re=0;reV&&(T=V),$<0?($+=V,$<0&&($=0)):$>V&&($=V),$$)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(T,$,V){T=T>>>0,$=$>>>0,V||z(T,$,this.length);let Z=this[T],re=1,ce=0;for(;++ce<$&&(re*=256);)Z+=this[T+ce]*re;return Z},u.prototype.readUintBE=u.prototype.readUIntBE=function(T,$,V){T=T>>>0,$=$>>>0,V||z(T,$,this.length);let Z=this[T+--$],re=1;for(;$>0&&(re*=256);)Z+=this[T+--$]*re;return Z},u.prototype.readUint8=u.prototype.readUInt8=function(T,$){return T=T>>>0,$||z(T,1,this.length),this[T]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(T,$){return T=T>>>0,$||z(T,2,this.length),this[T]|this[T+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(T,$){return T=T>>>0,$||z(T,2,this.length),this[T]<<8|this[T+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(T,$){return T=T>>>0,$||z(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(T,$){return T=T>>>0,$||z(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},u.prototype.readBigUInt64LE=dn(function(T){T=T>>>0,$e(T,"offset");const $=this[T],V=this[T+7];($===void 0||V===void 0)&&ge(T,this.length-8);const Z=$+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,re=this[++T]+this[++T]*2**8+this[++T]*2**16+V*2**24;return BigInt(Z)+(BigInt(re)<>>0,$e(T,"offset");const $=this[T],V=this[T+7];($===void 0||V===void 0)&&ge(T,this.length-8);const Z=$*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],re=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+V;return(BigInt(Z)<>>0,$=$>>>0,V||z(T,$,this.length);let Z=this[T],re=1,ce=0;for(;++ce<$&&(re*=256);)Z+=this[T+ce]*re;return re*=128,Z>=re&&(Z-=Math.pow(2,8*$)),Z},u.prototype.readIntBE=function(T,$,V){T=T>>>0,$=$>>>0,V||z(T,$,this.length);let Z=$,re=1,ce=this[T+--Z];for(;Z>0&&(re*=256);)ce+=this[T+--Z]*re;return re*=128,ce>=re&&(ce-=Math.pow(2,8*$)),ce},u.prototype.readInt8=function(T,$){return T=T>>>0,$||z(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},u.prototype.readInt16LE=function(T,$){T=T>>>0,$||z(T,2,this.length);const V=this[T]|this[T+1]<<8;return V&32768?V|4294901760:V},u.prototype.readInt16BE=function(T,$){T=T>>>0,$||z(T,2,this.length);const V=this[T+1]|this[T]<<8;return V&32768?V|4294901760:V},u.prototype.readInt32LE=function(T,$){return T=T>>>0,$||z(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},u.prototype.readInt32BE=function(T,$){return T=T>>>0,$||z(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},u.prototype.readBigInt64LE=dn(function(T){T=T>>>0,$e(T,"offset");const $=this[T],V=this[T+7];($===void 0||V===void 0)&&ge(T,this.length-8);const Z=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(V<<24);return(BigInt(Z)<>>0,$e(T,"offset");const $=this[T],V=this[T+7];($===void 0||V===void 0)&&ge(T,this.length-8);const Z=($<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(Z)<>>0,$||z(T,4,this.length),r.read(this,T,!0,23,4)},u.prototype.readFloatBE=function(T,$){return T=T>>>0,$||z(T,4,this.length),r.read(this,T,!1,23,4)},u.prototype.readDoubleLE=function(T,$){return T=T>>>0,$||z(T,8,this.length),r.read(this,T,!0,52,8)},u.prototype.readDoubleBE=function(T,$){return T=T>>>0,$||z(T,8,this.length),r.read(this,T,!1,52,8)};function _(U,T,$,V,Z,re){if(!u.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>Z||TU.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(T,$,V,Z){if(T=+T,$=$>>>0,V=V>>>0,!Z){const Ne=Math.pow(2,8*V)-1;_(this,T,$,V,Ne,0)}let re=1,ce=0;for(this[$]=T&255;++ce>>0,V=V>>>0,!Z){const Ne=Math.pow(2,8*V)-1;_(this,T,$,V,Ne,0)}let re=V-1,ce=1;for(this[$+re]=T&255;--re>=0&&(ce*=256);)this[$+re]=T/ce&255;return $+V},u.prototype.writeUint8=u.prototype.writeUInt8=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,1,255,0),this[$]=T&255,$+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,2,65535,0),this[$]=T&255,this[$+1]=T>>>8,$+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,2,65535,0),this[$]=T>>>8,this[$+1]=T&255,$+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,4,4294967295,0),this[$+3]=T>>>24,this[$+2]=T>>>16,this[$+1]=T>>>8,this[$]=T&255,$+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,4,4294967295,0),this[$]=T>>>24,this[$+1]=T>>>16,this[$+2]=T>>>8,this[$+3]=T&255,$+4};function W(U,T,$,V,Z){ve(T,V,Z,U,$,7);let re=Number(T&BigInt(4294967295));U[$++]=re,re=re>>8,U[$++]=re,re=re>>8,U[$++]=re,re=re>>8,U[$++]=re;let ce=Number(T>>BigInt(32)&BigInt(4294967295));return U[$++]=ce,ce=ce>>8,U[$++]=ce,ce=ce>>8,U[$++]=ce,ce=ce>>8,U[$++]=ce,$}function G(U,T,$,V,Z){ve(T,V,Z,U,$,7);let re=Number(T&BigInt(4294967295));U[$+7]=re,re=re>>8,U[$+6]=re,re=re>>8,U[$+5]=re,re=re>>8,U[$+4]=re;let ce=Number(T>>BigInt(32)&BigInt(4294967295));return U[$+3]=ce,ce=ce>>8,U[$+2]=ce,ce=ce>>8,U[$+1]=ce,ce=ce>>8,U[$]=ce,$+8}u.prototype.writeBigUInt64LE=dn(function(T,$=0){return W(this,T,$,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=dn(function(T,$=0){return G(this,T,$,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(T,$,V,Z){if(T=+T,$=$>>>0,!Z){const Ie=Math.pow(2,8*V-1);_(this,T,$,V,Ie-1,-Ie)}let re=0,ce=1,Ne=0;for(this[$]=T&255;++re>0)-Ne&255;return $+V},u.prototype.writeIntBE=function(T,$,V,Z){if(T=+T,$=$>>>0,!Z){const Ie=Math.pow(2,8*V-1);_(this,T,$,V,Ie-1,-Ie)}let re=V-1,ce=1,Ne=0;for(this[$+re]=T&255;--re>=0&&(ce*=256);)T<0&&Ne===0&&this[$+re+1]!==0&&(Ne=1),this[$+re]=(T/ce>>0)-Ne&255;return $+V},u.prototype.writeInt8=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,1,127,-128),T<0&&(T=255+T+1),this[$]=T&255,$+1},u.prototype.writeInt16LE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,2,32767,-32768),this[$]=T&255,this[$+1]=T>>>8,$+2},u.prototype.writeInt16BE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,2,32767,-32768),this[$]=T>>>8,this[$+1]=T&255,$+2},u.prototype.writeInt32LE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,4,2147483647,-2147483648),this[$]=T&255,this[$+1]=T>>>8,this[$+2]=T>>>16,this[$+3]=T>>>24,$+4},u.prototype.writeInt32BE=function(T,$,V){return T=+T,$=$>>>0,V||_(this,T,$,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[$]=T>>>24,this[$+1]=T>>>16,this[$+2]=T>>>8,this[$+3]=T&255,$+4},u.prototype.writeBigInt64LE=dn(function(T,$=0){return W(this,T,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=dn(function(T,$=0){return G(this,T,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function J(U,T,$,V,Z,re){if($+V>U.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function ee(U,T,$,V,Z){return T=+T,$=$>>>0,Z||J(U,T,$,4),r.write(U,T,$,V,23,4),$+4}u.prototype.writeFloatLE=function(T,$,V){return ee(this,T,$,!0,V)},u.prototype.writeFloatBE=function(T,$,V){return ee(this,T,$,!1,V)};function se(U,T,$,V,Z){return T=+T,$=$>>>0,Z||J(U,T,$,8),r.write(U,T,$,V,52,8),$+8}u.prototype.writeDoubleLE=function(T,$,V){return se(this,T,$,!0,V)},u.prototype.writeDoubleBE=function(T,$,V){return se(this,T,$,!1,V)},u.prototype.copy=function(T,$,V,Z){if(!u.isBuffer(T))throw new TypeError("argument should be a Buffer");if(V||(V=0),!Z&&Z!==0&&(Z=this.length),$>=T.length&&($=T.length),$||($=0),Z>0&&Z=this.length)throw new RangeError("Index out of range");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),T.length-$>>0,V=V===void 0?this.length:V>>>0,T||(T=0);let re;if(typeof T=="number")for(re=$;re2**32?Z=be(String($)):typeof $=="bigint"&&(Z=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(Z=be(Z)),Z+="n"),V+=` It must be ${T}. Received ${Z}`,V},RangeError);function be(U){let T="",$=U.length;const V=U[0]==="-"?1:0;for(;$>=V+4;$-=3)T=`_${U.slice($-3,$)}${T}`;return`${U.slice(0,$)}${T}`}function he(U,T,$){$e(T,"offset"),(U[T]===void 0||U[T+$]===void 0)&&ge(T,U.length-($+1))}function ve(U,T,$,V,Z,re){if(U>$||U3?T===0||T===BigInt(0)?Ne=`>= 0${ce} and < 2${ce} ** ${(re+1)*8}${ce}`:Ne=`>= -(2${ce} ** ${(re+1)*8-1}${ce}) and < 2 ** ${(re+1)*8-1}${ce}`:Ne=`>= ${T}${ce} and <= ${$}${ce}`,new ie.ERR_OUT_OF_RANGE("value",Ne,U)}he(V,Z,re)}function $e(U,T){if(typeof U!="number")throw new ie.ERR_INVALID_ARG_TYPE(T,"number",U)}function ge(U,T,$){throw Math.floor(U)!==U?($e(U,$),new ie.ERR_OUT_OF_RANGE($||"offset","an integer",U)):T<0?new ie.ERR_BUFFER_OUT_OF_BOUNDS:new ie.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${T}`,U)}const Ee=/[^+/0-9A-Za-z-_]/g;function Ue(U){if(U=U.split("=")[0],U=U.trim().replace(Ee,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function Ke(U,T){T=T||1/0;let $;const V=U.length;let Z=null;const re=[];for(let ce=0;ce55295&&$<57344){if(!Z){if($>56319){(T-=3)>-1&&re.push(239,191,189);continue}else if(ce+1===V){(T-=3)>-1&&re.push(239,191,189);continue}Z=$;continue}if($<56320){(T-=3)>-1&&re.push(239,191,189),Z=$;continue}$=(Z-55296<<10|$-56320)+65536}else Z&&(T-=3)>-1&&re.push(239,191,189);if(Z=null,$<128){if((T-=1)<0)break;re.push($)}else if($<2048){if((T-=2)<0)break;re.push($>>6|192,$&63|128)}else if($<65536){if((T-=3)<0)break;re.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((T-=4)<0)break;re.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return re}function Ye(U){const T=[];for(let $=0;$>8,Z=$%256,re.push(Z),re.push(V);return re}function At(U){return e.toByteArray(Ue(U))}function yt(U,T,$,V){let Z;for(Z=0;Z=T.length||Z>=U.length);++Z)T[Z+$]=U[Z];return Z}function Vr(U,T){return U instanceof T||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===T.name}function bt(U){return U!==U}const Pt=function(){const U="0123456789abcdef",T=new Array(256);for(let $=0;$<16;++$){const V=$*16;for(let Z=0;Z<16;++Z)T[V+Z]=U[$]+U[Z]}return T}();function dn(U){return typeof BigInt>"u"?It:U}function It(){throw new Error("BigInt not supported")}})(Wr);const Zc=Wr.Buffer,EG=Wr.Blob,CG=Wr.BlobOptions,SG=Wr.Buffer,kG=Wr.File,AG=Wr.FileOptions,_G=Wr.INSPECT_MAX_BYTES,PG=Wr.SlowBuffer,IG=Wr.TranscodeEncoding,TG=Wr.atob,OG=Wr.btoa,RG=Wr.constants,$G=Wr.isAscii,MG=Wr.isUtf8,NG=Wr.kMaxLength,DG=Wr.kStringMaxLength,LG=Wr.resolveObjectURL,jG=Wr.transcode,BG=Object.freeze(Object.defineProperty({__proto__:null,Blob:EG,BlobOptions:CG,Buffer:SG,File:kG,FileOptions:AG,INSPECT_MAX_BYTES:_G,SlowBuffer:PG,TranscodeEncoding:IG,atob:TG,btoa:OG,constants:RG,default:Zc,isAscii:$G,isUtf8:MG,kMaxLength:NG,kStringMaxLength:DG,resolveObjectURL:LG,transcode:jG},Symbol.toStringTag,{value:"Module"})),FG=wr(BG);J8.exports;(function(t){(function(e,r){function n(F,x){if(!F)throw new Error(x||"Assertion failed")}function i(F,x){F.super_=x;var k=function(){};k.prototype=x.prototype,F.prototype=new k,F.prototype.constructor=F}function s(F,x,k){if(s.isBN(F))return F;this.negative=0,this.words=null,this.length=0,this.red=null,F!==null&&((x==="le"||x==="be")&&(k=x,x=10),this._init(F||0,x||10,k||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=FG.Buffer}catch{}s.isBN=function(x){return x instanceof s?!0:x!==null&&typeof x=="object"&&x.constructor.wordSize===s.wordSize&&Array.isArray(x.words)},s.max=function(x,k){return x.cmp(k)>0?x:k},s.min=function(x,k){return x.cmp(k)<0?x:k},s.prototype._init=function(x,k,R){if(typeof x=="number")return this._initNumber(x,k,R);if(typeof x=="object")return this._initArray(x,k,R);k==="hex"&&(k=16),n(k===(k|0)&&k>=2&&k<=36),x=x.toString().replace(/\s+/g,"");var N=0;x[0]==="-"&&(N++,this.negative=1),N=0;N-=3)O=x[N]|x[N-1]<<8|x[N-2]<<16,this.words[A]|=O<>>26-B&67108863,B+=24,B>=26&&(B-=26,A++);else if(R==="le")for(N=0,A=0;N>>26-B&67108863,B+=24,B>=26&&(B-=26,A++);return this._strip()};function a(F,x){var k=F.charCodeAt(x);if(k>=48&&k<=57)return k-48;if(k>=65&&k<=70)return k-55;if(k>=97&&k<=102)return k-87;n(!1,"Invalid character in "+F)}function c(F,x,k){var R=a(F,k);return k-1>=x&&(R|=a(F,k-1)<<4),R}s.prototype._parseHex=function(x,k,R){this.length=Math.ceil((x.length-k)/6),this.words=new Array(this.length);for(var N=0;N=k;N-=2)B=c(x,k,N)<=18?(A-=18,O+=1,this.words[O]|=B>>>26):A+=8;else{var I=x.length-k;for(N=I%2===0?k+1:k;N=18?(A-=18,O+=1,this.words[O]|=B>>>26):A+=8}this._strip()};function l(F,x,k,R){for(var N=0,A=0,O=Math.min(F.length,k),B=x;B=49?A=I-49+10:I>=17?A=I-17+10:A=I,n(I>=0&&A1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(x,k){x=x||10,k=k|0||1;var R;if(x===16||x==="hex"){R="";for(var N=0,A=0,O=0;O>>24-N&16777215,N+=2,N>=26&&(N-=26,O--),A!==0||O!==this.length-1?R=d[6-I.length]+I+R:R=I+R}for(A!==0&&(R=A.toString(16)+R);R.length%k!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}if(x===(x|0)&&x>=2&&x<=36){var C=h[x],D=p[x];R="";var z=this.clone();for(z.negative=0;!z.isZero();){var _=z.modrn(D).toString(x);z=z.idivn(D),z.isZero()?R=_+R:R=d[C-_.length]+_+R}for(this.isZero()&&(R="0"+R);R.length%k!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var x=this.words[0];return this.length===2?x+=this.words[1]*67108864:this.length===3&&this.words[2]===1?x+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-x:x},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(x,k){return this.toArrayLike(o,x,k)}),s.prototype.toArray=function(x,k){return this.toArrayLike(Array,x,k)};var m=function(x,k){return x.allocUnsafe?x.allocUnsafe(k):new x(k)};s.prototype.toArrayLike=function(x,k,R){this._strip();var N=this.byteLength(),A=R||Math.max(1,N);n(N<=A,"byte array longer than desired length"),n(A>0,"Requested array length <= 0");var O=m(x,A),B=k==="le"?"LE":"BE";return this["_toArrayLike"+B](O,N),O},s.prototype._toArrayLikeLE=function(x,k){for(var R=0,N=0,A=0,O=0;A>8&255),R>16&255),O===6?(R>24&255),N=0,O=0):(N=B>>>24,O+=2)}if(R=0&&(x[R--]=B>>8&255),R>=0&&(x[R--]=B>>16&255),O===6?(R>=0&&(x[R--]=B>>24&255),N=0,O=0):(N=B>>>24,O+=2)}if(R>=0)for(x[R--]=N;R>=0;)x[R--]=0},Math.clz32?s.prototype._countBits=function(x){return 32-Math.clz32(x)}:s.prototype._countBits=function(x){var k=x,R=0;return k>=4096&&(R+=13,k>>>=13),k>=64&&(R+=7,k>>>=7),k>=8&&(R+=4,k>>>=4),k>=2&&(R+=2,k>>>=2),R+k},s.prototype._zeroBits=function(x){if(x===0)return 26;var k=x,R=0;return k&8191||(R+=13,k>>>=13),k&127||(R+=7,k>>>=7),k&15||(R+=4,k>>>=4),k&3||(R+=2,k>>>=2),k&1||R++,R},s.prototype.bitLength=function(){var x=this.words[this.length-1],k=this._countBits(x);return(this.length-1)*26+k};function v(F){for(var x=new Array(F.bitLength()),k=0;k>>N&1}return x}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var x=0,k=0;kx.length?this.clone().ior(x):x.clone().ior(this)},s.prototype.uor=function(x){return this.length>x.length?this.clone().iuor(x):x.clone().iuor(this)},s.prototype.iuand=function(x){var k;this.length>x.length?k=x:k=this;for(var R=0;Rx.length?this.clone().iand(x):x.clone().iand(this)},s.prototype.uand=function(x){return this.length>x.length?this.clone().iuand(x):x.clone().iuand(this)},s.prototype.iuxor=function(x){var k,R;this.length>x.length?(k=this,R=x):(k=x,R=this);for(var N=0;Nx.length?this.clone().ixor(x):x.clone().ixor(this)},s.prototype.uxor=function(x){return this.length>x.length?this.clone().iuxor(x):x.clone().iuxor(this)},s.prototype.inotn=function(x){n(typeof x=="number"&&x>=0);var k=Math.ceil(x/26)|0,R=x%26;this._expand(k),R>0&&k--;for(var N=0;N0&&(this.words[N]=~this.words[N]&67108863>>26-R),this._strip()},s.prototype.notn=function(x){return this.clone().inotn(x)},s.prototype.setn=function(x,k){n(typeof x=="number"&&x>=0);var R=x/26|0,N=x%26;return this._expand(R+1),k?this.words[R]=this.words[R]|1<x.length?(R=this,N=x):(R=x,N=this);for(var A=0,O=0;O>>26;for(;A!==0&&O>>26;if(this.length=R.length,A!==0)this.words[this.length]=A,this.length++;else if(R!==this)for(;Ox.length?this.clone().iadd(x):x.clone().iadd(this)},s.prototype.isub=function(x){if(x.negative!==0){x.negative=0;var k=this.iadd(x);return x.negative=1,k._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(x),this.negative=1,this._normSign();var R=this.cmp(x);if(R===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,A;R>0?(N=this,A=x):(N=x,A=this);for(var O=0,B=0;B>26,this.words[B]=k&67108863;for(;O!==0&&B>26,this.words[B]=k&67108863;if(O===0&&B>>26,z=I&67108863,_=Math.min(C,x.length-1),W=Math.max(0,C-F.length+1);W<=_;W++){var G=C-W|0;N=F.words[G]|0,A=x.words[W]|0,O=N*A+z,D+=O/67108864|0,z=O&67108863}k.words[C]=z|0,I=D|0}return I!==0?k.words[C]=I|0:k.length--,k._strip()}var b=function(x,k,R){var N=x.words,A=k.words,O=R.words,B=0,I,C,D,z=N[0]|0,_=z&8191,W=z>>>13,G=N[1]|0,J=G&8191,ee=G>>>13,se=N[2]|0,ie=se&8191,oe=se>>>13,be=N[3]|0,he=be&8191,ve=be>>>13,$e=N[4]|0,ge=$e&8191,Ee=$e>>>13,Ue=N[5]|0,Ke=Ue&8191,Ye=Ue>>>13,Ro=N[6]|0,At=Ro&8191,yt=Ro>>>13,Vr=N[7]|0,bt=Vr&8191,Pt=Vr>>>13,dn=N[8]|0,It=dn&8191,U=dn>>>13,T=N[9]|0,$=T&8191,V=T>>>13,Z=A[0]|0,re=Z&8191,ce=Z>>>13,Ne=A[1]|0,Ie=Ne&8191,Ae=Ne>>>13,gt=A[2]|0,ke=gt&8191,jt=gt>>>13,ul=A[3]|0,Bt=ul&8191,Ft=ul>>>13,fl=A[4]|0,Ut=fl&8191,zt=fl>>>13,dl=A[5]|0,qt=dl&8191,Wt=dl>>>13,hl=A[6]|0,Ht=hl&8191,Vt=hl>>>13,pl=A[7]|0,Gt=pl&8191,Kt=pl>>>13,ml=A[8]|0,Qt=ml&8191,Yt=ml>>>13,vl=A[9]|0,Jt=vl&8191,Xt=vl>>>13;R.negative=x.negative^k.negative,R.length=19,I=Math.imul(_,re),C=Math.imul(_,ce),C=C+Math.imul(W,re)|0,D=Math.imul(W,ce);var Da=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(Da>>>26)|0,Da&=67108863,I=Math.imul(J,re),C=Math.imul(J,ce),C=C+Math.imul(ee,re)|0,D=Math.imul(ee,ce),I=I+Math.imul(_,Ie)|0,C=C+Math.imul(_,Ae)|0,C=C+Math.imul(W,Ie)|0,D=D+Math.imul(W,Ae)|0;var La=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(La>>>26)|0,La&=67108863,I=Math.imul(ie,re),C=Math.imul(ie,ce),C=C+Math.imul(oe,re)|0,D=Math.imul(oe,ce),I=I+Math.imul(J,Ie)|0,C=C+Math.imul(J,Ae)|0,C=C+Math.imul(ee,Ie)|0,D=D+Math.imul(ee,Ae)|0,I=I+Math.imul(_,ke)|0,C=C+Math.imul(_,jt)|0,C=C+Math.imul(W,ke)|0,D=D+Math.imul(W,jt)|0;var ja=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(ja>>>26)|0,ja&=67108863,I=Math.imul(he,re),C=Math.imul(he,ce),C=C+Math.imul(ve,re)|0,D=Math.imul(ve,ce),I=I+Math.imul(ie,Ie)|0,C=C+Math.imul(ie,Ae)|0,C=C+Math.imul(oe,Ie)|0,D=D+Math.imul(oe,Ae)|0,I=I+Math.imul(J,ke)|0,C=C+Math.imul(J,jt)|0,C=C+Math.imul(ee,ke)|0,D=D+Math.imul(ee,jt)|0,I=I+Math.imul(_,Bt)|0,C=C+Math.imul(_,Ft)|0,C=C+Math.imul(W,Bt)|0,D=D+Math.imul(W,Ft)|0;var Ba=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,I=Math.imul(ge,re),C=Math.imul(ge,ce),C=C+Math.imul(Ee,re)|0,D=Math.imul(Ee,ce),I=I+Math.imul(he,Ie)|0,C=C+Math.imul(he,Ae)|0,C=C+Math.imul(ve,Ie)|0,D=D+Math.imul(ve,Ae)|0,I=I+Math.imul(ie,ke)|0,C=C+Math.imul(ie,jt)|0,C=C+Math.imul(oe,ke)|0,D=D+Math.imul(oe,jt)|0,I=I+Math.imul(J,Bt)|0,C=C+Math.imul(J,Ft)|0,C=C+Math.imul(ee,Bt)|0,D=D+Math.imul(ee,Ft)|0,I=I+Math.imul(_,Ut)|0,C=C+Math.imul(_,zt)|0,C=C+Math.imul(W,Ut)|0,D=D+Math.imul(W,zt)|0;var Fa=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,I=Math.imul(Ke,re),C=Math.imul(Ke,ce),C=C+Math.imul(Ye,re)|0,D=Math.imul(Ye,ce),I=I+Math.imul(ge,Ie)|0,C=C+Math.imul(ge,Ae)|0,C=C+Math.imul(Ee,Ie)|0,D=D+Math.imul(Ee,Ae)|0,I=I+Math.imul(he,ke)|0,C=C+Math.imul(he,jt)|0,C=C+Math.imul(ve,ke)|0,D=D+Math.imul(ve,jt)|0,I=I+Math.imul(ie,Bt)|0,C=C+Math.imul(ie,Ft)|0,C=C+Math.imul(oe,Bt)|0,D=D+Math.imul(oe,Ft)|0,I=I+Math.imul(J,Ut)|0,C=C+Math.imul(J,zt)|0,C=C+Math.imul(ee,Ut)|0,D=D+Math.imul(ee,zt)|0,I=I+Math.imul(_,qt)|0,C=C+Math.imul(_,Wt)|0,C=C+Math.imul(W,qt)|0,D=D+Math.imul(W,Wt)|0;var I2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(I2>>>26)|0,I2&=67108863,I=Math.imul(At,re),C=Math.imul(At,ce),C=C+Math.imul(yt,re)|0,D=Math.imul(yt,ce),I=I+Math.imul(Ke,Ie)|0,C=C+Math.imul(Ke,Ae)|0,C=C+Math.imul(Ye,Ie)|0,D=D+Math.imul(Ye,Ae)|0,I=I+Math.imul(ge,ke)|0,C=C+Math.imul(ge,jt)|0,C=C+Math.imul(Ee,ke)|0,D=D+Math.imul(Ee,jt)|0,I=I+Math.imul(he,Bt)|0,C=C+Math.imul(he,Ft)|0,C=C+Math.imul(ve,Bt)|0,D=D+Math.imul(ve,Ft)|0,I=I+Math.imul(ie,Ut)|0,C=C+Math.imul(ie,zt)|0,C=C+Math.imul(oe,Ut)|0,D=D+Math.imul(oe,zt)|0,I=I+Math.imul(J,qt)|0,C=C+Math.imul(J,Wt)|0,C=C+Math.imul(ee,qt)|0,D=D+Math.imul(ee,Wt)|0,I=I+Math.imul(_,Ht)|0,C=C+Math.imul(_,Vt)|0,C=C+Math.imul(W,Ht)|0,D=D+Math.imul(W,Vt)|0;var T2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(T2>>>26)|0,T2&=67108863,I=Math.imul(bt,re),C=Math.imul(bt,ce),C=C+Math.imul(Pt,re)|0,D=Math.imul(Pt,ce),I=I+Math.imul(At,Ie)|0,C=C+Math.imul(At,Ae)|0,C=C+Math.imul(yt,Ie)|0,D=D+Math.imul(yt,Ae)|0,I=I+Math.imul(Ke,ke)|0,C=C+Math.imul(Ke,jt)|0,C=C+Math.imul(Ye,ke)|0,D=D+Math.imul(Ye,jt)|0,I=I+Math.imul(ge,Bt)|0,C=C+Math.imul(ge,Ft)|0,C=C+Math.imul(Ee,Bt)|0,D=D+Math.imul(Ee,Ft)|0,I=I+Math.imul(he,Ut)|0,C=C+Math.imul(he,zt)|0,C=C+Math.imul(ve,Ut)|0,D=D+Math.imul(ve,zt)|0,I=I+Math.imul(ie,qt)|0,C=C+Math.imul(ie,Wt)|0,C=C+Math.imul(oe,qt)|0,D=D+Math.imul(oe,Wt)|0,I=I+Math.imul(J,Ht)|0,C=C+Math.imul(J,Vt)|0,C=C+Math.imul(ee,Ht)|0,D=D+Math.imul(ee,Vt)|0,I=I+Math.imul(_,Gt)|0,C=C+Math.imul(_,Kt)|0,C=C+Math.imul(W,Gt)|0,D=D+Math.imul(W,Kt)|0;var O2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(O2>>>26)|0,O2&=67108863,I=Math.imul(It,re),C=Math.imul(It,ce),C=C+Math.imul(U,re)|0,D=Math.imul(U,ce),I=I+Math.imul(bt,Ie)|0,C=C+Math.imul(bt,Ae)|0,C=C+Math.imul(Pt,Ie)|0,D=D+Math.imul(Pt,Ae)|0,I=I+Math.imul(At,ke)|0,C=C+Math.imul(At,jt)|0,C=C+Math.imul(yt,ke)|0,D=D+Math.imul(yt,jt)|0,I=I+Math.imul(Ke,Bt)|0,C=C+Math.imul(Ke,Ft)|0,C=C+Math.imul(Ye,Bt)|0,D=D+Math.imul(Ye,Ft)|0,I=I+Math.imul(ge,Ut)|0,C=C+Math.imul(ge,zt)|0,C=C+Math.imul(Ee,Ut)|0,D=D+Math.imul(Ee,zt)|0,I=I+Math.imul(he,qt)|0,C=C+Math.imul(he,Wt)|0,C=C+Math.imul(ve,qt)|0,D=D+Math.imul(ve,Wt)|0,I=I+Math.imul(ie,Ht)|0,C=C+Math.imul(ie,Vt)|0,C=C+Math.imul(oe,Ht)|0,D=D+Math.imul(oe,Vt)|0,I=I+Math.imul(J,Gt)|0,C=C+Math.imul(J,Kt)|0,C=C+Math.imul(ee,Gt)|0,D=D+Math.imul(ee,Kt)|0,I=I+Math.imul(_,Qt)|0,C=C+Math.imul(_,Yt)|0,C=C+Math.imul(W,Qt)|0,D=D+Math.imul(W,Yt)|0;var R2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(R2>>>26)|0,R2&=67108863,I=Math.imul($,re),C=Math.imul($,ce),C=C+Math.imul(V,re)|0,D=Math.imul(V,ce),I=I+Math.imul(It,Ie)|0,C=C+Math.imul(It,Ae)|0,C=C+Math.imul(U,Ie)|0,D=D+Math.imul(U,Ae)|0,I=I+Math.imul(bt,ke)|0,C=C+Math.imul(bt,jt)|0,C=C+Math.imul(Pt,ke)|0,D=D+Math.imul(Pt,jt)|0,I=I+Math.imul(At,Bt)|0,C=C+Math.imul(At,Ft)|0,C=C+Math.imul(yt,Bt)|0,D=D+Math.imul(yt,Ft)|0,I=I+Math.imul(Ke,Ut)|0,C=C+Math.imul(Ke,zt)|0,C=C+Math.imul(Ye,Ut)|0,D=D+Math.imul(Ye,zt)|0,I=I+Math.imul(ge,qt)|0,C=C+Math.imul(ge,Wt)|0,C=C+Math.imul(Ee,qt)|0,D=D+Math.imul(Ee,Wt)|0,I=I+Math.imul(he,Ht)|0,C=C+Math.imul(he,Vt)|0,C=C+Math.imul(ve,Ht)|0,D=D+Math.imul(ve,Vt)|0,I=I+Math.imul(ie,Gt)|0,C=C+Math.imul(ie,Kt)|0,C=C+Math.imul(oe,Gt)|0,D=D+Math.imul(oe,Kt)|0,I=I+Math.imul(J,Qt)|0,C=C+Math.imul(J,Yt)|0,C=C+Math.imul(ee,Qt)|0,D=D+Math.imul(ee,Yt)|0,I=I+Math.imul(_,Jt)|0,C=C+Math.imul(_,Xt)|0,C=C+Math.imul(W,Jt)|0,D=D+Math.imul(W,Xt)|0;var $2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+($2>>>26)|0,$2&=67108863,I=Math.imul($,Ie),C=Math.imul($,Ae),C=C+Math.imul(V,Ie)|0,D=Math.imul(V,Ae),I=I+Math.imul(It,ke)|0,C=C+Math.imul(It,jt)|0,C=C+Math.imul(U,ke)|0,D=D+Math.imul(U,jt)|0,I=I+Math.imul(bt,Bt)|0,C=C+Math.imul(bt,Ft)|0,C=C+Math.imul(Pt,Bt)|0,D=D+Math.imul(Pt,Ft)|0,I=I+Math.imul(At,Ut)|0,C=C+Math.imul(At,zt)|0,C=C+Math.imul(yt,Ut)|0,D=D+Math.imul(yt,zt)|0,I=I+Math.imul(Ke,qt)|0,C=C+Math.imul(Ke,Wt)|0,C=C+Math.imul(Ye,qt)|0,D=D+Math.imul(Ye,Wt)|0,I=I+Math.imul(ge,Ht)|0,C=C+Math.imul(ge,Vt)|0,C=C+Math.imul(Ee,Ht)|0,D=D+Math.imul(Ee,Vt)|0,I=I+Math.imul(he,Gt)|0,C=C+Math.imul(he,Kt)|0,C=C+Math.imul(ve,Gt)|0,D=D+Math.imul(ve,Kt)|0,I=I+Math.imul(ie,Qt)|0,C=C+Math.imul(ie,Yt)|0,C=C+Math.imul(oe,Qt)|0,D=D+Math.imul(oe,Yt)|0,I=I+Math.imul(J,Jt)|0,C=C+Math.imul(J,Xt)|0,C=C+Math.imul(ee,Jt)|0,D=D+Math.imul(ee,Xt)|0;var M2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(M2>>>26)|0,M2&=67108863,I=Math.imul($,ke),C=Math.imul($,jt),C=C+Math.imul(V,ke)|0,D=Math.imul(V,jt),I=I+Math.imul(It,Bt)|0,C=C+Math.imul(It,Ft)|0,C=C+Math.imul(U,Bt)|0,D=D+Math.imul(U,Ft)|0,I=I+Math.imul(bt,Ut)|0,C=C+Math.imul(bt,zt)|0,C=C+Math.imul(Pt,Ut)|0,D=D+Math.imul(Pt,zt)|0,I=I+Math.imul(At,qt)|0,C=C+Math.imul(At,Wt)|0,C=C+Math.imul(yt,qt)|0,D=D+Math.imul(yt,Wt)|0,I=I+Math.imul(Ke,Ht)|0,C=C+Math.imul(Ke,Vt)|0,C=C+Math.imul(Ye,Ht)|0,D=D+Math.imul(Ye,Vt)|0,I=I+Math.imul(ge,Gt)|0,C=C+Math.imul(ge,Kt)|0,C=C+Math.imul(Ee,Gt)|0,D=D+Math.imul(Ee,Kt)|0,I=I+Math.imul(he,Qt)|0,C=C+Math.imul(he,Yt)|0,C=C+Math.imul(ve,Qt)|0,D=D+Math.imul(ve,Yt)|0,I=I+Math.imul(ie,Jt)|0,C=C+Math.imul(ie,Xt)|0,C=C+Math.imul(oe,Jt)|0,D=D+Math.imul(oe,Xt)|0;var N2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(N2>>>26)|0,N2&=67108863,I=Math.imul($,Bt),C=Math.imul($,Ft),C=C+Math.imul(V,Bt)|0,D=Math.imul(V,Ft),I=I+Math.imul(It,Ut)|0,C=C+Math.imul(It,zt)|0,C=C+Math.imul(U,Ut)|0,D=D+Math.imul(U,zt)|0,I=I+Math.imul(bt,qt)|0,C=C+Math.imul(bt,Wt)|0,C=C+Math.imul(Pt,qt)|0,D=D+Math.imul(Pt,Wt)|0,I=I+Math.imul(At,Ht)|0,C=C+Math.imul(At,Vt)|0,C=C+Math.imul(yt,Ht)|0,D=D+Math.imul(yt,Vt)|0,I=I+Math.imul(Ke,Gt)|0,C=C+Math.imul(Ke,Kt)|0,C=C+Math.imul(Ye,Gt)|0,D=D+Math.imul(Ye,Kt)|0,I=I+Math.imul(ge,Qt)|0,C=C+Math.imul(ge,Yt)|0,C=C+Math.imul(Ee,Qt)|0,D=D+Math.imul(Ee,Yt)|0,I=I+Math.imul(he,Jt)|0,C=C+Math.imul(he,Xt)|0,C=C+Math.imul(ve,Jt)|0,D=D+Math.imul(ve,Xt)|0;var D2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(D2>>>26)|0,D2&=67108863,I=Math.imul($,Ut),C=Math.imul($,zt),C=C+Math.imul(V,Ut)|0,D=Math.imul(V,zt),I=I+Math.imul(It,qt)|0,C=C+Math.imul(It,Wt)|0,C=C+Math.imul(U,qt)|0,D=D+Math.imul(U,Wt)|0,I=I+Math.imul(bt,Ht)|0,C=C+Math.imul(bt,Vt)|0,C=C+Math.imul(Pt,Ht)|0,D=D+Math.imul(Pt,Vt)|0,I=I+Math.imul(At,Gt)|0,C=C+Math.imul(At,Kt)|0,C=C+Math.imul(yt,Gt)|0,D=D+Math.imul(yt,Kt)|0,I=I+Math.imul(Ke,Qt)|0,C=C+Math.imul(Ke,Yt)|0,C=C+Math.imul(Ye,Qt)|0,D=D+Math.imul(Ye,Yt)|0,I=I+Math.imul(ge,Jt)|0,C=C+Math.imul(ge,Xt)|0,C=C+Math.imul(Ee,Jt)|0,D=D+Math.imul(Ee,Xt)|0;var L2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(L2>>>26)|0,L2&=67108863,I=Math.imul($,qt),C=Math.imul($,Wt),C=C+Math.imul(V,qt)|0,D=Math.imul(V,Wt),I=I+Math.imul(It,Ht)|0,C=C+Math.imul(It,Vt)|0,C=C+Math.imul(U,Ht)|0,D=D+Math.imul(U,Vt)|0,I=I+Math.imul(bt,Gt)|0,C=C+Math.imul(bt,Kt)|0,C=C+Math.imul(Pt,Gt)|0,D=D+Math.imul(Pt,Kt)|0,I=I+Math.imul(At,Qt)|0,C=C+Math.imul(At,Yt)|0,C=C+Math.imul(yt,Qt)|0,D=D+Math.imul(yt,Yt)|0,I=I+Math.imul(Ke,Jt)|0,C=C+Math.imul(Ke,Xt)|0,C=C+Math.imul(Ye,Jt)|0,D=D+Math.imul(Ye,Xt)|0;var j2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(j2>>>26)|0,j2&=67108863,I=Math.imul($,Ht),C=Math.imul($,Vt),C=C+Math.imul(V,Ht)|0,D=Math.imul(V,Vt),I=I+Math.imul(It,Gt)|0,C=C+Math.imul(It,Kt)|0,C=C+Math.imul(U,Gt)|0,D=D+Math.imul(U,Kt)|0,I=I+Math.imul(bt,Qt)|0,C=C+Math.imul(bt,Yt)|0,C=C+Math.imul(Pt,Qt)|0,D=D+Math.imul(Pt,Yt)|0,I=I+Math.imul(At,Jt)|0,C=C+Math.imul(At,Xt)|0,C=C+Math.imul(yt,Jt)|0,D=D+Math.imul(yt,Xt)|0;var B2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(B2>>>26)|0,B2&=67108863,I=Math.imul($,Gt),C=Math.imul($,Kt),C=C+Math.imul(V,Gt)|0,D=Math.imul(V,Kt),I=I+Math.imul(It,Qt)|0,C=C+Math.imul(It,Yt)|0,C=C+Math.imul(U,Qt)|0,D=D+Math.imul(U,Yt)|0,I=I+Math.imul(bt,Jt)|0,C=C+Math.imul(bt,Xt)|0,C=C+Math.imul(Pt,Jt)|0,D=D+Math.imul(Pt,Xt)|0;var F2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(F2>>>26)|0,F2&=67108863,I=Math.imul($,Qt),C=Math.imul($,Yt),C=C+Math.imul(V,Qt)|0,D=Math.imul(V,Yt),I=I+Math.imul(It,Jt)|0,C=C+Math.imul(It,Xt)|0,C=C+Math.imul(U,Jt)|0,D=D+Math.imul(U,Xt)|0;var U2=(B+I|0)+((C&8191)<<13)|0;B=(D+(C>>>13)|0)+(U2>>>26)|0,U2&=67108863,I=Math.imul($,Jt),C=Math.imul($,Xt),C=C+Math.imul(V,Jt)|0,D=Math.imul(V,Xt);var z2=(B+I|0)+((C&8191)<<13)|0;return B=(D+(C>>>13)|0)+(z2>>>26)|0,z2&=67108863,O[0]=Da,O[1]=La,O[2]=ja,O[3]=Ba,O[4]=Fa,O[5]=I2,O[6]=T2,O[7]=O2,O[8]=R2,O[9]=$2,O[10]=M2,O[11]=N2,O[12]=D2,O[13]=L2,O[14]=j2,O[15]=B2,O[16]=F2,O[17]=U2,O[18]=z2,B!==0&&(O[19]=B,R.length++),R};Math.imul||(b=y);function E(F,x,k){k.negative=x.negative^F.negative,k.length=F.length+x.length;for(var R=0,N=0,A=0;A>>26)|0,N+=O>>>26,O&=67108863}k.words[A]=B,R=O,O=N}return R!==0?k.words[A]=R:k.length--,k._strip()}function S(F,x,k){return E(F,x,k)}s.prototype.mulTo=function(x,k){var R,N=this.length+x.length;return this.length===10&&x.length===10?R=b(this,x,k):N<63?R=y(this,x,k):N<1024?R=E(this,x,k):R=S(this,x,k),R},s.prototype.mul=function(x){var k=new s(null);return k.words=new Array(this.length+x.length),this.mulTo(x,k)},s.prototype.mulf=function(x){var k=new s(null);return k.words=new Array(this.length+x.length),S(this,x,k)},s.prototype.imul=function(x){return this.clone().mulTo(x,this)},s.prototype.imuln=function(x){var k=x<0;k&&(x=-x),n(typeof x=="number"),n(x<67108864);for(var R=0,N=0;N>=26,R+=A/67108864|0,R+=O>>>26,this.words[N]=O&67108863}return R!==0&&(this.words[N]=R,this.length++),k?this.ineg():this},s.prototype.muln=function(x){return this.clone().imuln(x)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(x){var k=v(x);if(k.length===0)return new s(1);for(var R=this,N=0;N=0);var k=x%26,R=(x-k)/26,N=67108863>>>26-k<<26-k,A;if(k!==0){var O=0;for(A=0;A>>26-k}O&&(this.words[A]=O,this.length++)}if(R!==0){for(A=this.length-1;A>=0;A--)this.words[A+R]=this.words[A];for(A=0;A=0);var N;k?N=(k-k%26)/26:N=0;var A=x%26,O=Math.min((x-A)/26,this.length),B=67108863^67108863>>>A<O)for(this.length-=O,C=0;C=0&&(D!==0||C>=N);C--){var z=this.words[C]|0;this.words[C]=D<<26-A|z>>>A,D=z&B}return I&&D!==0&&(I.words[I.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(x,k,R){return n(this.negative===0),this.iushrn(x,k,R)},s.prototype.shln=function(x){return this.clone().ishln(x)},s.prototype.ushln=function(x){return this.clone().iushln(x)},s.prototype.shrn=function(x){return this.clone().ishrn(x)},s.prototype.ushrn=function(x){return this.clone().iushrn(x)},s.prototype.testn=function(x){n(typeof x=="number"&&x>=0);var k=x%26,R=(x-k)/26,N=1<=0);var k=x%26,R=(x-k)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=R)return this;if(k!==0&&R++,this.length=Math.min(R,this.length),k!==0){var N=67108863^67108863>>>k<=67108864;k++)this.words[k]-=67108864,k===this.length-1?this.words[k+1]=1:this.words[k+1]++;return this.length=Math.max(this.length,k+1),this},s.prototype.isubn=function(x){if(n(typeof x=="number"),n(x<67108864),x<0)return this.iaddn(-x);if(this.negative!==0)return this.negative=0,this.iaddn(x),this.negative=1,this;if(this.words[0]-=x,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var k=0;k>26)-(I/67108864|0),this.words[A+R]=O&67108863}for(;A>26,this.words[A+R]=O&67108863;if(B===0)return this._strip();for(n(B===-1),B=0,A=0;A>26,this.words[A]=O&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(x,k){var R=this.length-x.length,N=this.clone(),A=x,O=A.words[A.length-1]|0,B=this._countBits(O);R=26-B,R!==0&&(A=A.ushln(R),N.iushln(R),O=A.words[A.length-1]|0);var I=N.length-A.length,C;if(k!=="mod"){C=new s(null),C.length=I+1,C.words=new Array(C.length);for(var D=0;D=0;_--){var W=(N.words[A.length+_]|0)*67108864+(N.words[A.length+_-1]|0);for(W=Math.min(W/O|0,67108863),N._ishlnsubmul(A,W,_);N.negative!==0;)W--,N.negative=0,N._ishlnsubmul(A,1,_),N.isZero()||(N.negative^=1);C&&(C.words[_]=W)}return C&&C._strip(),N._strip(),k!=="div"&&R!==0&&N.iushrn(R),{div:C||null,mod:N}},s.prototype.divmod=function(x,k,R){if(n(!x.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var N,A,O;return this.negative!==0&&x.negative===0?(O=this.neg().divmod(x,k),k!=="mod"&&(N=O.div.neg()),k!=="div"&&(A=O.mod.neg(),R&&A.negative!==0&&A.iadd(x)),{div:N,mod:A}):this.negative===0&&x.negative!==0?(O=this.divmod(x.neg(),k),k!=="mod"&&(N=O.div.neg()),{div:N,mod:O.mod}):this.negative&x.negative?(O=this.neg().divmod(x.neg(),k),k!=="div"&&(A=O.mod.neg(),R&&A.negative!==0&&A.isub(x)),{div:O.div,mod:A}):x.length>this.length||this.cmp(x)<0?{div:new s(0),mod:this}:x.length===1?k==="div"?{div:this.divn(x.words[0]),mod:null}:k==="mod"?{div:null,mod:new s(this.modrn(x.words[0]))}:{div:this.divn(x.words[0]),mod:new s(this.modrn(x.words[0]))}:this._wordDiv(x,k)},s.prototype.div=function(x){return this.divmod(x,"div",!1).div},s.prototype.mod=function(x){return this.divmod(x,"mod",!1).mod},s.prototype.umod=function(x){return this.divmod(x,"mod",!0).mod},s.prototype.divRound=function(x){var k=this.divmod(x);if(k.mod.isZero())return k.div;var R=k.div.negative!==0?k.mod.isub(x):k.mod,N=x.ushrn(1),A=x.andln(1),O=R.cmp(N);return O<0||A===1&&O===0?k.div:k.div.negative!==0?k.div.isubn(1):k.div.iaddn(1)},s.prototype.modrn=function(x){var k=x<0;k&&(x=-x),n(x<=67108863);for(var R=(1<<26)%x,N=0,A=this.length-1;A>=0;A--)N=(R*N+(this.words[A]|0))%x;return k?-N:N},s.prototype.modn=function(x){return this.modrn(x)},s.prototype.idivn=function(x){var k=x<0;k&&(x=-x),n(x<=67108863);for(var R=0,N=this.length-1;N>=0;N--){var A=(this.words[N]|0)+R*67108864;this.words[N]=A/x|0,R=A%x}return this._strip(),k?this.ineg():this},s.prototype.divn=function(x){return this.clone().idivn(x)},s.prototype.egcd=function(x){n(x.negative===0),n(!x.isZero());var k=this,R=x.clone();k.negative!==0?k=k.umod(x):k=k.clone();for(var N=new s(1),A=new s(0),O=new s(0),B=new s(1),I=0;k.isEven()&&R.isEven();)k.iushrn(1),R.iushrn(1),++I;for(var C=R.clone(),D=k.clone();!k.isZero();){for(var z=0,_=1;!(k.words[0]&_)&&z<26;++z,_<<=1);if(z>0)for(k.iushrn(z);z-- >0;)(N.isOdd()||A.isOdd())&&(N.iadd(C),A.isub(D)),N.iushrn(1),A.iushrn(1);for(var W=0,G=1;!(R.words[0]&G)&&W<26;++W,G<<=1);if(W>0)for(R.iushrn(W);W-- >0;)(O.isOdd()||B.isOdd())&&(O.iadd(C),B.isub(D)),O.iushrn(1),B.iushrn(1);k.cmp(R)>=0?(k.isub(R),N.isub(O),A.isub(B)):(R.isub(k),O.isub(N),B.isub(A))}return{a:O,b:B,gcd:R.iushln(I)}},s.prototype._invmp=function(x){n(x.negative===0),n(!x.isZero());var k=this,R=x.clone();k.negative!==0?k=k.umod(x):k=k.clone();for(var N=new s(1),A=new s(0),O=R.clone();k.cmpn(1)>0&&R.cmpn(1)>0;){for(var B=0,I=1;!(k.words[0]&I)&&B<26;++B,I<<=1);if(B>0)for(k.iushrn(B);B-- >0;)N.isOdd()&&N.iadd(O),N.iushrn(1);for(var C=0,D=1;!(R.words[0]&D)&&C<26;++C,D<<=1);if(C>0)for(R.iushrn(C);C-- >0;)A.isOdd()&&A.iadd(O),A.iushrn(1);k.cmp(R)>=0?(k.isub(R),N.isub(A)):(R.isub(k),A.isub(N))}var z;return k.cmpn(1)===0?z=N:z=A,z.cmpn(0)<0&&z.iadd(x),z},s.prototype.gcd=function(x){if(this.isZero())return x.abs();if(x.isZero())return this.abs();var k=this.clone(),R=x.clone();k.negative=0,R.negative=0;for(var N=0;k.isEven()&&R.isEven();N++)k.iushrn(1),R.iushrn(1);do{for(;k.isEven();)k.iushrn(1);for(;R.isEven();)R.iushrn(1);var A=k.cmp(R);if(A<0){var O=k;k=R,R=O}else if(A===0||R.cmpn(1)===0)break;k.isub(R)}while(!0);return R.iushln(N)},s.prototype.invm=function(x){return this.egcd(x).a.umod(x)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(x){return this.words[0]&x},s.prototype.bincn=function(x){n(typeof x=="number");var k=x%26,R=(x-k)/26,N=1<>>26,B&=67108863,this.words[O]=B}return A!==0&&(this.words[O]=A,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(x){var k=x<0;if(this.negative!==0&&!k)return-1;if(this.negative===0&&k)return 1;this._strip();var R;if(this.length>1)R=1;else{k&&(x=-x),n(x<=67108863,"Number is too big");var N=this.words[0]|0;R=N===x?0:Nx.length)return 1;if(this.length=0;R--){var N=this.words[R]|0,A=x.words[R]|0;if(N!==A){NA&&(k=1);break}}return k},s.prototype.gtn=function(x){return this.cmpn(x)===1},s.prototype.gt=function(x){return this.cmp(x)===1},s.prototype.gten=function(x){return this.cmpn(x)>=0},s.prototype.gte=function(x){return this.cmp(x)>=0},s.prototype.ltn=function(x){return this.cmpn(x)===-1},s.prototype.lt=function(x){return this.cmp(x)===-1},s.prototype.lten=function(x){return this.cmpn(x)<=0},s.prototype.lte=function(x){return this.cmp(x)<=0},s.prototype.eqn=function(x){return this.cmpn(x)===0},s.prototype.eq=function(x){return this.cmp(x)===0},s.red=function(x){return new Q(x)},s.prototype.toRed=function(x){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),x.convertTo(this)._forceRed(x)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(x){return this.red=x,this},s.prototype.forceRed=function(x){return n(!this.red,"Already a number in reduction context"),this._forceRed(x)},s.prototype.redAdd=function(x){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},s.prototype.redIAdd=function(x){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},s.prototype.redSub=function(x){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},s.prototype.redISub=function(x){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},s.prototype.redShl=function(x){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},s.prototype.redMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},s.prototype.redIMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(x){return n(this.red&&!x.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,x)};var P={k256:null,p224:null,p192:null,p25519:null};function M(F,x){this.name=F,this.p=new s(x,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}M.prototype._tmp=function(){var x=new s(null);return x.words=new Array(Math.ceil(this.n/13)),x},M.prototype.ireduce=function(x){var k=x,R;do this.split(k,this.tmp),k=this.imulK(k),k=k.iadd(this.tmp),R=k.bitLength();while(R>this.n);var N=R0?k.isub(this.p):k.strip!==void 0?k.strip():k._strip(),k},M.prototype.split=function(x,k){x.iushrn(this.n,0,k)},M.prototype.imulK=function(x){return x.imul(this.k)};function L(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(L,M),L.prototype.split=function(x,k){for(var R=4194303,N=Math.min(x.length,9),A=0;A>>22,O=B}O>>>=22,x.words[A-10]=O,O===0&&x.length>10?x.length-=10:x.length-=9},L.prototype.imulK=function(x){x.words[x.length]=0,x.words[x.length+1]=0,x.length+=2;for(var k=0,R=0;R>>=26,x.words[R]=A,k=N}return k!==0&&(x.words[x.length++]=k),x},s._prime=function(x){if(P[x])return P[x];var k;if(x==="k256")k=new L;else if(x==="p224")k=new j;else if(x==="p192")k=new H;else if(x==="p25519")k=new K;else throw new Error("Unknown prime "+x);return P[x]=k,k};function Q(F){if(typeof F=="string"){var x=s._prime(F);this.m=x.p,this.prime=x}else n(F.gtn(1),"modulus must be greater than 1"),this.m=F,this.prime=null}Q.prototype._verify1=function(x){n(x.negative===0,"red works only with positives"),n(x.red,"red works only with red numbers")},Q.prototype._verify2=function(x,k){n((x.negative|k.negative)===0,"red works only with positives"),n(x.red&&x.red===k.red,"red works only with red numbers")},Q.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):(u(x,x.umod(this.m)._forceRed(this)),x)},Q.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},Q.prototype.add=function(x,k){this._verify2(x,k);var R=x.add(k);return R.cmp(this.m)>=0&&R.isub(this.m),R._forceRed(this)},Q.prototype.iadd=function(x,k){this._verify2(x,k);var R=x.iadd(k);return R.cmp(this.m)>=0&&R.isub(this.m),R},Q.prototype.sub=function(x,k){this._verify2(x,k);var R=x.sub(k);return R.cmpn(0)<0&&R.iadd(this.m),R._forceRed(this)},Q.prototype.isub=function(x,k){this._verify2(x,k);var R=x.isub(k);return R.cmpn(0)<0&&R.iadd(this.m),R},Q.prototype.shl=function(x,k){return this._verify1(x),this.imod(x.ushln(k))},Q.prototype.imul=function(x,k){return this._verify2(x,k),this.imod(x.imul(k))},Q.prototype.mul=function(x,k){return this._verify2(x,k),this.imod(x.mul(k))},Q.prototype.isqr=function(x){return this.imul(x,x.clone())},Q.prototype.sqr=function(x){return this.mul(x,x)},Q.prototype.sqrt=function(x){if(x.isZero())return x.clone();var k=this.m.andln(3);if(n(k%2===1),k===3){var R=this.m.add(new s(1)).iushrn(2);return this.pow(x,R)}for(var N=this.m.subn(1),A=0;!N.isZero()&&N.andln(1)===0;)A++,N.iushrn(1);n(!N.isZero());var O=new s(1).toRed(this),B=O.redNeg(),I=this.m.subn(1).iushrn(1),C=this.m.bitLength();for(C=new s(2*C*C).toRed(this);this.pow(C,I).cmp(B)!==0;)C.redIAdd(B);for(var D=this.pow(C,N),z=this.pow(x,N.addn(1).iushrn(1)),_=this.pow(x,N),W=A;_.cmp(O)!==0;){for(var G=_,J=0;G.cmp(O)!==0;J++)G=G.redSqr();n(J=0;A--){for(var D=k.words[A],z=C-1;z>=0;z--){var _=D>>z&1;if(O!==N[0]&&(O=this.sqr(O)),_===0&&B===0){I=0;continue}B<<=1,B|=_,I++,!(I!==R&&(A!==0||z!==0))&&(O=this.mul(O,N[B]),I=0,B=0)}C=26}return O},Q.prototype.convertTo=function(x){var k=x.umod(this.m);return k===x?k.clone():k},Q.prototype.convertFrom=function(x){var k=x.clone();return k.red=null,k},s.mont=function(x){return new Y(x)};function Y(F){Q.call(this,F),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(Y,Q),Y.prototype.convertTo=function(x){return this.imod(x.ushln(this.shift))},Y.prototype.convertFrom=function(x){var k=this.imod(x.mul(this.rinv));return k.red=null,k},Y.prototype.imul=function(x,k){if(x.isZero()||k.isZero())return x.words[0]=0,x.length=1,x;var R=x.imul(k),N=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=R.isub(N).iushrn(this.shift),O=A;return A.cmp(this.m)>=0?O=A.isub(this.m):A.cmpn(0)<0&&(O=A.iadd(this.m)),O._forceRed(this)},Y.prototype.mul=function(x,k){if(x.isZero()||k.isZero())return new s(0)._forceRed(this);var R=x.mul(k),N=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=R.isub(N).iushrn(this.shift),O=A;return A.cmp(this.m)>=0?O=A.isub(this.m):A.cmpn(0)<0&&(O=A.iadd(this.m)),O._forceRed(this)},Y.prototype.invm=function(x){var k=this.imod(x._invmp(this.m).mul(this.r2));return k._forceRed(this)}})(t,mi)})(J8);var UG=J8.exports;const ze=Pi(UG),zG="logger/5.7.0";let U7=!1,z7=!1;const Wm={debug:1,default:2,info:2,warning:3,error:4,off:5};let q7=Wm.default,vx=null;function qG(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const W7=qG();var Kv;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Kv||(Kv={}));var ji;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(ji||(ji={}));const H7="0123456789abcdef";let ne=class Lr{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();Wm[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(q7>Wm[n])&&console.log.apply(console,r)}debug(...e){this._log(Lr.levels.DEBUG,e)}info(...e){this._log(Lr.levels.INFO,e)}warn(...e){this._log(Lr.levels.WARNING,e)}makeError(e,r,n){if(z7)return this.makeError("censored error",r,{});r||(r=Lr.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let u="";for(let f=0;f>4],u+=H7[l[f]&15];i.push(c+"=Uint8Array(0x"+u+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case ji.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case ji.CALL_EXCEPTION:case ji.INSUFFICIENT_FUNDS:case ji.MISSING_NEW:case ji.NONCE_EXPIRED:case ji.REPLACEMENT_UNDERPRICED:case ji.TRANSACTION_REPLACED:case ji.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Lr.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){W7&&this.throwError("platform missing String.prototype.normalize",Lr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:W7})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Lr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Lr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Lr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Lr.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Lr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Lr.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return vx||(vx=new Lr(zG)),vx}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Lr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),U7){if(!e)return;this.globalLogger().throwError("error censorship permanent",Lr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}z7=!!e,U7=!!r}static setLogLevel(e){const r=Wm[e.toLowerCase()];if(r==null){Lr.globalLogger().warn("invalid log level - "+e);return}q7=r}static from(e){return new Lr(e)}};ne.errors=ji;ne.levels=Kv;const WG=Object.freeze(Object.defineProperty({__proto__:null,get ErrorCode(){return ji},get LogLevel(){return Kv},Logger:ne},Symbol.toStringTag,{value:"Module"})),HG="bytes/5.7.0",pr=new ne(HG);function eR(t){return!!t.toHexString}function Mf(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Mf(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Ms(t){return qe(t)&&!(t.length%2)||ka(t)}function V7(t){return typeof t=="number"&&t==t&&t%1===0}function ka(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!V7(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function fe(t,e){if(e||(e={}),typeof t=="number"){pr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Mf(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),eR(t)&&(t=t.toHexString()),qe(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":pr.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ife(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Mf(n)}function Os(t){let e=fe(t);if(e.length===0)return e;let r=0;for(;re&&pr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Mf(r)}function qe(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const yx="0123456789abcdef";function le(t,e){if(e||(e={}),typeof t=="number"){pr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=yx[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),eR(t))return t.toHexString();if(qe(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":pr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(ka(t)){let r="0x";for(let n=0;n>4]+yx[i&15]}return r}return pr.throwArgumentError("invalid hexlify value","value",t)}function Ns(t){if(typeof t!="string")t=le(t);else if(!qe(t)||t.length%2)return null;return(t.length-2)/2}function rr(t,e,r){return typeof t!="string"?t=le(t):(!qe(t)||t.length%2)&&pr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function xn(t){let e="0x";return t.forEach(r=>{e+=le(r).substring(2)}),e}function Ji(t){const e=Z8(le(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function Z8(t){typeof t!="string"&&(t=le(t)),qe(t)||pr.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&pr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function el(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Ms(t)){let r=fe(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=le(r.slice(0,32)),e.s=le(r.slice(32,64))):r.length===65?(e.r=le(r.slice(0,32)),e.s=le(r.slice(32,64)),e.v=r[64]):pr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:pr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=le(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=Nf(fe(e._vs),32);e._vs=le(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&pr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=le(i);e.s==null?e.s=o:e.s!==o&&pr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?pr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&pr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!qe(e.r)?pr.throwArgumentError("signature missing or invalid r","signature",t):e.r=St(e.r,32),e.s==null||!qe(e.s)?pr.throwArgumentError("signature missing or invalid s","signature",t):e.s=St(e.s,32);const r=fe(e.s);r[0]>=128&&pr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=le(r);e._vs&&(qe(e._vs)||pr.throwArgumentError("signature invalid _vs","signature",t),e._vs=St(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&pr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function Qv(t){return t=el(t),le(Et([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const VG=Object.freeze(Object.defineProperty({__proto__:null,arrayify:fe,concat:Et,hexConcat:xn,hexDataLength:Ns,hexDataSlice:rr,hexStripZeros:Z8,hexValue:Ji,hexZeroPad:St,hexlify:le,isBytes:ka,isBytesLike:Ms,isHexString:qe,joinSignature:Qv,splitSignature:el,stripZeros:Os,zeroPad:Nf},Symbol.toStringTag,{value:"Module"})),tR="bignumber/5.7.0";var B0=ze.BN;const Do=new ne(tR),gx={},G7=9007199254740991;function GG(t){return t!=null&&(te.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||qe(t)||typeof t=="bigint"||ka(t))}let K7=!1;class te{constructor(e,r){e!==gx&&Do.throwError("cannot call constructor directly; use BigNumber.from",ne.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Vn(et(this).fromTwos(e))}toTwos(e){return Vn(et(this).toTwos(e))}abs(){return this._hex[0]==="-"?te.from(this._hex.substring(1)):this}add(e){return Vn(et(this).add(et(e)))}sub(e){return Vn(et(this).sub(et(e)))}div(e){return te.from(e).isZero()&&Ni("division-by-zero","div"),Vn(et(this).div(et(e)))}mul(e){return Vn(et(this).mul(et(e)))}mod(e){const r=et(e);return r.isNeg()&&Ni("division-by-zero","mod"),Vn(et(this).umod(r))}pow(e){const r=et(e);return r.isNeg()&&Ni("negative-power","pow"),Vn(et(this).pow(r))}and(e){const r=et(e);return(this.isNegative()||r.isNeg())&&Ni("unbound-bitwise-result","and"),Vn(et(this).and(r))}or(e){const r=et(e);return(this.isNegative()||r.isNeg())&&Ni("unbound-bitwise-result","or"),Vn(et(this).or(r))}xor(e){const r=et(e);return(this.isNegative()||r.isNeg())&&Ni("unbound-bitwise-result","xor"),Vn(et(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Ni("negative-width","mask"),Vn(et(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Ni("negative-width","shl"),Vn(et(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Ni("negative-width","shr"),Vn(et(this).shrn(e))}eq(e){return et(this).eq(et(e))}lt(e){return et(this).lt(et(e))}lte(e){return et(this).lte(et(e))}gt(e){return et(this).gt(et(e))}gte(e){return et(this).gte(et(e))}isNegative(){return this._hex[0]==="-"}isZero(){return et(this).isZero()}toNumber(){try{return et(this).toNumber()}catch{Ni("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Do.throwError("this platform does not support BigInt",ne.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?K7||(K7=!0,Do.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Do.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ne.errors.UNEXPECTED_ARGUMENT,{}):Do.throwError("BigNumber.toString does not accept parameters",ne.errors.UNEXPECTED_ARGUMENT,{})),et(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof te)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new te(gx,F0(e)):e.match(/^-?[0-9]+$/)?new te(gx,F0(new B0(e))):Do.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Ni("underflow","BigNumber.from",e),(e>=G7||e<=-G7)&&Ni("overflow","BigNumber.from",e),te.from(String(e));const r=e;if(typeof r=="bigint")return te.from(r.toString());if(ka(r))return te.from(le(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return te.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(qe(n)||n[0]==="-"&&qe(n.substring(1))))return te.from(n)}return Do.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function F0(t){if(typeof t!="string")return F0(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Do.throwArgumentError("invalid hex","value",t),t=F0(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Vn(t){return te.from(F0(t))}function et(t){const e=te.from(t).toHexString();return e[0]==="-"?new B0("-"+e.substring(3),16):new B0(e.substring(2),16)}function Ni(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Do.throwError(t,ne.errors.NUMERIC_FAULT,n)}function KG(t){return new B0(t,36).toString(16)}function QG(t){return new B0(t,16).toString(36)}const Dn=new ne(tR),Zh={},rR=te.from(0),nR=te.from(-1);function iR(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Dn.throwError(t,ne.errors.NUMERIC_FAULT,i)}let e0="0";for(;e0.length<256;)e0+=e0;function eE(t){if(typeof t!="number")try{t=te.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+e0.substring(0,t):Dn.throwArgumentError("invalid decimal size","decimals",t)}function Hm(t,e){e==null&&(e=0);const r=eE(e);t=te.from(t);const n=t.lt(rR);n&&(t=t.mul(nR));let i=t.mod(r).toString();for(;i.length2&&Dn.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&iR("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?c:(typeof e[o]!==a&&Dn.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Dn.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Dn.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new Df(Zh,r,n,i)}}class Zr{constructor(e,r,n,i){e!==Zh&&Dn.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ne.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Dn.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Gs(this._value,this.format.decimals),n=Gs(e._value,e.format.decimals);return Zr.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Gs(this._value,this.format.decimals),n=Gs(e._value,e.format.decimals);return Zr.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Gs(this._value,this.format.decimals),n=Gs(e._value,e.format.decimals);return Zr.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Gs(this._value,this.format.decimals),n=Gs(e._value,e.format.decimals);return Zr.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Zr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(Q7.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Zr.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(Q7.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Dn.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=Zr.from("1"+e0.substring(0,e),this.format),i=YG.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Dn.throwArgumentError("invalid byte width","width",e);const r=te.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return St(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Zr.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!GG(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),Zr.fromString(Hm(e,r),Df.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=Df.from(r),i=Gs(e,n.decimals);!n.signed&&i.lt(rR)&&iR("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=St(s,n.width/8));const o=Hm(i,n.decimals);return new Zr(Zh,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=Df.from(r);if(fe(e).length>n.width/8)throw new Error("overflow");let i=te.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=Hm(i,n.decimals);return new Zr(Zh,s,o,n)}static from(e,r){if(typeof e=="string")return Zr.fromString(e,r);if(ka(e))return Zr.fromBytes(e,r);try{return Zr.fromValue(e,0,r)}catch(n){if(n.code!==ne.errors.INVALID_ARGUMENT)throw n}return Dn.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const Q7=Zr.from(1),YG=Zr.from("0.5"),JG="properties/5.7.0";var XG=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Yv=new ne(JG);function de(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Qi(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function _t(t){return XG(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function Ug(t,e){(!t||typeof t!="object")&&Yv.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||Yv.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Mt(t){const e={};for(const r in t)e[r]=t[r];return e}const ZG={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function sR(t){if(t==null||ZG[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rsi(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&de(e,r,si(n))}return e}return Yv.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function si(t){return eK(t)}class tl{constructor(e){for(const r in e)this[r]=si(e[r])}}const tK=Object.freeze(Object.defineProperty({__proto__:null,Description:tl,checkProperties:Ug,deepCopy:si,defineReadOnly:de,getStatic:Qi,resolveProperties:_t,shallowCopy:Mt},Symbol.toStringTag,{value:"Module"})),U1="abi/5.7.0",st=new ne(U1),Zl={};let Y7={calldata:!0,memory:!0,storage:!0},rK={calldata:!0,memory:!0};function Hp(t,e){if(t==="bytes"||t==="string"){if(Y7[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&rK[e])return!0;return(Y7[e]||e==="payable")&&st.throwArgumentError("invalid modifier","name",e),!1}function nK(t,e){let r=t;function n(a){st.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let c={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(c.indexed=!1),c}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==at.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===at.full?", ":",")+")"):r+=this.type,e!==at.sighash&&(this.indexed===!0&&(r+=" indexed"),e===at.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Mr.fromString(e,r):Mr.fromObject(e)}static fromObject(e){return Mr.isParamType(e)?e:new Mr(Zl,{name:e.name||null,type:Ju(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Mr.fromObject):null})}static fromString(e,r){function n(i){return Mr.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(nK(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function U0(t,e){return oK(t).map(r=>Mr.fromString(r,e))}class As{constructor(e,r){e!==Zl&&st.throwError("use a static from method",ne.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Vm(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return As.isFragment(e)?e:typeof e=="string"?As.fromString(e):As.fromObject(e)}static fromObject(e){if(As.isFragment(e))return e;switch(e.type){case"function":return Hi.fromObject(e);case"event":return Ss.fromObject(e);case"constructor":return Wi.fromObject(e);case"error":return so.fromObject(e);case"fallback":case"receive":return null}return st.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Ss.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Hi.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Wi.fromString(e.trim()):e.split(" ")[0]==="error"?so.fromString(e.substring(5).trim()):st.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Ss extends As{format(e){if(e||(e=at.sighash),at[e]||st.throwArgumentError("invalid format type","format",e),e===at.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==at.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===at.full?", ":",")+") ",e!==at.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Ss.fromString(e):Ss.fromObject(e)}static fromObject(e){if(Ss.isEventFragment(e))return e;e.type!=="event"&&st.throwArgumentError("invalid event object","value",e);const r={name:z0(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Mr.fromObject):[],type:"event"};return new Ss(Zl,r)}static fromString(e){let r=e.match(q0);r||st.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:st.warn("unknown modifier: "+i)}}),Ss.fromObject({name:r[1].trim(),anonymous:n,inputs:U0(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function oR(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&st.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||st.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=te.from(r[1]),r[0]):t}function aR(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function cR(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&st.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&st.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&st.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&st.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&st.throwArgumentError("unable to determine stateMutability","value",t),e}class Wi extends As{format(e){if(e||(e=at.sighash),at[e]||st.throwArgumentError("invalid format type","format",e),e===at.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===at.sighash&&st.throwError("cannot format a constructor for sighash",ne.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===at.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Wi.fromString(e):Wi.fromObject(e)}static fromObject(e){if(Wi.isConstructorFragment(e))return e;e.type!=="constructor"&&st.throwArgumentError("invalid constructor object","value",e);let r=cR(e);r.constant&&st.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Mr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?te.from(e.gas):null};return new Wi(Zl,n)}static fromString(e){let r={type:"constructor"};e=oR(e,r);let n=e.match(q0);return(!n||n[1].trim()!=="constructor")&&st.throwArgumentError("invalid constructor string","value",e),r.inputs=U0(n[2].trim(),!1),aR(n[3].trim(),r),Wi.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class Hi extends Wi{format(e){if(e||(e=at.sighash),at[e]||st.throwArgumentError("invalid format type","format",e),e===at.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==at.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===at.full?", ":",")+") ",e!==at.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Hi.fromString(e):Hi.fromObject(e)}static fromObject(e){if(Hi.isFunctionFragment(e))return e;e.type!=="function"&&st.throwArgumentError("invalid function object","value",e);let r=cR(e);const n={type:e.type,name:z0(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Mr.fromObject):[],outputs:e.outputs?e.outputs.map(Mr.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?te.from(e.gas):null};return new Hi(Zl,n)}static fromString(e){let r={type:"function"};e=oR(e,r);let n=e.split(" returns ");n.length>2&&st.throwArgumentError("invalid function string","value",e);let i=n[0].match(q0);if(i||st.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&z0(r.name),r.inputs=U0(i[2],!1),aR(i[3].trim(),r),n.length>1){let s=n[1].match(q0);(s[1].trim()!=""||s[3].trim()!="")&&st.throwArgumentError("unexpected tokens","value",e),r.outputs=U0(s[2],!1)}else r.outputs=[];return Hi.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function J7(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&st.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class so extends As{format(e){if(e||(e=at.sighash),at[e]||st.throwArgumentError("invalid format type","format",e),e===at.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==at.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===at.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?so.fromString(e):so.fromObject(e)}static fromObject(e){if(so.isErrorFragment(e))return e;e.type!=="error"&&st.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:z0(e.name),inputs:e.inputs?e.inputs.map(Mr.fromObject):[]};return J7(new so(Zl,r))}static fromString(e){let r={type:"error"},n=e.match(q0);return n||st.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&z0(r.name),r.inputs=U0(n[2],!1),J7(so.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function Ju(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const sK=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function z0(t){return(!t||!t.match(sK))&&st.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const q0=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function oK(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&tE.throwError("value out-of-bounds",ne.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Et([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class Jv{constructor(e,r,n,i){de(this,"_data",fe(e)),de(this,"wordSize",r||32),de(this,"_coerceFunc",n),de(this,"allowLoose",i),this._offset=0}get data(){return le(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):Jv.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:tE.throwError("data out-of-bounds",ne.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new Jv(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return te.from(this.readBytes(this.wordSize))}}function aK(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var lR={exports:{}},Ir=lR.exports={},Ys,Js;function D5(){throw new Error("setTimeout has not been defined")}function L5(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ys=setTimeout:Ys=D5}catch{Ys=D5}try{typeof clearTimeout=="function"?Js=clearTimeout:Js=L5}catch{Js=L5}})();function uR(t){if(Ys===setTimeout)return setTimeout(t,0);if((Ys===D5||!Ys)&&setTimeout)return Ys=setTimeout,setTimeout(t,0);try{return Ys(t,0)}catch{try{return Ys.call(null,t,0)}catch{return Ys.call(this,t,0)}}}function cK(t){if(Js===clearTimeout)return clearTimeout(t);if((Js===L5||!Js)&&clearTimeout)return Js=clearTimeout,clearTimeout(t);try{return Js(t)}catch{try{return Js.call(null,t)}catch{return Js.call(this,t)}}}var Vo=[],Lf=!1,Nl,Gm=-1;function lK(){!Lf||!Nl||(Lf=!1,Nl.length?Vo=Nl.concat(Vo):Gm=-1,Vo.length&&fR())}function fR(){if(!Lf){var t=uR(lK);Lf=!0;for(var e=Vo.length;e;){for(Nl=Vo,Vo=[];++Gm1)for(var r=1;r>5,this.byteCount=this.blockCount<<2,this.outputBlocks=G>>5,this.extraBytes=(G&31)>>3;for(var J=0;J<50;++J)this.s[J]=0}C.prototype.update=function(_){if(this.finalized)throw new Error(r);var W,G=typeof _;if(G!=="string"){if(G==="object"){if(_===null)throw new Error(e);if(c&&_.constructor===ArrayBuffer)_=new Uint8Array(_);else if(!Array.isArray(_)&&(!c||!ArrayBuffer.isView(_)))throw new Error(e)}else throw new Error(e);W=!0}for(var J=this.blocks,ee=this.byteCount,se=_.length,ie=this.blockCount,oe=0,be=this.s,he,ve;oe>2]|=_[oe]<>2]|=ve<>2]|=(192|ve>>6)<>2]|=(128|ve&63)<=57344?(J[he>>2]|=(224|ve>>12)<>2]|=(128|ve>>6&63)<>2]|=(128|ve&63)<>2]|=(240|ve>>18)<>2]|=(128|ve>>12&63)<>2]|=(128|ve>>6&63)<>2]|=(128|ve&63)<=ee){for(this.start=he-ee,this.block=J[ie],he=0;he>8,G=_&255;G>0;)ee.unshift(G),_=_>>8,G=_&255,++J;return W?ee.push(J):ee.unshift(J),this.update(ee),ee.length},C.prototype.encodeString=function(_){var W,G=typeof _;if(G!=="string"){if(G==="object"){if(_===null)throw new Error(e);if(c&&_.constructor===ArrayBuffer)_=new Uint8Array(_);else if(!Array.isArray(_)&&(!c||!ArrayBuffer.isView(_)))throw new Error(e)}else throw new Error(e);W=!0}var J=0,ee=_.length;if(W)J=ee;else for(var se=0;se<_.length;++se){var ie=_.charCodeAt(se);ie<128?J+=1:ie<2048?J+=2:ie<55296||ie>=57344?J+=3:(ie=65536+((ie&1023)<<10|_.charCodeAt(++se)&1023),J+=4)}return J+=this.encode(J*8),this.update(_),J},C.prototype.bytepad=function(_,W){for(var G=this.encode(W),J=0;J<_.length;++J)G+=this.encodeString(_[J]);var ee=W-G%W,se=[];return se.length=ee,this.update(se),this},C.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var _=this.blocks,W=this.lastByteIndex,G=this.blockCount,J=this.s;if(_[W>>2]|=this.padding[W&3],this.lastByteIndex===this.byteCount)for(_[0]=_[G],W=1;W>4&15]+l[oe&15]+l[oe>>12&15]+l[oe>>8&15]+l[oe>>20&15]+l[oe>>16&15]+l[oe>>28&15]+l[oe>>24&15];se%_===0&&(z(W),ee=0)}return J&&(oe=W[ee],ie+=l[oe>>4&15]+l[oe&15],J>1&&(ie+=l[oe>>12&15]+l[oe>>8&15]),J>2&&(ie+=l[oe>>20&15]+l[oe>>16&15])),ie},C.prototype.arrayBuffer=function(){this.finalize();var _=this.blockCount,W=this.s,G=this.outputBlocks,J=this.extraBytes,ee=0,se=0,ie=this.outputBits>>3,oe;J?oe=new ArrayBuffer(G+1<<2):oe=new ArrayBuffer(ie);for(var be=new Uint32Array(oe);se>8&255,ie[oe+2]=be>>16&255,ie[oe+3]=be>>24&255;se%_===0&&z(W)}return J&&(oe=se<<2,be=W[ee],ie[oe]=be&255,J>1&&(ie[oe+1]=be>>8&255),J>2&&(ie[oe+2]=be>>16&255)),ie};function D(_,W,G){C.call(this,_,W,G)}D.prototype=new C,D.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var z=function(_){var W,G,J,ee,se,ie,oe,be,he,ve,$e,ge,Ee,Ue,Ke,Ye,Ro,At,yt,Vr,bt,Pt,dn,It,U,T,$,V,Z,re,ce,Ne,Ie,Ae,gt,ke,jt,ul,Bt,Ft,fl,Ut,zt,dl,qt,Wt,hl,Ht,Vt,pl,Gt,Kt,ml,Qt,Yt,vl,Jt,Xt,Da,La,ja,Ba,Fa;for(J=0;J<48;J+=2)ee=_[0]^_[10]^_[20]^_[30]^_[40],se=_[1]^_[11]^_[21]^_[31]^_[41],ie=_[2]^_[12]^_[22]^_[32]^_[42],oe=_[3]^_[13]^_[23]^_[33]^_[43],be=_[4]^_[14]^_[24]^_[34]^_[44],he=_[5]^_[15]^_[25]^_[35]^_[45],ve=_[6]^_[16]^_[26]^_[36]^_[46],$e=_[7]^_[17]^_[27]^_[37]^_[47],ge=_[8]^_[18]^_[28]^_[38]^_[48],Ee=_[9]^_[19]^_[29]^_[39]^_[49],W=ge^(ie<<1|oe>>>31),G=Ee^(oe<<1|ie>>>31),_[0]^=W,_[1]^=G,_[10]^=W,_[11]^=G,_[20]^=W,_[21]^=G,_[30]^=W,_[31]^=G,_[40]^=W,_[41]^=G,W=ee^(be<<1|he>>>31),G=se^(he<<1|be>>>31),_[2]^=W,_[3]^=G,_[12]^=W,_[13]^=G,_[22]^=W,_[23]^=G,_[32]^=W,_[33]^=G,_[42]^=W,_[43]^=G,W=ie^(ve<<1|$e>>>31),G=oe^($e<<1|ve>>>31),_[4]^=W,_[5]^=G,_[14]^=W,_[15]^=G,_[24]^=W,_[25]^=G,_[34]^=W,_[35]^=G,_[44]^=W,_[45]^=G,W=be^(ge<<1|Ee>>>31),G=he^(Ee<<1|ge>>>31),_[6]^=W,_[7]^=G,_[16]^=W,_[17]^=G,_[26]^=W,_[27]^=G,_[36]^=W,_[37]^=G,_[46]^=W,_[47]^=G,W=ve^(ee<<1|se>>>31),G=$e^(se<<1|ee>>>31),_[8]^=W,_[9]^=G,_[18]^=W,_[19]^=G,_[28]^=W,_[29]^=G,_[38]^=W,_[39]^=G,_[48]^=W,_[49]^=G,Ue=_[0],Ke=_[1],Wt=_[11]<<4|_[10]>>>28,hl=_[10]<<4|_[11]>>>28,V=_[20]<<3|_[21]>>>29,Z=_[21]<<3|_[20]>>>29,La=_[31]<<9|_[30]>>>23,ja=_[30]<<9|_[31]>>>23,Ut=_[40]<<18|_[41]>>>14,zt=_[41]<<18|_[40]>>>14,Ae=_[2]<<1|_[3]>>>31,gt=_[3]<<1|_[2]>>>31,Ye=_[13]<<12|_[12]>>>20,Ro=_[12]<<12|_[13]>>>20,Ht=_[22]<<10|_[23]>>>22,Vt=_[23]<<10|_[22]>>>22,re=_[33]<<13|_[32]>>>19,ce=_[32]<<13|_[33]>>>19,Ba=_[42]<<2|_[43]>>>30,Fa=_[43]<<2|_[42]>>>30,Qt=_[5]<<30|_[4]>>>2,Yt=_[4]<<30|_[5]>>>2,ke=_[14]<<6|_[15]>>>26,jt=_[15]<<6|_[14]>>>26,At=_[25]<<11|_[24]>>>21,yt=_[24]<<11|_[25]>>>21,pl=_[34]<<15|_[35]>>>17,Gt=_[35]<<15|_[34]>>>17,Ne=_[45]<<29|_[44]>>>3,Ie=_[44]<<29|_[45]>>>3,It=_[6]<<28|_[7]>>>4,U=_[7]<<28|_[6]>>>4,vl=_[17]<<23|_[16]>>>9,Jt=_[16]<<23|_[17]>>>9,ul=_[26]<<25|_[27]>>>7,Bt=_[27]<<25|_[26]>>>7,Vr=_[36]<<21|_[37]>>>11,bt=_[37]<<21|_[36]>>>11,Kt=_[47]<<24|_[46]>>>8,ml=_[46]<<24|_[47]>>>8,dl=_[8]<<27|_[9]>>>5,qt=_[9]<<27|_[8]>>>5,T=_[18]<<20|_[19]>>>12,$=_[19]<<20|_[18]>>>12,Xt=_[29]<<7|_[28]>>>25,Da=_[28]<<7|_[29]>>>25,Ft=_[38]<<8|_[39]>>>24,fl=_[39]<<8|_[38]>>>24,Pt=_[48]<<14|_[49]>>>18,dn=_[49]<<14|_[48]>>>18,_[0]=Ue^~Ye&At,_[1]=Ke^~Ro&yt,_[10]=It^~T&V,_[11]=U^~$&Z,_[20]=Ae^~ke&ul,_[21]=gt^~jt&Bt,_[30]=dl^~Wt&Ht,_[31]=qt^~hl&Vt,_[40]=Qt^~vl&Xt,_[41]=Yt^~Jt&Da,_[2]=Ye^~At&Vr,_[3]=Ro^~yt&bt,_[12]=T^~V&re,_[13]=$^~Z&ce,_[22]=ke^~ul&Ft,_[23]=jt^~Bt&fl,_[32]=Wt^~Ht&pl,_[33]=hl^~Vt&Gt,_[42]=vl^~Xt&La,_[43]=Jt^~Da&ja,_[4]=At^~Vr&Pt,_[5]=yt^~bt&dn,_[14]=V^~re&Ne,_[15]=Z^~ce&Ie,_[24]=ul^~Ft&Ut,_[25]=Bt^~fl&zt,_[34]=Ht^~pl&Kt,_[35]=Vt^~Gt&ml,_[44]=Xt^~La&Ba,_[45]=Da^~ja&Fa,_[6]=Vr^~Pt&Ue,_[7]=bt^~dn&Ke,_[16]=re^~Ne&It,_[17]=ce^~Ie&U,_[26]=Ft^~Ut&Ae,_[27]=fl^~zt>,_[36]=pl^~Kt&dl,_[37]=Gt^~ml&qt,_[46]=La^~Ba&Qt,_[47]=ja^~Fa&Yt,_[8]=Pt^~Ue&Ye,_[9]=dn^~Ke&Ro,_[18]=Ne^~It&T,_[19]=Ie^~U&$,_[28]=Ut^~Ae&ke,_[29]=zt^~gt&jt,_[38]=Kt^~dl&Wt,_[39]=ml^~qt&hl,_[48]=Ba^~Qt&vl,_[49]=Fa^~Yt&Jt,_[0]^=m[J],_[1]^=m[J+1]};if(a)t.exports=x;else for(R=0;R>=8;return e}function Z7(t,e,r){let n=0;for(let i=0;ie+1+n&&Xs.throwError("child data too short",ne.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function mR(t,e){if(t.length===0&&Xs.throwError("data too short",ne.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&Xs.throwError("data short segment too short",ne.errors.BUFFER_OVERRUN,{});const n=Z7(t,e+1,r);return e+1+r+n>t.length&&Xs.throwError("data long segment too short",ne.errors.BUFFER_OVERRUN,{}),eS(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&Xs.throwError("data array too short",ne.errors.BUFFER_OVERRUN,{}),eS(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&Xs.throwError("data array too short",ne.errors.BUFFER_OVERRUN,{});const n=Z7(t,e+1,r);e+1+r+n>t.length&&Xs.throwError("data array too short",ne.errors.BUFFER_OVERRUN,{});const i=le(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&Xs.throwError("data too short",ne.errors.BUFFER_OVERRUN,{});const n=le(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:le(t[e])}}function zg(t){const e=fe(t),r=mR(e,0);return r.consumed!==e.length&&Xs.throwArgumentError("invalid rlp data","data",t),r.result}const vR=Object.freeze(Object.defineProperty({__proto__:null,decode:zg,encode:eu},Symbol.toStringTag,{value:"Module"})),mK="address/5.7.0",ac=new ne(mK);function tS(t){qe(t,20)||ac.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=fe(Oe(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const vK=9007199254740991;function yK(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const nE={};for(let t=0;t<10;t++)nE[String(t)]=String(t);for(let t=0;t<26;t++)nE[String.fromCharCode(65+t)]=String(10+t);const rS=Math.floor(yK(vK));function yR(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>nE[n]).join("");for(;e.length>=rS;){let n=e.substring(0,rS);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Be(t){let e=null;if(typeof t!="string"&&ac.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=tS(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&ac.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==yR(t)&&ac.throwArgumentError("bad icap checksum","address",t),e=KG(t.substring(4));e.length<40;)e="0"+e;e=tS("0x"+e)}else ac.throwArgumentError("invalid address","address",t);return e}function iE(t){try{return Be(t),!0}catch{}return!1}function gR(t){let e=QG(Be(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+yR("XE00"+e)+e}function qg(t){let e=null;try{e=Be(t.from)}catch{ac.throwArgumentError("missing from address","transaction",t)}const r=Os(fe(te.from(t.nonce).toHexString()));return Be(rr(Oe(eu([e,r])),12))}function bR(t,e,r){return Ns(e)!==32&&ac.throwArgumentError("salt must be 32 bytes","salt",e),Ns(r)!==32&&ac.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Be(rr(Oe(Et(["0xff",Be(t),e,r])),12))}const gK=Object.freeze(Object.defineProperty({__proto__:null,getAddress:Be,getContractAddress:qg,getCreate2Address:bR,getIcapAddress:gR,isAddress:iE},Symbol.toStringTag,{value:"Module"}));class bK extends Aa{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Be(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Be(St(e.readValue().toHexString(),20))}}class xK extends Aa{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const gf=new ne(U1);function xR(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const u=l.localName;return u||gf.throwError("cannot encode object for signature with missing names",ne.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]&&gf.throwError("cannot encode object for signature with duplicate names",ne.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]=!0,r[u]})}else gf.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&gf.throwArgumentError("types/value length mismatch","tuple",r);let i=new N5(t.wordSize),s=new N5(t.wordSize),o=[];e.forEach((c,l)=>{let u=n[l];if(c.dynamic){let f=s.length;c.encode(s,u);let d=i.writeUpdatableValue();o.push(h=>{d(h+f)})}else c.encode(i,u)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function wR(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),c=n.subReader(a.toNumber());try{o=s.decode(c)}catch(l){if(l.code===ne.errors.BUFFER_OVERRUN)throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===ne.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const c=r[o];c instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw c}}):r[a]=c});for(let s=0;s{throw o}})}return Object.freeze(r)}class wK extends Aa{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&gf.throwError("insufficient data length",ne.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===Nn.OVERRUN?r.length-e-1:0}function OK(t,e,r,n,i){return t===Nn.OVERLONG?(n.push(i),0):(n.push(65533),AR(t,e,r))}const sE=Object.freeze({error:TK,ignore:AR,replace:OK});function oE(t,e){e==null&&(e=sE.error),t=fe(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(Nn.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(Nn.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(Nn.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let c=0;c1114111){n+=e(Nn.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(Nn.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(Nn.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function kt(t,e=Ds.current){e!=Ds.current&&(kR.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return fe(r)}function bx(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function _R(t,e){return'"'+oE(t,e).map(r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?bx(r):(r-=65536,bx((r>>10&1023)+55296)+bx((r&1023)+56320))}).join("")+'"'}function j5(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function os(t,e){return j5(oE(t,e))}function W0(t,e=Ds.current){return oE(kt(t,e))}function PR(t){const e=kt(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return le(Et([e,Xv]).slice(0,32))}function IR(t){const e=fe(t);if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;e[r-1]===0;)r--;return os(e.slice(0,r))}function RK(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r{let s=i.split(":");r+=parseInt(s[0],16),n[r]=e(s[1])}),n}function TR(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}function cE(t,e){let r=0;for(let n=0;n=r&&t<=r+i.h&&(t-r)%(i.d||1)===0){if(i.e&&i.e.indexOf(t-r)!==-1)continue;return i}}return null}const $K=TR("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),MK="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),NK=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],DK=aE("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),LK=aE("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),jK=aE("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",RK),BK=TR("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function FK(t){return t.reduce((e,r)=>(r.forEach(n=>{e.push(n)}),e),[])}function UK(t){return!!cE(t,$K)}function zK(t){let e=cE(t,NK);if(e)return[t+e.s];let r=DK[t];if(r)return r;let n=LK[t];if(n)return[t+n[0]];let i=jK[t];return i||null}function qK(t){return!!cE(t,BK)}function OR(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=W0(t);e=FK(e.map(n=>{if(MK.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let i=zK(n);return i||[n]})),e=W0(j5(e),Ds.NFKC),e.forEach(n=>{if(qK(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),e.forEach(n=>{if(UK(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=j5(e);if(r.substring(0,1)==="-"||r.substring(2,4)==="--"||r.substring(r.length-1)==="-")throw new Error("invalid hyphen");return r}const WK=Object.freeze(Object.defineProperty({__proto__:null,get UnicodeNormalizationForm(){return Ds},Utf8ErrorFuncs:sE,get Utf8ErrorReason(){return Nn},_toEscapedUtf8String:_R,formatBytes32String:PR,nameprep:OR,parseBytes32String:IR,toUtf8Bytes:kt,toUtf8CodePoints:W0,toUtf8String:os},Symbol.toStringTag,{value:"Module"}));class HK extends ER{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,kt(r))}decode(e){return os(super.decode(e))}}class Vp extends Aa{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return xR(e,this.coders,r)}decode(e){return e.coerce(this.name,wR(e,this.coders))}}const Gp=new ne(U1),VK=new RegExp(/^bytes([0-9]*)$/),GK=new RegExp(/^(u?int)([0-9]*)$/);class Wg{constructor(e){de(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new bK(e.name);case"bool":return new EK(e.name);case"string":return new HK(e.name);case"bytes":return new CK(e.name);case"array":return new wK(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Vp((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new kK(e.name)}let r=e.type.match(GK);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&Gp.throwArgumentError("invalid "+r[1]+" bit length","param",e),new PK(n/8,r[1]==="int",e.name)}if(r=e.type.match(VK),r){let n=parseInt(r[1]);return(n===0||n>32)&&Gp.throwArgumentError("invalid bytes length","param",e),new SK(n,e.name)}return Gp.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new Jv(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new N5(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Mr.from(i)));return new Vp(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&Gp.throwError("types/values length mismatch",ne.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(Mr.from(o))),i=new Vp(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(Mr.from(o)));return new Vp(i,"_").decode(this._getReader(fe(r),n))}}const _n=new Wg;function Go(t){return Oe(kt(t))}const RR="hash/5.7.0";function lE(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function KK(t){const e={};for(let r=0;r>--c&1}const f=31,d=Math.pow(2,f),h=d>>>1,p=h>>1,m=d-1;let v=0;for(let P=0;P1;){let K=M+L>>>1;P>>1|u(),j=j<<1^h,H=(H^h)<<1|h|1;b=j,E=1+H-j}let S=n-4;return y.map(P=>{switch(P-S){case 3:return S+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return S+256+(t[a++]<<8|t[a++]);case 1:return S+t[a++];default:return P-1}})}function YK(t){let e=0;return()=>t[e++]}function JK(t){return YK(QK(t))}function XK(t){return t&1?~t>>1:t>>1}function ZK(t,e){let r=Array(t);for(let n=0;ne[o]):r}function tQ(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(nQ(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(iQ(r,t))}return KK(MR(e))}function rQ(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function NR(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function nQ(t,e){let r=1+e(),n=e(),i=rQ(e),s=NR(i.length,1+t,e);return MR(s.map((o,a)=>{const c=o[0],l=o.slice(1);return Array(i[a]).fill(void 0).map((u,f)=>{let d=f*n;return[c+f*r,l.map(h=>h+d)]})}))}function iQ(t,e){let r=1+e();return NR(r,1+t,e).map(i=>[i[0],i.slice(1)])}function sQ(t){let e=Zv(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let l=Zv(t,e);if(l.length==0)break;n.push({set:new Set(l),node:r()})}n.sort((l,u)=>u.set.size-l.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,c=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:c}}}function oQ(){return JK(lE("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Hg=oQ(),aQ=new Set(Zv(Hg)),cQ=new Set(Zv(Hg)),lQ=tQ(Hg),uQ=sQ(Hg),iS=45,sS=95;function DR(t){return W0(t)}function fQ(t){return t.filter(e=>e!=65039)}function LR(t){for(let e of t.split(".")){let r=DR(e);try{for(let n=r.lastIndexOf(sS)-1;n>=0;n--)if(r[n]!==sS)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===iS&&r[3]===iS)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function dQ(t){return LR(hQ(t,fQ))}function hQ(t,e){let r=DR(t).reverse(),n=[];for(;r.length;){let i=mQ(r);if(i){n.push(...e(i));continue}let s=r.pop();if(aQ.has(s)){n.push(s);continue}if(cQ.has(s))continue;let o=lQ[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return LR(pQ(String.fromCodePoint(...n)))}function pQ(t){return t.normalize("NFC")}function mQ(t,e){var r;let n=uQ,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let c=t[--a];if(n=(r=n.branches.find(l=>l.set.has(c)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=c;else if(n.check&&c===s)break;o.push(c),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const vQ=new ne(RR),jR=new Uint8Array(32);jR.fill(0);function oS(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function Vg(t){const e=kt(dQ(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(oS(e.slice(n))),r}function yQ(t){return Vg(t).map(e=>os(e)).join(".")}function BR(t){try{return Vg(t).length!==0}catch{}return!1}function jf(t){typeof t!="string"&&vQ.throwArgumentError("invalid ENS name; not a string","name",t);let e=jR;const r=Vg(t);for(;r.length;)e=Oe(Et([e,Oe(r.pop())]));return le(e)}function fE(t){return le(Et(Vg(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const FR=`Ethereum Signed Message: +`;function z1(t){return typeof t=="string"&&(t=kt(t)),Oe(Et([kt(FR),kt(String(t.length)),t]))}var gQ=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const cr=new ne(RR),UR=new Uint8Array(32);UR.fill(0);const bQ=te.from(-1),zR=te.from(0),qR=te.from(1),xQ=te.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function wQ(t){const e=fe(t),r=e.length%32;return r?xn([e,UR.slice(r)]):le(e)}const EQ=St(qR.toHexString(),32),CQ=St(zR.toHexString(),32),aS={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},xx=["name","version","chainId","verifyingContract","salt"];function cS(t){return function(e){return typeof e!="string"&&cr.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const SQ={name:cS("name"),version:cS("version"),chainId:function(t){try{return te.from(t).toString()}catch{}return cr.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Be(t).toLowerCase()}catch{}return cr.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=fe(t);if(e.length!==32)throw new Error("bad length");return le(e)}catch{}return cr.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function wx(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&cr.throwArgumentError("invalid numeric width","type",t);const i=xQ.mask(r?n-1:n),s=r?i.add(qR).mul(bQ):zR;return function(o){const a=te.from(o);return(a.lt(s)||a.gt(i))&&cr.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),St(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&cr.throwArgumentError("invalid bytes width","type",t),function(n){return fe(n).length!==r&&cr.throwArgumentError(`invalid length for ${t}`,"value",n),wQ(n)}}}switch(t){case"address":return function(e){return St(Be(e),32)};case"bool":return function(e){return e?EQ:CQ};case"bytes":return function(e){return Oe(e)};case"string":return function(e){return Go(e)}}return null}function lS(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class Sr{constructor(e){de(this,"types",Object.freeze(si(e))),de(this,"_encoderCache",{}),de(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const c={};e[a].forEach(l=>{c[l.name]&&cr.throwArgumentError(`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(a)}`,"types",e),c[l.name]=!0;const u=l.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===a&&cr.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!wx(u)&&(n[u]||cr.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(a),r[a][u]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?cr.throwArgumentError("missing primary type","types",e):s.length>1&&cr.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),de(this,"primaryType",s[0]);function o(a,c){c[a]&&cr.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),c[a]=!0,Object.keys(r[a]).forEach(l=>{n[l]&&(o(l,c),Object.keys(c).forEach(u=>{i[u][l]=!0}))}),delete c[a]}o(this.primaryType,{});for(const a in i){const c=Object.keys(i[a]);c.sort(),this._types[a]=lS(a,e[a])+c.map(l=>lS(l,e[l])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=wx(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&cr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let c=a.map(s);return this._types[i]&&(c=c.map(Oe)),Oe(xn(c))}}const n=this.types[e];if(n){const i=Go(this._types[e]);return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return this._types[c]?Oe(l):l});return o.unshift(i),xn(o)}}return cr.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||cr.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Oe(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(wx(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&cr.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(c=>this._visit(o,c,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{}):cr.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new Sr(e)}static getPrimaryType(e){return Sr.from(e).primaryType}static hashStruct(e,r,n){return Sr.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=aS[n];i||cr.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>xx.indexOf(n.name)-xx.indexOf(i.name)),Sr.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return xn(["0x1901",Sr.hashDomain(e),Sr.from(r).hash(n)])}static hash(e,r,n){return Oe(Sr.encode(e,r,n))}static resolveNames(e,r,n,i){return gQ(this,void 0,void 0,function*(){e=Mt(e);const s={};e.verifyingContract&&!qe(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=Sr.from(r);o.visit(n,(a,c)=>(a==="address"&&!qe(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}})}static getPayload(e,r,n){Sr.hashDomain(e);const i={},s=[];xx.forEach(c=>{const l=e[c];l!=null&&(i[c]=SQ[c](l),s.push({name:c,type:aS[c]}))});const o=Sr.from(r),a=Mt(r);return a.EIP712Domain?cr.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return le(fe(l));if(c.match(/^u?int/))return te.from(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return typeof l!="string"&&cr.throwArgumentError("invalid string","value",l),l}return cr.throwArgumentError("unsupported type","type",c)})}}}const kQ=Object.freeze(Object.defineProperty({__proto__:null,_TypedDataEncoder:Sr,dnsEncode:fE,ensNormalize:yQ,hashMessage:z1,id:Go,isValidName:BR,messagePrefix:FR,namehash:jf},Symbol.toStringTag,{value:"Module"})),ar=new ne(U1);class dE extends tl{}class hE extends tl{}class AQ extends tl{}class H0 extends tl{static isIndexed(e){return!!(e&&e._isIndexed)}}const _Q={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function uS(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class xr{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,de(this,"fragments",r.map(n=>As.from(n)).filter(n=>n!=null)),de(this,"_abiCoder",Qi(new.target,"getAbiCoder")()),de(this,"functions",{}),de(this,"errors",{}),de(this,"events",{}),de(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){ar.warn("duplicate definition - constructor");return}de(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){ar.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||de(this,"deploy",Wi.from({payable:!1,type:"constructor"})),de(this,"_isInterface",!0)}format(e){e||(e=at.full),e===at.sighash&&ar.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===at.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return _n}static getAddress(e){return Be(e)}static getSighash(e){return rr(Go(e.format()),0,4)}static getEventTopic(e){return Go(e.format())}getFunction(e){if(qe(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];ar.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?ar.throwArgumentError("no matching function","name",n):i.length>1&&ar.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Hi.fromString(e).format()];return r||ar.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(qe(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];ar.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?ar.throwArgumentError("no matching event","name",n):i.length>1&&ar.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Ss.fromString(e).format()];return r||ar.throwArgumentError("no matching event","signature",e),r}getError(e){if(qe(e)){const n=Qi(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}ar.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?ar.throwArgumentError("no matching error","name",n):i.length>1&&ar.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Hi.fromString(e).format()];return r||ar.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return Qi(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Qi(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=fe(r);return le(n.slice(0,4))!==this.getSighash(e)&&ar.throwArgumentError(`data signature does not match error ${e.name}.`,"data",le(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),le(Et([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=fe(r);return le(n.slice(0,4))!==this.getSighash(e)&&ar.throwArgumentError(`data signature does not match function ${e.name}.`,"data",le(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),le(Et([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=fe(r),i=null,s="",o=null,a=null,c=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const l=le(n.slice(0,4)),u=_Q[l];if(u)o=this._abiCoder.decode(u.inputs,n.slice(4)),a=u.name,c=u.signature,u.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const f=this.getError(l);o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,c=f.format()}catch{}break}}return ar.throwError("call revert exception"+s,ne.errors.CALL_EXCEPTION,{method:e.format(),data:le(r),errorArgs:o,errorName:a,errorSignature:c,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),le(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&ar.throwError("too many arguments for "+e.format(),ne.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?Go(o):s.type==="bytes"?Oe(le(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=te.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),St(le(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&ar.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?ar.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&ar.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(Go(c));else if(o.type==="bytes")n.push(Oe(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let d=this.getEventTopic(e);(!qe(n[0],32)||n[0].toLowerCase()!==d)&&ar.throwError("fragment/topic mismatch",ne.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((d,h)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Mr.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(s.push(d),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,Et(n)):null,c=this._abiCoder.decode(s,r,!0),l=[],u=0,f=0;e.inputs.forEach((d,h)=>{if(d.indexed)if(a==null)l[h]=new H0({_isIndexed:!0,hash:null});else if(o[h])l[h]=new H0({_isIndexed:!0,hash:a[f++]});else try{l[h]=a[f++]}catch(p){l[h]=p}else try{l[h]=c[u++]}catch(p){l[h]=p}if(d.name&&l[d.name]==null){const p=l[h];p instanceof Error?Object.defineProperty(l,d.name,{enumerable:!0,get:()=>{throw uS(`property ${JSON.stringify(d.name)}`,p)}}):l[d.name]=p}});for(let d=0;d{throw uS(`index ${d}`,h)}})}return Object.freeze(l)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new hE({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:te.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new dE({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=le(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new AQ({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const PQ=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:Wg,ConstructorFragment:Wi,ErrorFragment:so,EventFragment:Ss,FormatTypes:at,Fragment:As,FunctionFragment:Hi,Indexed:H0,Interface:xr,LogDescription:dE,ParamType:Mr,TransactionDescription:hE,checkResultErrors:rE,defaultAbiCoder:_n},Symbol.toStringTag,{value:"Module"})),IQ="abstract-provider/5.7.0";var TQ=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const OQ=new ne(IQ);class RQ extends tl{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class Pa{constructor(){OQ.checkAbstract(new.target,Pa),de(this,"_isProvider",!0)}getFeeData(){return TQ(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield _t({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=te.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const $Q="abstract-signer/5.7.0";var hs=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Di=new ne($Q),MQ=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],NQ=[ne.errors.INSUFFICIENT_FUNDS,ne.errors.NONCE_EXPIRED,ne.errors.REPLACEMENT_UNDERPRICED];let Tc=class WR{constructor(){Di.checkAbstract(new.target,WR),de(this,"_isSigner",!0)}getBalance(e){return hs(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return hs(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return hs(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield _t(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return hs(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield _t(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return hs(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return hs(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return hs(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return hs(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return hs(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)MQ.indexOf(n)===-1&&Di.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Mt(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Di.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return hs(this,void 0,void 0,function*(){const r=yield _t(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>hs(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Di.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Di.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Di.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Di.throwError("network does not support EIP-1559",ne.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Di.throwError("failed to get consistent fee data",ne.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(NQ.indexOf(i.code)>=0)throw i;return Di.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ne.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Di.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield _t(r)})}_checkProvider(e){this.provider||Di.throwError("missing provider",ne.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};class pE extends Tc{constructor(e,r){super(),de(this,"address",e),de(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Di.throwError(e,ne.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new pE(this.address,e)}}var HR={},it={},q1=VR;function VR(t,e){if(!t)throw new Error(e||"Assertion failed")}VR.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var B5={exports:{}};typeof Object.create=="function"?B5.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:B5.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var DQ=B5.exports,LQ=q1,jQ=DQ;it.inherits=jQ;function BQ(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function FQ(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):BQ(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}it.htonl=GR;function zQ(t,e){for(var r="",n=0;n>>0}return s}it.join32=qQ;function WQ(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}it.split32=WQ;function HQ(t,e){return t>>>e|t<<32-e}it.rotr32=HQ;function VQ(t,e){return t<>>32-e}it.rotl32=VQ;function GQ(t,e){return t+e>>>0}it.sum32=GQ;function KQ(t,e,r){return t+e+r>>>0}it.sum32_3=KQ;function QQ(t,e,r,n){return t+e+r+n>>>0}it.sum32_4=QQ;function YQ(t,e,r,n,i){return t+e+r+n+i>>>0}it.sum32_5=YQ;function JQ(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}it.sum64=JQ;function XQ(t,e,r,n){var i=e+n>>>0,s=(i>>0}it.sum64_hi=XQ;function ZQ(t,e,r,n){var i=e+n;return i>>>0}it.sum64_lo=ZQ;function eY(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l>>0,c+=l>>0,c+=l>>0}it.sum64_4_hi=eY;function tY(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}it.sum64_4_lo=tY;function rY(t,e,r,n,i,s,o,a,c,l){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}it.sum64_5_hi=rY;function nY(t,e,r,n,i,s,o,a,c,l){var u=e+n+s+a+l;return u>>>0}it.sum64_5_lo=nY;function iY(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}it.rotr64_hi=iY;function sY(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}it.rotr64_lo=sY;function oY(t,e,r){return t>>>r}it.shr64_hi=oY;function aY(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}it.shr64_lo=aY;var _d={},fS=it,cY=q1;function Gg(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_d.BlockHash=Gg;Gg.prototype.update=function(e,r){if(e=fS.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=fS.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}Oo.g0_256=hY;function pY(t){return ho(t,17)^ho(t,19)^t>>>10}Oo.g1_256=pY;var rd=it,mY=_d,vY=Oo,Ex=rd.rotl32,hh=rd.sum32,yY=rd.sum32_5,gY=vY.ft_1,ZR=mY.BlockHash,bY=[1518500249,1859775393,2400959708,3395469782];function wo(){if(!(this instanceof wo))return new wo;ZR.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}rd.inherits(wo,ZR);var xY=wo;wo.blockSize=512;wo.outSize=160;wo.hmacStrength=80;wo.padLength=64;wo.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),aJ(e.length<=this.blockSize);for(var r=e.length;r>8,d=u&255;f?c.push(f,d):c.push(d)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c(d>>1)-1?m=(d>>1)-v:m=v,h.isubn(m)):m=0,f[p]=m,h.iushrn(1)}return f}r.getNAF=n;function i(c,l){var u=[[],[]];c=c.clone(),l=l.clone();for(var f=0,d=0,h;c.cmpn(-f)>0||l.cmpn(-d)>0;){var p=c.andln(3)+f&3,m=l.andln(3)+d&3;p===3&&(p=-1),m===3&&(m=-1);var v;p&1?(h=c.andln(7)+f&7,(h===3||h===5)&&m===2?v=-p:v=p):v=0,u[0].push(v);var y;m&1?(h=l.andln(7)+d&7,(h===3||h===5)&&p===2?y=-m:y=m):y=0,u[1].push(y),2*f===v+1&&(f=1-f),2*d===y+1&&(d=1-d),c.iushrn(1),l.iushrn(1)}return u}r.getJSF=i;function s(c,l,u){var f="_"+l;c.prototype[l]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new ze(c,"hex","le")}r.intFromLE=a}),ey=Oi.getNAF,uJ=Oi.getJSF,ty=Oi.assert;function rl(t,e){this.type=t,this.p=new ze(e.p,16),this.red=e.prime?ze.red(e.prime):ze.mont(this.p),this.zero=new ze(0).toRed(this.red),this.one=new ze(1).toRed(this.red),this.two=new ze(2).toRed(this.red),this.n=e.n&&new ze(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var xu=rl;rl.prototype.point=function(){throw new Error("Not implemented")};rl.prototype.validate=function(){throw new Error("Not implemented")};rl.prototype._fixedNafMul=function(e,r){ty(e.precomputed);var n=e._getDoubles(),i=ey(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var u=o[c];ty(u!==0),e.type==="affine"?u>0?a=a.mixedAdd(s[u-1>>1]):a=a.mixedAdd(s[-u-1>>1].neg()):u>0?a=a.add(s[u-1>>1]):a=a.add(s[-u-1>>1].neg())}return e.type==="affine"?a.toP():a};rl.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,u,f,d;for(u=0;u=1;u-=2){var p=u-1,m=u;if(o[p]!==1||o[m]!==1){c[p]=ey(n[p],o[p],this._bitLength),c[m]=ey(n[m],o[m],this._bitLength),l=Math.max(c[p].length,l),l=Math.max(c[m].length,l);continue}var v=[r[p],null,null,r[m]];r[p].y.cmp(r[m].y)===0?(v[1]=r[p].add(r[m]),v[2]=r[p].toJ().mixedAdd(r[m].neg())):r[p].y.cmp(r[m].y.redNeg())===0?(v[1]=r[p].toJ().mixedAdd(r[m]),v[2]=r[p].add(r[m].neg())):(v[1]=r[p].toJ().mixedAdd(r[m]),v[2]=r[p].toJ().mixedAdd(r[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],b=uJ(n[p],n[m]);for(l=Math.max(b[0].length,l),c[p]=new Array(l),c[m]=new Array(l),f=0;f=0;u--){for(var L=0;u>=0;){var j=!0;for(f=0;f=0&&L++,P=P.dblp(L),u<0)break;for(f=0;f0?d=a[f][H-1>>1]:H<0&&(d=a[f][-H-1>>1].neg()),d.type==="affine"?P=P.mixedAdd(d):P=P.add(d))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};as.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(h=l,p=u),f.negative&&(f=f.neg(),d=d.neg()),h.negative&&(h=h.neg(),p=p.neg()),[{a:f,b:d},{a:h,b:p}]};cs.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),u=o.mul(i.b),f=e.sub(a).sub(c),d=l.add(u).neg();return{k1:f,k2:d}};cs.prototype.pointFromX=function(e,r){e=new ze(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};cs.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};cs.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Jr.prototype.isInfinity=function(){return this.inf};Jr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Jr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Jr.prototype.getX=function(){return this.x.fromRed()};Jr.prototype.getY=function(){return this.y.fromRed()};Jr.prototype.mul=function(e){return e=new ze(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Jr.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Jr.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Jr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Jr.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Jr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function un(t,e,r,n){xu.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ze(0)):(this.x=new ze(e,16),this.y=new ze(r,16),this.z=new ze(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}vE(un,xu.BasePoint);cs.prototype.jpoint=function(e,r,n){return new un(this,e,r,n)};un.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};un.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};un.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),f=u.redMul(c),d=i.redMul(u),h=l.redSqr().redIAdd(f).redISub(d).redISub(d),p=l.redMul(d.redISub(h)).redISub(o.redMul(f)),m=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,p,m)};un.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),f=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(s.redMul(u)),p=this.z.redMul(a);return this.curve.jpoint(d,h,p)};un.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};un.prototype.inspect=function(){return this.isInfinity()?"":""};un.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Km=Td(function(t,e){var r=e;r.base=xu,r.short=dJ,r.mont=null,r.edwards=null}),Qm=Td(function(t,e){var r=e,n=Oi.assert;function i(a){a.type==="short"?this.curve=new Km.short(a):a.type==="edwards"?this.curve=new Km.edwards(a):this.curve=new Km.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Qn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Qn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Qn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Qn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Qn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qn.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Qn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Oc(t){if(!(this instanceof Oc))return new Oc(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=_s.toArray(t.entropy,t.entropyEnc||"hex"),r=_s.toArray(t.nonce,t.nonceEnc||"hex"),n=_s.toArray(t.pers,t.persEnc||"hex");mE(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var f$=Oc;Oc.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Oc.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=_s.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var hJ=Oi.assert;function Kg(t,e){if(t instanceof Kg)return t;this._importDER(t,e)||(hJ(t.r&&t.s,"Signature without r or s"),this.r=new ze(t.r,16),this.s=new ze(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Qg=Kg;function pJ(){this.place=0}function kx(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function mS(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Kg.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=mS(r),n=mS(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Ax(i,r.length),i=i.concat(r),i.push(2),Ax(i,n.length);var s=i.concat(n),o=[48];return Ax(o,s.length),o=o.concat(s),Oi.encode(o,e)};var mJ=function(){throw new Error("unsupported")},d$=Oi.assert;function ts(t){if(!(this instanceof ts))return new ts(t);typeof t=="string"&&(d$(Object.prototype.hasOwnProperty.call(Qm,t),"Unknown curve "+t),t=Qm[t]),t instanceof Qm.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var vJ=ts;ts.prototype.keyPair=function(e){return new yE(this,e)};ts.prototype.keyFromPrivate=function(e,r){return yE.fromPrivate(this,e,r)};ts.prototype.keyFromPublic=function(e,r){return yE.fromPublic(this,e,r)};ts.prototype.genKeyPair=function(e){e||(e={});for(var r=new f$({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||mJ(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ze(2));;){var s=new ze(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};ts.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};ts.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new ze(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new f$({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new ze(1)),u=0;;u++){var f=i.k?i.k(u):new ze(c.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(l)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var m=f.invm(this.n).mul(p.mul(r.getPrivate()).iadd(e));if(m=m.umod(this.n),m.cmpn(0)!==0){var v=(d.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return i.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),v^=1),new Qg({r:p,s:m,recoveryParam:v})}}}}}};ts.prototype.verify=function(e,r,n,i){e=this._truncateToN(new ze(e,16)),n=this.keyFromPublic(n,i),r=new Qg(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.eqXToP(s)):(u=this.g.mulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.getX().umod(this.n).cmp(s)===0)};ts.prototype.recoverPubKey=function(t,e,r,n){d$((3&r)===r,"The recovery param is more than two bits"),e=new Qg(e,n);var i=this.n,s=new ze(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),d=a.mul(u).umod(i);return this.g.mulAdd(f,o,d)};ts.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Qg(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var yJ=Td(function(t,e){var r=e;r.version="6.5.4",r.utils=Oi,r.rand=function(){throw new Error("unsupported")},r.curve=Km,r.curves=Qm,r.ec=vJ,r.eddsa=null}),gJ=yJ.ec;const bJ="signing-key/5.7.0",q5=new ne(bJ);let _x=null;function Zs(){return _x||(_x=new gJ("secp256k1")),_x}class bc{constructor(e){de(this,"curve","secp256k1"),de(this,"privateKey",le(e)),Ns(this.privateKey)!==32&&q5.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Zs().keyFromPrivate(fe(this.privateKey));de(this,"publicKey","0x"+r.getPublic(!1,"hex")),de(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),de(this,"_isSigningKey",!0)}_addPoint(e){const r=Zs().keyFromPublic(fe(this.publicKey)),n=Zs().keyFromPublic(fe(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Zs().keyFromPrivate(fe(this.privateKey)),n=fe(e);n.length!==32&&q5.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return el({recoveryParam:i.recoveryParam,r:St("0x"+i.r.toString(16),32),s:St("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Zs().keyFromPrivate(fe(this.privateKey)),n=Zs().keyFromPublic(fe(Yg(e)));return St("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function gE(t,e){const r=el(e),n={r:fe(r.r),s:fe(r.s)};return"0x"+Zs().recoverPubKey(fe(t),n,r.recoveryParam).encode("hex",!1)}function Yg(t,e){const r=fe(t);if(r.length===32){const n=new bc(r);return e?"0x"+Zs().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?le(r):"0x"+Zs().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Zs().keyFromPublic(r).getPublic(!0,"hex"):le(r)}return q5.throwArgumentError("invalid public or private key","key","[REDACTED]")}const xJ=Object.freeze(Object.defineProperty({__proto__:null,SigningKey:bc,computePublicKey:Yg,recoverPublicKey:gE},Symbol.toStringTag,{value:"Module"})),wJ="transactions/5.7.0",wn=new ne(wJ);var ry;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(ry||(ry={}));function bE(t){return t==="0x"?null:Be(t)}function bn(t){return t==="0x"?or:te.from(t)}const EJ=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],CJ={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Xo(t){const e=Yg(t);return Be(rr(Oe(rr(e,1)),12))}function Rc(t,e){return Xo(gE(fe(t),e))}function pi(t,e){const r=Os(te.from(t).toHexString());return r.length>32&&wn.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function Px(t,e){return{address:Be(t),storageKeys:(e||[]).map((r,n)=>(Ns(r)!==32&&wn.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function nl(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&wn.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),Px(r[0],r[1])):Px(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return Px(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function h$(t){return nl(t).map(e=>[e.address,e.storageKeys])}function p$(t,e){if(t.gasPrice!=null){const n=te.from(t.gasPrice),i=te.from(t.maxFeePerGas||0);n.eq(i)||wn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[pi(t.chainId||0,"chainId"),pi(t.nonce||0,"nonce"),pi(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),pi(t.maxFeePerGas||0,"maxFeePerGas"),pi(t.gasLimit||0,"gasLimit"),t.to!=null?Be(t.to):"0x",pi(t.value||0,"value"),t.data||"0x",h$(t.accessList||[])];if(e){const n=el(e);r.push(pi(n.recoveryParam,"recoveryParam")),r.push(Os(n.r)),r.push(Os(n.s))}return xn(["0x02",eu(r)])}function m$(t,e){const r=[pi(t.chainId||0,"chainId"),pi(t.nonce||0,"nonce"),pi(t.gasPrice||0,"gasPrice"),pi(t.gasLimit||0,"gasLimit"),t.to!=null?Be(t.to):"0x",pi(t.value||0,"value"),t.data||"0x",h$(t.accessList||[])];if(e){const n=el(e);r.push(pi(n.recoveryParam,"recoveryParam")),r.push(Os(n.r)),r.push(Os(n.s))}return xn(["0x01",eu(r)])}function SJ(t,e){Ug(t,CJ);const r=[];EJ.forEach(function(o){let a=t[o.name]||[];const c={};o.numeric&&(c.hexPad="left"),a=fe(le(a,c)),o.length&&a.length!==o.length&&a.length>0&&wn.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a),o.maxLength&&(a=Os(a),a.length>o.maxLength&&wn.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a)),r.push(le(a))});let n=0;if(t.chainId!=null?(n=t.chainId,typeof n!="number"&&wn.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!Ms(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),n!==0&&(r.push(le(n)),r.push("0x"),r.push("0x")),!e)return eu(r);const i=el(e);let s=27+i.recoveryParam;return n!==0?(r.pop(),r.pop(),r.pop(),s+=n*2+8,i.v>28&&i.v!==s&&wn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==s&&wn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(le(s)),r.push(Os(fe(i.r))),r.push(Os(fe(i.s))),eu(r)}function ny(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&wn.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),SJ(t,e);switch(t.type){case 1:return m$(t,e);case 2:return p$(t,e)}return wn.throwError(`unsupported transaction type: ${t.type}`,ne.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function v$(t,e,r){try{const n=bn(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{wn.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=St(e[1],32),t.s=St(e[2],32);try{const n=Oe(r(t));t.from=Rc(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function kJ(t){const e=zg(t.slice(1));e.length!==9&&e.length!==12&&wn.throwArgumentError("invalid component count for transaction type: 2","payload",le(t));const r=bn(e[2]),n=bn(e[3]),i={type:2,chainId:bn(e[0]).toNumber(),nonce:bn(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:bn(e[4]),to:bE(e[5]),value:bn(e[6]),data:e[7],accessList:nl(e[8])};return e.length===9||(i.hash=Oe(t),v$(i,e.slice(9),p$)),i}function AJ(t){const e=zg(t.slice(1));e.length!==8&&e.length!==11&&wn.throwArgumentError("invalid component count for transaction type: 1","payload",le(t));const r={type:1,chainId:bn(e[0]).toNumber(),nonce:bn(e[1]).toNumber(),gasPrice:bn(e[2]),gasLimit:bn(e[3]),to:bE(e[4]),value:bn(e[5]),data:e[6],accessList:nl(e[7])};return e.length===8||(r.hash=Oe(t),v$(r,e.slice(8),m$)),r}function _J(t){const e=zg(t);e.length!==9&&e.length!==6&&wn.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:bn(e[0]).toNumber(),gasPrice:bn(e[1]),gasLimit:bn(e[2]),to:bE(e[3]),value:bn(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=te.from(e[6]).toNumber()}catch{return r}if(r.r=St(e[7],32),r.s=St(e[8],32),te.from(r.r).isZero()&&te.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(le(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Oe(eu(i));try{r.from=Rc(s,{r:le(r.r),s:le(r.s),recoveryParam:n})}catch{}r.hash=Oe(t)}return r.type=null,r}function xE(t){const e=fe(t);if(e[0]>127)return _J(e);switch(e[0]){case 1:return AJ(e);case 2:return kJ(e)}return wn.throwError(`unsupported transaction type: ${e[0]}`,ne.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const PJ=Object.freeze(Object.defineProperty({__proto__:null,get TransactionTypes(){return ry},accessListify:nl,computeAddress:Xo,parse:xE,recoverAddress:Rc,serialize:ny},Symbol.toStringTag,{value:"Module"})),IJ="contracts/5.7.0";var ru=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const kr=new ne(IJ);function iy(t,e){return ru(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&kr.throwArgumentError("invalid address or ENS name","name",r);try{return Be(r)}catch{}t||kr.throwError("a provider or signer is needed to resolve ENS names",ne.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&kr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function Ym(t,e,r){return ru(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>Ym(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield iy(t,e):r.type==="tuple"?yield Ym(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>Ym(t,n,r.arrayChildren))):Promise.reject(kr.makeError("invalid value for array",ne.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function Jg(t,e,r){return ru(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Mt(r.pop())),kr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=_t({override:iy(t.signer,n.from),signer:t.signer.getAddress()}).then(l=>ru(this,void 0,void 0,function*(){return Be(l.signer)!==l.override&&kr.throwError("Contract with a Signer cannot override from",ne.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),l.override})):n.from=t.signer.getAddress():n.from&&(n.from=iy(t.provider,n.from));const i=yield _t({args:Ym(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:_t(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=te.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=te.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=te.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=te.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=te.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=nl(a.accessList)),o.gasLimit==null&&e.gas!=null){let l=21e3;const u=fe(s);for(let f=0;fn[l]!=null);return c.length&&kr.throwError(`cannot override ${c.map(l=>JSON.stringify(l)).join(",")}`,ne.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),o})}function TJ(t,e){return function(...r){return Jg(t,e,r)}}function OJ(t,e){const r=t.signer||t.provider;return function(...n){return ru(this,void 0,void 0,function*(){r||kr.throwError("estimate require a provider or signer",ne.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Jg(t,e,n);return yield r.estimateGas(i)})}}function RJ(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=si(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(c,l)=>t.interface.decodeEventLog(a.eventFragment,c,l),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function y$(t,e,r){const n=t.signer||t.provider;return function(...i){return ru(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const c=Mt(i.pop());c.blockTag!=null&&(s=yield c.blockTag),delete c.blockTag,i.push(c)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield Jg(t,e,i),a=yield n.call(o,s);try{let c=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(c=c[0]),c}catch(c){throw c.code===ne.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=o),c}})}}function $J(t,e){return function(...r){return ru(this,void 0,void 0,function*(){t.signer||kr.throwError("sending a transaction requires a signer",ne.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield Jg(t,e,r),i=yield t.signer.sendTransaction(n);return RJ(t,i),i})}}function vS(t,e,r){return e.constant?y$(t,e,r):$J(t,e)}function g$(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class V0{constructor(e,r){de(this,"tag",e),de(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class MJ extends V0{constructor(){super("error",null)}}class yS extends V0{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&kr.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(g$(s),s),de(this,"address",e),de(this,"interface",r),de(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=rE(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class gS extends V0{constructor(e,r){super("*",{address:e}),de(this,"address",e),de(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class NJ{constructor(e,r,n){de(this,"interface",Qi(new.target,"getInterface")(r)),n==null?(de(this,"provider",null),de(this,"signer",null)):Tc.isSigner(n)?(de(this,"provider",n.provider||null),de(this,"signer",n)):Pa.isProvider(n)?(de(this,"provider",n),de(this,"signer",null)):kr.throwArgumentError("invalid signer or provider","signerOrProvider",n),de(this,"callStatic",{}),de(this,"estimateGas",{}),de(this,"functions",{}),de(this,"populateTransaction",{}),de(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const c=this.interface.events[a];de(this.filters,a,(...l)=>({address:this.address,topics:this.interface.encodeFilterTopics(c,l)})),o[c.name]||(o[c.name]=[]),o[c.name].push(a)}),Object.keys(o).forEach(a=>{const c=o[a];c.length===1?de(this.filters,a,this.filters[c[0]]):kr.warn(`Duplicate definition of ${a} (${c.join(", ")})`)})}if(de(this,"_runningEvents",{}),de(this,"_wrappedEmits",{}),e==null&&kr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),de(this,"address",e),this.provider)de(this,"resolvedAddress",iy(this.provider,e));else try{de(this,"resolvedAddress",Promise.resolve(Be(e)))}catch{kr.throwError("provider is required to use ENS name as contract address",ne.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){kr.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const c=a.name;i[`%${c}`]||(i[`%${c}`]=[]),i[`%${c}`].push(o)}this[o]==null&&de(this,o,vS(this,a,!0)),this.functions[o]==null&&de(this.functions,o,vS(this,a,!1)),this.callStatic[o]==null&&de(this.callStatic,o,y$(this,a,!0)),this.populateTransaction[o]==null&&de(this.populateTransaction,o,TJ(this,a)),this.estimateGas[o]==null&&de(this.estimateGas,o,OJ(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const c=a[0];try{this[o]==null&&de(this,o,this[c])}catch{}this.functions[o]==null&&de(this.functions,o,this.functions[c]),this.callStatic[o]==null&&de(this.callStatic,o,this.callStatic[c]),this.populateTransaction[o]==null&&de(this.populateTransaction,o,this.populateTransaction[c]),this.estimateGas[o]==null&&de(this.estimateGas,o,this.estimateGas[c])})}static getContractAddress(e){return qg(e)}static getInterface(e){return xr.isInterface(e)?e:new xr(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&kr.throwError("contract not deployed",ne.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||kr.throwError("sending a transactions require a signer",ne.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Mt(e||{});return["from","to"].forEach(function(n){r[n]!=null&&kr.throwError("cannot override "+n,ne.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new pE(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&de(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return H0.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new MJ);if(e==="event")return this._normalizeRunningEvent(new V0("event",null));if(e==="*")return this._normalizeRunningEvent(new gS(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new yS(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new yS(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new V0(g$(r),r))}return this._normalizeRunningEvent(new gS(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=si(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||kr.throwError("events require a provider or a signer with a provider",ne.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=Mt(i.filter);return typeof r=="string"&&qe(r,32)?(n!=null&&kr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class Od extends NJ{}class wE{constructor(e){de(this,"alphabet",e),de(this,"base",e.length),de(this,"_alphabetMap",{}),de(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n>24&255,c[e.length+1]=f>>16&255,c[e.length+2]=f>>8&255,c[e.length+3]=f&255;let d=fe(sd(i,t,c));s||(s=d.length,u=new Uint8Array(s),o=Math.ceil(n/s),l=n-(o-1)*s),u.set(d);for(let m=1;m=256)throw new Error("Depth too large!");return LS(wt([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",le(this.depth),this.parentFingerprint,Ct(le(this.index),4),this.chainCode,this.privateKey!=null?wt(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Jn(qu,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~af));const n=new Uint8Array(37);if(e&af){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(fe(this.privateKey),1),r&&(r+="'")}else n.set(fe(this.publicKey));for(let f=24;f>=0;f-=8)n[33+(f>>3)]=e>>24-f&255;const i=fe(pd(fu.sha512,this.chainCode,n)),s=i.slice(0,32),o=i.slice(32);let a=null,c=null;this.privateKey?a=om(te.from(s).add(this.privateKey).mod(mX)):c=new kc(le(s))._addPoint(this.publicKey);let l=r;const u=this.mnemonic;return u&&(l=Object.freeze({phrase:u.phrase,path:r,locale:u.locale||"en"})),new Jn(qu,a,c,this.fingerprint,om(o),e,this.depth+1,l)}derivePath(e){const r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let n=this;for(let i=0;i=af)throw new Error("invalid path index - "+s);n=n._derive(af+o)}else if(s.match(/^[0-9]+$/)){const o=parseInt(s);if(o>=af)throw new Error("invalid path index - "+s);n=n._derive(o)}else throw new Error("invalid path component - "+s)}return n}static _fromSeed(e,r){const n=fe(e);if(n.length<16||n.length>64)throw new Error("invalid seed");const i=fe(pd(fu.sha512,vX,n));return new Jn(qu,om(i.slice(0,32)),null,"0x00000000",om(i.slice(32)),0,0,r)}static fromMnemonic(e,r,n){return n=jE(n),e=ip(np(e,n),n),Jn._fromSeed(BE(e,r),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return Jn._fromSeed(e,null)}static fromExtendedKey(e){const r=uu.decode(e);(r.length!==82||LS(r.slice(0,78))!==e)&&n1.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=r[4],i=le(r.slice(5,9)),s=parseInt(le(r.slice(9,13)).substring(2),16),o=le(r.slice(13,45)),a=r.slice(45,78);switch(le(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Jn(qu,null,le(a),i,o,s,n,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new Jn(qu,le(a.slice(1)),null,i,o,s,n,null)}return n1.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function BE(t,e){e||(e="");const r=St("mnemonic"+e,js.NFKD);return LE(St(t,js.NFKD),r,2048,64,"sha512")}function np(t,e){e=jE(e),n1.checkNormalize();const r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=fe(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let l=0;l>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=F$(o);if((fe(Ao(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return le(n.slice(0,s/8))}function ip(t,e){if(e=jE(e),t=fe(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&yX(8-n)),n+=3);const i=t.length/4,s=fe(Ao(t))[0]&F$(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}function U$(t,e){try{return np(t,e),!0}catch{}return!1}function z$(t){return(typeof t!="number"||t<0||t>=af||t%1)&&n1.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}const gX=Object.freeze(Object.defineProperty({__proto__:null,HDNode:Jn,defaultPath:du,entropyToMnemonic:ip,getAccountPath:z$,isValidMnemonic:U$,mnemonicToEntropy:np,mnemonicToSeed:BE},Symbol.toStringTag,{value:"Module"})),bX="random/5.7.0",i6=new ne(bX);function xX(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof Bn<"u")return Bn;throw new Error("unable to locate global object")}const jS=xX();let cv=jS.crypto||jS.msCrypto;(!cv||!cv.getRandomValues)&&(i6.warn("WARNING: Missing strong random number source"),cv={getRandomValues:function(t){return i6.throwError("no secure random source avaialble",ne.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function Ts(t){(t<=0||t>1024||t%1||t!=t)&&i6.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return cv.getRandomValues(e),fe(e)}function FE(t){t=t.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}const wX=Object.freeze(Object.defineProperty({__proto__:null,randomBytes:Ts,shuffled:FE},Symbol.toStringTag,{value:"Module"}));var q$={exports:{}};(function(t,e){(function(r){function n(I){return parseInt(I)===I}function i(I){if(!n(I.length))return!1;for(var C=0;C255)return!1;return!0}function s(I,C){if(I.buffer&&ArrayBuffer.isView(I)&&I.name==="Uint8Array")return C&&(I.slice?I=I.slice():I=Array.prototype.slice.call(I)),I;if(Array.isArray(I)){if(!i(I))throw new Error("Array contains invalid value: "+I);return new Uint8Array(I)}if(n(I.length)&&i(I))return new Uint8Array(I);throw new Error("unsupported array-like object")}function o(I){return new Uint8Array(I)}function a(I,C,D,z,_){(z!=null||_!=null)&&(I.slice?I=I.slice(z,_):I=Array.prototype.slice.call(I,z,_)),C.set(I,D)}var c=function(){function I(D){var z=[],_=0;for(D=encodeURI(D);_191&&W<224?(z.push(String.fromCharCode((W&31)<<6|D[_+1]&63)),_+=2):(z.push(String.fromCharCode((W&15)<<12|(D[_+1]&63)<<6|D[_+2]&63)),_+=3)}return z.join("")}return{toBytes:I,fromBytes:C}}(),l=function(){function I(z){for(var _=[],W=0;W>4]+C[G&15])}return _.join("")}return{toBytes:I,fromBytes:D}}(),u={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],E=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],S=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],P=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],M=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],L=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],j=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],H=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function K(I){for(var C=[],D=0;D>2,this._Ke[W][C%4]=_[C],this._Kd[I-W][C%4]=_[C];for(var G=0,J=z,ee;J>16&255]<<24^d[ee>>8&255]<<16^d[ee&255]<<8^d[ee>>24&255]^f[G]<<24,G+=1,z!=8)for(var C=1;C>8&255]<<8^d[ee>>16&255]<<16^d[ee>>24&255]<<24;for(var C=z/2+1;C>2,ie=J%4,this._Ke[se][ie]=_[C],this._Kd[I-se][ie]=_[C++],J++}for(var se=1;se>24&255]^L[ee>>16&255]^j[ee>>8&255]^H[ee&255]},Q.prototype.encrypt=function(I){if(I.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var C=this._Ke.length-1,D=[0,0,0,0],z=K(I),_=0;_<4;_++)z[_]^=this._Ke[0][_];for(var W=1;W>24&255]^m[z[(_+1)%4]>>16&255]^v[z[(_+2)%4]>>8&255]^y[z[(_+3)%4]&255]^this._Ke[W][_];z=D.slice()}for(var G=o(16),J,_=0;_<4;_++)J=this._Ke[C][_],G[4*_]=(d[z[_]>>24&255]^J>>24)&255,G[4*_+1]=(d[z[(_+1)%4]>>16&255]^J>>16)&255,G[4*_+2]=(d[z[(_+2)%4]>>8&255]^J>>8)&255,G[4*_+3]=(d[z[(_+3)%4]&255]^J)&255;return G},Q.prototype.decrypt=function(I){if(I.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var C=this._Kd.length-1,D=[0,0,0,0],z=K(I),_=0;_<4;_++)z[_]^=this._Kd[0][_];for(var W=1;W>24&255]^E[z[(_+3)%4]>>16&255]^S[z[(_+2)%4]>>8&255]^P[z[(_+1)%4]&255]^this._Kd[W][_];z=D.slice()}for(var G=o(16),J,_=0;_<4;_++)J=this._Kd[C][_],G[4*_]=(h[z[_]>>24&255]^J>>24)&255,G[4*_+1]=(h[z[(_+3)%4]>>16&255]^J>>16)&255,G[4*_+2]=(h[z[(_+2)%4]>>8&255]^J>>8)&255,G[4*_+3]=(h[z[(_+1)%4]&255]^J)&255;return G};var Y=function(I){if(!(this instanceof Y))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new Q(I)};Y.prototype.encrypt=function(I){if(I=s(I),I.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var C=o(I.length),D=o(16),z=0;z=0;--C)this._counter[C]=I%256,I=I>>8},R.prototype.setBytes=function(I){if(I=s(I,!0),I.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=I},R.prototype.increment=function(){for(var I=15;I>=0;I--)if(this._counter[I]===255)this._counter[I]=0;else{this._counter[I]++;break}};var N=function(I,C){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",C instanceof R||(C=new R(C)),this._counter=C,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new Q(I)};N.prototype.encrypt=function(I){for(var C=s(I,!0),D=0;D16)throw new Error("PKCS#7 padding byte out of range");for(var D=I.length-C,z=0;z=64;){let B=y,I=b,C=E,D=S,z=P,_=M,W=L,G=j,J,ee,se,ie,oe;for(ee=0;ee<16;ee++)se=A+ee*4,H[ee]=(N[se]&255)<<24|(N[se+1]&255)<<16|(N[se+2]&255)<<8|N[se+3]&255;for(ee=16;ee<64;ee++)J=H[ee-2],ie=(J>>>17|J<<15)^(J>>>19|J<<13)^J>>>10,J=H[ee-15],oe=(J>>>7|J<<25)^(J>>>18|J<<14)^J>>>3,H[ee]=(ie+H[ee-7]|0)+(oe+H[ee-16]|0)|0;for(ee=0;ee<64;ee++)ie=(((z>>>6|z<<26)^(z>>>11|z<<21)^(z>>>25|z<<7))+(z&_^~z&W)|0)+(G+(v[ee]+H[ee]|0)|0)|0,oe=((B>>>2|B<<30)^(B>>>13|B<<19)^(B>>>22|B<<10))+(B&I^B&C^I&C)|0,G=W,W=_,_=z,z=D+ie|0,D=C,C=I,I=B,B=ie+oe|0;y=y+B|0,b=b+I|0,E=E+C|0,S=S+D|0,P=P+z|0,M=M+_|0,L=L+W|0,j=j+G|0,A+=64,O-=64}}K(m);let Q,Y=m.length%64,F=m.length/536870912|0,w=m.length<<3,k=Y<56?56:120,R=m.slice(m.length-Y,m.length);for(R.push(128),Q=Y+1;Q>>24&255),R.push(F>>>16&255),R.push(F>>>8&255),R.push(F>>>0&255),R.push(w>>>24&255),R.push(w>>>16&255),R.push(w>>>8&255),R.push(w>>>0&255),K(R),[y>>>24&255,y>>>16&255,y>>>8&255,y>>>0&255,b>>>24&255,b>>>16&255,b>>>8&255,b>>>0&255,E>>>24&255,E>>>16&255,E>>>8&255,E>>>0&255,S>>>24&255,S>>>16&255,S>>>8&255,S>>>0&255,P>>>24&255,P>>>16&255,P>>>8&255,P>>>0&255,M>>>24&255,M>>>16&255,M>>>8&255,M>>>0&255,L>>>24&255,L>>>16&255,L>>>8&255,L>>>0&255,j>>>24&255,j>>>16&255,j>>>8&255,j>>>0&255]}function s(m,v,y){m=m.length<=64?m:i(m);const b=64+v.length+4,E=new Array(b),S=new Array(64);let P,M=[];for(P=0;P<64;P++)E[P]=54;for(P=0;P=b-4;j--){if(E[j]++,E[j]<=255)return;E[j]=0}}for(;y>=32;)L(),M=M.concat(i(S.concat(i(E)))),y-=32;return y>0&&(L(),M=M.concat(i(S.concat(i(E))).slice(0,y))),M}function o(m,v,y,b,E){let S;for(u(m,(2*y-1)*16,E,0,16),S=0;S<2*y;S++)l(m,S*16,E,16),c(E,b),u(E,0,m,v+S*16,16);for(S=0;S>>32-v}function c(m,v){u(m,0,v,0,16);for(let y=8;y>0;y-=2)v[4]^=a(v[0]+v[12],7),v[8]^=a(v[4]+v[0],9),v[12]^=a(v[8]+v[4],13),v[0]^=a(v[12]+v[8],18),v[9]^=a(v[5]+v[1],7),v[13]^=a(v[9]+v[5],9),v[1]^=a(v[13]+v[9],13),v[5]^=a(v[1]+v[13],18),v[14]^=a(v[10]+v[6],7),v[2]^=a(v[14]+v[10],9),v[6]^=a(v[2]+v[14],13),v[10]^=a(v[6]+v[2],18),v[3]^=a(v[15]+v[11],7),v[7]^=a(v[3]+v[15],9),v[11]^=a(v[7]+v[3],13),v[15]^=a(v[11]+v[7],18),v[1]^=a(v[0]+v[3],7),v[2]^=a(v[1]+v[0],9),v[3]^=a(v[2]+v[1],13),v[0]^=a(v[3]+v[2],18),v[6]^=a(v[5]+v[4],7),v[7]^=a(v[6]+v[5],9),v[4]^=a(v[7]+v[6],13),v[5]^=a(v[4]+v[7],18),v[11]^=a(v[10]+v[9],7),v[8]^=a(v[11]+v[10],9),v[9]^=a(v[8]+v[11],13),v[10]^=a(v[9]+v[8],18),v[12]^=a(v[15]+v[14],7),v[13]^=a(v[12]+v[15],9),v[14]^=a(v[13]+v[12],13),v[15]^=a(v[14]+v[13],18);for(let y=0;y<16;++y)m[y]+=v[y]}function l(m,v,y,b){for(let E=0;E=256)return!1}return!0}function d(m,v){if(typeof m!="number"||m%1)throw new Error("invalid "+v);return m}function h(m,v,y,b,E,S,P){if(y=d(y,"N"),b=d(b,"r"),E=d(E,"p"),S=d(S,"dkLen"),y===0||y&y-1)throw new Error("N must be power of 2");if(y>2147483647/128/b)throw new Error("N too large");if(b>2147483647/128/E)throw new Error("r too large");if(!f(m))throw new Error("password must be an array or buffer");if(m=Array.prototype.slice.call(m),!f(v))throw new Error("salt must be an array or buffer");v=Array.prototype.slice.call(v);let M=s(m,v,E*128*b);const L=new Uint32Array(E*32*b);for(let z=0;zI&&(z=I);for(let W=0;WI&&(z=I);for(let W=0;W>0&255),M.push(L[W]>>8&255),M.push(L[W]>>16&255),M.push(L[W]>>24&255);const _=s(m,M,S);return P&&P(null,1,_),_}P&&C(D)};if(!P)for(;;){const z=D();if(z!=null)return z}D()}const p={scrypt:function(m,v,y,b,E,S,P){return new Promise(function(M,L){let j=0;P&&P(0),h(m,v,y,b,E,S,function(H,K,Q){if(H)L(H);else if(Q)P&&j!==1&&P(1),M(new Uint8Array(Q));else if(P&&K!==j)return j=K,P(K)})})},syncScrypt:function(m,v,y,b,E,S){return new Uint8Array(h(m,v,y,b,E,S))}};t.exports=p})()})(V$);var AX=V$.exports;const qE=Ti(AX);var _X=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const s6=new ne(W$);function BS(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}class PX extends ol{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}}function IX(t,e,r){if(_r(t,"crypto/cipher")==="aes-128-ctr"){const i=Kl(_r(t,"crypto/cipherparams/iv")),s=new lo.Counter(i),o=new lo.ModeOfOperation.ctr(e,s);return fe(o.decrypt(r))}return null}function G$(t,e){const r=Kl(_r(t,"crypto/ciphertext"));if(le(Oe(wt([e.slice(16,32),r]))).substring(2)!==_r(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const i=IX(t,e.slice(0,16),r);i||s6.throwError("unsupported cipher",ne.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const s=e.slice(32,64),o=ta(i);if(t.address){let c=t.address.toLowerCase();if(c.substring(0,2)!=="0x"&&(c="0x"+c),Be(c)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:le(i)};if(_r(t,"x-ethers/version")==="0.1"){const c=Kl(_r(t,"x-ethers/mnemonicCiphertext")),l=Kl(_r(t,"x-ethers/mnemonicCounter")),u=new lo.Counter(l),f=new lo.ModeOfOperation.ctr(s,u),d=_r(t,"x-ethers/path")||du,h=_r(t,"x-ethers/locale")||"en",p=fe(f.decrypt(c));try{const m=ip(p,h),v=Jn.fromMnemonic(m,null,h).derivePath(d);if(v.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=v.mnemonic}catch(m){if(m.code!==ne.errors.INVALID_ARGUMENT||m.argument!=="wordlist")throw m}}return new PX(a)}function K$(t,e,r,n,i){return fe(LE(t,e,r,n,i))}function TX(t,e,r,n,i){return Promise.resolve(K$(t,e,r,n,i))}function Q$(t,e,r,n,i){const s=UE(e),o=_r(t,"crypto/kdf");if(o&&typeof o=="string"){const a=function(c,l){return s6.throwArgumentError("invalid key-derivation function parameters",c,l)};if(o.toLowerCase()==="scrypt"){const c=Kl(_r(t,"crypto/kdfparams/salt")),l=parseInt(_r(t,"crypto/kdfparams/n")),u=parseInt(_r(t,"crypto/kdfparams/r")),f=parseInt(_r(t,"crypto/kdfparams/p"));(!l||!u||!f)&&a("kdf",o),l&l-1&&a("N",l);const d=parseInt(_r(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),n(s,c,l,u,f,64,i)}else if(o.toLowerCase()==="pbkdf2"){const c=Kl(_r(t,"crypto/kdfparams/salt"));let l=null;const u=_r(t,"crypto/kdfparams/prf");u==="hmac-sha256"?l="sha256":u==="hmac-sha512"?l="sha512":a("prf",u);const f=parseInt(_r(t,"crypto/kdfparams/c")),d=parseInt(_r(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),r(s,c,f,d,l)}}return s6.throwArgumentError("unsupported key-derivation function","kdf",o)}function Y$(t,e){const r=JSON.parse(t),n=Q$(r,e,K$,qE.syncScrypt);return G$(r,n)}function J$(t,e,r){return _X(this,void 0,void 0,function*(){const n=JSON.parse(t),i=yield Q$(n,e,TX,qE.scrypt,r);return G$(n,i)})}function X$(t,e,r,n){try{if(Be(t.address)!==ta(t.privateKey))throw new Error("address/privateKey mismatch");if(BS(t)){const v=t.mnemonic;if(Jn.fromMnemonic(v.phrase,null,v.locale).derivePath(v.path||du).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(v){return Promise.reject(v)}typeof r=="function"&&!n&&(n=r,r={}),r||(r={});const i=fe(t.privateKey),s=UE(e);let o=null,a=null,c=null;if(BS(t)){const v=t.mnemonic;o=fe(np(v.phrase,v.locale||"en")),a=v.path||du,c=v.locale||"en"}let l=r.client;l||(l="ethers.js");let u=null;r.salt?u=fe(r.salt):u=Ts(32);let f=null;if(r.iv){if(f=fe(r.iv),f.length!==16)throw new Error("invalid iv")}else f=Ts(16);let d=null;if(r.uuid){if(d=fe(r.uuid),d.length!==16)throw new Error("invalid uuid")}else d=Ts(16);let h=1<<17,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),qE.scrypt(s,u,h,p,m,64,n).then(v=>{v=fe(v);const y=v.slice(0,16),b=v.slice(16,32),E=v.slice(32,64),S=new lo.Counter(f),P=new lo.ModeOfOperation.ctr(y,S),M=fe(P.encrypt(i)),L=Oe(wt([b,M])),j={address:t.address.substring(2).toLowerCase(),id:CX(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:le(f).substring(2)},ciphertext:le(M).substring(2),kdf:"scrypt",kdfparams:{salt:le(u).substring(2),n:h,dklen:32,p:m,r:p},mac:L.substring(2)}};if(o){const H=Ts(16),K=new lo.Counter(H),Q=new lo.ModeOfOperation.ctr(E,K),Y=fe(Q.encrypt(o)),F=new Date,w=F.getUTCFullYear()+"-"+kh(F.getUTCMonth()+1,2)+"-"+kh(F.getUTCDate(),2)+"T"+kh(F.getUTCHours(),2)+"-"+kh(F.getUTCMinutes(),2)+"-"+kh(F.getUTCSeconds(),2)+".0Z";j["x-ethers"]={client:l,gethFilename:"UTC--"+w+"--"+j.address,mnemonicCounter:le(H).substring(2),mnemonicCiphertext:le(Y).substring(2),path:a,locale:c,version:"0.1"}}return JSON.stringify(j)})}function Z$(t,e,r){if(ub(t)){r&&r(0);const n=zE(t,e);return r&&r(1),Promise.resolve(n)}return fb(t)?J$(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function eM(t,e){if(ub(t))return zE(t,e);if(fb(t))return Y$(t,e);throw new Error("invalid JSON wallet")}const OX=Object.freeze(Object.defineProperty({__proto__:null,decryptCrowdsale:zE,decryptJsonWallet:Z$,decryptJsonWalletSync:eM,decryptKeystore:J$,decryptKeystoreSync:Y$,encryptKeystore:X$,getJsonWalletAddress:H$,isCrowdsaleWallet:ub,isKeystoreWallet:fb},Symbol.toStringTag,{value:"Module"})),RX="wallet/5.7.0";var FS=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Wu=new ne(RX);function $X(t){return t!=null&&qe(t.privateKey,32)&&t.address!=null}function MX(t){const e=t.mnemonic;return e&&e.phrase}let tM=class cf extends Dc{constructor(e,r){if(super(),$X(e)){const n=new kc(e.privateKey);if(de(this,"_signingKey",()=>n),de(this,"address",ta(this.publicKey)),this.address!==Be(e.address)&&Wu.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),MX(e)){const i=e.mnemonic;de(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||du,locale:i.locale||"en"}));const s=this.mnemonic,o=Jn.fromMnemonic(s.phrase,null,s.locale).derivePath(s.path);ta(o.privateKey)!==this.address&&Wu.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else de(this,"_mnemonic",()=>null)}else{if(kc.isSigningKey(e))e.curve!=="secp256k1"&&Wu.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),de(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);const n=new kc(e);de(this,"_signingKey",()=>n)}de(this,"_mnemonic",()=>null),de(this,"address",ta(this.publicKey))}r&&!Ra.isProvider(r)&&Wu.throwArgumentError("invalid provider","provider",r),de(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new cf(this,e)}signTransaction(e){return At(e).then(r=>{r.from!=null&&(Be(r.from)!==this.address&&Wu.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);const n=this._signingKey().signDigest(Oe(my(r)));return my(r,n)})}signMessage(e){return FS(this,void 0,void 0,function*(){return ay(this._signingKey().signDigest(ep(e)))})}_signTypedData(e,r,n){return FS(this,void 0,void 0,function*(){const i=yield kr.resolveNames(e,r,n,s=>(this.provider==null&&Wu.throwError("cannot resolve ENS names without a provider",ne.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:s}),this.provider.resolveName(s)));return ay(this._signingKey().signDigest(kr.hash(i.domain,r,i.value)))})}encrypt(e,r,n){if(typeof r=="function"&&!n&&(n=r,r={}),n&&typeof n!="function")throw new Error("invalid callback");return r||(r={}),X$(this,e,r,n)}static createRandom(e){let r=Ts(16);e||(e={}),e.extraEntropy&&(r=fe(rr(Oe(wt([r,e.extraEntropy])),0,16)));const n=ip(r,e.locale);return cf.fromMnemonic(n,e.path,e.locale)}static fromEncryptedJson(e,r,n){return Z$(e,r,n).then(i=>new cf(i))}static fromEncryptedJsonSync(e,r){return new cf(eM(e,r))}static fromMnemonic(e,r,n){return r||(r=du),new cf(Jn.fromMnemonic(e,null,n).derivePath(r))}};function WE(t,e){return jc(ep(t),e)}function rM(t,e,r,n){return jc(kr.hash(t,e,r),n)}const NX=Object.freeze(Object.defineProperty({__proto__:null,Wallet:tM,verifyMessage:WE,verifyTypedData:rM},Symbol.toStringTag,{value:"Module"})),DX="networks/5.7.1",US=new ne(DX);function LX(t){return t&&typeof t.renetwork=="function"}function qo(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return qo(r)},e}function yy(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return yy(t,n)},r}const zS={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:qo("homestead")},qS={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:qo("ropsten")},WS={chainId:63,name:"classicMordor",_defaultProvider:yy("https://www.ethercluster.com/mordor","classicMordor")},am={unspecified:{chainId:0,name:"unspecified"},homestead:zS,mainnet:zS,morden:{chainId:2,name:"morden"},ropsten:qS,testnet:qS,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:qo("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:qo("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:qo("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:qo("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:yy("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:WS,classicTestnet:WS,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:yy("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:qo("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:qo("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function jX(t){if(t==null)return null;if(typeof t=="number"){for(const n in am){const i=am[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=am[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=am[t.name];if(!e)return typeof t.chainId!="number"&&US.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&US.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(LX(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const BX="web/5.7.1";var FX=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};function UX(t,e){return FX(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:fe(new Uint8Array(i))}})}var zX=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const xs=new ne(BX);function HS(t){return new Promise(e=>{setTimeout(e,t)})}function Ga(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Ds(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return cs(t)}catch{}return le(t)}return t}function qX(t){return St(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function HE(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;xs.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;xs.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let c=null;const l={method:"GET"};let u=!1,f=2*60*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&xs.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(f=t.timeout),t.headers)for(const y in t.headers)a[y.toLowerCase()]={key:y,value:String(t.headers[y])},["if-none-match","if-modified-since"].indexOf(y.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&xs.throwError("basic authentication requires a secure https url",ne.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const y=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+SE(St(y))}}t.skipFetchSetup!=null&&(l.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(l.fetchOptions=Mt(t.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(d):null;if(h)try{const y={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?CE(h[3]):qX(h[3])};let b=y.body;return r&&(b=r(y.body,y)),Promise.resolve(b)}catch(y){xs.throwError("processing response error",ne.errors.SERVER_ERROR,{body:Ga(h[1],h[2]),error:y,requestBody:null,requestMethod:"GET",url:c})}e&&(l.method="POST",l.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(a).forEach(y=>{const b=a[y];p[b.key]=b.value}),l.headers=p;const m=function(){let y=null;return{promise:new Promise(function(S,P){f&&(y=setTimeout(()=>{y!=null&&(y=null,P(xs.makeError("timeout",ne.errors.TIMEOUT,{requestBody:Ga(l.body,p["content-type"]),requestMethod:l.method,timeout:f,url:c})))},f))}),cancel:function(){y!=null&&(clearTimeout(y),y=null)}}}(),v=function(){return zX(this,void 0,void 0,function*(){for(let y=0;y=300)&&(m.cancel(),xs.throwError("bad response",ne.errors.SERVER_ERROR,{status:b.statusCode,headers:b.headers,body:Ga(E,b.headers?b.headers["content-type"]:null),requestBody:Ga(l.body,p["content-type"]),requestMethod:l.method,url:c})),r)try{const S=yield r(E,b);return m.cancel(),S}catch(S){if(S.throttleRetry&&y{let a=null;if(s!=null)try{a=JSON.parse(cs(s))}catch(c){xs.throwError("invalid JSON",ne.errors.SERVER_ERROR,{body:s,error:c})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=St(e);const s=typeof t=="string"?{url:t}:Mt(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=Mt(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return HE(t,i,n)}function Jo(t,e){return e||(e={}),e=Mt(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let c=0;function l(){return t().then(function(u){if(u!==void 0)o()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",l);else if(e.onceBlock)e.onceBlock.once("block",l);else if(!s){if(c++,c>a){o()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));fe.ceiling&&(f=e.ceiling),setTimeout(l,f)}return null},function(u){o()&&n(u)})}l()})}const WX=Object.freeze(Object.defineProperty({__proto__:null,_fetchData:HE,fetchJson:Ud,poll:Jo},Symbol.toStringTag,{value:"Module"}));var gy="qpzry9x8gf2tvdw0s3jn54khce6mua7l",o6={};for(var cm=0;cm>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function nM(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=Gf(e)^n>>5}for(e=Gf(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=nM(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=Gf(n)^o,i+=gy.charAt(o)}for(s=0;s<6;++s)n=Gf(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=gy.charAt(a)}return i}function iM(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=nM(s);if(typeof a=="string")return a;for(var c=[],l=0;l=o.length)&&c.push(f)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:c}}function VX(){var t=iM.apply(null,arguments);if(typeof t=="object")return t}function GX(t){var e=iM.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function db(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(f,!0);return e.transaction={hash:o,type:l,accessList:Ce.allowNull(this.accessList.bind(this),null),blockHash:Ce.allowNull(o,null),blockNumber:Ce.allowNull(c,null),transactionIndex:Ce.allowNull(c,null),confirmations:Ce.allowNull(c,null),from:r,gasPrice:Ce.allowNull(n),maxPriorityFeePerGas:Ce.allowNull(n),maxFeePerGas:Ce.allowNull(n),gasLimit:n,to:Ce.allowNull(r,null),value:n,nonce:c,data:s,r:Ce.allowNull(this.uint256),s:Ce.allowNull(this.uint256),v:Ce.allowNull(c),creates:Ce.allowNull(r,null),raw:Ce.allowNull(s)},e.transactionRequest={from:Ce.allowNull(r),nonce:Ce.allowNull(c),gasLimit:Ce.allowNull(n),gasPrice:Ce.allowNull(n),maxPriorityFeePerGas:Ce.allowNull(n),maxFeePerGas:Ce.allowNull(n),to:Ce.allowNull(r),value:Ce.allowNull(n),data:Ce.allowNull(u),type:Ce.allowNull(c),accessList:Ce.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:r,topics:Ce.arrayOf(o),data:s,logIndex:c,blockHash:o},e.receipt={to:Ce.allowNull(this.address,null),from:Ce.allowNull(this.address,null),contractAddress:Ce.allowNull(r,null),transactionIndex:c,root:Ce.allowNull(a),gasUsed:n,logsBloom:Ce.allowNull(s),blockHash:o,transactionHash:o,logs:Ce.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:Ce.allowNull(c,null),cumulativeGasUsed:n,effectiveGasPrice:Ce.allowNull(n),status:Ce.allowNull(c),type:l},e.block={hash:Ce.allowNull(o),parentHash:o,number:c,timestamp:c,nonce:Ce.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Ce.allowNull(r),extraData:s,transactions:Ce.allowNull(Ce.arrayOf(o)),baseFeePerGas:Ce.allowNull(n)},e.blockWithTransactions=Mt(e.block),e.blockWithTransactions.transactions=Ce.allowNull(Ce.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Ce.allowNull(i,void 0),toBlock:Ce.allowNull(i,void 0),blockHash:Ce.allowNull(o,void 0),address:Ce.allowNull(r,void 0),topics:Ce.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Ce.allowNull(c),blockHash:Ce.allowNull(o),transactionIndex:c,removed:Ce.allowNull(this.boolean.bind(this)),address:r,data:Ce.allowFalsish(s,"0x"),topics:Ce.arrayOf(o),transactionHash:o,logIndex:c},e}accessList(e){return cl(e||[])}number(e){return e==="0x"?0:te.from(e).toNumber()}type(e){return e==="0x"||e==null?0:te.from(e).toNumber()}bigNumber(e){return te.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),qe(e))?e.toLowerCase():Ah.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Be(e)}callAddress(e){if(!qe(e,32))return null;const r=Be(rr(e,12));return r===Dt?null:r}contractAddress(e){return tb(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||qe(e))return Zi(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Ls(n)!==32?Ah.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=te.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!qe(e))throw new Error("invalid uint256");return Ct(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=Ce.check(r,e);return i._difficulty=n==null?null:te.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Ce.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&te.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=Ce.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;qe(n)&&(n=te.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),qe(n)&&(n=te.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return ME(e)}receiptLog(e){return Ce.check(this.formats.receiptLog,e)}receipt(e){const r=Ce.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=te.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&Ah.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):Ah.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&Ah.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return Ce.check(this.formats.filter,e)}filterLog(e){return Ce.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function ZX(t){return t&&typeof t.isCommunityResource=="function"}function GS(t){return ZX(t)&&t.isCommunityResource()}var je=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Je=new ne(zd),eZ=10;function KS(t){return t==null?"null":(Ls(t)!==32&&Je.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function QS(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[KS(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return KS(e)}).join("&")}function tZ(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Hu(t){if(typeof t=="string"){if(t=t.toLowerCase(),Ls(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+QS(t);if(tY.isForkEvent(t))throw Je.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+QS(t.topics||[])}throw new Error("invalid event - "+t)}function _h(){return new Date().getTime()}function YS(t){return new Promise(e=>{setTimeout(e,t)})}const rZ=["block","network","pending","poll"];let nZ=class{constructor(e,r,n){de(this,"tag",e),de(this,"listener",r),de(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=tZ(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||rZ.indexOf(this.tag)>=0}};const iZ={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function qx(t){return Ct(te.from(t).toHexString(),32)}function JS(t){return uu.encode(wt([t,rr(Ao(Ao(t)),0,4)]))}const sM=new RegExp("^(ipfs)://(.*)$","i"),XS=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),sM,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function lv(t,e){try{return cs(i1(t,e))}catch{}return null}function i1(t,e){if(t==="0x")return null;const r=te.from(rr(t,e,e+32)).toNumber(),n=te.from(rr(t,r,r+32)).toNumber();return rr(t,r+32,r+32+n)}function Wx(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Je.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function ZS(t){const e=fe(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function sZ(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function oM(t){const e=[];let r=0;for(let n=0;nte.from(e).eq(1)).catch(e=>{if(e.code===ne.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return je(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:xn([e,Vf(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=xn(["0x9061b923",oM([kE(this.name),n.data])]));try{let s=yield this.provider.call(n);return fe(s).length%32===4&&Je.throwError("resolver threw error",ne.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=i1(s,0)),s}catch(s){if(s.code===ne.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return je(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?i1(n,0):null})}_getAddress(e,r){const n=iZ[String(e)];if(n==null&&Je.throwError(`unsupported coin type: ${e}`,ne.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=fe(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return JS(wt([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return JS(wt([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=VS.toWords(i.slice(2));return a.unshift(o),VS.encode(n.prefix,a)}}return null}getAddress(e){return je(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===uy?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===ne.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",qx(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Je.throwError("invalid or unsupported coin data",ne.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return je(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[c])}return Je.throwError("invalid or unsupported content hash data",ne.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return je(this,void 0,void 0,function*(){let r=St(e);r=wt([qx(64),qx(r.length),r]),r.length%32!==0&&(r=wt([r,Ct("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",le(r));return n==null||n==="0x"?null:cs(n)})}}let Hx=null,oZ=1;class hb extends Ra{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),de(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Ji(new.target,"getNetwork")(e);r?(de(this,"_network",r),this.emit("network",r,null)):Je.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return je(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Je.throwError("no network detected",ne.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:de(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Jo(()=>this._ready().then(e=>e,e=>{if(!(e.code===ne.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return Hx==null&&(Hx=new Ce),Hx}static getNetwork(e){return jX(e??"homestead")}ccipReadFetch(e,r,n){return je(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),f=yield Ud({url:l,errorPassThrough:!0},u,(h,p)=>(h.status=p.statusCode,h));if(f.data)return f.data;const d=f.message||"unknown error";if(f.status>=400&&f.status<500)return Je.throwError(`response not found during CCIP fetch: ${d}`,ne.errors.SERVER_ERROR,{url:c,errorMessage:d});o.push(d)}return Je.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,ne.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return je(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(_h()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=_h(),n=At({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=_h();return i=te.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return je(this,void 0,void 0,function*(){const e=oZ++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Je.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Je.makeError("network block skew detected",ne.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(c=>{i._inflight=!1,c.length!==0&&c.forEach(l=>{l.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=l.blockNumber),this._emitted["b:"+l.blockHash]=l.blockNumber,this._emitted["t:"+l.transactionHash]=l.blockNumber,this.emit(s,l)})}).catch(c=>{this.emit("error",c),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return je(this,void 0,void 0,function*(){return Je.throwError("provider does not support network detection",ne.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return je(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield YS(0),this._network;const n=Je.makeError("underlying network changed",ne.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=_h();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return je(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return je(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const c=[];let l=!1;const u=function(){return l?!0:(l=!0,c.forEach(d=>{d()}),!1)},f=d=>{d.confirmations{this.removeListener(e,f)}),i){let d=i.startBlock,h=null;const p=m=>je(this,void 0,void 0,function*(){l||(yield YS(1e3),this.getTransactionCount(i.from).then(v=>je(this,void 0,void 0,function*(){if(!l){if(v<=i.nonce)d=m;else{{const y=yield this.getTransaction(e);if(y&&y.blockNumber!=null)return}for(h==null&&(h=d-3,h{l||this.once("block",p)}))});if(l)return;this.once("block",p),c.push(()=>{this.removeListener("block",p)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{u()||a(Je.makeError("timeout exceeded",ne.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),c.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return je(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return je(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return te.from(e)}catch(r){return Je.throwError("bad result from backend",ne.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return je(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield At({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return te.from(i)}catch(s){return Je.throwError("bad result from backend",ne.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return je(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield At({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return te.from(i).toNumber()}catch(s){return Je.throwError("bad result from backend",ne.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return je(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield At({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return le(i)}catch(s){return Je.throwError("bad result from backend",ne.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return je(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield At({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>Zi(o))}),s=yield this.perform("getStorageAt",i);try{return le(s)}catch(o){return Je.throwError("bad result from backend",ne.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&Ls(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Je.throwError("Transaction hash mismatch from Provider.sendTransaction.",ne.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>je(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const c=yield this._waitForTransaction(e.hash,s,o,a);return c==null&&s===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&Je.throwError("transaction failed",ne.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),i}sendTransaction(e){return je(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>le(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return je(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?te.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?le(s):null))}),this.formatter.transactionRequest(yield At(n))})}_getFilter(e){return je(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield At(r))})}_call(e,r,n){return je(this,void 0,void 0,function*(){n>=eZ&&Je.throwError("CCIP read exceeded maximum redirections",ne.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&Ls(s)%32===4)try{const o=rr(s,4),a=rr(o,0,32);te.from(a).eq(i)||Je.throwError("CCIP Read sender did not match",ne.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const c=[],l=te.from(rr(o,32,64)).toNumber(),u=te.from(rr(o,l,l+32)).toNumber(),f=rr(o,l+32);for(let y=0;yje(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let c=0;cthis._wrapTransaction(c)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return je(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Jo(()=>je(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return je(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Jo(()=>je(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return je(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield At({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),Ce.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return je(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return je(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Je.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return je(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new a6(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return je(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Je.throwError("network does not support ENS",ne.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Vf(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return je(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(qe(e))throw n}typeof e!="string"&&Je.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return je(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=lv(yield this.call({to:n,data:"0x691f3431"+Vf(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return je(this,void 0,void 0,function*(){let r=null;if(qe(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new a6(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==ne.errors.CALL_EXCEPTION)throw a}try{const a=lv(yield this.call({to:o,data:"0x691f3431"+Vf(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==ne.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Je.throwError(e+" not implemented",ne.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new nZ(Hu(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Hu(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Hu(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Hu(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Hu(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Hu(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var Bo=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Mr=new ne(zd),aZ=["call","estimateGas"];function d0(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=qe(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=d0(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return d0(JSON.parse(t),e)}catch{}return null}function aM(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=d0(e,!0);if(s)return s.data;Mr.throwError("missing revert data in call exception; Transaction reverted without a reason string",ne.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=d0(e.body,!1);s==null&&(s=d0(e,!1)),s&&Mr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ne.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===ne.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Mr.throwError("insufficient funds for intrinsic transaction cost",ne.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Mr.throwError("nonce has already been used",ne.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Mr.throwError("replacement fee too low",ne.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Mr.throwError("legacy pre-eip-155 transactions not supported",ne.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),aZ.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Mr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ne.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function ek(t){return new Promise(function(e){setTimeout(e,t)})}function cZ(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Ph(t){return t&&t.toLowerCase()}const c6={};class cM extends Dc{constructor(e,r,n){if(super(),e!==c6)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");de(this,"provider",r),n==null&&(n=0),typeof n=="string"?(de(this,"_address",this.provider.formatter.address(n)),de(this,"_index",null)):typeof n=="number"?(de(this,"_index",n),de(this,"_address",null)):Mr.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return Mr.throwError("cannot alter JSON-RPC Signer connection",ne.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new lZ(c6,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&Mr.throwError("unknown account #"+this._index,ne.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Mt(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Mt(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>Bo(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&Mr.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),At({tx:At(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&Mr.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&Mr.throwError("user rejected transaction",ne.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),aM("sendTransaction",o,s)))})}signTransaction(e){return Mr.throwError("signing transactions is unsupported",ne.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Bo(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield Jo(()=>Bo(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return Bo(this,void 0,void 0,function*(){const r=typeof e=="string"?St(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[le(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Mr.throwError("user rejected signing",ne.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return Bo(this,void 0,void 0,function*(){const r=typeof e=="string"?St(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),le(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Mr.throwError("user rejected signing",ne.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return Bo(this,void 0,void 0,function*(){const i=yield kr.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(kr.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&Mr.throwError("user rejected signing",ne.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return Bo(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class lZ extends cM{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const uZ={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let ha=class extends hb{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Ji(this.constructor,"defaultUrl")()),typeof e=="string"?de(this,"connection",Object.freeze({url:e})):de(this,"connection",Object.freeze(Mt(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Bo(this,void 0,void 0,function*(){yield ek(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Ji(this.constructor,"getNetwork");try{return r(te.from(e).toNumber())}catch(n){return Mr.throwError("could not detect network",ne.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return Mr.throwError("could not detect network",ne.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new cM(c6,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:oi(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=Ud(this.connection,JSON.stringify(n),cZ).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Ph(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Ph(r.address),r.blockTag]];case"getCode":return["eth_getCode",[Ph(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Ph(r.address),Ct(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Ji(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Ji(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=Ph(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return Bo(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&te.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Mt(r),r.transaction=Mt(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&Mr.throwError(e+" not implemented",ne.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return aM(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),o.then(function(){return ek(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=Mt(uZ);if(r)for(const s in r)r[s]&&(n[s]=!0);Zg(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=Zi(te.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=le(e[s]))}),e.accessList&&(i.accessList=cl(e.accessList)),i}};var fZ=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const dZ=new ne(zd);class by extends ha{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return fZ(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||dZ.throwError("no network detected",ne.errors.UNKNOWN_ERROR,{}),this._network==null&&(de(this,"_network",r),this.emit("network",r,null))),r})}}var xy=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const $l=new ne(zd);function lm(){return new Date().getTime()}function tk(t){let e=null;for(let r=0;re?null:(n+i)/2}function _f(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(te.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>_f(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=_f(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let hZ=1;function nk(t){let e=null,r=null,n=new Promise(o=>{e=function(){r&&(clearTimeout(r),r=null),o()},r=setTimeout(e,t)});const i=o=>(n=n.then(o),n);function s(){return n}return{cancel:e,getPromise:s,wait:i}}const pZ=[ne.errors.CALL_EXCEPTION,ne.errors.INSUFFICIENT_FUNDS,ne.errors.NONCE_EXPIRED,ne.errors.REPLACEMENT_UNDERPRICED,ne.errors.UNPREDICTABLE_GAS_LIMIT],mZ=["address","args","errorArgs","errorSignature","method","transaction"];function um(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function vZ(t,e){return function(r){const n={};r.forEach(s=>{const o=t(s.result);n[o]||(n[o]={count:0,result:s.result}),n[o].count++});const i=Object.keys(n);for(let s=0;s=e)return o.result}}}function yZ(t,e,r){let n=_f;switch(e){case"getBlockNumber":return function(i){const s=i.map(a=>a.result);let o=rk(i.map(a=>a.result),2);if(o!=null)return o=Math.ceil(o),s.indexOf(o+1)>=0&&o++,o>=t._highestBlockNumber&&(t._highestBlockNumber=o),t._highestBlockNumber};case"getGasPrice":return function(i){const s=i.map(o=>o.result);return s.sort(),s[Math.floor(s.length/2)]};case"getEtherPrice":return function(i){return rk(i.map(s=>s.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=Mt(i),i.confirmations=-1,_f(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=Mt(i),i.transactions=i.transactions.map(s=>(s=Mt(s),s.confirmations=-1,s)),_f(i))}:n=function(i){return i==null?null:_f(i)};break;default:throw new Error("unknown method: "+e)}return vZ(n,t.quorum)}function Ih(t,e){return xy(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:Jo(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function gZ(t,e,r,n){return xy(this,void 0,void 0,function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&qe(n.blockTag)&&(i=yield Ih(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&qe(n.blockTag)&&(i=yield Ih(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&qe(n.blockTag)&&(i=yield Ih(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&qe(n.blockTag)&&(i=yield Ih(t,e)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&qe(s.fromBlock)||s.toBlock&&qe(s.toBlock))&&(i=yield Ih(t,e)),i.getLogs(s)}}return $l.throwError("unknown method error",ne.errors.UNKNOWN_ERROR,{method:r,params:n})})}class bZ extends hb{constructor(e,r){e.length===0&&$l.throwArgumentError("missing providers","providers",e);const n=e.map((o,a)=>{if(Ra.isProvider(o)){const u=GS(o)?2e3:750;return Object.freeze({provider:o,weight:1,stallTimeout:u,priority:1})}const c=Mt(o);c.priority==null&&(c.priority=1),c.stallTimeout==null&&(c.stallTimeout=GS(o)?2e3:750),c.weight==null&&(c.weight=1);const l=c.weight;return(l%1||l>512||l<1)&&$l.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,l),Object.freeze(c)}),i=n.reduce((o,a)=>o+a.weight,0);r==null?r=i/2:r>i&&$l.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let s=tk(n.map(o=>o.provider.network));s==null&&(s=new Promise((o,a)=>{setTimeout(()=>{this.detectNetwork().then(o,a)},0)})),super(s),de(this,"providerConfigs",Object.freeze(n)),de(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return xy(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return tk(e)})}perform(e,r){return xy(this,void 0,void 0,function*(){if(e==="sendTransaction"){const c=yield Promise.all(this.providerConfigs.map(l=>l.provider.sendTransaction(r.signedTransaction).then(u=>u.hash,u=>u)));for(let l=0;lc.priority-l.priority);const s=this._highestBlockNumber;let o=0,a=!0;for(;;){const c=lm();let l=i.filter(h=>h.runner&&c-h.starth+p.weight,0);for(;l{h.staller=null}),h.runner=gZ(h,s,e,r).then(m=>{h.done=!0,h.result=m,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:um(h,lm()),request:{method:e,params:oi(r)},provider:this})},m=>{h.done=!0,h.error=m,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:um(h,lm()),request:{method:e,params:oi(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:um(h,null),request:{method:e,params:oi(r)},provider:this}),l+=h.weight}const u=[];i.forEach(h=>{h.done||!h.runner||(u.push(h.runner),h.staller&&u.push(h.staller.getPromise()))}),u.length&&(yield Promise.race(u));const f=i.filter(h=>h.done&&h.error==null);if(f.length>=this.quorum){const h=n(f);if(h!==void 0)return i.forEach(p=>{p.staller&&p.staller.cancel(),p.cancelled=!0}),h;a||(yield nk(100).getPromise()),a=!1}const d=i.reduce((h,p)=>{if(!p.done||p.error==null)return h;const m=p.error.code;return pZ.indexOf(m)>=0&&(h[m]||(h[m]={error:p.error,weight:0}),h[m].weight+=p.weight),h},{});if(Object.keys(d).forEach(h=>{const p=d[h];if(p.weight{y.staller&&y.staller.cancel(),y.cancelled=!0});const m=p.error,v={};mZ.forEach(y=>{m[y]!=null&&(v[y]=m[y])}),$l.throwError(m.reason||m.message,h,v)}),i.filter(h=>!h.done).length===0)break}return i.forEach(c=>{c.staller&&c.staller.cancel(),c.cancelled=!0}),$l.throwError("failed to meet quorum",ne.errors.SERVER_ERROR,{method:e,params:r,results:i.map(c=>um(c)),provider:this})})}}const ik=new ne(zd);let xZ=1;function sk(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:xZ++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:oi(s),provider:this}),e(s,(c,l)=>{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:s,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:l,provider:this}),l.error){const u=new Error(l.error.message);return u.code=l.error.code,u.data=l.error.data,a(u)}o(l.result)})})}}function wZ(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:oi(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class lM extends ha{constructor(e,r){e==null&&ik.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=wZ(e)):e.sendAsync?i=sk(e,e.sendAsync.bind(e)):e.send?i=sk(e,e.send.bind(e)):ik.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),de(this,"jsonRpcFetchFunc",i),de(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const EZ="solidity/5.7.0",CZ=new RegExp("^bytes([0-9]+)$"),SZ=new RegExp("^(u?int)([0-9]*)$"),kZ=new RegExp("^(.*)\\[([0-9]*)\\]$"),AZ="0000000000000000000000000000000000000000000000000000000000000000",lf=new ne(EZ);function uM(t,e,r){switch(t){case"address":return r?qf(e,32):fe(e);case"string":return St(e);case"bytes":return fe(e);case"bool":return e=e?"0x01":"0x00",r?qf(e,32):fe(e)}let n=t.match(SZ);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)&&lf.throwArgumentError("invalid number type","type",t),r&&(i=256),e=te.from(e).toTwos(i),qf(e,i/8)}if(n=t.match(CZ),n){const i=parseInt(n[1]);return(String(i)!==n[1]||i===0||i>32)&&lf.throwArgumentError("invalid bytes type","type",t),fe(e).byteLength!==i&&lf.throwArgumentError(`invalid value for ${t}`,"value",e),r?fe((e+AZ).substring(0,66)):e}if(n=t.match(kZ),n&&Array.isArray(e)){const i=n[1];parseInt(n[2]||String(e.length))!=e.length&&lf.throwArgumentError(`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(uM(i,a,!0))}),wt(o)}return lf.throwArgumentError("invalid type","type",t)}function Qe(t,e){t.length!=e.length&&lf.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(uM(n,e[i]))}),le(wt(r))}function ra(t,e){return Oe(Qe(t,e))}function fM(t,e){return Ao(Qe(t,e))}const _Z=Object.freeze(Object.defineProperty({__proto__:null,keccak256:ra,pack:Qe,sha256:fM},Symbol.toStringTag,{value:"Module"})),PZ="units/5.7.0",dM=new ne(PZ),hM=["wei","kwei","mwei","gwei","szabo","finney","ether"];function pM(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||t==="."||t==="-.")&&dM.throwArgumentError("invalid value","value",t);let r=e[0],n="";for(r.substring(0,1)==="-"&&(n="-",r=r.substring(1));r.substring(0,1)==="0";)r=r.substring(1);r===""&&(r="0");let i="";for(e.length===2&&(i="."+(e[1]||"0"));i.length>2&&i[i.length-1]==="0";)i=i.substring(0,i.length-1);const s=[];for(;r.length;)if(r.length<=3){s.unshift(r);break}else{const o=r.length-3;s.unshift(r.substring(o)),r=r.substring(0,o)}return n+s.join(",")+i}function Nt(t,e){if(typeof e=="string"){const r=hM.indexOf(e);r!==-1&&(e=3*r)}return rv(t,e??18)}function hu(t,e){if(typeof t!="string"&&dM.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=hM.indexOf(e);r!==-1&&(e=3*r)}return Qs(t,e??18)}function mM(t){return Nt(t,18)}function vM(t){return hu(t,18)}const IZ=Object.freeze(Object.defineProperty({__proto__:null,commify:pM,formatEther:mM,formatUnits:Nt,parseEther:vM,parseUnits:hu},Symbol.toStringTag,{value:"Module"})),TZ=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:rb,ConstructorFragment:Vi,ErrorFragment:ao,EventFragment:As,FormatTypes:at,Fragment:Ps,FunctionFragment:Gi,HDNode:Jn,Indexed:t1,Interface:wr,LogDescription:AE,Logger:ne,ParamType:Nr,RLP:NR,SigningKey:kc,get SupportedAlgorithm(){return fu},TransactionDescription:_E,get TransactionTypes(){return py},get UnicodeNormalizationForm(){return js},Utf8ErrorFuncs:bE,get Utf8ErrorReason(){return Nn},_TypedDataEncoder:kr,_fetchData:HE,_toEscapedUtf8String:VR,accessListify:cl,arrayify:fe,base58:uu,base64:XR,checkProperties:Zg,checkResultErrors:vE,commify:pM,computeAddress:ta,computeHmac:pd,computePublicKey:cb,concat:wt,deepCopy:oi,defaultAbiCoder:_n,defaultPath:du,defineReadOnly:de,dnsEncode:kE,entropyToMnemonic:ip,fetchJson:Ud,formatBytes32String:GR,formatEther:mM,formatUnits:Nt,getAccountPath:z$,getAddress:Be,getContractAddress:tb,getCreate2Address:jR,getIcapAddress:LR,getJsonWalletAddress:H$,getStatic:Ji,hashMessage:ep,hexConcat:xn,hexDataLength:Ls,hexDataSlice:rr,hexStripZeros:hE,hexValue:Zi,hexZeroPad:Ct,hexlify:le,id:Yo,isAddress:gE,isBytes:Ia,isBytesLike:Ds,isHexString:qe,isValidMnemonic:U$,isValidName:i$,joinSignature:ay,keccak256:Oe,mnemonicToEntropy:np,mnemonicToSeed:BE,namehash:Vf,nameprep:YR,parseBytes32String:KR,parseEther:vM,parseTransaction:ME,parseUnits:hu,poll:Jo,randomBytes:Ts,recoverAddress:jc,recoverPublicKey:RE,resolveProperties:At,ripemd160:DE,serializeTransaction:my,sha256:Ao,sha512:j$,shallowCopy:Mt,shuffled:FE,solidityKeccak256:ra,solidityPack:Qe,soliditySha256:fM,splitSignature:sl,stripZeros:$s,toUtf8Bytes:St,toUtf8CodePoints:e1,toUtf8String:cs,verifyMessage:WE,verifyTypedData:rM,zeroPad:qf},Symbol.toStringTag,{value:"Module"})),yM="3.7.6",OZ=yM,RZ=typeof atob=="function",$Z=typeof btoa=="function",qd=typeof il=="function",ok=typeof TextDecoder=="function"?new TextDecoder:void 0,ak=typeof TextEncoder=="function"?new TextEncoder:void 0,MZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Yh=Array.prototype.slice.call(MZ),fm=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(Yh),NZ=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,rn=String.fromCharCode.bind(String),ck=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),gM=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),bM=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),xM=t=>{let e,r,n,i,s="";const o=t.length%3;for(let a=0;a255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=Yh[e>>18&63]+Yh[e>>12&63]+Yh[e>>6&63]+Yh[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},VE=$Z?t=>btoa(t):qd?t=>il.from(t,"binary").toString("base64"):xM,l6=qd?t=>il.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?gM(l6(t)):l6(t),DZ=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?rn(192|e>>>6)+rn(128|e&63):rn(224|e>>>12&15)+rn(128|e>>>6&63)+rn(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return rn(240|e>>>18&7)+rn(128|e>>>12&63)+rn(128|e>>>6&63)+rn(128|e&63)}},LZ=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,wM=t=>t.replace(LZ,DZ),lk=qd?t=>il.from(t,"utf8").toString("base64"):ak?t=>l6(ak.encode(t)):t=>VE(wM(t)),Kf=(t,e=!1)=>e?gM(lk(t)):lk(t),uk=t=>Kf(t,!0),jZ=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,BZ=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return rn((r>>>10)+55296)+rn((r&1023)+56320);case 3:return rn((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return rn((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},EM=t=>t.replace(jZ,BZ),CM=t=>{if(t=t.replace(/\s+/g,""),!NZ.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,i;for(let s=0;s>16&255):i===64?rn(e>>16&255,e>>8&255):rn(e>>16&255,e>>8&255,e&255);return r},GE=RZ?t=>atob(bM(t)):qd?t=>il.from(t,"base64").toString("binary"):CM,SM=qd?t=>ck(il.from(t,"base64")):t=>ck(GE(t).split("").map(e=>e.charCodeAt(0))),kM=t=>SM(AM(t)),FZ=qd?t=>il.from(t,"base64").toString("utf8"):ok?t=>ok.decode(SM(t)):t=>EM(GE(t)),AM=t=>bM(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),u6=t=>FZ(AM(t)),UZ=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},_M=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),PM=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,_M(r));t("fromBase64",function(){return u6(this)}),t("toBase64",function(e){return Kf(this,e)}),t("toBase64URI",function(){return Kf(this,!0)}),t("toBase64URL",function(){return Kf(this,!0)}),t("toUint8Array",function(){return kM(this)})},IM=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,_M(r));t("toBase64",function(e){return uv(this,e)}),t("toBase64URI",function(){return uv(this,!0)}),t("toBase64URL",function(){return uv(this,!0)})},zZ=()=>{PM(),IM()},pu={version:yM,VERSION:OZ,atob:GE,atobPolyfill:CM,btoa:VE,btoaPolyfill:xM,fromBase64:u6,toBase64:Kf,encode:Kf,encodeURI:uk,encodeURL:uk,utob:wM,btou:EM,decode:u6,isValid:UZ,fromUint8Array:uv,toUint8Array:kM,extendString:PM,extendUint8Array:IM,extendBuiltins:zZ};var f6=function(){return f6=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0&&(i.types.Claims.push({name:"app",type:"string"}),i.message.app=this.claims.app),this.claims.iat&&this.claims.iat>0&&(i.types.Claims.push({name:"iat",type:"int64"}),i.message.iat=this.claims.iat),this.claims.exp&&this.claims.exp>0&&(i.types.Claims.push({name:"exp",type:"int64"}),i.message.exp=this.claims.exp),this.claims.n&&this.claims.n>0&&(i.types.Claims.push({name:"n",type:"uint64"}),i.message.n=this.claims.n),this.claims.typ&&this.claims.typ.length>0&&(i.types.Claims.push({name:"typ",type:"string"}),i.message.typ=this.claims.typ),this.claims.ogn&&this.claims.ogn.length>0&&(i.types.Claims.push({name:"ogn",type:"string"}),i.message.ogn=this.claims.ogn),this.claims.v&&this.claims.v.length>0&&(i.types.Claims.push({name:"v",type:"string"}),i.message.v=this.claims.v),i},t}(),WZ=function(t){if(t.app==="")return{ok:!1,err:new Error("claims: app is empty")};var e=Math.round(new Date().getTime()/1e3),r=5*60,n=60*60*24*365+r;return t.v===""?{ok:!1,err:new Error("claims: ethauth version is empty")}:t.iat&&t.iat!==0&&(t.iat>e+r||t.iate+n?{ok:!1,err:new Error("claims: token has expired")}:{ok:!0}},HZ=function(t,e,r){return Ml(void 0,void 0,void 0,function(){var n,i;return Nl(this,function(s){return n=r.messageDigest(),i=WE(n,r.signature),i.slice(0,2)==="0x"&&i.length===42&&i.toLowerCase()===r.address.toLowerCase()?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]})})},VZ=function(t,e,r){return Ml(void 0,void 0,void 0,function(){var n,i,s,o,a;return Nl(this,function(c){switch(c.label){case 0:return!t||t===void 0?[2,{isValid:!1}]:(n=r.messageDigest(),[4,t.getCode(r.address)]);case 1:if(i=c.sent(),i==="0x"||i.length<=2)throw new Error("ValidateContractAccountProof failed. unable to fetch wallet contract code");return s=["function isValidSignature(bytes32, bytes) public view returns (bytes4)"],o=new Fd(r.address,s,t),[4,o.isValidSignature(n,fe(r.signature))];case 2:return a=c.sent(),a===GZ?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]}})})},GZ="0x1626ba7e",TM="1",d6="eth",KZ={name:"ETHAuth",version:TM},s1=function(){function t(){for(var e=[],r=0;r0&&(c+="."+i.extra),[2,c]}})})},this.decodeProof=function(i,s){return s===void 0&&(s=!1),Ml(n,void 0,void 0,function(){var o,a,c,l,u,f,d,h,p,m;return Nl(this,function(v){switch(v.label){case 0:if(o=i.split("."),o.length<4||o.length>5)throw new Error("ethauth: invalid proof string");if(a=o[0],c=o[1],l=o[2],u=o[3],f=o[4],a!==d6)throw new Error("ethauth: not an ethauth proof");return d=pu.decode(l),h=JSON.parse(d),p=new pb({address:c,claims:h,signature:u,extra:f}),[4,this.validateProof(p,s)];case 1:if(m=v.sent(),!m)throw new Error("ethauth: proof is invalid");return[2,p]}})})},this.validateProof=function(i,s){return s===void 0&&(s=!1),Ml(n,void 0,void 0,function(){var o,a;return Nl(this,function(c){switch(c.label){case 0:if(o=this.validateProofClaims(i),o.err)throw new Error("ethauth: proof claims are invalid ".concat(o.err));return s===!0?[3,2]:[4,this.validateProofSignature(i)];case 1:if(a=c.sent(),a!==!0)throw new Error("ethauth: proof signature is invalid");c.label=2;case 2:return[2,!0]}})})},this.validateProofSignature=function(i){return Ml(n,void 0,void 0,function(){var s,c,o,a,c;return Nl(this,function(l){switch(l.label){case 0:s=[],c=0,l.label=1;case 1:if(!(cpu.encode(t,!0),KE=t=>pu.encode(JSON.stringify(t),!0),YZ=t=>{if(t!=null)return pu.decode(t)},QE=t=>{if(t!=null)return JSON.parse(pu.decode(t))};function OM(t){return t!=null&&(te.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||qe(t)||typeof t=="bigint"||Ia(t))}const YE=t=>fe(Oe(typeof t=="string"?St(t):t)),RM=(t,e,r)=>Qe(["string","uint256","address","bytes32"],["",e,t,r]),h6=(t,e,r)=>Oe(RM(t,e,r)),$M=()=>typeof window>"u"&&typeof nn=="object",JZ=()=>!$M(),MM=t=>{const e=t.split(".");if(e.length!==3)throw new Error("invalid jwt");return JSON.parse(pu.decode(e[1]))};function wy(){return wy=Object.assign?Object.assign.bind():function(t){for(var e=1;eSe.configure(t),o1=(t,e,r)=>{const n={};return r&&r.length>0&&(n.Authorization=`BEARER ${r}`),e&&e.length>0&&(n["X-Access-Key"]=e),{url:t,headers:n,skipFetchSetup:!0,fetchOptions:{mode:"cors",cache:"force-cache",credentials:"same-origin",redirect:"follow",referrer:"client"}}};let ZZ=class{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${Oe(St(JSON.stringify(i,eee)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}};function eee(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function JE(t,e){return function(...r){const n=Array.prototype.slice.call(r);return new Promise(async(i,s)=>{try{n.push((o,a)=>o?s(o):i(a)),await t.apply(e,n)}catch(o){s(o)}})}}function tee(t,e){const r=encodeURIComponent(t),n=encodeURIComponent(JSON.stringify(e));return`${r}=${n}`}function ree(t){const e=t.split("&"),r={};for(const n of e){const i=n.split("=");r[decodeURIComponent(i[0])]=JSON.parse(decodeURIComponent(i[1]))}return r}const XE=(t=0,e=Number.MAX_SAFE_INTEGER)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),DM=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\d.]+/);return e&&e.length>0?e[0].trim():""},LM=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\s\d]+/);return e&&e.length>0?e[0].trim():""},jM=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\d.\-:\/]+/);return e&&e.length>0?e[0].trim():""},nee=t=>new Promise(e=>{const r=setTimeout(()=>{clearTimeout(r),e()},t)}),BM=t=>{const e=wy({},t.types);return delete e.EIP712Domain,kr.hash(t.domain,e,t.message)},sp=t=>fe(BM(t)),{defineReadOnly:iee,getStatic:see,resolveProperties:oee,checkProperties:aee,shallowCopy:cee,deepCopy:lee}=TZ,uee=t=>t.replace(/([^:]\/)\/+/g,"$1"),fee=Object.freeze(Object.defineProperty({__proto__:null,Logger:NM,PromiseCache:ZZ,base64Decode:YZ,base64DecodeObject:QE,base64Encode:QZ,base64EncodeObject:KE,checkProperties:aee,configureLogger:XZ,deepCopy:lee,defineReadOnly:iee,encodeMessageDigest:YE,encodeTypedDataDigest:sp,encodeTypedDataHash:BM,getEthersConnectionInfo:o1,getRandomInt:XE,getStatic:see,isBigNumberish:OM,isBrowser:JZ,isNode:$M,jwtDecodeClaims:MM,logger:Se,packMessageData:RM,promisify:JE,queryStringFromObject:tee,queryStringToObject:ree,resolveProperties:oee,sanitizeAlphanumeric:LM,sanitizeHost:jM,sanitizeNumberString:DM,shallowCopy:cee,sleep:nee,subDigestOf:h6,urlClean:uee},Symbol.toStringTag,{value:"Module"}));function ft(){return ft=Object.assign?Object.assign.bind():function(t){for(var e=1;etypeof t=="number"?t:t.chainId?t.chainId:te.from(t).toNumber(),hee=t=>{if(t)return FM(t)},UM=(t,e=!1,r=!1)=>{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(l=>l.chainId).sort(),s=i.filter((l,u)=>i.indexOf(l)!==u);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(l=>l.name=l.name.toLowerCase());const o=n.map(l=>l.name).sort(),a=o.filter((l,u)=>o.indexOf(l)!==u);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let c=!1;for(let l=0;l(UM(t,!0,e),t),pee=(t,e=!0)=>{const r=t.map(i=>i.chainId).sort(),n=r.filter((i,s)=>r.indexOf(i)!==s);if(n.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${n}`);return!1}return!0},mee=(t,e)=>{if(!(!t||!e)){if(!t.chainId&&!t.name)throw new Error("failed to update network config: source config is missing chainId or name");if(t.chainId!==e.chainId&&t.name!==e.name)throw new Error("failed to update network config: one of chainId or name must match");t.rpcUrl&&(e.rpcUrl=t.rpcUrl,e.provider=void 0),t.provider&&(e.provider=t.provider),t.relayer&&(e.relayer=t.relayer)}},qM=t=>zM(WM(t)),Ms=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=te.from(e).toNumber();return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(te.isBigNumber(e)){const r=e.toNumber();return t.find(n=>n.chainId===r)}else return}},vee=(t,e)=>t?t.name===e||t.chainId===e:!1,yee=t=>{const e={};for(let r=0;r{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},mb=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",ZE=t=>mb("https://${network}-indexer.sequence.app",{network:t}),HM=t=>mb("https://${network}-relayer.sequence.app",{network:t}),VM=t=>mb("https://nodes.sequence.app/${network}",{network:t});function eC(t){return Ms(md,t)}function GM(t){return te.isBigNumber(t)?t:OM(t)?te.from(t):te.from(t.chainId)}const It=t=>{const e=VM(t);return{rpcUrl:e,relayer:{url:HM(t),provider:{url:e}},indexerUrl:ZE(t)}},md=qM([ft({},lt[ue.POLYGON],It("polygon"),{isDefaultChain:!0,isAuthChain:!0}),ft({},lt[ue.MAINNET],It("mainnet")),ft({},lt[ue.BSC],It("bsc")),ft({},lt[ue.AVALANCHE],It("avalanche")),ft({},lt[ue.ARBITRUM],It("arbitrum")),ft({},lt[ue.ARBITRUM_NOVA],It("arbitrum-nova")),ft({},lt[ue.OPTIMISM],It("optimism")),ft({},lt[ue.OPTIMISM_SEPOLIA],It("optimism-sepolia")),ft({},lt[ue.POLYGON_ZKEVM],It("polygon-zkevm")),ft({},lt[ue.GNOSIS],It("gnosis")),ft({},lt[ue.RINKEBY],It("rinkeby"),{disabled:!0}),ft({},lt[ue.GOERLI],It("goerli"),{disabled:!0}),ft({},lt[ue.SEPOLIA],It("sepolia")),ft({},lt[ue.POLYGON_MUMBAI],It("mumbai"),{disabled:!0}),ft({},lt[ue.POLYGON_AMOY],It("amoy")),ft({},lt[ue.BSC_TESTNET],It("bsc-testnet")),ft({},lt[ue.ARBITRUM_SEPOLIA],It("arbitrum-sepolia")),ft({},lt[ue.BASE],It("base")),ft({},lt[ue.BASE_SEPOLIA],It("base-sepolia")),ft({},lt[ue.HOMEVERSE],It("homeverse")),ft({},lt[ue.HOMEVERSE_TESTNET],It("homeverse-testnet")),ft({},lt[ue.XAI],It("xai")),ft({},lt[ue.XAI_SEPOLIA],It("xai-sepolia")),ft({},lt[ue.AVALANCHE_TESTNET],It("avalanche-testnet")),ft({},lt[ue.ASTAR_ZKEVM],It("astar-zkevm")),ft({},lt[ue.ASTAR_ZKYOTO],It("astar-zkyoto")),ft({},lt[ue.XR_SEPOLIA],It("xr-sepolia")),ft({},lt[ue.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),ft({},lt[ue.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})]),vd="2.0";class tC{constructor(e,r){this.sender=void 0,this.handler=void 0,this.sender=r,e&&this.setMiddleware(e)}setMiddleware(e){this.handler=KM(e,this.sender.sendAsync)}sendAsync(e,r,n){try{this.handler(e,r,n)}catch(i){r(i,void 0)}}}const KM=(t,e)=>{if(t.length===0)return e;const r=i=>i.sendAsyncMiddleware?i.sendAsyncMiddleware:i;let n;n=r(t[t.length-1])(e);for(let i=t.length-2;i>=0;i--)n=r(t[i])(n);return n};function QM(t){return t!==void 0&&t.send!==void 0&&t.constructor.defaultUrl!==void 0&&t.detectNetwork!==void 0&&t.getSigner!==void 0&&t.perform!==void 0}function YM(t){return t!==void 0&&t.sendAsync!==void 0}let gee=0;class Ey{constructor(e,r){this.send=void 0,this.request=void 0,this.defaultChainId=void 0,this.sendAsync=(n,i,s)=>{this.send(n.method,n.params,s||this.defaultChainId).then(o=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:o})}).catch(o=>{i(o,void 0)})},this.defaultChainId=r,QM(e)?this.send=e.send.bind(e):YM(e)?this.send=(n,i,s)=>new Promise((o,a)=>{e.sendAsync({jsonrpc:vd,id:++gee,method:n,params:i},(c,l)=>{c?a(c):o(l?l.result:void 0)},s||this.defaultChainId)}):this.send=e,this.request=(n,i)=>this.send(n.method,n.params,i)}}class bee{constructor(e){this.provider=e,this.sendAsync=(r,n)=>{this.provider.send(r.method,r.params).then(i=>{n(void 0,{jsonrpc:"2.0",id:r.id,result:i})}).catch(i=>{n(i,void 0)})},this.send=this.sendAsync}}class xee{constructor(e){this.sendAsyncMiddleware=void 0,this.isAllowedFunc=void 0,e?this.isAllowedFunc=e:this.isAllowedFunc=r=>!0,this.sendAsyncMiddleware=p6(this.isAllowedFunc)}setIsAllowedFunc(e){this.isAllowedFunc=e,this.sendAsyncMiddleware=p6(this.isAllowedFunc)}}const p6=t=>e=>(r,n,i)=>{if(!t(r))throw new Error("allowProvider middleware precondition is unmet.");e(r,n,i)};class rC{constructor(e){this.cachableJsonRpcMethods=["net_version","eth_chainId","eth_accounts","sequence_getWalletContext","sequence_getNetworks"],this.cachableJsonRpcMethodsByBlock=["eth_call","eth_getCode"],this.cache=void 0,this.cacheByBlock=void 0,this.cacheByBlockResetLock=!1,this.onUpdateCallback=void 0,this.defaultChainId=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{if(this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method)){const o=this.cacheKey(n.method,n.params,s||this.defaultChainId),a=this.getCacheValue(o);if(a&&a!==""){i(void 0,{jsonrpc:"2.0",id:n.id,result:a});return}}r(n,(o,a,c)=>{if((this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method))&&a&&a.result&&this.shouldCacheResponse(n,a)){const l=this.cacheKey(n.method,n.params,c||this.defaultChainId);this.cachableJsonRpcMethods.includes(n.method)?this.setCacheValue(l,a.result):this.setCacheByBlockValue(l,a.result)}i(o,a)},s||this.defaultChainId)},this.cacheKey=(r,n,i)=>{let s="";return i?s=`${i}:${r}:`:s=`:${r}:`,!n||n.length===0?s+"[]":s+JSON.stringify(n)},this.getCache=()=>this.cache,this.setCache=r=>{this.cache=r,this.onUpdateCallback&&this.onUpdateCallback()},this.getCacheValue=r=>{if(this.cache[r])return this.cache[r];if(this.cacheByBlock[r])return this.cacheByBlock[r]},this.setCacheValue=(r,n)=>{this.cache[r]=n,this.onUpdateCallback&&this.onUpdateCallback(r,n)},this.setCacheByBlockValue=(r,n)=>{this.cacheByBlock[r]=n,this.cacheByBlockResetLock||(this.cacheByBlockResetLock=!0,setTimeout(()=>{this.cacheByBlockResetLock=!1,this.cacheByBlock={}},1500))},this.shouldCacheResponse=(r,n)=>!(!n||!n.result||r.method==="eth_getCode"&&n.result.length<=2),this.clearCache=()=>{this.cache={},this.cacheByBlock={}},this.cache={},this.cacheByBlock={},this.defaultChainId=e==null?void 0:e.defaultChainId,e!=null&&e.blockCache?(e==null?void 0:e.blockCache)!==!0&&(this.cachableJsonRpcMethodsByBlock=e==null?void 0:e.blockCache):this.cachableJsonRpcMethodsByBlock=[]}onUpdate(e){this.onUpdateCallback=e}}class JM{constructor(e){this.options=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{const{id:o,method:a}=n;switch(a){case"net_version":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:`${this.options.chainId}`});return}break;case"eth_chainId":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:le(this.options.chainId)});return}break;case"eth_accounts":if(this.options.accountAddress){i(void 0,{jsonrpc:"2.0",id:o,result:[Be(this.options.accountAddress)]});return}break;case"sequence_getWalletContext":if(this.options.walletContext){i(void 0,{jsonrpc:"2.0",id:o,result:this.options.walletContext});return}break}r(n,i,s)},this.options=e}}const XM=t=>(e,r,n)=>{t(e,(i,s)=>{if(!i&&s&&s.error)throw typeof s.error=="string"?new Error(s.error):new Error(s.error.message);r(i,s)},n)},ZM=t=>(e,r,n)=>{const i=n?` chainId:${n}`:"";Se.info(`[provider request]${i} id:${e.id} method:${e.method} params:`,e.params),t(e,(s,o)=>{s?Se.warn(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"error:",s):Se.info(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"response:",o),r(s,o)},n)},wee=t=>e=>(r,n,i)=>{const s=t(r),{id:o,method:a}=r;switch(a){case"net_version":n(void 0,{jsonrpc:"2.0",id:o,result:`${s}`});return;case"eth_chainId":n(void 0,{jsonrpc:"2.0",id:o,result:le(s)});return}e(r,n,i)},eN=["personal_sign","eth_sign","eth_signTypedData","eth_signTypedData_v4","eth_sendTransaction","eth_sendRawTransaction","sequence_sign","sequence_signTypedData_v4","sequence_getWalletContext","sequence_getWalletConfig","sequence_getWalletState","sequence_getNetworks","sequence_updateConfig","sequence_publishConfig","sequence_gasRefundOptions","sequence_getNonce","sequence_relay","eth_decrypt","eth_getEncryptionPublicKey","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class Eee{constructor(e){this.provider=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{if(eN.includes(n.method)){this.provider.sendAsync(n,i,s);return}r(n,i,s)},this.provider=e}}class Cee{constructor(e){this.privateJsonRpcMethods=["net_version","eth_chainId","eth_accounts",...eN],this.provider=void 0,this.rpcUrl=void 0,this.sendAsyncMiddleware=r=>(n,i)=>{if(this.provider&&!this.privateJsonRpcMethods.includes(n.method)){this.provider.send(n.method,n.params).then(s=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:s})}).catch(s=>i(s));return}Se.debug("[public-provider] sending request to signer window",n.method),r(n,i)},e&&this.setRpcUrl(e)}getRpcUrl(){return this.rpcUrl}setRpcUrl(e){!e||e===""?(this.rpcUrl=void 0,this.provider=void 0):(this.rpcUrl=e,this.provider=new ha(e))}}class tN{constructor(){this.singleflightJsonRpcMethods=["eth_chainId","net_version","eth_call","eth_getCode","eth_blockNumber","eth_getBalance","eth_getStorageAt","eth_getTransactionCount","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_getBlockByHash","eth_getBlockByNumber","eth_getTransactionByHash","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionReceipt","eth_getUncleByBlockHashAndIndex","eth_getUncleByBlockNumberAndIndex","eth_getLogs"],this.inflight=void 0,this.sendAsyncMiddleware=e=>(r,n,i)=>{if(!this.singleflightJsonRpcMethods.includes(r.method)){e(r,n,i);return}const s=this.requestKey(r.method,r.params||[],i);if(!this.inflight[s])this.inflight[s]=[];else{this.inflight[s].push({id:r.id,callback:n});return}e(r,(o,a,c)=>{n(o,a);for(let l=0;l{let i="";return n?i=`${n}:${e}:`:i=`:${e}:`,!r||r.length===0?i+"[]":i+JSON.stringify(r)},this.inflight={}}}class See extends ha{constructor(e,r){super(e,r==null?void 0:r.chainId),this._chainId=void 0,this._sender=void 0,this.send=(a,c)=>this._sender.send(a,c),this.fetch=(a,c)=>{const l={method:a,params:c,id:this._nextId++,jsonrpc:"2.0"};return Ud(this.connection,JSON.stringify(l),kee).then(f=>f,f=>{throw f})};const n=r==null?void 0:r.chainId,i=r==null?void 0:r.middlewares,s=r==null?void 0:r.blockCache;this._chainId=n;const o=new tC(i??[new JM({chainId:n}),new tN,new rC({defaultChainId:n,blockCache:s})],new Ey(this.fetch,n));this._sender=new Ey(o,n)}async getNetwork(){const e=this._chainId;if(e){const r=lt[e],n=(r==null?void 0:r.name)||"",i=r==null?void 0:r.ensAddress;return{name:n,chainId:e,ensAddress:i}}else{const r=await this.send("eth_chainId",[]);return this._chainId=te.from(r).toNumber(),this.getNetwork()}}}function kee(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}const Aee=Object.freeze(Object.defineProperty({__proto__:null,AllowProvider:xee,CachedProvider:rC,ChainId:ue,EagerProvider:JM,JsonRpcExternalProvider:bee,JsonRpcProvider:See,JsonRpcRouter:tC,JsonRpcSender:Ey,JsonRpcVersion:vd,NetworkType:ot,PublicProvider:Cee,SigningProvider:Eee,SingleflightMiddleware:tN,allNetworks:md,allowProviderMiddleware:p6,checkNetworkConfig:vee,createJsonRpcMiddlewareStack:KM,ensureUniqueNetworks:pee,ensureValidNetworks:zM,exceptionProviderMiddleware:XM,findNetworkConfig:Ms,findSupportedNetwork:eC,getChainId:FM,indexerURL:ZE,isJsonRpcHandler:YM,isJsonRpcProvider:QM,isNetworkConfig:dee,isValidNetworkConfig:UM,loggingProviderMiddleware:ZM,maybeChainId:hee,networkProviderMiddleware:wee,networks:lt,networksIndex:yee,nodesURL:VM,relayerURL:HM,sortNetworks:WM,stringTemplate:mb,toChainIdNumber:GM,updateNetworkConfig:mee,validateAndSortNetworks:qM},Symbol.toStringTag,{value:"Module"}));function an(){return an=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(iC(i))return Qe(["uint8","uint8","address"],[Ql.Address,i.weight,i.address]);if(i.isDynamic){const s=fe(i.signature);return Qe(["uint8","uint8","address","uint16","bytes"],[Ql.DynamicSignature,i.weight,i.address,s.length,s])}return Qe(["uint8","uint8","bytes"],[Ql.EOASignature,i.weight,i.signature])});return Qe(["uint16",...new Array(n.length).fill("bytes")],[r,...n])}async function aN(t,e,r){const n=op(e),i=await Promise.all(t.signers.map(async s=>{if(iC(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!nC(s.address,n,s.signature,r))throw new Error(`Invalid dynamic signature part ${s.address}`);return{address:s.address,weight:s.weight,signature:s.signature}}else return{address:ap(n,s.signature),weight:s.weight,signature:s.signature}}));return{version:1,payload:e,subdigest:n,config:{version:1,threshold:t.threshold,signers:i}}}function h0(t,e,r,n){if(r.length!==0)throw new Error("Explicit subdigests not supported on v1");let i=te.from(0);const s=t.signers.map(a=>{if(!e.has(a.address))return a;const c=e.get(a.address),l=fe(c.signature);return i=i.add(a.weight),c.isDynamic||l.length!==66?an({},a,{isDynamic:!0,signature:c.signature,address:a.address}):an({},a,{isDynamic:!1,signature:c.signature})});return{encoded:sC({version:1,threshold:t.threshold,signers:s}),weight:i}}const oC={decode:t=>oN(t),encode:t=>sC(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>aN(t,e,r),encodeSigners:(t,e,r,n)=>h0(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=oC.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(t){throw new Error("Image hash not supported on v1")},signaturesOf(t){return t.signers.filter(e=>e.signature!==void 0).map(e=>({address:e.address,signature:e.signature}))},signaturesOfDecoded:function(t){return t.signers.map(e=>e.signature).filter(e=>e!==void 0)}};var Nee=Object.freeze({__proto__:null,SignaturePartType:Ql,isAddressMember:iC,isUnrecoveredSignatureMember:iN,isUnrecoveredSignature:sN,decodeSignature:oN,encodeSignature:sC,recoverSignature:aN,encodeSigners:h0,SignatureCoder:oC});const aC={isWalletConfig:t=>t.version===1&&t.threshold!==void 0&&t.signers!==void 0,imageHashOf:t=>t.signers.reduce((e,r)=>Oe(_n.encode(["bytes32","uint8","address"],[e,r.weight,r.address])),Qe(["uint256"],[t.threshold])),hasSubdigest:(t,e)=>!1,isComplete:t=>!0,checkpointOf:t=>te.from(0),signersOf:t=>t.signers.map(e=>({address:e.address,weight:te.from(e.weight).toNumber()})),fromSimple:t=>{if(!or.eq(t.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(t.subdigests&&t.subdigests.length>0)throw new Error("v1 wallet config does not support subdigests");return{version:1,threshold:t.threshold,signers:t.signers}},update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new wr([...Jr.mainModule.abi,...Jr.mainModuleUpgradable.abi]),s=[];return(!n||n==="first")&&s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImplementation"),[r.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[aC.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:t,transactions:s}},decodeTransaction:function(t){throw new Error("Function not implemented.")}},toJSON:function(t){const e=t.signers.map(r=>({weight:te.from(r.weight).toString(),address:r.address}));return JSON.stringify({version:t.version,threshold:te.from(t.threshold).toString(),signers:e})},fromJSON:function(t){const e=JSON.parse(t),r=e.signers.map(n=>({weight:te.from(n.weight),address:n.address}));return{version:e.version,threshold:te.from(e.threshold),signers:r}},editConfig:function(t,e){var r;const n=t.signers.slice();if(e.checkpoint&&!or.eq(e.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(e.add)for(const i of e.add)n.find(s=>s.address===i.address)||n.push({weight:i.weight,address:i.address});if(e.remove)for(const i of e.remove){const s=n.findIndex(o=>o.address===i);s>=0&&n.splice(s,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,signers:n}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=h0(t,r,[]);if(a.gte(t.threshold))return o}const n=t.signers;for(const{address:i}of n.sort(({weight:s},{weight:o})=>te.from(s).sub(o).toNumber())){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=h0(t,r,[]);if(a.gte(t.threshold))return o}return h0(t,r,[]).encoded}};var Dee=Object.freeze({__proto__:null,ConfigCoder:aC});const cN=1,lN={version:cN,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var Vo=Object.freeze({__proto__:null,config:Dee,signature:Nee,version:cN,DeployedWalletContext:lN});const cC="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function uN(t){return Oe(fN(t))}function fN(t){return Qe(["bytes32","bytes32"],[cC,t])}function dN(t){const e=fe(t);if(e.length===64&&le(e.slice(0,32))===cC)return le(e.slice(32,64))}function Lee(t){return dN(t)!==void 0}var jee=Object.freeze({__proto__:null,SetImageHashPrefix:cC,hashSetImageHash:uN,messageSetImageHash:fN,decodeMessageSetImageHash:dN,isMessageSetImageHash:Lee});let Qr=function(t){return t[t.Legacy=0]="Legacy",t[t.Dynamic=1]="Dynamic",t[t.NoChainIdDynamic=2]="NoChainIdDynamic",t[t.Chained=3]="Chained",t}({}),yr=function(t){return t[t.Signature=0]="Signature",t[t.Address=1]="Address",t[t.DynamicSignature=2]="DynamicSignature",t[t.Node=3]="Node",t[t.Branch=4]="Branch",t[t.Subdigest=5]="Subdigest",t[t.Nested=6]="Nested",t}({});const Cy=66;function mu(t){return t.left!==void 0&&t.right!==void 0}function Wd(t){return t.tree!==void 0}function cp(t){return t.unrecovered&&t.signature!==void 0&&t.isDynamic!==void 0}function Sy(t){let e=fe(t),r;const n=(i,s)=>i?i.right?{left:i,right:s}:{left:i.left,right:s}:{left:s};for(;e.length>0;){const i=e[0];switch(e=e.slice(1),i){case yr.Signature:{const s=e[0],o=le(e.slice(1,Cy+1));r=n(r,{signature:o,weight:s,unrecovered:!0,isDynamic:!1}),e=e.slice(Cy+1)}break;case yr.Address:{const s=e[0],o=Be(le(e.slice(1,21)));r=n(r,{address:o,weight:s}),e=e.slice(21)}break;case yr.DynamicSignature:{const s=e[0],o=Be(le(e.slice(1,21))),a=e[21]<<16|e[22]<<8|e[23],c=le(e.slice(24,24+a));r=n(r,{address:o,signature:c,weight:s,unrecovered:!0,isDynamic:!0}),e=e.slice(24+a)}break;case yr.Node:{const s=le(e.slice(0,32));r=n(r,{nodeHash:s}),e=e.slice(32)}break;case yr.Branch:{const s=e[0]<<16|e[1]<<8|e[2],o=Sy(e.slice(3,3+s));r=n(r,o),e=e.slice(3+s)}break;case yr.Subdigest:{const s=le(e.slice(0,32));r=n(r,{subdigest:s}),e=e.slice(32)}break;case yr.Nested:{const s=e[0],o=e[1]<<8|e[2],a=e[3]<<16|e[4]<<8|e[5],c=Sy(e.slice(6,6+a));r=n(r,{weight:s,threshold:o,tree:c}),e=e.slice(6+a)}break;default:throw new Error(`Unknown signature part type: ${i}: ${le(e)}`)}}if(!r)throw new Error("Empty signature tree");return r.right?r:r.left}class hN extends Error{constructor(e){super(`Invalid signature leaf: ${JSON.stringify(e)}`),this.leaf=e}}async function Yl(t,e,r){if(mu(t)){const[n,i]=await Promise.all([Yl(t.left,e,r),Yl(t.right,e,r)]);return{left:n,right:i}}if(Wd(t))return{weight:t.weight,threshold:t.threshold,tree:await Yl(t.tree,e,r)};if(cp(t))if(t.isDynamic){if(!t.address)throw new Error("Dynamic signature leaf without address");if(!await nC(t.address,e,t.signature,r))throw new hN(t);return{weight:t.weight,address:t.address,signature:t.signature,subdigest:e}}else return{weight:t.weight,address:ap(e,t.signature),signature:t.signature,subdigest:e};return t}const mn={concat:(t,e)=>Qe(["bytes","bytes"],[t,e]),node:t=>Qe(["uint8","bytes32"],[yr.Node,t]),branch:t=>{const e=fe(t);return Qe(["uint8","uint24","bytes"],[yr.Branch,e.length,e])},nested:(t,e,r)=>{const n=fe(r);return Qe(["uint8","uint8","uint16","uint24","bytes"],[yr.Nested,t,e,n.length,n])},subdigest:t=>Qe(["uint8","bytes32"],[yr.Subdigest,t]),signature:(t,e)=>Qe(["uint8","uint8","bytes"],[yr.Signature,t,e]),dynamicSignature:(t,e,r)=>{const n=fe(r);return Qe(["uint8","uint8","address","uint24","bytes"],[yr.DynamicSignature,t,e,n.length,n])},address:(t,e)=>Qe(["uint8","uint8","address"],[yr.Address,t,e])};function p0(t,e,r,n,i={}){const s=m0(t.tree,e,r,i);return te.from(n).isZero()?{encoded:Qe(["uint8","uint16","uint32","bytes"],[Qr.NoChainIdDynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:te.from(t.threshold).gt(255)?{encoded:Qe(["uint8","uint16","uint32","bytes"],[Qr.Dynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:{encoded:Qe(["uint8","uint8","uint32","bytes"],[Qr.Legacy,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}}function m0(t,e,r,n={}){const i=!n.disableTrim;if(Fs(t)){const s=m0(t.left,e,r),o=m0(t.right,e,r),a=Fn(t.left),c=Fn(t.right);return i&&s.weight.eq(0)&&o.weight.eq(0)&&!a&&!c?{encoded:mn.node(Ki(t)),weight:or}:i&&o.weight.eq(0)&&!c?{encoded:mn.concat(s.encoded,mn.node(Ki(t.right))),weight:s.weight}:i&&s.weight.eq(0)&&!a?{encoded:mn.concat(mn.node(Ki(t.left)),mn.branch(o.encoded)),weight:o.weight}:{encoded:mn.concat(s.encoded,mn.branch(o.encoded)),weight:s.weight.add(o.weight)}}if(Ma(t)){const s=m0(t.tree,e,r);return i&&s.weight.eq(0)?{encoded:mn.node(Ki(t)),weight:or}:{encoded:mn.nested(t.weight,t.threshold,s.encoded),weight:s.weight}}if(Na(t))return{encoded:mn.node(Ki(t)),weight:or};if($a(t)){const s=r.includes(t.subdigest);return{encoded:mn.subdigest(t.subdigest),weight:s?qR:or}}if(Fn(t))if(e.has(t.address)){const o=e.get(t.address),a=o.signature;return n.forceDynamicEncoding||o.isDynamic?{encoded:mn.dynamicSignature(t.weight,t.address,a),weight:te.from(t.weight)}:{encoded:mn.signature(t.weight,a),weight:te.from(t.weight)}}else return{encoded:mn.address(t.weight,t.address),weight:or};throw new Error(`Invalid topology - unknown error: ${JSON.stringify(t)}`)}function lC(t){return fC(t)?lC(t.suffix[t.suffix.length-1]):t.config}function uC(t){return t.type!==void 0&&t.decoded!==void 0&&t.version!==void 0&&t.version===2}function lp(t){return t.suffix!==void 0&&Array.isArray(t.suffix)&&t.suffix.every(uC)}function pN(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function fC(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(pN)}function vb(t){const e=fe(t),r=e[0];switch(r){case Qr.Legacy:return{version:2,type:Qr.Legacy,decoded:fv(e)};case Qr.Dynamic:return{version:2,type:Qr.Dynamic,decoded:fv(e.slice(1))};case Qr.NoChainIdDynamic:return{version:2,type:Qr.NoChainIdDynamic,decoded:fv(e.slice(1))};case Qr.Chained:return mN(e);default:throw new Error(`Invalid signature type: ${r}`)}}function fv(t){const e=fe(t),r=e[0]<<8|e[1],n=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i=Sy(e.slice(6));return{threshold:r,checkpoint:n,tree:i}}function mN(t){const e=fe(t),r=e[0];if(r!==Qr.Chained)throw new Error(`Expected chained signature type: ${r}`);const n=[];let i=1;for(;ife(_c(s))),i=Qe(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return Qe(["uint8","bytes"],[Qr.Chained,i])}function _c(t){if(Ds(t))return le(t);if(lp(t)||fC(t))return yb(_c(t),(t.suffix||[]).map(_c));const e=uC(t)?t.decoded:t.config;switch(t.type){case Qr.Legacy:if(te.from(e.threshold).gt(255))throw new Error(`Legacy signature threshold is too large: ${e.threshold} (max 255)`);return m6(e);case Qr.NoChainIdDynamic:case Qr.Dynamic:return Qe(["uint8","bytes"],[t.type,m6(e)]);case Qr.Chained:throw new Error("Unreachable code: Chained signature should be handled above");default:throw new Error(`Invalid signature type: ${t.type}`)}}function m6(t){return Qe(["uint16","uint32","bytes"],[t.threshold,t.checkpoint,v0(t.tree)])}function v0(t){if(Fs(t)||mu(t)){const e=fe(v0(t.right)),r=fe(v0(t.left));return Fs(t.right)||mu(t.right)?Qe(["bytes","uint8","uint24","bytes"],[r,yr.Branch,e.length,e]):Qe(["bytes","bytes"],[r,e])}if(Ma(t)||Wd(t)){const e=fe(v0(t.tree));return Qe(["uint8","uint8","uint16","uint24","bytes"],[yr.Nested,t.weight,t.threshold,e.length,e])}if(cp(t)||Fn(t)&&t.signature!==void 0){const e=fe(t.signature);if(t.isDynamic||e.length!==Cy){if(!t.address)throw new Error("Dynamic signature leaf must have address");return Qe(["uint8","uint8","address","uint24","bytes"],[yr.DynamicSignature,t.weight,t.address,e.length,e])}else return Qe(["uint8","uint8","bytes"],[yr.Signature,t.weight,e])}if(Fn(t))return Qe(["uint8","uint8","address"],[yr.Address,t.weight,t.address]);if(Na(t))return Qe(["uint8","bytes32"],[yr.Node,t.nodeHash]);if($a(t))return Qe(["uint8","bytes32"],[yr.Subdigest,t.subdigest]);throw new Error(`Unknown signature tree type: ${t}`)}function y0(t){return Fs(t)?[...y0(t.left),...y0(t.right)]:Ma(t)?y0(t.tree):Fn(t)&&t.signature?[{address:t.address,signature:t.signature}]:[]}function g0(t){return mu(t)?[...g0(t.left),...g0(t.right)]:Wd(t)?g0(t.tree):cp(t)?[t.signature]:[]}function dv(t){return mu(t)?[...dv(t.left),...dv(t.right)]:Wd(t)?dv(t.tree):$a(t)?[t.subdigest]:[]}async function ky(t){const e=typeof t=="string"?vb(t):t;if(lp(e)){const n=await Promise.all([ky(an({},e,{suffix:void 0})),...e.suffix.map(i=>ky(i))]);return yb(n[0],n.slice(1))}const{trimmed:r}=await b0(e.decoded.tree);return _c(an({},e,{decoded:an({},e.decoded,{tree:r})}))}async function b0(t,e=!0){if(mu(t)){const[r,n]=await Promise.all([b0(t.left),b0(t.right)]);if(r.weight===0&&n.weight===0)try{const i=await Yl(t,uy,void 0);return{weight:0,trimmed:{nodeHash:Ki(i)}}}catch{}else return{weight:r.weight+n.weight,trimmed:{left:r.trimmed,right:n.trimmed}}}if(Wd(t)){const r=await b0(t.tree);if(r.weight===0)try{const n=await Yl(t,uy,void 0);return{weight:0,trimmed:{nodeHash:Ki(n)}}}catch{}return{weight:r.weight,trimmed:{weight:t.weight,threshold:t.threshold,tree:r.trimmed}}}return Na(t)&&bN(t.nodeHash)?{weight:0,trimmed:an({},gN(t.nodeHash))}:cp(t)||Fn(t)&&t.signature!==void 0?{weight:te.from(t.weight).toNumber(),trimmed:t}:!e&&$a(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const gb={decode:t=>vb(t),encode:t=>_c(t),trim:t=>ky(t),supportsNoChainId:!0,recover:(t,e,r)=>dC(t,e,r),encodeSigners:(t,e,r,n)=>p0(t,e,r,n),hasEnoughSigningPower:(t,e)=>{const{weight:r}=gb.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{const r=e.reverse(),n=Ds(t)?t:_c(t),i=r.map(s=>Ds(s)?s:_c(s));return yb(n,i)},hashSetImageHash:function(t){return uN(t)},signaturesOf(t){return y0(t.tree)},signaturesOfDecoded:function(t){return g0(t.decoded.tree)}};var Bee=Object.freeze({__proto__:null,SignatureType:Qr,SignaturePartType:yr,SignaturePartTypeLength:Cy,isUnrecoveredNode:mu,isUnrecoveredNestedLeaf:Wd,isUnrecoveredSignatureLeaf:cp,decodeSignatureTree:Sy,InvalidSignatureLeafError:hN,recoverTopology:Yl,partEncoder:mn,encodeSigners:p0,encodeTree:m0,deepestConfigOfSignature:lC,isUnrecoveredSignature:uC,isUnrecoveredChainedSignature:lp,isSignature:pN,isChainedSignature:fC,decodeSignature:vb,decodeSignatureBody:fv,decodeChainedSignature:mN,setImageHashStruct:vN,recoverSignature:dC,encodeChain:yb,encodeSignature:_c,encodeSignatureBody:m6,encodeSignatureTree:v0,signaturesOf:y0,signaturesOfDecoded:g0,subdigestsOfDecoded:dv,trimSignature:ky,trimUnrecoveredTree:b0,SignatureCoder:gb});function Fn(t){return t.address!==void 0&&t.weight!==void 0}function $a(t){return t.subdigest!==void 0&&t.address===void 0}function x0(t){return Fs(t)?JSON.stringify({left:x0(t.left),right:x0(t.right)}):Ma(t)?JSON.stringify({weight:te.from(t.weight).toString(),threshold:te.from(t.threshold).toString(),tree:x0(t.tree)}):Fn(t)?JSON.stringify({address:t.address,weight:te.from(t.weight).toString()}):JSON.stringify(t)}function w0(t){const e=typeof t=="string"?JSON.parse(t):t;return e.left!==void 0&&e.right!==void 0?{left:w0(e.left),right:w0(e.right)}:e.weight!==void 0&&e.threshold!==void 0&&e.tree!==void 0?{weight:te.from(e.weight),threshold:te.from(e.threshold),tree:w0(e.tree)}:e.address!==void 0&&e.weight!==void 0?{address:e.address,weight:te.from(e.weight)}:e}function Ma(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function Na(t){return t.nodeHash!==void 0}function hC(t){return Fn(t)||$a(t)||Ma(t)||Na(t)}function Fs(t){return t.left!==void 0&&t.right!==void 0}function Fee(t){return Fs(t)||hC(t)}function yN(t){return Qe(["uint96","address"],[t.weight,t.address])}function gN(t){const e=fe(t);if(e.length!==32)throw new Error("Invalid encoded string length");const r=te.from(e.slice(0,12)),n=Be(le(e.slice(12)));return{weight:r,address:n}}function bN(t){const e=fe(t);return e.length!==32?!1:e.slice(0,11).every(n=>n===0)}function Ki(t){if(Fn(t))return yN(t);if($a(t))return ra(["string","bytes32"],[`Sequence static digest: -`,t.subdigest]);if(Ma(t)){const e=Ki(t.tree);return ra(["string","bytes32","uint256","uint256"],[`Sequence nested config: -`,e,t.threshold,t.weight])}return Na(t)?t.nodeHash:ra(["bytes32","bytes32"],[Ki(t.left),Ki(t.right)])}function Uee(t){const e=[];let r=t;for(;!hC(r);)e.unshift(r.right),r=r.left;return e.unshift(r),e}function zee(t){return t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&t.version!==void 0&&t.version===2}function pC(t){return ra(["bytes32","uint256"],[ra(["bytes32","uint256"],[Ki(t.tree),t.threshold]),t.checkpoint])}function xN(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function Qf(t){return Fn(t)||$a(t)?[t]:Ma(t)?[{threshold:t.threshold,weight:t.weight,members:Qf(t.tree)}]:Na(t)?[]:[...Qf(t.left),...Qf(t.right)]}function v6(t){return Na(t)?!0:Fs(t)?v6(t.left)||v6(t.right):!1}function qee(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:Qf(t.tree)}}const wN=(t,e)=>t.map(r=>xN(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function mC(t){if(t.length===0)throw new Error("Empty members array");return wN(t,mC).reduce((r,n)=>({left:r,right:n}))}function vC(t){if(t.length===0)throw new Error("Empty members array");const e=wN(t,vC);for(let r=e.length;r>1;r=r/2)for(let n=0;n=r?e[n]=e[i]:e[n]={left:e[i],right:e[s]}}return e[0]}function yC(t){return t.length>8?vC(t):mC(t)}function EN(t,e=yC){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function Ay(t,e){return $a(t)?t.subdigest===e:Fs(t)?Ay(t.left,e)||Ay(t.right,e):!1}function y6(t){const e=[t],r=new Set;for(;e.length>0;){const n=e.pop();Ma(n)?e.push(n.tree):Fs(n)?(e.push(n.left),e.push(n.right)):Fn(n)&&r.add({address:n.address,weight:te.from(n.weight).toNumber()})}return Array.from(r)}function _y(t){return Fs(t)?_y(t.left)&&_y(t.right):!Na(t)}const bb={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>pC(t),hasSubdigest:(t,e)=>Ay(t.tree,e),checkpointOf:t=>te.from(t.checkpoint),signersOf:t=>y6(t.tree),fromSimple:t=>{var e;return EN(an({},t,{members:[...t.signers,...((e=t.subdigests)!=null?e:[]).map(r=>({subdigest:r}))]}))},isComplete:t=>_y(t.tree),update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new wr(Jr.mainModuleUpgradable.abi);return{entrypoint:t,transactions:[{to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[bb.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}]}},decodeTransaction:function(t){var e,r,n,i;const s=new wr(Jr.mainModuleUpgradable.abi);if(t.transactions.length!==1)throw new Error("Invalid transaction bundle, expected 1 transaction");const o=t.transactions[0].data;if(!o)throw new Error("Invalid transaction bundle, expected data");const a=s.decodeFunctionData(s.getFunction("updateImageHash"),o);if(!a)throw new Error("Invalid transaction bundle, expected valid data");if(t.transactions[0].to!==t.entrypoint)throw new Error("Invalid transaction bundle, expected to be sent to entrypoint");if(t.transactions[0].delegateCall)throw new Error("Invalid transaction bundle, expected not to be a delegateCall");if(!t.transactions[0].revertOnError)throw new Error("Invalid transaction bundle, expected revertOnError");if(!or.eq((e=(r=t.transactions[0])==null?void 0:r.value)!=null?e:0))throw new Error("Invalid transaction bundle, expected value to be 0");if(!or.eq((n=(i=t.transactions[0])==null?void 0:i.gasLimit)!=null?n:0))throw new Error("Invalid transaction bundle, expected value to be 0");return{address:t.entrypoint,newImageHash:a[0],kind:void 0}}},toJSON:function(t){return JSON.stringify({version:t.version,threshold:te.from(t.threshold).toString(),checkpoint:te.from(t.checkpoint).toString(),tree:x0(t.tree)})},fromJSON:function(t){const e=JSON.parse(t);return{version:e.version,threshold:te.from(e.threshold),checkpoint:te.from(e.checkpoint),tree:w0(e.tree)}},editConfig:function(t,e){var r,n;const i=Qf(t.tree);if(e.add)for(const s of e.add)i.find(o=>Fn(o)&&o.address===s.address)||i.push({address:s.address,weight:s.weight});if(e.remove)for(const s of e.remove){const o=i.findIndex(a=>Fn(a)&&a.address===s);o>=0&&i.splice(o,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,checkpoint:(n=e.checkpoint)!=null?n:t.checkpoint,tree:yC(i)}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=p0(t,r,[],0);if(a.gte(t.threshold))return o}const n=y6(t.tree);for(const{address:i}of n.sort(({weight:s},{weight:o})=>s-o)){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=p0(t,r,[],0);if(a.gte(t.threshold))return o}return p0(t,r,[],0).encoded}};var Wee=Object.freeze({__proto__:null,isSignerLeaf:Fn,isSubdigestLeaf:$a,topologyToJSON:x0,topologyFromJSON:w0,isNestedLeaf:Ma,isNodeLeaf:Na,isLeaf:hC,isNode:Fs,isTopology:Fee,encodeSignerLeaf:yN,decodeSignerLeaf:gN,isEncodedSignerLeaf:bN,hashNode:Ki,leftFace:Uee,isWalletConfig:zee,imageHash:pC,isSimpleNestedMember:xN,topologyToMembers:Qf,hasUnknownNodes:v6,toSimpleWalletConfig:qee,legacyTopologyBuilder:mC,merkleTopologyBuilder:vC,optimized2SignersTopologyBuilder:yC,toWalletConfig:EN,hasSubdigest:Ay,signersOf:y6,isComplete:_y,ConfigCoder:bb}),Hee=Object.freeze({__proto__:null});const Vee={config:bb,signature:gb},CN=2,SN={version:CN,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var Ze=Object.freeze({__proto__:null,config:Wee,signature:Bee,context:Hee,chained:jee,coders:Vee,version:CN,DeployedWalletContext:SN});function g6(t,e){const r=Oe(Qe(["bytes","bytes32"],[t.walletCreationCode,Ct(t.mainModule,32)])),n=Oe(Qe(["bytes1","address","bytes32","bytes32"],["0xff",t.factory,e,r]));return Be(rr(n,12))}async function Gee(t,e,r,n,i,s){return(await Promise.all(DN.map(async a=>{try{const c=a.signature.SignatureCoder.decode(le(r)),l=await a.signature.SignatureCoder.recover(c,{address:t,digest:le(e),chainId:n},i),u=a.config.ConfigCoder.imageHashOf(l.config);if(g6(s[a.version],u).toLowerCase()===t.toLowerCase())return!0;const d=await a.signature.SignatureCoder.recover(c,{address:t,digest:le(e),chainId:n},i),h=a.config.ConfigCoder.imageHashOf(d.config);return g6(s[a.version],h).toLowerCase()===t.toLowerCase()}catch{}return!1}))).some(a=>a)}function Kee(t){const e=Object.keys(t).length;for(let r=1;r<=e;r++){const n=t[r];if(!n||n.version!==r)return!1}return!0}function Qee(t){const e=Object.keys(t).length;return t[e]}const Yee={1:lN,2:SN};var Jee=Object.freeze({__proto__:null,addressOf:g6,isValidCounterfactual:Gee,isValidVersionedContext:Kee,latestContext:Qee,defaultContexts:Yee});const xb=`tuple( +`)}static register(e,r){r||(r=e.locale)}}const qJ="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let t0=null;function bS(t){if(t0==null&&(t0=qJ.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),W1.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw t0=null,new Error("BIP39 Wordlist for en (English) FAILED")}class WJ extends W1{constructor(){super("en")}getWord(e){return bS(this),t0[e]}getWordIndex(e){return bS(this),t0.indexOf(e)}}const x$=new WJ;W1.register(x$);const xS={en:x$},HJ="hdnode/5.7.0",G0=new ne(HJ),VJ=te.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),GJ=kt("Bitcoin seed"),Xu=2147483648;function w$(t){return(1<=256)throw new Error("Depth too large!");return wS(Et([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",le(this.depth),this.parentFingerprint,St(le(this.index),4),this.chainCode,this.privateKey!=null?Et(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Yn(Nu,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~Xu));const n=new Uint8Array(37);if(e&Xu){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(fe(this.privateKey),1),r&&(r+="'")}else n.set(fe(this.publicKey));for(let f=24;f>=0;f-=8)n[33+(f>>3)]=e>>24-f&255;const i=fe(sd(iu.sha512,this.chainCode,n)),s=i.slice(0,32),o=i.slice(32);let a=null,c=null;this.privateKey?a=Qp(te.from(s).add(this.privateKey).mod(VJ)):c=new bc(le(s))._addPoint(this.publicKey);let l=r;const u=this.mnemonic;return u&&(l=Object.freeze({phrase:u.phrase,path:r,locale:u.locale||"en"})),new Yn(Nu,a,c,this.fingerprint,Qp(o),e,this.depth+1,l)}derivePath(e){const r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let n=this;for(let i=0;i=Xu)throw new Error("invalid path index - "+s);n=n._derive(Xu+o)}else if(s.match(/^[0-9]+$/)){const o=parseInt(s);if(o>=Xu)throw new Error("invalid path index - "+s);n=n._derive(o)}else throw new Error("invalid path component - "+s)}return n}static _fromSeed(e,r){const n=fe(e);if(n.length<16||n.length>64)throw new Error("invalid seed");const i=fe(sd(iu.sha512,GJ,n));return new Yn(Nu,Qp(i.slice(0,32)),null,"0x00000000",Qp(i.slice(32)),0,0,r)}static fromMnemonic(e,r,n){return n=SE(n),e=V1(H1(e,n),n),Yn._fromSeed(kE(e,r),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return Yn._fromSeed(e,null)}static fromExtendedKey(e){const r=nu.decode(e);(r.length!==82||wS(r.slice(0,78))!==e)&&G0.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=r[4],i=le(r.slice(5,9)),s=parseInt(le(r.slice(9,13)).substring(2),16),o=le(r.slice(13,45)),a=r.slice(45,78);switch(le(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Yn(Nu,null,le(a),i,o,s,n,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new Yn(Nu,le(a.slice(1)),null,i,o,s,n,null)}return G0.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function kE(t,e){e||(e="");const r=kt("mnemonic"+e,Ds.NFKD);return CE(kt(t,Ds.NFKD),r,2048,64,"sha512")}function H1(t,e){e=SE(e),G0.checkNormalize();const r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=fe(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let l=0;l>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=w$(o);if((fe(So(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return le(n.slice(0,s/8))}function V1(t,e){if(e=SE(e),t=fe(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&KJ(8-n)),n+=3);const i=t.length/4,s=fe(So(t))[0]&w$(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}function E$(t,e){try{return H1(t,e),!0}catch{}return!1}function C$(t){return(typeof t!="number"||t<0||t>=Xu||t%1)&&G0.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}const QJ=Object.freeze(Object.defineProperty({__proto__:null,HDNode:Yn,defaultPath:su,entropyToMnemonic:V1,getAccountPath:C$,isValidMnemonic:E$,mnemonicToEntropy:H1,mnemonicToSeed:kE},Symbol.toStringTag,{value:"Module"})),YJ="random/5.7.0",W5=new ne(YJ);function JJ(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof Bn<"u")return Bn;throw new Error("unable to locate global object")}const ES=JJ();let Jm=ES.crypto||ES.msCrypto;(!Jm||!Jm.getRandomValues)&&(W5.warn("WARNING: Missing strong random number source"),Jm={getRandomValues:function(t){return W5.throwError("no secure random source avaialble",ne.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function Ps(t){(t<=0||t>1024||t%1||t!=t)&&W5.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return Jm.getRandomValues(e),fe(e)}function AE(t){t=t.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}const XJ=Object.freeze(Object.defineProperty({__proto__:null,randomBytes:Ps,shuffled:AE},Symbol.toStringTag,{value:"Module"}));var S$={exports:{}};(function(t,e){(function(r){function n(I){return parseInt(I)===I}function i(I){if(!n(I.length))return!1;for(var C=0;C255)return!1;return!0}function s(I,C){if(I.buffer&&ArrayBuffer.isView(I)&&I.name==="Uint8Array")return C&&(I.slice?I=I.slice():I=Array.prototype.slice.call(I)),I;if(Array.isArray(I)){if(!i(I))throw new Error("Array contains invalid value: "+I);return new Uint8Array(I)}if(n(I.length)&&i(I))return new Uint8Array(I);throw new Error("unsupported array-like object")}function o(I){return new Uint8Array(I)}function a(I,C,D,z,_){(z!=null||_!=null)&&(I.slice?I=I.slice(z,_):I=Array.prototype.slice.call(I,z,_)),C.set(I,D)}var c=function(){function I(D){var z=[],_=0;for(D=encodeURI(D);_191&&W<224?(z.push(String.fromCharCode((W&31)<<6|D[_+1]&63)),_+=2):(z.push(String.fromCharCode((W&15)<<12|(D[_+1]&63)<<6|D[_+2]&63)),_+=3)}return z.join("")}return{toBytes:I,fromBytes:C}}(),l=function(){function I(z){for(var _=[],W=0;W>4]+C[G&15])}return _.join("")}return{toBytes:I,fromBytes:D}}(),u={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],v=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],y=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],E=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],S=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],P=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],M=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],L=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],j=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],H=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function K(I){for(var C=[],D=0;D>2,this._Ke[W][C%4]=_[C],this._Kd[I-W][C%4]=_[C];for(var G=0,J=z,ee;J>16&255]<<24^d[ee>>8&255]<<16^d[ee&255]<<8^d[ee>>24&255]^f[G]<<24,G+=1,z!=8)for(var C=1;C>8&255]<<8^d[ee>>16&255]<<16^d[ee>>24&255]<<24;for(var C=z/2+1;C>2,ie=J%4,this._Ke[se][ie]=_[C],this._Kd[I-se][ie]=_[C++],J++}for(var se=1;se>24&255]^L[ee>>16&255]^j[ee>>8&255]^H[ee&255]},Q.prototype.encrypt=function(I){if(I.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var C=this._Ke.length-1,D=[0,0,0,0],z=K(I),_=0;_<4;_++)z[_]^=this._Ke[0][_];for(var W=1;W>24&255]^m[z[(_+1)%4]>>16&255]^v[z[(_+2)%4]>>8&255]^y[z[(_+3)%4]&255]^this._Ke[W][_];z=D.slice()}for(var G=o(16),J,_=0;_<4;_++)J=this._Ke[C][_],G[4*_]=(d[z[_]>>24&255]^J>>24)&255,G[4*_+1]=(d[z[(_+1)%4]>>16&255]^J>>16)&255,G[4*_+2]=(d[z[(_+2)%4]>>8&255]^J>>8)&255,G[4*_+3]=(d[z[(_+3)%4]&255]^J)&255;return G},Q.prototype.decrypt=function(I){if(I.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var C=this._Kd.length-1,D=[0,0,0,0],z=K(I),_=0;_<4;_++)z[_]^=this._Kd[0][_];for(var W=1;W>24&255]^E[z[(_+3)%4]>>16&255]^S[z[(_+2)%4]>>8&255]^P[z[(_+1)%4]&255]^this._Kd[W][_];z=D.slice()}for(var G=o(16),J,_=0;_<4;_++)J=this._Kd[C][_],G[4*_]=(h[z[_]>>24&255]^J>>24)&255,G[4*_+1]=(h[z[(_+3)%4]>>16&255]^J>>16)&255,G[4*_+2]=(h[z[(_+2)%4]>>8&255]^J>>8)&255,G[4*_+3]=(h[z[(_+1)%4]&255]^J)&255;return G};var Y=function(I){if(!(this instanceof Y))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new Q(I)};Y.prototype.encrypt=function(I){if(I=s(I),I.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var C=o(I.length),D=o(16),z=0;z=0;--C)this._counter[C]=I%256,I=I>>8},R.prototype.setBytes=function(I){if(I=s(I,!0),I.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=I},R.prototype.increment=function(){for(var I=15;I>=0;I--)if(this._counter[I]===255)this._counter[I]=0;else{this._counter[I]++;break}};var N=function(I,C){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",C instanceof R||(C=new R(C)),this._counter=C,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new Q(I)};N.prototype.encrypt=function(I){for(var C=s(I,!0),D=0;D16)throw new Error("PKCS#7 padding byte out of range");for(var D=I.length-C,z=0;z=64;){let B=y,I=b,C=E,D=S,z=P,_=M,W=L,G=j,J,ee,se,ie,oe;for(ee=0;ee<16;ee++)se=A+ee*4,H[ee]=(N[se]&255)<<24|(N[se+1]&255)<<16|(N[se+2]&255)<<8|N[se+3]&255;for(ee=16;ee<64;ee++)J=H[ee-2],ie=(J>>>17|J<<15)^(J>>>19|J<<13)^J>>>10,J=H[ee-15],oe=(J>>>7|J<<25)^(J>>>18|J<<14)^J>>>3,H[ee]=(ie+H[ee-7]|0)+(oe+H[ee-16]|0)|0;for(ee=0;ee<64;ee++)ie=(((z>>>6|z<<26)^(z>>>11|z<<21)^(z>>>25|z<<7))+(z&_^~z&W)|0)+(G+(v[ee]+H[ee]|0)|0)|0,oe=((B>>>2|B<<30)^(B>>>13|B<<19)^(B>>>22|B<<10))+(B&I^B&C^I&C)|0,G=W,W=_,_=z,z=D+ie|0,D=C,C=I,I=B,B=ie+oe|0;y=y+B|0,b=b+I|0,E=E+C|0,S=S+D|0,P=P+z|0,M=M+_|0,L=L+W|0,j=j+G|0,A+=64,O-=64}}K(m);let Q,Y=m.length%64,F=m.length/536870912|0,x=m.length<<3,k=Y<56?56:120,R=m.slice(m.length-Y,m.length);for(R.push(128),Q=Y+1;Q>>24&255),R.push(F>>>16&255),R.push(F>>>8&255),R.push(F>>>0&255),R.push(x>>>24&255),R.push(x>>>16&255),R.push(x>>>8&255),R.push(x>>>0&255),K(R),[y>>>24&255,y>>>16&255,y>>>8&255,y>>>0&255,b>>>24&255,b>>>16&255,b>>>8&255,b>>>0&255,E>>>24&255,E>>>16&255,E>>>8&255,E>>>0&255,S>>>24&255,S>>>16&255,S>>>8&255,S>>>0&255,P>>>24&255,P>>>16&255,P>>>8&255,P>>>0&255,M>>>24&255,M>>>16&255,M>>>8&255,M>>>0&255,L>>>24&255,L>>>16&255,L>>>8&255,L>>>0&255,j>>>24&255,j>>>16&255,j>>>8&255,j>>>0&255]}function s(m,v,y){m=m.length<=64?m:i(m);const b=64+v.length+4,E=new Array(b),S=new Array(64);let P,M=[];for(P=0;P<64;P++)E[P]=54;for(P=0;P=b-4;j--){if(E[j]++,E[j]<=255)return;E[j]=0}}for(;y>=32;)L(),M=M.concat(i(S.concat(i(E)))),y-=32;return y>0&&(L(),M=M.concat(i(S.concat(i(E))).slice(0,y))),M}function o(m,v,y,b,E){let S;for(u(m,(2*y-1)*16,E,0,16),S=0;S<2*y;S++)l(m,S*16,E,16),c(E,b),u(E,0,m,v+S*16,16);for(S=0;S>>32-v}function c(m,v){u(m,0,v,0,16);for(let y=8;y>0;y-=2)v[4]^=a(v[0]+v[12],7),v[8]^=a(v[4]+v[0],9),v[12]^=a(v[8]+v[4],13),v[0]^=a(v[12]+v[8],18),v[9]^=a(v[5]+v[1],7),v[13]^=a(v[9]+v[5],9),v[1]^=a(v[13]+v[9],13),v[5]^=a(v[1]+v[13],18),v[14]^=a(v[10]+v[6],7),v[2]^=a(v[14]+v[10],9),v[6]^=a(v[2]+v[14],13),v[10]^=a(v[6]+v[2],18),v[3]^=a(v[15]+v[11],7),v[7]^=a(v[3]+v[15],9),v[11]^=a(v[7]+v[3],13),v[15]^=a(v[11]+v[7],18),v[1]^=a(v[0]+v[3],7),v[2]^=a(v[1]+v[0],9),v[3]^=a(v[2]+v[1],13),v[0]^=a(v[3]+v[2],18),v[6]^=a(v[5]+v[4],7),v[7]^=a(v[6]+v[5],9),v[4]^=a(v[7]+v[6],13),v[5]^=a(v[4]+v[7],18),v[11]^=a(v[10]+v[9],7),v[8]^=a(v[11]+v[10],9),v[9]^=a(v[8]+v[11],13),v[10]^=a(v[9]+v[8],18),v[12]^=a(v[15]+v[14],7),v[13]^=a(v[12]+v[15],9),v[14]^=a(v[13]+v[12],13),v[15]^=a(v[14]+v[13],18);for(let y=0;y<16;++y)m[y]+=v[y]}function l(m,v,y,b){for(let E=0;E=256)return!1}return!0}function d(m,v){if(typeof m!="number"||m%1)throw new Error("invalid "+v);return m}function h(m,v,y,b,E,S,P){if(y=d(y,"N"),b=d(b,"r"),E=d(E,"p"),S=d(S,"dkLen"),y===0||y&y-1)throw new Error("N must be power of 2");if(y>2147483647/128/b)throw new Error("N too large");if(b>2147483647/128/E)throw new Error("r too large");if(!f(m))throw new Error("password must be an array or buffer");if(m=Array.prototype.slice.call(m),!f(v))throw new Error("salt must be an array or buffer");v=Array.prototype.slice.call(v);let M=s(m,v,E*128*b);const L=new Uint32Array(E*32*b);for(let z=0;zI&&(z=I);for(let W=0;WI&&(z=I);for(let W=0;W>0&255),M.push(L[W]>>8&255),M.push(L[W]>>16&255),M.push(L[W]>>24&255);const _=s(m,M,S);return P&&P(null,1,_),_}P&&C(D)};if(!P)for(;;){const z=D();if(z!=null)return z}D()}const p={scrypt:function(m,v,y,b,E,S,P){return new Promise(function(M,L){let j=0;P&&P(0),h(m,v,y,b,E,S,function(H,K,Q){if(H)L(H);else if(Q)P&&j!==1&&P(1),M(new Uint8Array(Q));else if(P&&K!==j)return j=K,P(K)})})},syncScrypt:function(m,v,y,b,E,S){return new Uint8Array(h(m,v,y,b,E,S))}};t.exports=p})()})(_$);var nX=_$.exports;const IE=Pi(nX);var iX=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const H5=new ne(k$);function CS(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}class sX extends tl{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}}function oX(t,e,r){if(Ar(t,"crypto/cipher")==="aes-128-ctr"){const i=Ul(Ar(t,"crypto/cipherparams/iv")),s=new ao.Counter(i),o=new ao.ModeOfOperation.ctr(e,s);return fe(o.decrypt(r))}return null}function P$(t,e){const r=Ul(Ar(t,"crypto/ciphertext"));if(le(Oe(Et([e.slice(16,32),r]))).substring(2)!==Ar(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const i=oX(t,e.slice(0,16),r);i||H5.throwError("unsupported cipher",ne.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const s=e.slice(32,64),o=Xo(i);if(t.address){let c=t.address.toLowerCase();if(c.substring(0,2)!=="0x"&&(c="0x"+c),Be(c)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:le(i)};if(Ar(t,"x-ethers/version")==="0.1"){const c=Ul(Ar(t,"x-ethers/mnemonicCiphertext")),l=Ul(Ar(t,"x-ethers/mnemonicCounter")),u=new ao.Counter(l),f=new ao.ModeOfOperation.ctr(s,u),d=Ar(t,"x-ethers/path")||su,h=Ar(t,"x-ethers/locale")||"en",p=fe(f.decrypt(c));try{const m=V1(p,h),v=Yn.fromMnemonic(m,null,h).derivePath(d);if(v.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=v.mnemonic}catch(m){if(m.code!==ne.errors.INVALID_ARGUMENT||m.argument!=="wordlist")throw m}}return new sX(a)}function I$(t,e,r,n,i){return fe(CE(t,e,r,n,i))}function aX(t,e,r,n,i){return Promise.resolve(I$(t,e,r,n,i))}function T$(t,e,r,n,i){const s=_E(e),o=Ar(t,"crypto/kdf");if(o&&typeof o=="string"){const a=function(c,l){return H5.throwArgumentError("invalid key-derivation function parameters",c,l)};if(o.toLowerCase()==="scrypt"){const c=Ul(Ar(t,"crypto/kdfparams/salt")),l=parseInt(Ar(t,"crypto/kdfparams/n")),u=parseInt(Ar(t,"crypto/kdfparams/r")),f=parseInt(Ar(t,"crypto/kdfparams/p"));(!l||!u||!f)&&a("kdf",o),l&l-1&&a("N",l);const d=parseInt(Ar(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),n(s,c,l,u,f,64,i)}else if(o.toLowerCase()==="pbkdf2"){const c=Ul(Ar(t,"crypto/kdfparams/salt"));let l=null;const u=Ar(t,"crypto/kdfparams/prf");u==="hmac-sha256"?l="sha256":u==="hmac-sha512"?l="sha512":a("prf",u);const f=parseInt(Ar(t,"crypto/kdfparams/c")),d=parseInt(Ar(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),r(s,c,f,d,l)}}return H5.throwArgumentError("unsupported key-derivation function","kdf",o)}function O$(t,e){const r=JSON.parse(t),n=T$(r,e,I$,IE.syncScrypt);return P$(r,n)}function R$(t,e,r){return iX(this,void 0,void 0,function*(){const n=JSON.parse(t),i=yield T$(n,e,aX,IE.scrypt,r);return P$(n,i)})}function $$(t,e,r,n){try{if(Be(t.address)!==Xo(t.privateKey))throw new Error("address/privateKey mismatch");if(CS(t)){const v=t.mnemonic;if(Yn.fromMnemonic(v.phrase,null,v.locale).derivePath(v.path||su).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(v){return Promise.reject(v)}typeof r=="function"&&!n&&(n=r,r={}),r||(r={});const i=fe(t.privateKey),s=_E(e);let o=null,a=null,c=null;if(CS(t)){const v=t.mnemonic;o=fe(H1(v.phrase,v.locale||"en")),a=v.path||su,c=v.locale||"en"}let l=r.client;l||(l="ethers.js");let u=null;r.salt?u=fe(r.salt):u=Ps(32);let f=null;if(r.iv){if(f=fe(r.iv),f.length!==16)throw new Error("invalid iv")}else f=Ps(16);let d=null;if(r.uuid){if(d=fe(r.uuid),d.length!==16)throw new Error("invalid uuid")}else d=Ps(16);let h=1<<17,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),IE.scrypt(s,u,h,p,m,64,n).then(v=>{v=fe(v);const y=v.slice(0,16),b=v.slice(16,32),E=v.slice(32,64),S=new ao.Counter(f),P=new ao.ModeOfOperation.ctr(y,S),M=fe(P.encrypt(i)),L=Oe(Et([b,M])),j={address:t.address.substring(2).toLowerCase(),id:eX(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:le(f).substring(2)},ciphertext:le(M).substring(2),kdf:"scrypt",kdfparams:{salt:le(u).substring(2),n:h,dklen:32,p:m,r:p},mac:L.substring(2)}};if(o){const H=Ps(16),K=new ao.Counter(H),Q=new ao.ModeOfOperation.ctr(E,K),Y=fe(Q.encrypt(o)),F=new Date,x=F.getUTCFullYear()+"-"+mh(F.getUTCMonth()+1,2)+"-"+mh(F.getUTCDate(),2)+"T"+mh(F.getUTCHours(),2)+"-"+mh(F.getUTCMinutes(),2)+"-"+mh(F.getUTCSeconds(),2)+".0Z";j["x-ethers"]={client:l,gethFilename:"UTC--"+x+"--"+j.address,mnemonicCounter:le(H).substring(2),mnemonicCiphertext:le(Y).substring(2),path:a,locale:c,version:"0.1"}}return JSON.stringify(j)})}function M$(t,e,r){if(Xg(t)){r&&r(0);const n=PE(t,e);return r&&r(1),Promise.resolve(n)}return Zg(t)?R$(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function N$(t,e){if(Xg(t))return PE(t,e);if(Zg(t))return O$(t,e);throw new Error("invalid JSON wallet")}const cX=Object.freeze(Object.defineProperty({__proto__:null,decryptCrowdsale:PE,decryptJsonWallet:M$,decryptJsonWalletSync:N$,decryptKeystore:R$,decryptKeystoreSync:O$,encryptKeystore:$$,getJsonWalletAddress:A$,isCrowdsaleWallet:Xg,isKeystoreWallet:Zg},Symbol.toStringTag,{value:"Module"})),lX="wallet/5.7.0";var SS=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Du=new ne(lX);function uX(t){return t!=null&&qe(t.privateKey,32)&&t.address!=null}function fX(t){const e=t.mnemonic;return e&&e.phrase}let D$=class Zu extends Tc{constructor(e,r){if(super(),uX(e)){const n=new bc(e.privateKey);if(de(this,"_signingKey",()=>n),de(this,"address",Xo(this.publicKey)),this.address!==Be(e.address)&&Du.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),fX(e)){const i=e.mnemonic;de(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||su,locale:i.locale||"en"}));const s=this.mnemonic,o=Yn.fromMnemonic(s.phrase,null,s.locale).derivePath(s.path);Xo(o.privateKey)!==this.address&&Du.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else de(this,"_mnemonic",()=>null)}else{if(bc.isSigningKey(e))e.curve!=="secp256k1"&&Du.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),de(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);const n=new bc(e);de(this,"_signingKey",()=>n)}de(this,"_mnemonic",()=>null),de(this,"address",Xo(this.publicKey))}r&&!Pa.isProvider(r)&&Du.throwArgumentError("invalid provider","provider",r),de(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new Zu(this,e)}signTransaction(e){return _t(e).then(r=>{r.from!=null&&(Be(r.from)!==this.address&&Du.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);const n=this._signingKey().signDigest(Oe(ny(r)));return ny(r,n)})}signMessage(e){return SS(this,void 0,void 0,function*(){return Qv(this._signingKey().signDigest(z1(e)))})}_signTypedData(e,r,n){return SS(this,void 0,void 0,function*(){const i=yield Sr.resolveNames(e,r,n,s=>(this.provider==null&&Du.throwError("cannot resolve ENS names without a provider",ne.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:s}),this.provider.resolveName(s)));return Qv(this._signingKey().signDigest(Sr.hash(i.domain,r,i.value)))})}encrypt(e,r,n){if(typeof r=="function"&&!n&&(n=r,r={}),n&&typeof n!="function")throw new Error("invalid callback");return r||(r={}),$$(this,e,r,n)}static createRandom(e){let r=Ps(16);e||(e={}),e.extraEntropy&&(r=fe(rr(Oe(Et([r,e.extraEntropy])),0,16)));const n=V1(r,e.locale);return Zu.fromMnemonic(n,e.path,e.locale)}static fromEncryptedJson(e,r,n){return M$(e,r,n).then(i=>new Zu(i))}static fromEncryptedJsonSync(e,r){return new Zu(N$(e,r))}static fromMnemonic(e,r,n){return r||(r=su),new Zu(Yn.fromMnemonic(e,null,n).derivePath(r))}};function TE(t,e){return Rc(z1(t),e)}function L$(t,e,r,n){return Rc(Sr.hash(t,e,r),n)}const dX=Object.freeze(Object.defineProperty({__proto__:null,Wallet:D$,verifyMessage:TE,verifyTypedData:L$},Symbol.toStringTag,{value:"Module"})),hX="networks/5.7.1",kS=new ne(hX);function pX(t){return t&&typeof t.renetwork=="function"}function Uo(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return Uo(r)},e}function sy(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return sy(t,n)},r}const AS={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Uo("homestead")},_S={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Uo("ropsten")},PS={chainId:63,name:"classicMordor",_defaultProvider:sy("https://www.ethercluster.com/mordor","classicMordor")},Yp={unspecified:{chainId:0,name:"unspecified"},homestead:AS,mainnet:AS,morden:{chainId:2,name:"morden"},ropsten:_S,testnet:_S,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Uo("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Uo("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Uo("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Uo("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:sy("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:PS,classicTestnet:PS,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:sy("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Uo("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Uo("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function mX(t){if(t==null)return null;if(typeof t=="number"){for(const n in Yp){const i=Yp[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=Yp[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=Yp[t.name];if(!e)return typeof t.chainId!="number"&&kS.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&kS.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(pX(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const vX="web/5.7.1";var yX=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};function gX(t,e){return yX(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:fe(new Uint8Array(i))}})}var bX=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const gs=new ne(vX);function IS(t){return new Promise(e=>{setTimeout(e,t)})}function qa(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Ms(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return os(t)}catch{}return le(t)}return t}function xX(t){return kt(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function OE(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;gs.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;gs.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let c=null;const l={method:"GET"};let u=!1,f=2*60*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&gs.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(f=t.timeout),t.headers)for(const y in t.headers)a[y.toLowerCase()]={key:y,value:String(t.headers[y])},["if-none-match","if-modified-since"].indexOf(y.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&gs.throwError("basic authentication requires a secure https url",ne.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const y=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+uE(kt(y))}}t.skipFetchSetup!=null&&(l.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(l.fetchOptions=Mt(t.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(d):null;if(h)try{const y={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?lE(h[3]):xX(h[3])};let b=y.body;return r&&(b=r(y.body,y)),Promise.resolve(b)}catch(y){gs.throwError("processing response error",ne.errors.SERVER_ERROR,{body:qa(h[1],h[2]),error:y,requestBody:null,requestMethod:"GET",url:c})}e&&(l.method="POST",l.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(a).forEach(y=>{const b=a[y];p[b.key]=b.value}),l.headers=p;const m=function(){let y=null;return{promise:new Promise(function(S,P){f&&(y=setTimeout(()=>{y!=null&&(y=null,P(gs.makeError("timeout",ne.errors.TIMEOUT,{requestBody:qa(l.body,p["content-type"]),requestMethod:l.method,timeout:f,url:c})))},f))}),cancel:function(){y!=null&&(clearTimeout(y),y=null)}}}(),v=function(){return bX(this,void 0,void 0,function*(){for(let y=0;y=300)&&(m.cancel(),gs.throwError("bad response",ne.errors.SERVER_ERROR,{status:b.statusCode,headers:b.headers,body:qa(E,b.headers?b.headers["content-type"]:null),requestBody:qa(l.body,p["content-type"]),requestMethod:l.method,url:c})),r)try{const S=yield r(E,b);return m.cancel(),S}catch(S){if(S.throttleRetry&&y{let a=null;if(s!=null)try{a=JSON.parse(os(s))}catch(c){gs.throwError("invalid JSON",ne.errors.SERVER_ERROR,{body:s,error:c})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=kt(e);const s=typeof t=="string"?{url:t}:Mt(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=Mt(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return OE(t,i,n)}function Ko(t,e){return e||(e={}),e=Mt(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let c=0;function l(){return t().then(function(u){if(u!==void 0)o()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",l);else if(e.onceBlock)e.onceBlock.once("block",l);else if(!s){if(c++,c>a){o()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));fe.ceiling&&(f=e.ceiling),setTimeout(l,f)}return null},function(u){o()&&n(u)})}l()})}const wX=Object.freeze(Object.defineProperty({__proto__:null,_fetchData:OE,fetchJson:Rd,poll:Ko},Symbol.toStringTag,{value:"Module"}));var oy="qpzry9x8gf2tvdw0s3jn54khce6mua7l",V5={};for(var Jp=0;Jp>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function j$(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=Bf(e)^n>>5}for(e=Bf(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=j$(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=Bf(n)^o,i+=oy.charAt(o)}for(s=0;s<6;++s)n=Bf(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=oy.charAt(a)}return i}function B$(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=j$(s);if(typeof a=="string")return a;for(var c=[],l=0;l=o.length)&&c.push(f)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:c}}function CX(){var t=B$.apply(null,arguments);if(typeof t=="object")return t}function SX(t){var e=B$.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function eb(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(f,!0);return e.transaction={hash:o,type:l,accessList:Ce.allowNull(this.accessList.bind(this),null),blockHash:Ce.allowNull(o,null),blockNumber:Ce.allowNull(c,null),transactionIndex:Ce.allowNull(c,null),confirmations:Ce.allowNull(c,null),from:r,gasPrice:Ce.allowNull(n),maxPriorityFeePerGas:Ce.allowNull(n),maxFeePerGas:Ce.allowNull(n),gasLimit:n,to:Ce.allowNull(r,null),value:n,nonce:c,data:s,r:Ce.allowNull(this.uint256),s:Ce.allowNull(this.uint256),v:Ce.allowNull(c),creates:Ce.allowNull(r,null),raw:Ce.allowNull(s)},e.transactionRequest={from:Ce.allowNull(r),nonce:Ce.allowNull(c),gasLimit:Ce.allowNull(n),gasPrice:Ce.allowNull(n),maxPriorityFeePerGas:Ce.allowNull(n),maxFeePerGas:Ce.allowNull(n),to:Ce.allowNull(r),value:Ce.allowNull(n),data:Ce.allowNull(u),type:Ce.allowNull(c),accessList:Ce.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:r,topics:Ce.arrayOf(o),data:s,logIndex:c,blockHash:o},e.receipt={to:Ce.allowNull(this.address,null),from:Ce.allowNull(this.address,null),contractAddress:Ce.allowNull(r,null),transactionIndex:c,root:Ce.allowNull(a),gasUsed:n,logsBloom:Ce.allowNull(s),blockHash:o,transactionHash:o,logs:Ce.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:Ce.allowNull(c,null),cumulativeGasUsed:n,effectiveGasPrice:Ce.allowNull(n),status:Ce.allowNull(c),type:l},e.block={hash:Ce.allowNull(o),parentHash:o,number:c,timestamp:c,nonce:Ce.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Ce.allowNull(r),extraData:s,transactions:Ce.allowNull(Ce.arrayOf(o)),baseFeePerGas:Ce.allowNull(n)},e.blockWithTransactions=Mt(e.block),e.blockWithTransactions.transactions=Ce.allowNull(Ce.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Ce.allowNull(i,void 0),toBlock:Ce.allowNull(i,void 0),blockHash:Ce.allowNull(o,void 0),address:Ce.allowNull(r,void 0),topics:Ce.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Ce.allowNull(c),blockHash:Ce.allowNull(o),transactionIndex:c,removed:Ce.allowNull(this.boolean.bind(this)),address:r,data:Ce.allowFalsish(s,"0x"),topics:Ce.arrayOf(o),transactionHash:o,logIndex:c},e}accessList(e){return nl(e||[])}number(e){return e==="0x"?0:te.from(e).toNumber()}type(e){return e==="0x"||e==null?0:te.from(e).toNumber()}bigNumber(e){return te.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),qe(e))?e.toLowerCase():vh.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Be(e)}callAddress(e){if(!qe(e,32))return null;const r=Be(rr(e,12));return r===Dt?null:r}contractAddress(e){return qg(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||qe(e))return Ji(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Ns(n)!==32?vh.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=te.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!qe(e))throw new Error("invalid uint256");return St(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=Ce.check(r,e);return i._difficulty=n==null?null:te.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Ce.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&te.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=Ce.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;qe(n)&&(n=te.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),qe(n)&&(n=te.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return xE(e)}receiptLog(e){return Ce.check(this.formats.receiptLog,e)}receipt(e){const r=Ce.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=te.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&vh.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):vh.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&vh.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return Ce.check(this.formats.filter,e)}filterLog(e){return Ce.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function TX(t){return t&&typeof t.isCommunityResource=="function"}function OS(t){return TX(t)&&t.isCommunityResource()}var je=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Je=new ne($d),OX=10;function RS(t){return t==null?"null":(Ns(t)!==32&&Je.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function $S(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[RS(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return RS(e)}).join("&")}function RX(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Lu(t){if(typeof t=="string"){if(t=t.toLowerCase(),Ns(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+$S(t);if(RQ.isForkEvent(t))throw Je.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+$S(t.topics||[])}throw new Error("invalid event - "+t)}function yh(){return new Date().getTime()}function MS(t){return new Promise(e=>{setTimeout(e,t)})}const $X=["block","network","pending","poll"];let MX=class{constructor(e,r,n){de(this,"tag",e),de(this,"listener",r),de(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=RX(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||$X.indexOf(this.tag)>=0}};const NX={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Tx(t){return St(te.from(t).toHexString(),32)}function NS(t){return nu.encode(Et([t,rr(So(So(t)),0,4)]))}const F$=new RegExp("^(ipfs)://(.*)$","i"),DS=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),F$,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Xm(t,e){try{return os(K0(t,e))}catch{}return null}function K0(t,e){if(t==="0x")return null;const r=te.from(rr(t,e,e+32)).toNumber(),n=te.from(rr(t,r,r+32)).toNumber();return rr(t,r+32,r+32+n)}function Ox(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Je.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function LS(t){const e=fe(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function DX(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function U$(t){const e=[];let r=0;for(let n=0;nte.from(e).eq(1)).catch(e=>{if(e.code===ne.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return je(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:xn([e,jf(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=xn(["0x9061b923",U$([fE(this.name),n.data])]));try{let s=yield this.provider.call(n);return fe(s).length%32===4&&Je.throwError("resolver threw error",ne.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=K0(s,0)),s}catch(s){if(s.code===ne.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return je(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?K0(n,0):null})}_getAddress(e,r){const n=NX[String(e)];if(n==null&&Je.throwError(`unsupported coin type: ${e}`,ne.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=fe(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return NS(Et([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return NS(Et([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=TS.toWords(i.slice(2));return a.unshift(o),TS.encode(n.prefix,a)}}return null}getAddress(e){return je(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===Xv?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===ne.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",Tx(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Je.throwError("invalid or unsupported coin data",ne.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return je(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[c])}return Je.throwError("invalid or unsupported content hash data",ne.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return je(this,void 0,void 0,function*(){let r=kt(e);r=Et([Tx(64),Tx(r.length),r]),r.length%32!==0&&(r=Et([r,St("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",le(r));return n==null||n==="0x"?null:os(n)})}}let Rx=null,LX=1;class tb extends Pa{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),de(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Qi(new.target,"getNetwork")(e);r?(de(this,"_network",r),this.emit("network",r,null)):Je.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return je(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Je.throwError("no network detected",ne.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:de(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Ko(()=>this._ready().then(e=>e,e=>{if(!(e.code===ne.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return Rx==null&&(Rx=new Ce),Rx}static getNetwork(e){return mX(e??"homestead")}ccipReadFetch(e,r,n){return je(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),f=yield Rd({url:l,errorPassThrough:!0},u,(h,p)=>(h.status=p.statusCode,h));if(f.data)return f.data;const d=f.message||"unknown error";if(f.status>=400&&f.status<500)return Je.throwError(`response not found during CCIP fetch: ${d}`,ne.errors.SERVER_ERROR,{url:c,errorMessage:d});o.push(d)}return Je.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,ne.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return je(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(yh()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=yh(),n=_t({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=yh();return i=te.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return je(this,void 0,void 0,function*(){const e=LX++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Je.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Je.makeError("network block skew detected",ne.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(c=>{i._inflight=!1,c.length!==0&&c.forEach(l=>{l.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=l.blockNumber),this._emitted["b:"+l.blockHash]=l.blockNumber,this._emitted["t:"+l.transactionHash]=l.blockNumber,this.emit(s,l)})}).catch(c=>{this.emit("error",c),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return je(this,void 0,void 0,function*(){return Je.throwError("provider does not support network detection",ne.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return je(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield MS(0),this._network;const n=Je.makeError("underlying network changed",ne.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=yh();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return je(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return je(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const c=[];let l=!1;const u=function(){return l?!0:(l=!0,c.forEach(d=>{d()}),!1)},f=d=>{d.confirmations{this.removeListener(e,f)}),i){let d=i.startBlock,h=null;const p=m=>je(this,void 0,void 0,function*(){l||(yield MS(1e3),this.getTransactionCount(i.from).then(v=>je(this,void 0,void 0,function*(){if(!l){if(v<=i.nonce)d=m;else{{const y=yield this.getTransaction(e);if(y&&y.blockNumber!=null)return}for(h==null&&(h=d-3,h{l||this.once("block",p)}))});if(l)return;this.once("block",p),c.push(()=>{this.removeListener("block",p)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{u()||a(Je.makeError("timeout exceeded",ne.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),c.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return je(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return je(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return te.from(e)}catch(r){return Je.throwError("bad result from backend",ne.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return je(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield _t({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return te.from(i)}catch(s){return Je.throwError("bad result from backend",ne.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return je(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield _t({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return te.from(i).toNumber()}catch(s){return Je.throwError("bad result from backend",ne.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return je(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield _t({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return le(i)}catch(s){return Je.throwError("bad result from backend",ne.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return je(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield _t({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>Ji(o))}),s=yield this.perform("getStorageAt",i);try{return le(s)}catch(o){return Je.throwError("bad result from backend",ne.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&Ns(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Je.throwError("Transaction hash mismatch from Provider.sendTransaction.",ne.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>je(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const c=yield this._waitForTransaction(e.hash,s,o,a);return c==null&&s===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&Je.throwError("transaction failed",ne.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),i}sendTransaction(e){return je(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>le(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return je(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?te.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?le(s):null))}),this.formatter.transactionRequest(yield _t(n))})}_getFilter(e){return je(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield _t(r))})}_call(e,r,n){return je(this,void 0,void 0,function*(){n>=OX&&Je.throwError("CCIP read exceeded maximum redirections",ne.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&Ns(s)%32===4)try{const o=rr(s,4),a=rr(o,0,32);te.from(a).eq(i)||Je.throwError("CCIP Read sender did not match",ne.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const c=[],l=te.from(rr(o,32,64)).toNumber(),u=te.from(rr(o,l,l+32)).toNumber(),f=rr(o,l+32);for(let y=0;yje(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let c=0;cthis._wrapTransaction(c)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return je(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Ko(()=>je(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return je(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Ko(()=>je(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return je(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield _t({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),Ce.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return je(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return je(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Je.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return je(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new G5(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return je(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Je.throwError("network does not support ENS",ne.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+jf(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return je(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(qe(e))throw n}typeof e!="string"&&Je.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return je(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=Xm(yield this.call({to:n,data:"0x691f3431"+jf(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return je(this,void 0,void 0,function*(){let r=null;if(qe(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new G5(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==ne.errors.CALL_EXCEPTION)throw a}try{const a=Xm(yield this.call({to:o,data:"0x691f3431"+jf(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==ne.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Je.throwError(e+" not implemented",ne.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new MX(Lu(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Lu(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Lu(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Lu(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Lu(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Lu(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var Lo=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const $r=new ne($d),jX=["call","estimateGas"];function r0(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=qe(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=r0(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return r0(JSON.parse(t),e)}catch{}return null}function z$(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=r0(e,!0);if(s)return s.data;$r.throwError("missing revert data in call exception; Transaction reverted without a reason string",ne.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=r0(e.body,!1);s==null&&(s=r0(e,!1)),s&&$r.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ne.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===ne.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&$r.throwError("insufficient funds for intrinsic transaction cost",ne.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&$r.throwError("nonce has already been used",ne.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&$r.throwError("replacement fee too low",ne.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&$r.throwError("legacy pre-eip-155 transactions not supported",ne.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),jX.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&$r.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ne.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function jS(t){return new Promise(function(e){setTimeout(e,t)})}function BX(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function gh(t){return t&&t.toLowerCase()}const K5={};class q$ extends Tc{constructor(e,r,n){if(super(),e!==K5)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");de(this,"provider",r),n==null&&(n=0),typeof n=="string"?(de(this,"_address",this.provider.formatter.address(n)),de(this,"_index",null)):typeof n=="number"?(de(this,"_index",n),de(this,"_address",null)):$r.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return $r.throwError("cannot alter JSON-RPC Signer connection",ne.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new FX(K5,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&$r.throwError("unknown account #"+this._index,ne.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Mt(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Mt(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>Lo(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&$r.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),_t({tx:_t(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&$r.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&$r.throwError("user rejected transaction",ne.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),z$("sendTransaction",o,s)))})}signTransaction(e){return $r.throwError("signing transactions is unsupported",ne.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Lo(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield Ko(()=>Lo(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return Lo(this,void 0,void 0,function*(){const r=typeof e=="string"?kt(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[le(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&$r.throwError("user rejected signing",ne.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return Lo(this,void 0,void 0,function*(){const r=typeof e=="string"?kt(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),le(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&$r.throwError("user rejected signing",ne.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return Lo(this,void 0,void 0,function*(){const i=yield Sr.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(Sr.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&$r.throwError("user rejected signing",ne.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return Lo(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class FX extends q${sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const UX={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let ua=class extends tb{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Qi(this.constructor,"defaultUrl")()),typeof e=="string"?de(this,"connection",Object.freeze({url:e})):de(this,"connection",Object.freeze(Mt(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Lo(this,void 0,void 0,function*(){yield jS(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Qi(this.constructor,"getNetwork");try{return r(te.from(e).toNumber())}catch(n){return $r.throwError("could not detect network",ne.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return $r.throwError("could not detect network",ne.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new q$(K5,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:si(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=Rd(this.connection,JSON.stringify(n),BX).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[gh(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[gh(r.address),r.blockTag]];case"getCode":return["eth_getCode",[gh(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[gh(r.address),St(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Qi(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Qi(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=gh(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return Lo(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&te.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Mt(r),r.transaction=Mt(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&$r.throwError(e+" not implemented",ne.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return z$(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),o.then(function(){return jS(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=Mt(UX);if(r)for(const s in r)r[s]&&(n[s]=!0);Ug(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=Ji(te.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=le(e[s]))}),e.accessList&&(i.accessList=nl(e.accessList)),i}};var zX=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const qX=new ne($d);class ay extends ua{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return zX(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||qX.throwError("no network detected",ne.errors.UNKNOWN_ERROR,{}),this._network==null&&(de(this,"_network",r),this.emit("network",r,null))),r})}}var cy=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Al=new ne($d);function Xp(){return new Date().getTime()}function BS(t){let e=null;for(let r=0;re?null:(n+i)/2}function bf(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(te.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>bf(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=bf(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let WX=1;function US(t){let e=null,r=null,n=new Promise(o=>{e=function(){r&&(clearTimeout(r),r=null),o()},r=setTimeout(e,t)});const i=o=>(n=n.then(o),n);function s(){return n}return{cancel:e,getPromise:s,wait:i}}const HX=[ne.errors.CALL_EXCEPTION,ne.errors.INSUFFICIENT_FUNDS,ne.errors.NONCE_EXPIRED,ne.errors.REPLACEMENT_UNDERPRICED,ne.errors.UNPREDICTABLE_GAS_LIMIT],VX=["address","args","errorArgs","errorSignature","method","transaction"];function Zp(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function GX(t,e){return function(r){const n={};r.forEach(s=>{const o=t(s.result);n[o]||(n[o]={count:0,result:s.result}),n[o].count++});const i=Object.keys(n);for(let s=0;s=e)return o.result}}}function KX(t,e,r){let n=bf;switch(e){case"getBlockNumber":return function(i){const s=i.map(a=>a.result);let o=FS(i.map(a=>a.result),2);if(o!=null)return o=Math.ceil(o),s.indexOf(o+1)>=0&&o++,o>=t._highestBlockNumber&&(t._highestBlockNumber=o),t._highestBlockNumber};case"getGasPrice":return function(i){const s=i.map(o=>o.result);return s.sort(),s[Math.floor(s.length/2)]};case"getEtherPrice":return function(i){return FS(i.map(s=>s.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=Mt(i),i.confirmations=-1,bf(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=Mt(i),i.transactions=i.transactions.map(s=>(s=Mt(s),s.confirmations=-1,s)),bf(i))}:n=function(i){return i==null?null:bf(i)};break;default:throw new Error("unknown method: "+e)}return GX(n,t.quorum)}function bh(t,e){return cy(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:Ko(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function QX(t,e,r,n){return cy(this,void 0,void 0,function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&qe(n.blockTag)&&(i=yield bh(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&qe(n.blockTag)&&(i=yield bh(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&qe(n.blockTag)&&(i=yield bh(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&qe(n.blockTag)&&(i=yield bh(t,e)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&qe(s.fromBlock)||s.toBlock&&qe(s.toBlock))&&(i=yield bh(t,e)),i.getLogs(s)}}return Al.throwError("unknown method error",ne.errors.UNKNOWN_ERROR,{method:r,params:n})})}class YX extends tb{constructor(e,r){e.length===0&&Al.throwArgumentError("missing providers","providers",e);const n=e.map((o,a)=>{if(Pa.isProvider(o)){const u=OS(o)?2e3:750;return Object.freeze({provider:o,weight:1,stallTimeout:u,priority:1})}const c=Mt(o);c.priority==null&&(c.priority=1),c.stallTimeout==null&&(c.stallTimeout=OS(o)?2e3:750),c.weight==null&&(c.weight=1);const l=c.weight;return(l%1||l>512||l<1)&&Al.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,l),Object.freeze(c)}),i=n.reduce((o,a)=>o+a.weight,0);r==null?r=i/2:r>i&&Al.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let s=BS(n.map(o=>o.provider.network));s==null&&(s=new Promise((o,a)=>{setTimeout(()=>{this.detectNetwork().then(o,a)},0)})),super(s),de(this,"providerConfigs",Object.freeze(n)),de(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return cy(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return BS(e)})}perform(e,r){return cy(this,void 0,void 0,function*(){if(e==="sendTransaction"){const c=yield Promise.all(this.providerConfigs.map(l=>l.provider.sendTransaction(r.signedTransaction).then(u=>u.hash,u=>u)));for(let l=0;lc.priority-l.priority);const s=this._highestBlockNumber;let o=0,a=!0;for(;;){const c=Xp();let l=i.filter(h=>h.runner&&c-h.starth+p.weight,0);for(;l{h.staller=null}),h.runner=QX(h,s,e,r).then(m=>{h.done=!0,h.result=m,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:Zp(h,Xp()),request:{method:e,params:si(r)},provider:this})},m=>{h.done=!0,h.error=m,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:Zp(h,Xp()),request:{method:e,params:si(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:Zp(h,null),request:{method:e,params:si(r)},provider:this}),l+=h.weight}const u=[];i.forEach(h=>{h.done||!h.runner||(u.push(h.runner),h.staller&&u.push(h.staller.getPromise()))}),u.length&&(yield Promise.race(u));const f=i.filter(h=>h.done&&h.error==null);if(f.length>=this.quorum){const h=n(f);if(h!==void 0)return i.forEach(p=>{p.staller&&p.staller.cancel(),p.cancelled=!0}),h;a||(yield US(100).getPromise()),a=!1}const d=i.reduce((h,p)=>{if(!p.done||p.error==null)return h;const m=p.error.code;return HX.indexOf(m)>=0&&(h[m]||(h[m]={error:p.error,weight:0}),h[m].weight+=p.weight),h},{});if(Object.keys(d).forEach(h=>{const p=d[h];if(p.weight{y.staller&&y.staller.cancel(),y.cancelled=!0});const m=p.error,v={};VX.forEach(y=>{m[y]!=null&&(v[y]=m[y])}),Al.throwError(m.reason||m.message,h,v)}),i.filter(h=>!h.done).length===0)break}return i.forEach(c=>{c.staller&&c.staller.cancel(),c.cancelled=!0}),Al.throwError("failed to meet quorum",ne.errors.SERVER_ERROR,{method:e,params:r,results:i.map(c=>Zp(c)),provider:this})})}}const zS=new ne($d);let JX=1;function qS(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:JX++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:si(s),provider:this}),e(s,(c,l)=>{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:s,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:l,provider:this}),l.error){const u=new Error(l.error.message);return u.code=l.error.code,u.data=l.error.data,a(u)}o(l.result)})})}}function XX(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:si(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class W$ extends ua{constructor(e,r){e==null&&zS.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=XX(e)):e.sendAsync?i=qS(e,e.sendAsync.bind(e)):e.send?i=qS(e,e.send.bind(e)):zS.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),de(this,"jsonRpcFetchFunc",i),de(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const ZX="solidity/5.7.0",eZ=new RegExp("^bytes([0-9]+)$"),tZ=new RegExp("^(u?int)([0-9]*)$"),rZ=new RegExp("^(.*)\\[([0-9]*)\\]$"),nZ="0000000000000000000000000000000000000000000000000000000000000000",ef=new ne(ZX);function H$(t,e,r){switch(t){case"address":return r?Nf(e,32):fe(e);case"string":return kt(e);case"bytes":return fe(e);case"bool":return e=e?"0x01":"0x00",r?Nf(e,32):fe(e)}let n=t.match(tZ);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)&&ef.throwArgumentError("invalid number type","type",t),r&&(i=256),e=te.from(e).toTwos(i),Nf(e,i/8)}if(n=t.match(eZ),n){const i=parseInt(n[1]);return(String(i)!==n[1]||i===0||i>32)&&ef.throwArgumentError("invalid bytes type","type",t),fe(e).byteLength!==i&&ef.throwArgumentError(`invalid value for ${t}`,"value",e),r?fe((e+nZ).substring(0,66)):e}if(n=t.match(rZ),n&&Array.isArray(e)){const i=n[1];parseInt(n[2]||String(e.length))!=e.length&&ef.throwArgumentError(`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(H$(i,a,!0))}),Et(o)}return ef.throwArgumentError("invalid type","type",t)}function Qe(t,e){t.length!=e.length&&ef.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(H$(n,e[i]))}),le(Et(r))}function Zo(t,e){return Oe(Qe(t,e))}function V$(t,e){return So(Qe(t,e))}const iZ=Object.freeze(Object.defineProperty({__proto__:null,keccak256:Zo,pack:Qe,sha256:V$},Symbol.toStringTag,{value:"Module"})),sZ="units/5.7.0",G$=new ne(sZ),K$=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Q$(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||t==="."||t==="-.")&&G$.throwArgumentError("invalid value","value",t);let r=e[0],n="";for(r.substring(0,1)==="-"&&(n="-",r=r.substring(1));r.substring(0,1)==="0";)r=r.substring(1);r===""&&(r="0");let i="";for(e.length===2&&(i="."+(e[1]||"0"));i.length>2&&i[i.length-1]==="0";)i=i.substring(0,i.length-1);const s=[];for(;r.length;)if(r.length<=3){s.unshift(r);break}else{const o=r.length-3;s.unshift(r.substring(o)),r=r.substring(0,o)}return n+s.join(",")+i}function Nt(t,e){if(typeof e=="string"){const r=K$.indexOf(e);r!==-1&&(e=3*r)}return Hm(t,e??18)}function ou(t,e){if(typeof t!="string"&&G$.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=K$.indexOf(e);r!==-1&&(e=3*r)}return Gs(t,e??18)}function Y$(t){return Nt(t,18)}function J$(t){return ou(t,18)}const oZ=Object.freeze(Object.defineProperty({__proto__:null,commify:Q$,formatEther:Y$,formatUnits:Nt,parseEther:J$,parseUnits:ou},Symbol.toStringTag,{value:"Module"})),aZ=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:Wg,ConstructorFragment:Wi,ErrorFragment:so,EventFragment:Ss,FormatTypes:at,Fragment:As,FunctionFragment:Hi,HDNode:Yn,Indexed:H0,Interface:xr,LogDescription:dE,Logger:ne,ParamType:Mr,RLP:vR,SigningKey:bc,get SupportedAlgorithm(){return iu},TransactionDescription:hE,get TransactionTypes(){return ry},get UnicodeNormalizationForm(){return Ds},Utf8ErrorFuncs:sE,get Utf8ErrorReason(){return Nn},_TypedDataEncoder:Sr,_fetchData:OE,_toEscapedUtf8String:_R,accessListify:nl,arrayify:fe,base58:nu,base64:$R,checkProperties:Ug,checkResultErrors:rE,commify:Q$,computeAddress:Xo,computeHmac:sd,computePublicKey:Yg,concat:Et,deepCopy:si,defaultAbiCoder:_n,defaultPath:su,defineReadOnly:de,dnsEncode:fE,entropyToMnemonic:V1,fetchJson:Rd,formatBytes32String:PR,formatEther:Y$,formatUnits:Nt,getAccountPath:C$,getAddress:Be,getContractAddress:qg,getCreate2Address:bR,getIcapAddress:gR,getJsonWalletAddress:A$,getStatic:Qi,hashMessage:z1,hexConcat:xn,hexDataLength:Ns,hexDataSlice:rr,hexStripZeros:Z8,hexValue:Ji,hexZeroPad:St,hexlify:le,id:Go,isAddress:iE,isBytes:ka,isBytesLike:Ms,isHexString:qe,isValidMnemonic:E$,isValidName:BR,joinSignature:Qv,keccak256:Oe,mnemonicToEntropy:H1,mnemonicToSeed:kE,namehash:jf,nameprep:OR,parseBytes32String:IR,parseEther:J$,parseTransaction:xE,parseUnits:ou,poll:Ko,randomBytes:Ps,recoverAddress:Rc,recoverPublicKey:gE,resolveProperties:_t,ripemd160:EE,serializeTransaction:ny,sha256:So,sha512:b$,shallowCopy:Mt,shuffled:AE,solidityKeccak256:Zo,solidityPack:Qe,soliditySha256:V$,splitSignature:el,stripZeros:Os,toUtf8Bytes:kt,toUtf8CodePoints:W0,toUtf8String:os,verifyMessage:TE,verifyTypedData:L$,zeroPad:Nf},Symbol.toStringTag,{value:"Module"})),X$="3.7.6",cZ=X$,lZ=typeof atob=="function",uZ=typeof btoa=="function",Md=typeof Zc=="function",WS=typeof TextDecoder=="function"?new TextDecoder:void 0,HS=typeof TextEncoder=="function"?new TextEncoder:void 0,fZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Fh=Array.prototype.slice.call(fZ),em=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(Fh),dZ=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,tn=String.fromCharCode.bind(String),VS=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),Z$=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),eM=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),tM=t=>{let e,r,n,i,s="";const o=t.length%3;for(let a=0;a255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=Fh[e>>18&63]+Fh[e>>12&63]+Fh[e>>6&63]+Fh[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},RE=uZ?t=>btoa(t):Md?t=>Zc.from(t,"binary").toString("base64"):tM,Q5=Md?t=>Zc.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?Z$(Q5(t)):Q5(t),hZ=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?tn(192|e>>>6)+tn(128|e&63):tn(224|e>>>12&15)+tn(128|e>>>6&63)+tn(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return tn(240|e>>>18&7)+tn(128|e>>>12&63)+tn(128|e>>>6&63)+tn(128|e&63)}},pZ=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,rM=t=>t.replace(pZ,hZ),GS=Md?t=>Zc.from(t,"utf8").toString("base64"):HS?t=>Q5(HS.encode(t)):t=>RE(rM(t)),Ff=(t,e=!1)=>e?Z$(GS(t)):GS(t),KS=t=>Ff(t,!0),mZ=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,vZ=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return tn((r>>>10)+55296)+tn((r&1023)+56320);case 3:return tn((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return tn((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},nM=t=>t.replace(mZ,vZ),iM=t=>{if(t=t.replace(/\s+/g,""),!dZ.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,i;for(let s=0;s>16&255):i===64?tn(e>>16&255,e>>8&255):tn(e>>16&255,e>>8&255,e&255);return r},$E=lZ?t=>atob(eM(t)):Md?t=>Zc.from(t,"base64").toString("binary"):iM,sM=Md?t=>VS(Zc.from(t,"base64")):t=>VS($E(t).split("").map(e=>e.charCodeAt(0))),oM=t=>sM(aM(t)),yZ=Md?t=>Zc.from(t,"base64").toString("utf8"):WS?t=>WS.decode(sM(t)):t=>nM($E(t)),aM=t=>eM(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),Y5=t=>yZ(aM(t)),gZ=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},cM=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),lM=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,cM(r));t("fromBase64",function(){return Y5(this)}),t("toBase64",function(e){return Ff(this,e)}),t("toBase64URI",function(){return Ff(this,!0)}),t("toBase64URL",function(){return Ff(this,!0)}),t("toUint8Array",function(){return oM(this)})},uM=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,cM(r));t("toBase64",function(e){return Zm(this,e)}),t("toBase64URI",function(){return Zm(this,!0)}),t("toBase64URL",function(){return Zm(this,!0)})},bZ=()=>{lM(),uM()},au={version:X$,VERSION:cZ,atob:$E,atobPolyfill:iM,btoa:RE,btoaPolyfill:tM,fromBase64:Y5,toBase64:Ff,encode:Ff,encodeURI:KS,encodeURL:KS,utob:rM,btou:nM,decode:Y5,isValid:gZ,fromUint8Array:Zm,toUint8Array:oM,extendString:lM,extendUint8Array:uM,extendBuiltins:bZ};var J5=function(){return J5=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0&&(i.types.Claims.push({name:"app",type:"string"}),i.message.app=this.claims.app),this.claims.iat&&this.claims.iat>0&&(i.types.Claims.push({name:"iat",type:"int64"}),i.message.iat=this.claims.iat),this.claims.exp&&this.claims.exp>0&&(i.types.Claims.push({name:"exp",type:"int64"}),i.message.exp=this.claims.exp),this.claims.n&&this.claims.n>0&&(i.types.Claims.push({name:"n",type:"uint64"}),i.message.n=this.claims.n),this.claims.typ&&this.claims.typ.length>0&&(i.types.Claims.push({name:"typ",type:"string"}),i.message.typ=this.claims.typ),this.claims.ogn&&this.claims.ogn.length>0&&(i.types.Claims.push({name:"ogn",type:"string"}),i.message.ogn=this.claims.ogn),this.claims.v&&this.claims.v.length>0&&(i.types.Claims.push({name:"v",type:"string"}),i.message.v=this.claims.v),i},t}(),wZ=function(t){if(t.app==="")return{ok:!1,err:new Error("claims: app is empty")};var e=Math.round(new Date().getTime()/1e3),r=5*60,n=60*60*24*365+r;return t.v===""?{ok:!1,err:new Error("claims: ethauth version is empty")}:t.iat&&t.iat!==0&&(t.iat>e+r||t.iate+n?{ok:!1,err:new Error("claims: token has expired")}:{ok:!0}},EZ=function(t,e,r){return _l(void 0,void 0,void 0,function(){var n,i;return Pl(this,function(s){return n=r.messageDigest(),i=TE(n,r.signature),i.slice(0,2)==="0x"&&i.length===42&&i.toLowerCase()===r.address.toLowerCase()?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]})})},CZ=function(t,e,r){return _l(void 0,void 0,void 0,function(){var n,i,s,o,a;return Pl(this,function(c){switch(c.label){case 0:return!t||t===void 0?[2,{isValid:!1}]:(n=r.messageDigest(),[4,t.getCode(r.address)]);case 1:if(i=c.sent(),i==="0x"||i.length<=2)throw new Error("ValidateContractAccountProof failed. unable to fetch wallet contract code");return s=["function isValidSignature(bytes32, bytes) public view returns (bytes4)"],o=new Od(r.address,s,t),[4,o.isValidSignature(n,fe(r.signature))];case 2:return a=c.sent(),a===SZ?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]}})})},SZ="0x1626ba7e",fM="1",X5="eth",kZ={name:"ETHAuth",version:fM},Q0=function(){function t(){for(var e=[],r=0;r0&&(c+="."+i.extra),[2,c]}})})},this.decodeProof=function(i,s){return s===void 0&&(s=!1),_l(n,void 0,void 0,function(){var o,a,c,l,u,f,d,h,p,m;return Pl(this,function(v){switch(v.label){case 0:if(o=i.split("."),o.length<4||o.length>5)throw new Error("ethauth: invalid proof string");if(a=o[0],c=o[1],l=o[2],u=o[3],f=o[4],a!==X5)throw new Error("ethauth: not an ethauth proof");return d=au.decode(l),h=JSON.parse(d),p=new rb({address:c,claims:h,signature:u,extra:f}),[4,this.validateProof(p,s)];case 1:if(m=v.sent(),!m)throw new Error("ethauth: proof is invalid");return[2,p]}})})},this.validateProof=function(i,s){return s===void 0&&(s=!1),_l(n,void 0,void 0,function(){var o,a;return Pl(this,function(c){switch(c.label){case 0:if(o=this.validateProofClaims(i),o.err)throw new Error("ethauth: proof claims are invalid ".concat(o.err));return s===!0?[3,2]:[4,this.validateProofSignature(i)];case 1:if(a=c.sent(),a!==!0)throw new Error("ethauth: proof signature is invalid");c.label=2;case 2:return[2,!0]}})})},this.validateProofSignature=function(i){return _l(n,void 0,void 0,function(){var s,c,o,a,c;return Pl(this,function(l){switch(l.label){case 0:s=[],c=0,l.label=1;case 1:if(!(cau.encode(t,!0),ME=t=>au.encode(JSON.stringify(t),!0),_Z=t=>{if(t!=null)return au.decode(t)},NE=t=>{if(t!=null)return JSON.parse(au.decode(t))};function dM(t){return t!=null&&(te.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||qe(t)||typeof t=="bigint"||ka(t))}const DE=t=>fe(Oe(typeof t=="string"?kt(t):t)),hM=(t,e,r)=>Qe(["string","uint256","address","bytes32"],["",e,t,r]),Z5=(t,e,r)=>Oe(hM(t,e,r)),pM=()=>typeof window>"u"&&typeof rn=="object",PZ=()=>!pM(),mM=t=>{const e=t.split(".");if(e.length!==3)throw new Error("invalid jwt");return JSON.parse(au.decode(e[1]))};function ly(){return ly=Object.assign?Object.assign.bind():function(t){for(var e=1;eSe.configure(t),Y0=(t,e,r)=>{const n={};return r&&r.length>0&&(n.Authorization=`BEARER ${r}`),e&&e.length>0&&(n["X-Access-Key"]=e),{url:t,headers:n,skipFetchSetup:!0,fetchOptions:{mode:"cors",cache:"force-cache",credentials:"same-origin",redirect:"follow",referrer:"client"}}};let TZ=class{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${Oe(kt(JSON.stringify(i,OZ)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}};function OZ(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function LE(t,e){return function(...r){const n=Array.prototype.slice.call(r);return new Promise(async(i,s)=>{try{n.push((o,a)=>o?s(o):i(a)),await t.apply(e,n)}catch(o){s(o)}})}}function RZ(t,e){const r=encodeURIComponent(t),n=encodeURIComponent(JSON.stringify(e));return`${r}=${n}`}function $Z(t){const e=t.split("&"),r={};for(const n of e){const i=n.split("=");r[decodeURIComponent(i[0])]=JSON.parse(decodeURIComponent(i[1]))}return r}const jE=(t=0,e=Number.MAX_SAFE_INTEGER)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),yM=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\d.]+/);return e&&e.length>0?e[0].trim():""},gM=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\s\d]+/);return e&&e.length>0?e[0].trim():""},bM=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\d.\-:\/]+/);return e&&e.length>0?e[0].trim():""},MZ=t=>new Promise(e=>{const r=setTimeout(()=>{clearTimeout(r),e()},t)}),xM=t=>{const e=ly({},t.types);return delete e.EIP712Domain,Sr.hash(t.domain,e,t.message)},G1=t=>fe(xM(t)),{defineReadOnly:NZ,getStatic:DZ,resolveProperties:LZ,checkProperties:jZ,shallowCopy:BZ,deepCopy:FZ}=aZ,UZ=t=>t.replace(/([^:]\/)\/+/g,"$1"),zZ=Object.freeze(Object.defineProperty({__proto__:null,Logger:vM,PromiseCache:TZ,base64Decode:_Z,base64DecodeObject:NE,base64Encode:AZ,base64EncodeObject:ME,checkProperties:jZ,configureLogger:IZ,deepCopy:FZ,defineReadOnly:NZ,encodeMessageDigest:DE,encodeTypedDataDigest:G1,encodeTypedDataHash:xM,getEthersConnectionInfo:Y0,getRandomInt:jE,getStatic:DZ,isBigNumberish:dM,isBrowser:PZ,isNode:pM,jwtDecodeClaims:mM,logger:Se,packMessageData:hM,promisify:LE,queryStringFromObject:RZ,queryStringToObject:$Z,resolveProperties:LZ,sanitizeAlphanumeric:gM,sanitizeHost:bM,sanitizeNumberString:yM,shallowCopy:BZ,sleep:MZ,subDigestOf:Z5,urlClean:UZ},Symbol.toStringTag,{value:"Module"}));function ft(){return ft=Object.assign?Object.assign.bind():function(t){for(var e=1;etypeof t=="number"?t:t.chainId?t.chainId:te.from(t).toNumber(),WZ=t=>{if(t)return wM(t)},EM=(t,e=!1,r=!1)=>{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(l=>l.chainId).sort(),s=i.filter((l,u)=>i.indexOf(l)!==u);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(l=>l.name=l.name.toLowerCase());const o=n.map(l=>l.name).sort(),a=o.filter((l,u)=>o.indexOf(l)!==u);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let c=!1;for(let l=0;l(EM(t,!0,e),t),HZ=(t,e=!0)=>{const r=t.map(i=>i.chainId).sort(),n=r.filter((i,s)=>r.indexOf(i)!==s);if(n.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${n}`);return!1}return!0},VZ=(t,e)=>{if(!(!t||!e)){if(!t.chainId&&!t.name)throw new Error("failed to update network config: source config is missing chainId or name");if(t.chainId!==e.chainId&&t.name!==e.name)throw new Error("failed to update network config: one of chainId or name must match");t.rpcUrl&&(e.rpcUrl=t.rpcUrl,e.provider=void 0),t.provider&&(e.provider=t.provider),t.relayer&&(e.relayer=t.relayer)}},SM=t=>CM(kM(t)),Rs=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=te.from(e).toNumber();return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(te.isBigNumber(e)){const r=e.toNumber();return t.find(n=>n.chainId===r)}else return}},GZ=(t,e)=>t?t.name===e||t.chainId===e:!1,KZ=t=>{const e={};for(let r=0;r{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},nb=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",BE=t=>nb("https://${network}-indexer.sequence.app",{network:t}),AM=t=>nb("https://${network}-relayer.sequence.app",{network:t}),_M=t=>nb("https://nodes.sequence.app/${network}",{network:t});function FE(t){return Rs(od,t)}function PM(t){return te.isBigNumber(t)?t:dM(t)?te.from(t):te.from(t.chainId)}const Tt=t=>{const e=_M(t);return{rpcUrl:e,relayer:{url:AM(t),provider:{url:e}},indexerUrl:BE(t)}},od=SM([ft({},lt[ue.POLYGON],Tt("polygon"),{isDefaultChain:!0,isAuthChain:!0}),ft({},lt[ue.MAINNET],Tt("mainnet")),ft({},lt[ue.BSC],Tt("bsc")),ft({},lt[ue.AVALANCHE],Tt("avalanche")),ft({},lt[ue.ARBITRUM],Tt("arbitrum")),ft({},lt[ue.ARBITRUM_NOVA],Tt("arbitrum-nova")),ft({},lt[ue.OPTIMISM],Tt("optimism")),ft({},lt[ue.OPTIMISM_SEPOLIA],Tt("optimism-sepolia")),ft({},lt[ue.POLYGON_ZKEVM],Tt("polygon-zkevm")),ft({},lt[ue.GNOSIS],Tt("gnosis")),ft({},lt[ue.RINKEBY],Tt("rinkeby"),{disabled:!0}),ft({},lt[ue.GOERLI],Tt("goerli"),{disabled:!0}),ft({},lt[ue.SEPOLIA],Tt("sepolia")),ft({},lt[ue.POLYGON_MUMBAI],Tt("mumbai"),{disabled:!0}),ft({},lt[ue.POLYGON_AMOY],Tt("amoy")),ft({},lt[ue.BSC_TESTNET],Tt("bsc-testnet")),ft({},lt[ue.ARBITRUM_SEPOLIA],Tt("arbitrum-sepolia")),ft({},lt[ue.BASE],Tt("base")),ft({},lt[ue.BASE_SEPOLIA],Tt("base-sepolia")),ft({},lt[ue.HOMEVERSE],Tt("homeverse")),ft({},lt[ue.HOMEVERSE_TESTNET],Tt("homeverse-testnet")),ft({},lt[ue.XAI],Tt("xai")),ft({},lt[ue.XAI_SEPOLIA],Tt("xai-sepolia")),ft({},lt[ue.AVALANCHE_TESTNET],Tt("avalanche-testnet")),ft({},lt[ue.ASTAR_ZKEVM],Tt("astar-zkevm")),ft({},lt[ue.ASTAR_ZKYOTO],Tt("astar-zkyoto")),ft({},lt[ue.XR_SEPOLIA],Tt("xr-sepolia")),ft({},lt[ue.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),ft({},lt[ue.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})]),ad="2.0";class UE{constructor(e,r){this.sender=void 0,this.handler=void 0,this.sender=r,e&&this.setMiddleware(e)}setMiddleware(e){this.handler=IM(e,this.sender.sendAsync)}sendAsync(e,r,n){try{this.handler(e,r,n)}catch(i){r(i,void 0)}}}const IM=(t,e)=>{if(t.length===0)return e;const r=i=>i.sendAsyncMiddleware?i.sendAsyncMiddleware:i;let n;n=r(t[t.length-1])(e);for(let i=t.length-2;i>=0;i--)n=r(t[i])(n);return n};function TM(t){return t!==void 0&&t.send!==void 0&&t.constructor.defaultUrl!==void 0&&t.detectNetwork!==void 0&&t.getSigner!==void 0&&t.perform!==void 0}function OM(t){return t!==void 0&&t.sendAsync!==void 0}let QZ=0;class uy{constructor(e,r){this.send=void 0,this.request=void 0,this.defaultChainId=void 0,this.sendAsync=(n,i,s)=>{this.send(n.method,n.params,s||this.defaultChainId).then(o=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:o})}).catch(o=>{i(o,void 0)})},this.defaultChainId=r,TM(e)?this.send=e.send.bind(e):OM(e)?this.send=(n,i,s)=>new Promise((o,a)=>{e.sendAsync({jsonrpc:ad,id:++QZ,method:n,params:i},(c,l)=>{c?a(c):o(l?l.result:void 0)},s||this.defaultChainId)}):this.send=e,this.request=(n,i)=>this.send(n.method,n.params,i)}}class YZ{constructor(e){this.provider=e,this.sendAsync=(r,n)=>{this.provider.send(r.method,r.params).then(i=>{n(void 0,{jsonrpc:"2.0",id:r.id,result:i})}).catch(i=>{n(i,void 0)})},this.send=this.sendAsync}}class JZ{constructor(e){this.sendAsyncMiddleware=void 0,this.isAllowedFunc=void 0,e?this.isAllowedFunc=e:this.isAllowedFunc=r=>!0,this.sendAsyncMiddleware=e6(this.isAllowedFunc)}setIsAllowedFunc(e){this.isAllowedFunc=e,this.sendAsyncMiddleware=e6(this.isAllowedFunc)}}const e6=t=>e=>(r,n,i)=>{if(!t(r))throw new Error("allowProvider middleware precondition is unmet.");e(r,n,i)};class zE{constructor(e){this.cachableJsonRpcMethods=["net_version","eth_chainId","eth_accounts","sequence_getWalletContext","sequence_getNetworks"],this.cachableJsonRpcMethodsByBlock=["eth_call","eth_getCode"],this.cache=void 0,this.cacheByBlock=void 0,this.cacheByBlockResetLock=!1,this.onUpdateCallback=void 0,this.defaultChainId=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{if(this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method)){const o=this.cacheKey(n.method,n.params,s||this.defaultChainId),a=this.getCacheValue(o);if(a&&a!==""){i(void 0,{jsonrpc:"2.0",id:n.id,result:a});return}}r(n,(o,a,c)=>{if((this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method))&&a&&a.result&&this.shouldCacheResponse(n,a)){const l=this.cacheKey(n.method,n.params,c||this.defaultChainId);this.cachableJsonRpcMethods.includes(n.method)?this.setCacheValue(l,a.result):this.setCacheByBlockValue(l,a.result)}i(o,a)},s||this.defaultChainId)},this.cacheKey=(r,n,i)=>{let s="";return i?s=`${i}:${r}:`:s=`:${r}:`,!n||n.length===0?s+"[]":s+JSON.stringify(n)},this.getCache=()=>this.cache,this.setCache=r=>{this.cache=r,this.onUpdateCallback&&this.onUpdateCallback()},this.getCacheValue=r=>{if(this.cache[r])return this.cache[r];if(this.cacheByBlock[r])return this.cacheByBlock[r]},this.setCacheValue=(r,n)=>{this.cache[r]=n,this.onUpdateCallback&&this.onUpdateCallback(r,n)},this.setCacheByBlockValue=(r,n)=>{this.cacheByBlock[r]=n,this.cacheByBlockResetLock||(this.cacheByBlockResetLock=!0,setTimeout(()=>{this.cacheByBlockResetLock=!1,this.cacheByBlock={}},1500))},this.shouldCacheResponse=(r,n)=>!(!n||!n.result||r.method==="eth_getCode"&&n.result.length<=2),this.clearCache=()=>{this.cache={},this.cacheByBlock={}},this.cache={},this.cacheByBlock={},this.defaultChainId=e==null?void 0:e.defaultChainId,e!=null&&e.blockCache?(e==null?void 0:e.blockCache)!==!0&&(this.cachableJsonRpcMethodsByBlock=e==null?void 0:e.blockCache):this.cachableJsonRpcMethodsByBlock=[]}onUpdate(e){this.onUpdateCallback=e}}class RM{constructor(e){this.options=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{const{id:o,method:a}=n;switch(a){case"net_version":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:`${this.options.chainId}`});return}break;case"eth_chainId":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:le(this.options.chainId)});return}break;case"eth_accounts":if(this.options.accountAddress){i(void 0,{jsonrpc:"2.0",id:o,result:[Be(this.options.accountAddress)]});return}break;case"sequence_getWalletContext":if(this.options.walletContext){i(void 0,{jsonrpc:"2.0",id:o,result:this.options.walletContext});return}break}r(n,i,s)},this.options=e}}const $M=t=>(e,r,n)=>{t(e,(i,s)=>{if(!i&&s&&s.error)throw typeof s.error=="string"?new Error(s.error):new Error(s.error.message);r(i,s)},n)},MM=t=>(e,r,n)=>{const i=n?` chainId:${n}`:"";Se.info(`[provider request]${i} id:${e.id} method:${e.method} params:`,e.params),t(e,(s,o)=>{s?Se.warn(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"error:",s):Se.info(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"response:",o),r(s,o)},n)},XZ=t=>e=>(r,n,i)=>{const s=t(r),{id:o,method:a}=r;switch(a){case"net_version":n(void 0,{jsonrpc:"2.0",id:o,result:`${s}`});return;case"eth_chainId":n(void 0,{jsonrpc:"2.0",id:o,result:le(s)});return}e(r,n,i)},NM=["personal_sign","eth_sign","eth_signTypedData","eth_signTypedData_v4","eth_sendTransaction","eth_sendRawTransaction","sequence_sign","sequence_signTypedData_v4","sequence_getWalletContext","sequence_getWalletConfig","sequence_getWalletState","sequence_getNetworks","sequence_updateConfig","sequence_publishConfig","sequence_gasRefundOptions","sequence_getNonce","sequence_relay","eth_decrypt","eth_getEncryptionPublicKey","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class ZZ{constructor(e){this.provider=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{if(NM.includes(n.method)){this.provider.sendAsync(n,i,s);return}r(n,i,s)},this.provider=e}}class eee{constructor(e){this.privateJsonRpcMethods=["net_version","eth_chainId","eth_accounts",...NM],this.provider=void 0,this.rpcUrl=void 0,this.sendAsyncMiddleware=r=>(n,i)=>{if(this.provider&&!this.privateJsonRpcMethods.includes(n.method)){this.provider.send(n.method,n.params).then(s=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:s})}).catch(s=>i(s));return}Se.debug("[public-provider] sending request to signer window",n.method),r(n,i)},e&&this.setRpcUrl(e)}getRpcUrl(){return this.rpcUrl}setRpcUrl(e){!e||e===""?(this.rpcUrl=void 0,this.provider=void 0):(this.rpcUrl=e,this.provider=new ua(e))}}class DM{constructor(){this.singleflightJsonRpcMethods=["eth_chainId","net_version","eth_call","eth_getCode","eth_blockNumber","eth_getBalance","eth_getStorageAt","eth_getTransactionCount","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_getBlockByHash","eth_getBlockByNumber","eth_getTransactionByHash","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionReceipt","eth_getUncleByBlockHashAndIndex","eth_getUncleByBlockNumberAndIndex","eth_getLogs"],this.inflight=void 0,this.sendAsyncMiddleware=e=>(r,n,i)=>{if(!this.singleflightJsonRpcMethods.includes(r.method)){e(r,n,i);return}const s=this.requestKey(r.method,r.params||[],i);if(!this.inflight[s])this.inflight[s]=[];else{this.inflight[s].push({id:r.id,callback:n});return}e(r,(o,a,c)=>{n(o,a);for(let l=0;l{let i="";return n?i=`${n}:${e}:`:i=`:${e}:`,!r||r.length===0?i+"[]":i+JSON.stringify(r)},this.inflight={}}}class tee extends ua{constructor(e,r){super(e,r==null?void 0:r.chainId),this._chainId=void 0,this._sender=void 0,this.send=(a,c)=>this._sender.send(a,c),this.fetch=(a,c)=>{const l={method:a,params:c,id:this._nextId++,jsonrpc:"2.0"};return Rd(this.connection,JSON.stringify(l),ree).then(f=>f,f=>{throw f})};const n=r==null?void 0:r.chainId,i=r==null?void 0:r.middlewares,s=r==null?void 0:r.blockCache;this._chainId=n;const o=new UE(i??[new RM({chainId:n}),new DM,new zE({defaultChainId:n,blockCache:s})],new uy(this.fetch,n));this._sender=new uy(o,n)}async getNetwork(){const e=this._chainId;if(e){const r=lt[e],n=(r==null?void 0:r.name)||"",i=r==null?void 0:r.ensAddress;return{name:n,chainId:e,ensAddress:i}}else{const r=await this.send("eth_chainId",[]);return this._chainId=te.from(r).toNumber(),this.getNetwork()}}}function ree(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}const nee=Object.freeze(Object.defineProperty({__proto__:null,AllowProvider:JZ,CachedProvider:zE,ChainId:ue,EagerProvider:RM,JsonRpcExternalProvider:YZ,JsonRpcProvider:tee,JsonRpcRouter:UE,JsonRpcSender:uy,JsonRpcVersion:ad,NetworkType:ot,PublicProvider:eee,SigningProvider:ZZ,SingleflightMiddleware:DM,allNetworks:od,allowProviderMiddleware:e6,checkNetworkConfig:GZ,createJsonRpcMiddlewareStack:IM,ensureUniqueNetworks:HZ,ensureValidNetworks:CM,exceptionProviderMiddleware:$M,findNetworkConfig:Rs,findSupportedNetwork:FE,getChainId:wM,indexerURL:BE,isJsonRpcHandler:OM,isJsonRpcProvider:TM,isNetworkConfig:qZ,isValidNetworkConfig:EM,loggingProviderMiddleware:MM,maybeChainId:WZ,networkProviderMiddleware:XZ,networks:lt,networksIndex:KZ,nodesURL:_M,relayerURL:AM,sortNetworks:kM,stringTemplate:nb,toChainIdNumber:PM,updateNetworkConfig:VZ,validateAndSortNetworks:SM},Symbol.toStringTag,{value:"Module"}));function on(){return on=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(WE(i))return Qe(["uint8","uint8","address"],[zl.Address,i.weight,i.address]);if(i.isDynamic){const s=fe(i.signature);return Qe(["uint8","uint8","address","uint16","bytes"],[zl.DynamicSignature,i.weight,i.address,s.length,s])}return Qe(["uint8","uint8","bytes"],[zl.EOASignature,i.weight,i.signature])});return Qe(["uint16",...new Array(n.length).fill("bytes")],[r,...n])}async function zM(t,e,r){const n=K1(e),i=await Promise.all(t.signers.map(async s=>{if(WE(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!qE(s.address,n,s.signature,r))throw new Error(`Invalid dynamic signature part ${s.address}`);return{address:s.address,weight:s.weight,signature:s.signature}}else return{address:Q1(n,s.signature),weight:s.weight,signature:s.signature}}));return{version:1,payload:e,subdigest:n,config:{version:1,threshold:t.threshold,signers:i}}}function n0(t,e,r,n){if(r.length!==0)throw new Error("Explicit subdigests not supported on v1");let i=te.from(0);const s=t.signers.map(a=>{if(!e.has(a.address))return a;const c=e.get(a.address),l=fe(c.signature);return i=i.add(a.weight),c.isDynamic||l.length!==66?on({},a,{isDynamic:!0,signature:c.signature,address:a.address}):on({},a,{isDynamic:!1,signature:c.signature})});return{encoded:HE({version:1,threshold:t.threshold,signers:s}),weight:i}}const VE={decode:t=>UM(t),encode:t=>HE(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>zM(t,e,r),encodeSigners:(t,e,r,n)=>n0(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=VE.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(t){throw new Error("Image hash not supported on v1")},signaturesOf(t){return t.signers.filter(e=>e.signature!==void 0).map(e=>({address:e.address,signature:e.signature}))},signaturesOfDecoded:function(t){return t.signers.map(e=>e.signature).filter(e=>e!==void 0)}};var dee=Object.freeze({__proto__:null,SignaturePartType:zl,isAddressMember:WE,isUnrecoveredSignatureMember:BM,isUnrecoveredSignature:FM,decodeSignature:UM,encodeSignature:HE,recoverSignature:zM,encodeSigners:n0,SignatureCoder:VE});const GE={isWalletConfig:t=>t.version===1&&t.threshold!==void 0&&t.signers!==void 0,imageHashOf:t=>t.signers.reduce((e,r)=>Oe(_n.encode(["bytes32","uint8","address"],[e,r.weight,r.address])),Qe(["uint256"],[t.threshold])),hasSubdigest:(t,e)=>!1,isComplete:t=>!0,checkpointOf:t=>te.from(0),signersOf:t=>t.signers.map(e=>({address:e.address,weight:te.from(e.weight).toNumber()})),fromSimple:t=>{if(!or.eq(t.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(t.subdigests&&t.subdigests.length>0)throw new Error("v1 wallet config does not support subdigests");return{version:1,threshold:t.threshold,signers:t.signers}},update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new xr([...Yr.mainModule.abi,...Yr.mainModuleUpgradable.abi]),s=[];return(!n||n==="first")&&s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImplementation"),[r.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[GE.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:t,transactions:s}},decodeTransaction:function(t){throw new Error("Function not implemented.")}},toJSON:function(t){const e=t.signers.map(r=>({weight:te.from(r.weight).toString(),address:r.address}));return JSON.stringify({version:t.version,threshold:te.from(t.threshold).toString(),signers:e})},fromJSON:function(t){const e=JSON.parse(t),r=e.signers.map(n=>({weight:te.from(n.weight),address:n.address}));return{version:e.version,threshold:te.from(e.threshold),signers:r}},editConfig:function(t,e){var r;const n=t.signers.slice();if(e.checkpoint&&!or.eq(e.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(e.add)for(const i of e.add)n.find(s=>s.address===i.address)||n.push({weight:i.weight,address:i.address});if(e.remove)for(const i of e.remove){const s=n.findIndex(o=>o.address===i);s>=0&&n.splice(s,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,signers:n}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=n0(t,r,[]);if(a.gte(t.threshold))return o}const n=t.signers;for(const{address:i}of n.sort(({weight:s},{weight:o})=>te.from(s).sub(o).toNumber())){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=n0(t,r,[]);if(a.gte(t.threshold))return o}return n0(t,r,[]).encoded}};var hee=Object.freeze({__proto__:null,ConfigCoder:GE});const qM=1,WM={version:qM,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var qo=Object.freeze({__proto__:null,config:hee,signature:dee,version:qM,DeployedWalletContext:WM});const KE="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function HM(t){return Oe(VM(t))}function VM(t){return Qe(["bytes32","bytes32"],[KE,t])}function GM(t){const e=fe(t);if(e.length===64&&le(e.slice(0,32))===KE)return le(e.slice(32,64))}function pee(t){return GM(t)!==void 0}var mee=Object.freeze({__proto__:null,SetImageHashPrefix:KE,hashSetImageHash:HM,messageSetImageHash:VM,decodeMessageSetImageHash:GM,isMessageSetImageHash:pee});let Kr=function(t){return t[t.Legacy=0]="Legacy",t[t.Dynamic=1]="Dynamic",t[t.NoChainIdDynamic=2]="NoChainIdDynamic",t[t.Chained=3]="Chained",t}({}),vr=function(t){return t[t.Signature=0]="Signature",t[t.Address=1]="Address",t[t.DynamicSignature=2]="DynamicSignature",t[t.Node=3]="Node",t[t.Branch=4]="Branch",t[t.Subdigest=5]="Subdigest",t[t.Nested=6]="Nested",t}({});const fy=66;function cu(t){return t.left!==void 0&&t.right!==void 0}function Nd(t){return t.tree!==void 0}function Y1(t){return t.unrecovered&&t.signature!==void 0&&t.isDynamic!==void 0}function dy(t){let e=fe(t),r;const n=(i,s)=>i?i.right?{left:i,right:s}:{left:i.left,right:s}:{left:s};for(;e.length>0;){const i=e[0];switch(e=e.slice(1),i){case vr.Signature:{const s=e[0],o=le(e.slice(1,fy+1));r=n(r,{signature:o,weight:s,unrecovered:!0,isDynamic:!1}),e=e.slice(fy+1)}break;case vr.Address:{const s=e[0],o=Be(le(e.slice(1,21)));r=n(r,{address:o,weight:s}),e=e.slice(21)}break;case vr.DynamicSignature:{const s=e[0],o=Be(le(e.slice(1,21))),a=e[21]<<16|e[22]<<8|e[23],c=le(e.slice(24,24+a));r=n(r,{address:o,signature:c,weight:s,unrecovered:!0,isDynamic:!0}),e=e.slice(24+a)}break;case vr.Node:{const s=le(e.slice(0,32));r=n(r,{nodeHash:s}),e=e.slice(32)}break;case vr.Branch:{const s=e[0]<<16|e[1]<<8|e[2],o=dy(e.slice(3,3+s));r=n(r,o),e=e.slice(3+s)}break;case vr.Subdigest:{const s=le(e.slice(0,32));r=n(r,{subdigest:s}),e=e.slice(32)}break;case vr.Nested:{const s=e[0],o=e[1]<<8|e[2],a=e[3]<<16|e[4]<<8|e[5],c=dy(e.slice(6,6+a));r=n(r,{weight:s,threshold:o,tree:c}),e=e.slice(6+a)}break;default:throw new Error(`Unknown signature part type: ${i}: ${le(e)}`)}}if(!r)throw new Error("Empty signature tree");return r.right?r:r.left}class KM extends Error{constructor(e){super(`Invalid signature leaf: ${JSON.stringify(e)}`),this.leaf=e}}async function ql(t,e,r){if(cu(t)){const[n,i]=await Promise.all([ql(t.left,e,r),ql(t.right,e,r)]);return{left:n,right:i}}if(Nd(t))return{weight:t.weight,threshold:t.threshold,tree:await ql(t.tree,e,r)};if(Y1(t))if(t.isDynamic){if(!t.address)throw new Error("Dynamic signature leaf without address");if(!await qE(t.address,e,t.signature,r))throw new KM(t);return{weight:t.weight,address:t.address,signature:t.signature,subdigest:e}}else return{weight:t.weight,address:Q1(e,t.signature),signature:t.signature,subdigest:e};return t}const mn={concat:(t,e)=>Qe(["bytes","bytes"],[t,e]),node:t=>Qe(["uint8","bytes32"],[vr.Node,t]),branch:t=>{const e=fe(t);return Qe(["uint8","uint24","bytes"],[vr.Branch,e.length,e])},nested:(t,e,r)=>{const n=fe(r);return Qe(["uint8","uint8","uint16","uint24","bytes"],[vr.Nested,t,e,n.length,n])},subdigest:t=>Qe(["uint8","bytes32"],[vr.Subdigest,t]),signature:(t,e)=>Qe(["uint8","uint8","bytes"],[vr.Signature,t,e]),dynamicSignature:(t,e,r)=>{const n=fe(r);return Qe(["uint8","uint8","address","uint24","bytes"],[vr.DynamicSignature,t,e,n.length,n])},address:(t,e)=>Qe(["uint8","uint8","address"],[vr.Address,t,e])};function i0(t,e,r,n,i={}){const s=s0(t.tree,e,r,i);return te.from(n).isZero()?{encoded:Qe(["uint8","uint16","uint32","bytes"],[Kr.NoChainIdDynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:te.from(t.threshold).gt(255)?{encoded:Qe(["uint8","uint16","uint32","bytes"],[Kr.Dynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:{encoded:Qe(["uint8","uint8","uint32","bytes"],[Kr.Legacy,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}}function s0(t,e,r,n={}){const i=!n.disableTrim;if(js(t)){const s=s0(t.left,e,r),o=s0(t.right,e,r),a=Fn(t.left),c=Fn(t.right);return i&&s.weight.eq(0)&&o.weight.eq(0)&&!a&&!c?{encoded:mn.node(Vi(t)),weight:or}:i&&o.weight.eq(0)&&!c?{encoded:mn.concat(s.encoded,mn.node(Vi(t.right))),weight:s.weight}:i&&s.weight.eq(0)&&!a?{encoded:mn.concat(mn.node(Vi(t.left)),mn.branch(o.encoded)),weight:o.weight}:{encoded:mn.concat(s.encoded,mn.branch(o.encoded)),weight:s.weight.add(o.weight)}}if(Ta(t)){const s=s0(t.tree,e,r);return i&&s.weight.eq(0)?{encoded:mn.node(Vi(t)),weight:or}:{encoded:mn.nested(t.weight,t.threshold,s.encoded),weight:s.weight}}if(Oa(t))return{encoded:mn.node(Vi(t)),weight:or};if(Ia(t)){const s=r.includes(t.subdigest);return{encoded:mn.subdigest(t.subdigest),weight:s?SR:or}}if(Fn(t))if(e.has(t.address)){const o=e.get(t.address),a=o.signature;return n.forceDynamicEncoding||o.isDynamic?{encoded:mn.dynamicSignature(t.weight,t.address,a),weight:te.from(t.weight)}:{encoded:mn.signature(t.weight,a),weight:te.from(t.weight)}}else return{encoded:mn.address(t.weight,t.address),weight:or};throw new Error(`Invalid topology - unknown error: ${JSON.stringify(t)}`)}function QE(t){return JE(t)?QE(t.suffix[t.suffix.length-1]):t.config}function YE(t){return t.type!==void 0&&t.decoded!==void 0&&t.version!==void 0&&t.version===2}function J1(t){return t.suffix!==void 0&&Array.isArray(t.suffix)&&t.suffix.every(YE)}function QM(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function JE(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(QM)}function ib(t){const e=fe(t),r=e[0];switch(r){case Kr.Legacy:return{version:2,type:Kr.Legacy,decoded:ev(e)};case Kr.Dynamic:return{version:2,type:Kr.Dynamic,decoded:ev(e.slice(1))};case Kr.NoChainIdDynamic:return{version:2,type:Kr.NoChainIdDynamic,decoded:ev(e.slice(1))};case Kr.Chained:return YM(e);default:throw new Error(`Invalid signature type: ${r}`)}}function ev(t){const e=fe(t),r=e[0]<<8|e[1],n=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i=dy(e.slice(6));return{threshold:r,checkpoint:n,tree:i}}function YM(t){const e=fe(t),r=e[0];if(r!==Kr.Chained)throw new Error(`Expected chained signature type: ${r}`);const n=[];let i=1;for(;ife(wc(s))),i=Qe(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return Qe(["uint8","bytes"],[Kr.Chained,i])}function wc(t){if(Ms(t))return le(t);if(J1(t)||JE(t))return sb(wc(t),(t.suffix||[]).map(wc));const e=YE(t)?t.decoded:t.config;switch(t.type){case Kr.Legacy:if(te.from(e.threshold).gt(255))throw new Error(`Legacy signature threshold is too large: ${e.threshold} (max 255)`);return t6(e);case Kr.NoChainIdDynamic:case Kr.Dynamic:return Qe(["uint8","bytes"],[t.type,t6(e)]);case Kr.Chained:throw new Error("Unreachable code: Chained signature should be handled above");default:throw new Error(`Invalid signature type: ${t.type}`)}}function t6(t){return Qe(["uint16","uint32","bytes"],[t.threshold,t.checkpoint,o0(t.tree)])}function o0(t){if(js(t)||cu(t)){const e=fe(o0(t.right)),r=fe(o0(t.left));return js(t.right)||cu(t.right)?Qe(["bytes","uint8","uint24","bytes"],[r,vr.Branch,e.length,e]):Qe(["bytes","bytes"],[r,e])}if(Ta(t)||Nd(t)){const e=fe(o0(t.tree));return Qe(["uint8","uint8","uint16","uint24","bytes"],[vr.Nested,t.weight,t.threshold,e.length,e])}if(Y1(t)||Fn(t)&&t.signature!==void 0){const e=fe(t.signature);if(t.isDynamic||e.length!==fy){if(!t.address)throw new Error("Dynamic signature leaf must have address");return Qe(["uint8","uint8","address","uint24","bytes"],[vr.DynamicSignature,t.weight,t.address,e.length,e])}else return Qe(["uint8","uint8","bytes"],[vr.Signature,t.weight,e])}if(Fn(t))return Qe(["uint8","uint8","address"],[vr.Address,t.weight,t.address]);if(Oa(t))return Qe(["uint8","bytes32"],[vr.Node,t.nodeHash]);if(Ia(t))return Qe(["uint8","bytes32"],[vr.Subdigest,t.subdigest]);throw new Error(`Unknown signature tree type: ${t}`)}function a0(t){return js(t)?[...a0(t.left),...a0(t.right)]:Ta(t)?a0(t.tree):Fn(t)&&t.signature?[{address:t.address,signature:t.signature}]:[]}function c0(t){return cu(t)?[...c0(t.left),...c0(t.right)]:Nd(t)?c0(t.tree):Y1(t)?[t.signature]:[]}function tv(t){return cu(t)?[...tv(t.left),...tv(t.right)]:Nd(t)?tv(t.tree):Ia(t)?[t.subdigest]:[]}async function hy(t){const e=typeof t=="string"?ib(t):t;if(J1(e)){const n=await Promise.all([hy(on({},e,{suffix:void 0})),...e.suffix.map(i=>hy(i))]);return sb(n[0],n.slice(1))}const{trimmed:r}=await l0(e.decoded.tree);return wc(on({},e,{decoded:on({},e.decoded,{tree:r})}))}async function l0(t,e=!0){if(cu(t)){const[r,n]=await Promise.all([l0(t.left),l0(t.right)]);if(r.weight===0&&n.weight===0)try{const i=await ql(t,Xv,void 0);return{weight:0,trimmed:{nodeHash:Vi(i)}}}catch{}else return{weight:r.weight+n.weight,trimmed:{left:r.trimmed,right:n.trimmed}}}if(Nd(t)){const r=await l0(t.tree);if(r.weight===0)try{const n=await ql(t,Xv,void 0);return{weight:0,trimmed:{nodeHash:Vi(n)}}}catch{}return{weight:r.weight,trimmed:{weight:t.weight,threshold:t.threshold,tree:r.trimmed}}}return Oa(t)&&eN(t.nodeHash)?{weight:0,trimmed:on({},ZM(t.nodeHash))}:Y1(t)||Fn(t)&&t.signature!==void 0?{weight:te.from(t.weight).toNumber(),trimmed:t}:!e&&Ia(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const ob={decode:t=>ib(t),encode:t=>wc(t),trim:t=>hy(t),supportsNoChainId:!0,recover:(t,e,r)=>XE(t,e,r),encodeSigners:(t,e,r,n)=>i0(t,e,r,n),hasEnoughSigningPower:(t,e)=>{const{weight:r}=ob.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{const r=e.reverse(),n=Ms(t)?t:wc(t),i=r.map(s=>Ms(s)?s:wc(s));return sb(n,i)},hashSetImageHash:function(t){return HM(t)},signaturesOf(t){return a0(t.tree)},signaturesOfDecoded:function(t){return c0(t.decoded.tree)}};var vee=Object.freeze({__proto__:null,SignatureType:Kr,SignaturePartType:vr,SignaturePartTypeLength:fy,isUnrecoveredNode:cu,isUnrecoveredNestedLeaf:Nd,isUnrecoveredSignatureLeaf:Y1,decodeSignatureTree:dy,InvalidSignatureLeafError:KM,recoverTopology:ql,partEncoder:mn,encodeSigners:i0,encodeTree:s0,deepestConfigOfSignature:QE,isUnrecoveredSignature:YE,isUnrecoveredChainedSignature:J1,isSignature:QM,isChainedSignature:JE,decodeSignature:ib,decodeSignatureBody:ev,decodeChainedSignature:YM,setImageHashStruct:JM,recoverSignature:XE,encodeChain:sb,encodeSignature:wc,encodeSignatureBody:t6,encodeSignatureTree:o0,signaturesOf:a0,signaturesOfDecoded:c0,subdigestsOfDecoded:tv,trimSignature:hy,trimUnrecoveredTree:l0,SignatureCoder:ob});function Fn(t){return t.address!==void 0&&t.weight!==void 0}function Ia(t){return t.subdigest!==void 0&&t.address===void 0}function u0(t){return js(t)?JSON.stringify({left:u0(t.left),right:u0(t.right)}):Ta(t)?JSON.stringify({weight:te.from(t.weight).toString(),threshold:te.from(t.threshold).toString(),tree:u0(t.tree)}):Fn(t)?JSON.stringify({address:t.address,weight:te.from(t.weight).toString()}):JSON.stringify(t)}function f0(t){const e=typeof t=="string"?JSON.parse(t):t;return e.left!==void 0&&e.right!==void 0?{left:f0(e.left),right:f0(e.right)}:e.weight!==void 0&&e.threshold!==void 0&&e.tree!==void 0?{weight:te.from(e.weight),threshold:te.from(e.threshold),tree:f0(e.tree)}:e.address!==void 0&&e.weight!==void 0?{address:e.address,weight:te.from(e.weight)}:e}function Ta(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function Oa(t){return t.nodeHash!==void 0}function ZE(t){return Fn(t)||Ia(t)||Ta(t)||Oa(t)}function js(t){return t.left!==void 0&&t.right!==void 0}function yee(t){return js(t)||ZE(t)}function XM(t){return Qe(["uint96","address"],[t.weight,t.address])}function ZM(t){const e=fe(t);if(e.length!==32)throw new Error("Invalid encoded string length");const r=te.from(e.slice(0,12)),n=Be(le(e.slice(12)));return{weight:r,address:n}}function eN(t){const e=fe(t);return e.length!==32?!1:e.slice(0,11).every(n=>n===0)}function Vi(t){if(Fn(t))return XM(t);if(Ia(t))return Zo(["string","bytes32"],[`Sequence static digest: +`,t.subdigest]);if(Ta(t)){const e=Vi(t.tree);return Zo(["string","bytes32","uint256","uint256"],[`Sequence nested config: +`,e,t.threshold,t.weight])}return Oa(t)?t.nodeHash:Zo(["bytes32","bytes32"],[Vi(t.left),Vi(t.right)])}function gee(t){const e=[];let r=t;for(;!ZE(r);)e.unshift(r.right),r=r.left;return e.unshift(r),e}function bee(t){return t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&t.version!==void 0&&t.version===2}function eC(t){return Zo(["bytes32","uint256"],[Zo(["bytes32","uint256"],[Vi(t.tree),t.threshold]),t.checkpoint])}function tN(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function Uf(t){return Fn(t)||Ia(t)?[t]:Ta(t)?[{threshold:t.threshold,weight:t.weight,members:Uf(t.tree)}]:Oa(t)?[]:[...Uf(t.left),...Uf(t.right)]}function r6(t){return Oa(t)?!0:js(t)?r6(t.left)||r6(t.right):!1}function xee(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:Uf(t.tree)}}const rN=(t,e)=>t.map(r=>tN(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function tC(t){if(t.length===0)throw new Error("Empty members array");return rN(t,tC).reduce((r,n)=>({left:r,right:n}))}function rC(t){if(t.length===0)throw new Error("Empty members array");const e=rN(t,rC);for(let r=e.length;r>1;r=r/2)for(let n=0;n=r?e[n]=e[i]:e[n]={left:e[i],right:e[s]}}return e[0]}function nC(t){return t.length>8?rC(t):tC(t)}function nN(t,e=nC){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function py(t,e){return Ia(t)?t.subdigest===e:js(t)?py(t.left,e)||py(t.right,e):!1}function n6(t){const e=[t],r=new Set;for(;e.length>0;){const n=e.pop();Ta(n)?e.push(n.tree):js(n)?(e.push(n.left),e.push(n.right)):Fn(n)&&r.add({address:n.address,weight:te.from(n.weight).toNumber()})}return Array.from(r)}function my(t){return js(t)?my(t.left)&&my(t.right):!Oa(t)}const ab={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>eC(t),hasSubdigest:(t,e)=>py(t.tree,e),checkpointOf:t=>te.from(t.checkpoint),signersOf:t=>n6(t.tree),fromSimple:t=>{var e;return nN(on({},t,{members:[...t.signers,...((e=t.subdigests)!=null?e:[]).map(r=>({subdigest:r}))]}))},isComplete:t=>my(t.tree),update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new xr(Yr.mainModuleUpgradable.abi);return{entrypoint:t,transactions:[{to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[ab.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}]}},decodeTransaction:function(t){var e,r,n,i;const s=new xr(Yr.mainModuleUpgradable.abi);if(t.transactions.length!==1)throw new Error("Invalid transaction bundle, expected 1 transaction");const o=t.transactions[0].data;if(!o)throw new Error("Invalid transaction bundle, expected data");const a=s.decodeFunctionData(s.getFunction("updateImageHash"),o);if(!a)throw new Error("Invalid transaction bundle, expected valid data");if(t.transactions[0].to!==t.entrypoint)throw new Error("Invalid transaction bundle, expected to be sent to entrypoint");if(t.transactions[0].delegateCall)throw new Error("Invalid transaction bundle, expected not to be a delegateCall");if(!t.transactions[0].revertOnError)throw new Error("Invalid transaction bundle, expected revertOnError");if(!or.eq((e=(r=t.transactions[0])==null?void 0:r.value)!=null?e:0))throw new Error("Invalid transaction bundle, expected value to be 0");if(!or.eq((n=(i=t.transactions[0])==null?void 0:i.gasLimit)!=null?n:0))throw new Error("Invalid transaction bundle, expected value to be 0");return{address:t.entrypoint,newImageHash:a[0],kind:void 0}}},toJSON:function(t){return JSON.stringify({version:t.version,threshold:te.from(t.threshold).toString(),checkpoint:te.from(t.checkpoint).toString(),tree:u0(t.tree)})},fromJSON:function(t){const e=JSON.parse(t);return{version:e.version,threshold:te.from(e.threshold),checkpoint:te.from(e.checkpoint),tree:f0(e.tree)}},editConfig:function(t,e){var r,n;const i=Uf(t.tree);if(e.add)for(const s of e.add)i.find(o=>Fn(o)&&o.address===s.address)||i.push({address:s.address,weight:s.weight});if(e.remove)for(const s of e.remove){const o=i.findIndex(a=>Fn(a)&&a.address===s);o>=0&&i.splice(o,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,checkpoint:(n=e.checkpoint)!=null?n:t.checkpoint,tree:nC(i)}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=i0(t,r,[],0);if(a.gte(t.threshold))return o}const n=n6(t.tree);for(const{address:i}of n.sort(({weight:s},{weight:o})=>s-o)){r.set(i,{signature:"0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02",isDynamic:!1});const{encoded:o,weight:a}=i0(t,r,[],0);if(a.gte(t.threshold))return o}return i0(t,r,[],0).encoded}};var wee=Object.freeze({__proto__:null,isSignerLeaf:Fn,isSubdigestLeaf:Ia,topologyToJSON:u0,topologyFromJSON:f0,isNestedLeaf:Ta,isNodeLeaf:Oa,isLeaf:ZE,isNode:js,isTopology:yee,encodeSignerLeaf:XM,decodeSignerLeaf:ZM,isEncodedSignerLeaf:eN,hashNode:Vi,leftFace:gee,isWalletConfig:bee,imageHash:eC,isSimpleNestedMember:tN,topologyToMembers:Uf,hasUnknownNodes:r6,toSimpleWalletConfig:xee,legacyTopologyBuilder:tC,merkleTopologyBuilder:rC,optimized2SignersTopologyBuilder:nC,toWalletConfig:nN,hasSubdigest:py,signersOf:n6,isComplete:my,ConfigCoder:ab}),Eee=Object.freeze({__proto__:null});const Cee={config:ab,signature:ob},iN=2,sN={version:iN,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var Ze=Object.freeze({__proto__:null,config:wee,signature:vee,context:Eee,chained:mee,coders:Cee,version:iN,DeployedWalletContext:sN});function i6(t,e){const r=Oe(Qe(["bytes","bytes32"],[t.walletCreationCode,St(t.mainModule,32)])),n=Oe(Qe(["bytes1","address","bytes32","bytes32"],["0xff",t.factory,e,r]));return Be(rr(n,12))}async function See(t,e,r,n,i,s){return(await Promise.all(yN.map(async a=>{try{const c=a.signature.SignatureCoder.decode(le(r)),l=await a.signature.SignatureCoder.recover(c,{address:t,digest:le(e),chainId:n},i),u=a.config.ConfigCoder.imageHashOf(l.config);if(i6(s[a.version],u).toLowerCase()===t.toLowerCase())return!0;const d=await a.signature.SignatureCoder.recover(c,{address:t,digest:le(e),chainId:n},i),h=a.config.ConfigCoder.imageHashOf(d.config);return i6(s[a.version],h).toLowerCase()===t.toLowerCase()}catch{}return!1}))).some(a=>a)}function kee(t){const e=Object.keys(t).length;for(let r=1;r<=e;r++){const n=t[r];if(!n||n.version!==r)return!1}return!0}function Aee(t){const e=Object.keys(t).length;return t[e]}const _ee={1:WM,2:sN};var Pee=Object.freeze({__proto__:null,addressOf:i6,isValidCounterfactual:See,isValidVersionedContext:kee,latestContext:Aee,defaultContexts:_ee});const cb=`tuple( bool delegateCall, bool revertOnError, uint256 gasLimit, address target, uint256 value, bytes data -)[]`;function Xee(t,e,r,n){return an({},t,{chainId:r,intent:{id:n,wallet:e}})}function Zee(t){return Oe(_n.encode(["address","uint256","bytes32"],[t.intent.wallet,t.chainId,t.intent.id]))}function ete(t){const e=_n.decode(["uint256",xb],t);if(e.length!==2||!e[0]||!e[1])throw new Error("Invalid meta transaction data");return[e[0],e[1]]}function kN(t,e){return _n.encode(["uint256",xb],[t,a1(e)])}function AN(t,e){return Oe(kN(t,e))}function tte(t,e,r,n){return op({address:t,chainId:e,digest:AN(r,n)})}function rte(t,e,r){return op({address:t,chainId:e,digest:Oe(_n.encode(["string",xb],["guest:",a1(r)]))})}function _N(t,e){return e.map(r=>gC(t,r))}function gC(t,e){if(e.to&&e.to!==Dt)return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit||0,to:e.to,value:e.value||0,data:e.data||"0x"}};{const r=new wr(Jr.mainModule.abi),n=r.encodeFunctionData(r.getFunction("createContract"),[e.data]);return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit,to:t,value:e.value||0,data:n}}}}function wb(t){return t.delegateCall!==void 0||t.revertOnError!==void 0}function PN(t){return t.every(wb)}function a1(t){return t.map(e=>{var r;return{delegateCall:e.delegateCall===!0,revertOnError:e.revertOnError===!0,gasLimit:e.gasLimit!==void 0?e.gasLimit:or,target:(r=e.to)!=null?r:Dt,value:e.value!==void 0?e.value:or,data:e.data!==void 0?e.data:[]}})}function nte(t){return t.map(e=>({delegateCall:e.delegateCall,revertOnError:e.revertOnError,gasLimit:e.gasLimit,to:e.target,value:e.value,data:e.data}))}function ite(t,e){const r=te.from(t),n=te.from(e),i=zR.pow(te.from(96));if(!n.div(i).eq(or))throw new Error("Space already encoded");return n.add(r.mul(i))}function ste(t){const e=te.from(t),r=zR.pow(te.from(96));return[e.div(r),e.mod(r)]}function ote(t,e){return Array.isArray(e)?PN(e)?e:_N(t,e).map(n=>n.transaction):wb(e)?[e]:[gC(t,e).transaction]}function IN(t){return t!==void 0&&t.entrypoint!==void 0&&t.chainId!==void 0&&t.transactions!==void 0&&t.nonce!==void 0&&t.intent!==void 0&&t.intent.id!==void 0&&t.intent.wallet!==void 0&&Array.isArray(t.transactions)&&t.transactions.reduce((e,r)=>e&&wb(r),!0)}function TN(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&IN(t)}function ate(t){const e=new wr(Jr.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),TN(t)?[a1(t.transactions),t.nonce,t.signature]:[a1(t.transactions),0,[]])}const ON="0x61c2926c",RN=`tuple( +)[]`;function Iee(t,e,r,n){return on({},t,{chainId:r,intent:{id:n,wallet:e}})}function Tee(t){return Oe(_n.encode(["address","uint256","bytes32"],[t.intent.wallet,t.chainId,t.intent.id]))}function Oee(t){const e=_n.decode(["uint256",cb],t);if(e.length!==2||!e[0]||!e[1])throw new Error("Invalid meta transaction data");return[e[0],e[1]]}function oN(t,e){return _n.encode(["uint256",cb],[t,J0(e)])}function aN(t,e){return Oe(oN(t,e))}function Ree(t,e,r,n){return K1({address:t,chainId:e,digest:aN(r,n)})}function $ee(t,e,r){return K1({address:t,chainId:e,digest:Oe(_n.encode(["string",cb],["guest:",J0(r)]))})}function cN(t,e){return e.map(r=>iC(t,r))}function iC(t,e){if(e.to&&e.to!==Dt)return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit||0,to:e.to,value:e.value||0,data:e.data||"0x"}};{const r=new xr(Yr.mainModule.abi),n=r.encodeFunctionData(r.getFunction("createContract"),[e.data]);return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit,to:t,value:e.value||0,data:n}}}}function lb(t){return t.delegateCall!==void 0||t.revertOnError!==void 0}function lN(t){return t.every(lb)}function J0(t){return t.map(e=>{var r;return{delegateCall:e.delegateCall===!0,revertOnError:e.revertOnError===!0,gasLimit:e.gasLimit!==void 0?e.gasLimit:or,target:(r=e.to)!=null?r:Dt,value:e.value!==void 0?e.value:or,data:e.data!==void 0?e.data:[]}})}function Mee(t){return t.map(e=>({delegateCall:e.delegateCall,revertOnError:e.revertOnError,gasLimit:e.gasLimit,to:e.target,value:e.value,data:e.data}))}function Nee(t,e){const r=te.from(t),n=te.from(e),i=CR.pow(te.from(96));if(!n.div(i).eq(or))throw new Error("Space already encoded");return n.add(r.mul(i))}function Dee(t){const e=te.from(t),r=CR.pow(te.from(96));return[e.div(r),e.mod(r)]}function Lee(t,e){return Array.isArray(e)?lN(e)?e:cN(t,e).map(n=>n.transaction):lb(e)?[e]:[iC(t,e).transaction]}function uN(t){return t!==void 0&&t.entrypoint!==void 0&&t.chainId!==void 0&&t.transactions!==void 0&&t.nonce!==void 0&&t.intent!==void 0&&t.intent.id!==void 0&&t.intent.wallet!==void 0&&Array.isArray(t.transactions)&&t.transactions.reduce((e,r)=>e&&lb(r),!0)}function fN(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&uN(t)}function jee(t){const e=new xr(Yr.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),fN(t)?[J0(t.transactions),t.nonce,t.signature]:[J0(t.transactions),0,[]])}const dN="0x61c2926c",hN=`tuple( bool delegateCall, bool revertOnError, uint256 gasLimit, address target, uint256 value, bytes data -)[]`,b6=(t,e)=>{const r=[],n=new wr(Jr.mainModule.abi);for(const i of e){const s=fe(i.data||"0x");if(i.to===t&&le(s.slice(0,4))===ON){const o=s.slice(4),a=_n.decode([RN],o)[0];r.push(...b6(i.to,a.map(c=>an({},c,{to:c.target}))))}else try{const o=n.decodeFunctionData("execute",s)[0],a=b6(t,o.map(c=>an({},c,{to:c.target})));r.push(...a)}catch{r.push(i)}}return r};var cte=Object.freeze({__proto__:null,MetaTransactionsType:xb,intendTransactionBundle:Xee,intendedTransactionID:Zee,unpackMetaTransactionsData:ete,packMetaTransactionsData:kN,digestOfTransactions:AN,subdigestOfTransactions:tte,subdigestOfGuestModuleTransactions:rte,toSequenceTransactions:_N,toSequenceTransaction:gC,isSequenceTransaction:wb,hasSequenceTransactions:PN,sequenceTxAbiEncode:a1,fromTxAbiEncode:nte,encodeNonce:ite,decodeNonce:ste,fromTransactionish:ote,isTransactionBundle:IN,isSignedTransactionBundle:TN,encodeBundleExecData:ate,selfExecuteSelector:ON,selfExecuteAbi:RN,unwind:b6});const $N="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",lte="0x6492649264926492649264926492649264926492649264926492649264926492";async function MN(t,e,r,n){return await t.call({data:wt([$N,new rb().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}var ute=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:$N,EIP_6492_SUFFIX:lte,validateEIP6492Offchain:MN});class fte{constructor(e){this.provider=e,this.isDeployedCache=new Set}module(e){return new Fd(e,[...Jr.mainModuleUpgradable.abi,...Jr.mainModule.abi,...Jr.erc1271.abi],this.provider)}async isDeployed(e){if(this.isDeployedCache.has(e))return!0;const n=(await this.provider.getCode(e).then(i=>fe(i))).length!==0;return n&&this.isDeployedCache.add(e),n}async implementation(e){const r=_n.encode(["address"],[e]),n=await this.provider.getStorageAt(e,r).then(i=>fe(i));if(n.length===20)return Be(le(n));if(n.length===32)return _n.decode(["address"],n)[0]}async imageHash(e){try{return await this.module(e).imageHash()}catch{}}async nonce(e,r=0){try{return await this.module(e).readNonce(r)}catch(n){if(!await this.isDeployed(e))return 0;throw n}}async isValidSignature(e,r,n){return MN(this.provider,e,r,n)}}var dte=Object.freeze({__proto__:null,OnChainReader:fte});function hte(t){return t&&t.address&&t.digest&&t.chainId!==void 0&&t.config}var we=Object.freeze({__proto__:null,config:_ee,signature:Pee,context:Jee,signer:Mee,EIP1271:Oee,transaction:cte,reader:dte,EIP6492:ute,isWalletSignRequestMetadata:hte});const x6=[{config:aC,signature:oC},{config:bb,signature:gb}];function NN(t){const e=t-1;if(e<0||e>=x6.length)throw new Error(`No coder for version: ${t}`);return x6[e]}function pte(t){return NN(t)}var sn=Object.freeze({__proto__:null,ALL_CODERS:x6,coderFor:NN,genericCoderFor:pte});const DN=[Vo,Ze],mte=Object.freeze(Object.defineProperty({__proto__:null,allVersions:DN,commons:we,universal:sn,v1:Vo,v2:Ze},Symbol.toStringTag,{value:"Module"}));function vte(t,e,r){for(let n=0;ne.version)&&(e=r);if(e===void 0)throw new Error("No migrations");return e}async getAllMigratePresignedTransaction(e){const{address:r,fromImageHash:n,fromVersion:i,chainId:s}=e;let o=n,a=i;const c=Object.values(this.contexts),l=[];for(let u=1;ufe(s).length===0))return fk;if(!n.provider)throw new Error("signer.provider is not set, but is required");return n.provider.estimateGas({from:e,to:i.to,data:i.data,value:i.value})}))).map(i=>({executed:!0,succeeded:!0,gasUsed:te.from(i).toNumber(),gasLimit:te.from(i).toNumber()}))}async getNonce(e,r,n){if(!this.provider)throw new Error("provider is not set");if(await this.provider.getCode(e)==="0x")return 0;r===void 0&&(r=0);const s=await new Fd(e,Jr.mainModule.abi,this.provider).readNonce(r,{blockTag:n});return we.transaction.encodeNonce(r,s)}async wait(e,r,n=this.waitPollRate,i=5){var s=this;typeof e!="string"&&(e=we.transaction.intendedTransactionID(e));let o=!1;const a=async function(u,f){let d=0;for(;!o;){try{return await u()}catch(h){if(d++,i!==void 0&&d>=i)throw Se.error(`giving up after ${d} failed attempts${f?`: ${f}`:""}`,h),h;Se.warn(`attempt #${d} failed${f?`: ${f}`:""}`,h)}n>0&&await new Promise(h=>setTimeout(h,n))}throw new Error(`timed out after ${d} failed attempts${f?`: ${f}`:""}`)},c=async function(){let u=s.fromBlockLog;if(u<0&&(u=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number")+u),typeof e!="string")throw new Error("impossible");const f=e.replace("0x","");for(;!o;){const d=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number"),h=await a(()=>s.provider.getLogs({fromBlock:Math.max(0,u-s.deltaBlocksLog),toBlock:d,topics:["0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881"]}),`unable to get NonceChange logs for blocks ${Math.max(0,u-s.deltaBlocksLog)} to ${d}`);u=d;const m=(await Promise.all(h.map(v=>a(()=>s.provider.getTransactionReceipt(v.transactionHash),`unable to get receipt for transaction ${v.transactionHash}`)))).find(v=>v.logs.find(y=>y.topics.length===0&&y.data.replace("0x","")===f||y.topics.length===1&&y.topics[0]==="0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7"&&y.data.length>=64&&y.data.replace("0x","").startsWith(f)));if(m)return Bc({receipt:m},await a(()=>s.provider.getTransaction(m.transactionHash),`unable to get transaction ${m.transactionHash}`));o||await new Promise(v=>setTimeout(v,n))}throw new Error(`Timeout waiting for transaction receipt ${e}`)};return r!==void 0?Promise.race([c(),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):c()}}function Cte(t){return t.signer!==void 0&&Dc.isSigner(t.signer)}class Ste extends UN{constructor(e){if(super(Dc.isSigner(e)?{provider:e.provider}:Bc({},e,{provider:e.signer.provider})),this.signer=void 0,this.txnOptions=void 0,this.signer=Dc.isSigner(e)?e:e.signer,!this.signer.provider)throw new Error("Signer must have a provider")}async getFeeOptions(e,...r){return{options:[]}}async getFeeOptionsRaw(e,r,n){return{options:[]}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}setTransactionOptions(e){this.txnOptions=e}async relay(e,r,n=!0){r!==void 0&&Se.warn("LocalRelayer doesn't accept fee quotes");const i=we.transaction.encodeBundleExecData(e),s=this.signer.sendTransaction(Bc({to:e.entrypoint,data:i},this.txnOptions,{gasLimit:9e6}));if(n){const o=await s;return o.receipt=await o.wait(),o}else return s}}const kte="v1",Ate="v0.4.1",_te="13cf0e854e8127ae83218cc188ef0e7456241c96";let pc=function(t){return t.UNKNOWN="UNKNOWN",t.DROPPED="DROPPED",t.QUEUED="QUEUED",t.SENT="SENT",t.SUCCEEDED="SUCCEEDED",t.PARTIALLY_FAILED="PARTIALLY_FAILED",t.FAILED="FAILED",t}({}),Pte=function(t){return t.SEND="SEND",t.RECEIVE="RECEIVE",t.BRIDGE_DEPOSIT="BRIDGE_DEPOSIT",t.BRIDGE_WITHDRAW="BRIDGE_WITHDRAW",t.BURN="BURN",t.UNKNOWN="UNKNOWN",t}({}),Ite=function(t){return t.UNKNOWN="UNKNOWN",t.ERC20_TOKEN="ERC20_TOKEN",t.ERC1155_TOKEN="ERC1155_TOKEN",t}({}),Tte=function(t){return t.DESC="DESC",t.ASC="ASC",t}({});class zN{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Relayer/",this.ping=n=>this.fetch(this.url("Ping"),bt({},n)).then(i=>xt(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),bt({},n)).then(i=>xt(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),bt({},n)).then(i=>xt(i).then(s=>({status:s.status}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),bt({},n)).then(i=>xt(i).then(s=>({data:s.data}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),bt({},n)).then(i=>xt(i).then(s=>({chainID:s.chainID}))),this.sendMetaTxn=(n,i)=>this.fetch(this.url("SendMetaTxn"),bt(n,i)).then(s=>xt(s).then(o=>({status:o.status,txnHash:o.txnHash}))),this.getMetaTxnNonce=(n,i)=>this.fetch(this.url("GetMetaTxnNonce"),bt(n,i)).then(s=>xt(s).then(o=>({nonce:o.nonce}))),this.getMetaTxnReceipt=(n,i)=>this.fetch(this.url("GetMetaTxnReceipt"),bt(n,i)).then(s=>xt(s).then(o=>({receipt:o.receipt}))),this.simulate=(n,i)=>this.fetch(this.url("Simulate"),bt(n,i)).then(s=>xt(s).then(o=>({results:o.results}))),this.updateMetaTxnGasLimits=(n,i)=>this.fetch(this.url("UpdateMetaTxnGasLimits"),bt(n,i)).then(s=>xt(s).then(o=>({payload:o.payload}))),this.feeTokens=n=>this.fetch(this.url("FeeTokens"),bt({},n)).then(i=>xt(i).then(s=>({isFeeRequired:s.isFeeRequired,tokens:s.tokens}))),this.feeOptions=(n,i)=>this.fetch(this.url("FeeOptions"),bt(n,i)).then(s=>xt(s).then(o=>({options:o.options,sponsored:o.sponsored,quote:o.quote}))),this.getMetaTxnNetworkFeeOptions=(n,i)=>this.fetch(this.url("GetMetaTxnNetworkFeeOptions"),bt(n,i)).then(s=>xt(s).then(o=>({options:o.options}))),this.getMetaTransactions=(n,i)=>this.fetch(this.url("GetMetaTransactions"),bt(n,i)).then(s=>xt(s).then(o=>({page:o.page,transactions:o.transactions}))),this.sentTransactions=(n,i)=>this.fetch(this.url("SentTransactions"),bt(n,i)).then(s=>xt(s).then(o=>({page:o.page,transactions:o.transactions}))),this.pendingTransactions=(n,i)=>this.fetch(this.url("PendingTransactions"),bt(n,i)).then(s=>xt(s).then(o=>({page:o.page,transactions:o.transactions}))),this.getGasTank=(n,i)=>this.fetch(this.url("GetGasTank"),bt(n,i)).then(s=>xt(s).then(o=>({gasTank:o.gasTank}))),this.addGasTank=(n,i)=>this.fetch(this.url("AddGasTank"),bt(n,i)).then(s=>xt(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.updateGasTank=(n,i)=>this.fetch(this.url("UpdateGasTank"),bt(n,i)).then(s=>xt(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.getGasSponsor=(n,i)=>this.fetch(this.url("GetGasSponsor"),bt(n,i)).then(s=>xt(s).then(o=>({gasSponsor:o.gasSponsor}))),this.listGasSponsors=(n,i)=>this.fetch(this.url("ListGasSponsors"),bt(n,i)).then(s=>xt(s).then(o=>({page:o.page,gasSponsors:o.gasSponsors}))),this.addGasSponsor=(n,i)=>this.fetch(this.url("AddGasSponsor"),bt(n,i)).then(s=>xt(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.updateGasSponsor=(n,i)=>this.fetch(this.url("UpdateGasSponsor"),bt(n,i)).then(s=>xt(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.removeGasSponsor=(n,i)=>this.fetch(this.url("RemoveGasSponsor"),bt(n,i)).then(s=>xt(s).then(o=>({status:o.status}))),this.reportGasSponsorUsage=(n,i)=>this.fetch(this.url("ReportGasSponsorUsage"),bt(n,i)).then(s=>xt(s).then(o=>({gasSponsorUsage:o.gasSponsorUsage}))),this.nextGasTankBalanceAdjustmentNonce=(n,i)=>this.fetch(this.url("NextGasTankBalanceAdjustmentNonce"),bt(n,i)).then(s=>xt(s).then(o=>({nonce:o.nonce}))),this.adjustGasTankBalance=(n,i)=>this.fetch(this.url("AdjustGasTankBalance"),bt(n,i)).then(s=>xt(s).then(o=>({status:o.status,adjustment:o.adjustment}))),this.getGasTankBalanceAdjustment=(n,i)=>this.fetch(this.url("GetGasTankBalanceAdjustment"),bt(n,i)).then(s=>xt(s).then(o=>({adjustment:o.adjustment}))),this.listGasTankBalanceAdjustments=(n,i)=>this.fetch(this.url("ListGasTankBalanceAdjustments"),bt(n,i)).then(s=>xt(s).then(o=>({page:o.page,adjustments:o.adjustments}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const bt=(t={},e={})=>({method:"POST",headers:Bc({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),xt=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});var yd=Object.freeze({__proto__:null,WebRPCVersion:kte,WebRPCSchemaVersion:Ate,WebRPCSchemaHash:_te,ETHTxnStatus:pc,TransferType:Pte,FeeTokenType:Ite,SortOrder:Tte,Relayer:zN});const Ote=[pc.DROPPED,pc.SUCCEEDED,pc.PARTIALLY_FAILED,pc.FAILED],Rte=[pc.DROPPED,pc.PARTIALLY_FAILED,pc.FAILED];function $te(t){return t.url!==void 0&&typeof t.url=="string"&&t.provider!==void 0&&Ra.isProvider(t.provider)}const Mte=typeof Bn=="object"?Bn.fetch:window.fetch;class qN{constructor(e){if(this.options=e,this.service=void 0,this.provider=void 0,this._fetch=(r,n)=>{const i={},{jwtAuth:s,projectAccessKey:o}=this.options;return s&&s.length>0&&(i.Authorization=`BEARER ${s}`),o&&o.length>0&&(i["X-Access-Key"]=o),n.headers=Bc({},n.headers,i),Mte(r,n)},this.service=new zN(e.url,this._fetch),Ra.isProvider(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=o1(e.provider.url,n,r);this.provider=new by(i)}}async waitReceipt(e,r=1e3,n=5,i){typeof e!="string"&&(e=we.transaction.intendedTransactionID(e)),Se.info(`[rpc-relayer/waitReceipt] waiting for ${e}`);let s=0;for(;i===void 0||!i();){try{const{receipt:o}=await this.service.getMetaTxnReceipt({metaTxID:e});if(o&&o.txnReceipt&&o.txnReceipt!=="null"&&Ote.includes(o.status))return{receipt:o}}catch(o){if(s++,s===n)throw o}(i===void 0||!i())&&await new Promise(o=>setTimeout(o,r))}throw new Error(`Cancelled waiting for transaction receipt ${e}`)}async simulate(e,...r){const i=_n.encode([we.transaction.MetaTransactionsType],[we.transaction.sequenceTxAbiEncode(r)]);return(await this.service.simulate({wallet:e,transactions:i})).results}async getFeeOptions(e,...r){const n=await this.service.feeTokens();if(n.isFeeRequired){const i=n.tokens.map(c=>c.symbol).join(", ");Se.info(`[rpc-relayer/getFeeOptions] relayer fees are required, accepted tokens are ${i}`);const s=await this.getNonce(e);if(!this.provider)throw Se.warn("[rpc-relayer/getFeeOptions] provider not set, needed for stub signature"),new Error("provider is not set");const{options:o,quote:a}=await this.service.feeOptions({wallet:e,to:e,data:we.transaction.encodeBundleExecData({entrypoint:e,transactions:r,nonce:s})});return Se.info(`[rpc-relayer/getFeeOptions] got refund options ${JSON.stringify(o)}`),{options:o,quote:{_tag:"FeeQuote",_quote:a}}}else return Se.info("[rpc-relayer/getFeeOptions] relayer fees are not required"),{options:[]}}async getFeeOptionsRaw(e,r,n){const{options:i,quote:s}=await this.service.feeOptions({wallet:e,to:e,data:le(r),simulate:n==null?void 0:n.simulate});return{options:i,quote:{_tag:"FeeQuote",_quote:s}}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}async getNonce(e,r){Se.info(`[rpc-relayer/getNonce] get nonce for wallet ${e} space: ${r}`);const n=r!==void 0?te.from(r).toHexString():void 0,i=await this.service.getMetaTxnNonce({walletContractAddress:e,space:n}),s=te.from(i.nonce),[o,a]=we.transaction.decodeNonce(s);return Se.info(`[rpc-relayer/getNonce] got next nonce for wallet ${e} ${a} space: ${o}`),s}async relay(e,r,n=!0){var i=this;Se.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(e)} with quote ${JSON.stringify(r)}`);let s;if(r!==void 0&&(typeof r._quote=="string"?s=r._quote:Se.warn("[rpc-relayer/relay] ignoring invalid fee quote")),!this.provider)throw Se.warn("[rpc-relayer/relay] provider not set, failed relay"),new Error("provider is not set");const o=we.transaction.encodeBundleExecData(e),a=await this.service.sendMetaTxn({call:{walletAddress:e.intent.wallet,contract:e.entrypoint,input:o},quote:s});if(Se.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(a)}`),n)return this.wait(e.intent.id);{const c={hash:e.intent.id,confirmations:0,from:e.intent.wallet,wait:u=>Promise.reject(new Error("impossible"))},l=async function(f){var d;if(!i.provider)throw new Error("cannot wait for receipt, relayer has no provider set");const h=await i.wait(e.intent.id),p=(d=h.receipt)==null?void 0:d.transactionHash;if(!p)throw new Error("cannot wait for receipt, unknown native transaction hash");return Object.assign(c,h),i.provider.waitForTransaction(p,f)};return c.wait=l,c}}async wait(e,r,n=1e3,i=5){var s=this;let o=!1;const{receipt:a}=await(r!==void 0?Promise.race([this.waitReceipt(e,n,i,()=>o),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):this.waitReceipt(e,n,i));if(!a.txnReceipt||Rte.includes(a.status))throw new Nte(a);const c=JSON.parse(a.txnReceipt);return{blockHash:c.blockHash,blockNumber:te.from(c.blockNumber).toNumber(),confirmations:1,from:typeof e=="string"?void 0:e.intent.wallet,hash:c.transactionHash,raw:a.txnReceipt,receipt:c,wait:async function(l){return s.provider.waitForTransaction(c.transactionHash,l)}}}}class Nte{constructor(e){this.receipt=e}}function WN(t){return typeof t=="object"&&typeof t.simulate=="function"&&typeof t.getFeeOptions=="function"&&typeof t.gasRefundOptions=="function"&&typeof t.getNonce=="function"&&typeof t.relay=="function"&&typeof t.wait=="function"}const Dte=Object.freeze(Object.defineProperty({__proto__:null,LocalRelayer:Ste,ProviderRelayer:UN,ProviderRelayerDefaults:FN,RpcRelayer:qN,RpcRelayerProto:yd,isLocalRelayerOptions:Cte,isProviderRelayerOptions:Ete,isRelayer:WN,isRpcRelayerOptions:$te,proto:yd},Symbol.toStringTag,{value:"Module"}));function HN(t){return t.getAddress!==void 0&&t.buildDeployTransaction!==void 0&&t.predecorateSignedTransactions!==void 0&&t.decorateTransactions!==void 0&&t.sign!==void 0&&t.notifyStatusChange!==void 0}class VN{constructor(e,r=!0){this.signer=e,this.eoa=r}getAddress(){return this.signer.getAddress()}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}sign(e,r){return this.signer.signMessage(e)}notifyStatusChange(e,r,n){}suffix(){return[2]}}var k6=Object.freeze({__proto__:null,isSapientSigner:HN,SignerWrapper:VN});let mc=function(t){return t[t.INITIAL=0]="INITIAL",t[t.SIGNING=1]="SIGNING",t[t.SIGNED=2]="SIGNED",t[t.ERROR=3]="ERROR",t}({});function GN(t){return t===void 0||t.state===mc.INITIAL||t.state===mc.SIGNING}class Eb{constructor(e,r=Eb.randomTag()){this.tag=r,this.observers=[],this.signers=[],this.count=0,this.setSigners(e)}static randomTag(){return`default-${le(Ts(8)).slice(2)}`}pullId(){return`${this.tag}-${this.count++}`}setSigners(e){this.signers=e.map(r=>HN(r)?r:new VN(r))}async getSigners(){return Promise.all(this.signers.map(async function(e){return e.getAddress()}))}subscribe(e){return this.observers.push(e),()=>{this.observers=this.observers.filter(r=>r!==e)}}async notifyObservers(e,r,n){await Promise.all([...this.signers.map(async function(i){return i.notifyStatusChange(e,r,n)}),...this.observers.map(async function(i){return i(r,n)})])}async buildDeployTransaction(e){let r;for(const n of this.signers){const i=await n.buildDeployTransaction(e);r===void 0?r=i:i!=null&&i.transactions&&(r.transactions=i.transactions.concat(r.transactions))}return r}async predecorateSignedTransactions(e){const r=[];for(const n of this.signers)r.push(...await n.predecorateSignedTransactions(e??{}));return r}async decorateTransactions(e,r){for(const n of this.signers)e=await n.decorateTransactions(e,r??{});return e}signMessage(e){var r=this;const n=this.pullId();return new Promise(async function(i){const{message:s,metadata:o,callback:a,candidates:c}=e,l={ended:!1,message:s,signers:{}};let u=o??{};const f=m=>{u=m,r.notifyObservers(n,l,u)},d=()=>{try{r.notifyObservers(n,l,u);const m=Object.entries(l.signers).filter(([v,y])=>GN(y));if(a&&a(l,f)||m.length===0){l.ended=!0,i(l),r.notifyObservers(n,l,u);return}}catch(m){console.error("Error while notifying observers",m)}};let h=r.signers;if(c){const m=await Promise.all(r.signers.map(async function(v){return v.getAddress()}));h=r.signers.filter((v,y)=>c.includes(m[y]))}const p=await Promise.allSettled(h.map(async function(m){const v=await m.getAddress();l.signers[v]={state:mc.SIGNING,request:m.sign(s,o??{}).then(y=>{const b=m.suffix();return l.signers[v]={state:mc.SIGNED,signature:y,suffix:b},d(),y}).catch(y=>{throw l.signers[v]={state:mc.ERROR,error:y},d(),y})}}));for(let m=0;mAt(e))):At(t)}const hk=t=>{const e=new Map;for(const r of Object.keys(t.signers)){const n=t.signers[r];if(n.state===mc.SIGNED){const i=fe(n.suffix),s=Qe(["bytes","bytes"],[n.signature,i]);e.set(r,{signature:s,isDynamic:i.length!==1||i[0]!==2})}}return e};class c1 extends Dc{constructor(e){if(or.eq(e.chainId)&&!e.coders.signature.supportsNoChainId)throw new Error(`Sequence version ${e.config.version} doesn't support chainId 0`);super(),this.context=void 0,this.config=void 0,this.address=void 0,this.chainId=void 0,this.provider=void 0,this.relayer=void 0,this.coders=void 0,this.orchestrator=void 0,this._reader=void 0,this.context=e.context,this.config=e.config,this.orchestrator=e.orchestrator,this.coders=e.coders,this.address=e.address,this.chainId=e.chainId,this.provider=e.provider,this.relayer=e.relayer,this._reader=e.reader}static newWallet(e){const r=we.context.addressOf(e.context,e.coders.config.imageHashOf(e.config));return new c1(ic({},e,{address:r}))}reader(){if(this._reader)return this._reader;if(!this.provider)throw new Error("Wallet status provider requires a provider");return new we.reader.OnChainReader(this.provider)}setConfig(e){this.config=e}setOrchestrator(e){this.orchestrator=e}setAddress(e){this.address=e}getSigners(){return this.orchestrator.getSigners()}async getAddress(){return this.address}async decorateTransactions(e){const r=await this.orchestrator.decorateTransactions(e);if(await this.reader().isDeployed(this.address))return r;const n=[{to:r.entrypoint,data:we.transaction.encodeBundleExecData(r),revertOnError:!0}],i=await this.buildDeployTransaction();return i&&n.unshift(...i.transactions),{entrypoint:this.context.guestModule,chainId:this.chainId,intent:r.intent,transactions:n}}async buildDeployTransaction(e){if(e!=null&&e.ignoreDeployed&&await this.reader().isDeployed(this.address))return;const r=this.coders.config.imageHashOf(this.config);if(we.context.addressOf(this.context,r)!==this.address)throw new Error(`First address of config ${r} doesn't match wallet address ${this.address}`);const n=c1.buildDeployTransaction(this.context,r);if(e!=null&&e.includeChildren){const i=await this.orchestrator.buildDeployTransaction(e);i&&(n.transactions=i.transactions.concat(n.transactions))}return n}async deploy(e){const r=await this.buildDeployTransaction(e);if(r!==void 0){if(!this.relayer)throw new Error("Wallet deploy requires a relayer");return this.relayer.relay(ic({},r,{chainId:this.chainId,intent:{id:le(Ts(32)),wallet:this.address}}))}}static buildDeployTransaction(e,r){const n=new wr(Jr.factory.abi);return{entrypoint:e.guestModule,transactions:[{to:e.factory,data:n.encodeFunctionData(n.getFunction("deploy"),[e.mainModule,r]),gasLimit:1e5,delegateCall:!1,revertOnError:!0,value:0}]}}async buildUpdateConfigurationTransaction(e){if(this.coders.config.update.isKindUsed){const r=await this.reader().implementation(this.address),n=r&&r===this.context.mainModuleUpgradable;return this.coders.config.update.buildTransaction(this.address,e,this.context,n?"later":"first")}return this.coders.config.update.buildTransaction(this.address,e,this.context)}async getNonce(e=0){const r=await this.reader().nonce(this.address,e);if(r===void 0)throw new Error("Unable to determine nonce");return r}async signDigest(e,r){const n=h6(this.address,this.chainId,e);if(this.coders.config.hasSubdigest(this.config,n))return this.coders.signature.encodeSigners(this.config,new Map,[n],this.chainId).encoded;const i=ic({},r,{digest:e,chainId:this.chainId,address:this.address,config:this.config}),s=fe(n),o=await this.orchestrator.signMessage({candidates:this.coders.config.signersOf(this.config).map(c=>c.address),message:s,metadata:i,callback:(c,l)=>{const u=hk(c),f=ic({},i,{parts:u});return l(f),this.coders.signature.hasEnoughSigningPower(this.config,u)}}),a=hk(o);return this.coders.signature.encodeSigners(this.config,a,[],this.chainId).encoded}signMessage(e){return this.signDigest(Oe(e),{message:e})}signTransactionBundle(e){if(e.entrypoint!==this.address)throw new Error(`Invalid entrypoint: ${e.entrypoint} !== ${this.address}`);return this.signTransactions(e.transactions,e.nonce)}async fetchNonceOrSpace(e){let r;if(e&&e.space!==void 0)r=te.from(e.space);else{if(e===void 0)return this.randomNonce();if(e&&e.serial===!0)r=0;else return e}const n=await this.reader().nonce(this.address,r);if(n===void 0)throw new Error("Unable to determine nonce");return we.transaction.encodeNonce(r,n)}randomNonce(){const e=te.from(le(Ts(12)));return we.transaction.encodeNonce(e,0)}async signTransactions(e,r,n){const i=await dk(e),s=we.transaction.fromTransactionish(this.address,i);s.length===0&&s.push({to:this.address,data:"0x",value:0,gasLimit:0,delegateCall:!1,revertOnError:!0});const o=await this.fetchNonceOrSpace(r),a=we.transaction.digestOfTransactions(o,s),c=ic({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:h6(this.address,this.chainId,a),wallet:this.address},chainId:this.chainId,transactions:s,entrypoint:this.address,nonce:o,signature:l}}async sendSignedTransaction(e,r){if(!this.relayer)throw new Error("Wallet sendTransaction requires a relayer");return this.relayer.relay(e,r)}async sendTransaction(e,r){let n;(r==null?void 0:r.nonce)!==void 0?n=r.nonce:r!=null&&r.serial?n={serial:!0}:n=this.randomNonce();const i=await this.signTransactions(e,n),s=await this.decorateTransactions(i);return this.sendSignedTransaction(s,r==null?void 0:r.quote)}async fillGasLimits(e){const r=await dk(e),n=we.transaction.fromTransactionish(this.address,r),i=this.relayer;if(!i)throw new Error("Wallet fillGasLimits requires a relayer");const s=await i.simulate(this.address,...n);return n.map((o,a)=>{const c=o.gasLimit?te.from(o.gasLimit).toNumber():s[a].gasLimit;return ic({},o,s[a],{gasLimit:c})})}connect(e,r){return this.provider=e,this.relayer=r,this}signTransaction(e){throw new Error("Method not implemented.")}}function Fo(){return Fo=Object.assign?Object.assign.bind():function(t){for(var e=1;ejte(t[e])):!1}function Fte(t){if(!t)return[];const e=te.from(t.value);switch(t.token.type){case yd.FeeTokenType.UNKNOWN:return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.to,value:e.toHexString(),data:[]}];case yd.FeeTokenType.ERC20_TOKEN:if(!t.token.contractAddress)throw new Error("No contract address for ERC-20 fee option");return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.token.contractAddress,value:0,data:new wr([{constant:!1,inputs:[{type:"address"},{type:"uint256"}],name:"transfer",outputs:[],type:"function"}]).encodeFunctionData("transfer",[t.to,e.toHexString()])}];default:throw new Error(`Unhandled fee token type ${t.token.type}`)}}class Ute{constructor(e,r,n){this.account=e,this.chainId=r,this.options=n,this._isSigner=!0}get provider(){return this.account.providerFor(this.chainId)}async getAddress(){return this.account.address}signMessage(e){var r,n;return this.account.signMessage(e,this.chainId,(r=(n=this.options)==null?void 0:n.cantValidateBehavior)!=null?r:"throw")}async defaultSelectFee(e,r){if(r.length===0)return;const n=[{constant:!0,inputs:[{type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],type:"function"}];for(const i of r)if(i.token.type===yd.FeeTokenType.UNKNOWN){if((await this.getBalance()).gte(te.from(i.value)))return i}else if(i.token.contractAddress&&i.token.type===yd.FeeTokenType.ERC20_TOKEN&&(await new Fd(i.token.contractAddress,n,this.provider).balanceOf(this.account.address)).gte(te.from(i.value)))return i;throw new Error("No fee option available - not enough balance")}async sendTransaction(e,r){var n,i,s,o,a;const c=Bte(e)?await At(e):e,l=await this.account.prepareTransactions({txs:c,chainId:this.chainId,stubSignatureOverrides:(n=(i=this.options)==null?void 0:i.stubSignatureOverrides)!=null?n:new Map,simulateForFeeOptions:r==null?void 0:r.simulateForFeeOptions}),f=await((s=(o=this.options)==null?void 0:o.selectFee)!=null?s:this.defaultSelectFee.bind(this))(c,l.feeOptions),d=[...l.transactions,...Fte(f)];return this.account.sendTransaction(d,this.chainId,l.feeQuote,void 0,void 0,((a=this.options)==null?void 0:a.nonceSpace)!==void 0?{nonceSpace:this.options.nonceSpace}:void 0)}getBalance(e){return this.provider.getBalance(this.account.address,e)}call(e,r){return this.provider.call(e,r)}async resolveName(e){const r=await this.provider.resolveName(e);if(!r)throw new Error(`Could not resolve name ${e}`);return r}connect(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}getTransactionCount(e){throw new Error("Method not implemented.")}estimateGas(e){throw new Error("Method not implemented.")}getChainId(){return Promise.resolve(te.from(this.chainId).toNumber())}getGasPrice(){throw new Error("Method not implemented.")}getFeeData(){throw new Error("Method not implemented.")}checkTransaction(e){throw new Error("Method not implemented.")}populateTransaction(e){throw new Error("Method not implemented.")}_checkProvider(e){throw new Error("Method not implemented.")}}class zte{async isDeployed(e){return!1}async implementation(e){}async imageHash(e){}async nonce(e,r){return or}async isValidSignature(e,r,n){throw new Error("Method not supported.")}}class Xo{constructor(e){this.address=void 0,this.networks=void 0,this.tracker=void 0,this.contexts=void 0,this.migrator=void 0,this.migrations=void 0,this.orchestrator=void 0,this.jwt=void 0,this.projectAccessKey=void 0,this.address=Be(e.address),this.contexts=e.contexts,this.tracker=e.tracker,this.networks=e.networks,this.orchestrator=e.orchestrator,this.jwt=e.jwt,this.projectAccessKey=e.projectAccessKey,this.migrations=e.migrations||S6.DefaultMigrations,this.migrator=new C6.Migrator(e.tracker,this.migrations,this.contexts)}getSigner(e,r){return new Ute(this,e,r)}static async new(e){var r;const i=new C6.Migrator(e.tracker,(r=e.migrations)!=null?r:S6.DefaultMigrations,e.contexts).lastMigration(),s=i.configCoder,o=s.fromSimple(e.config),a=s.imageHashOf(o),c=e.contexts[i.version],l=we.context.addressOf(c,a);return await e.tracker.saveCounterfactualWallet({config:o,context:Object.values(e.contexts)}),new Xo({address:l,tracker:e.tracker,contexts:e.contexts,networks:e.networks,orchestrator:e.orchestrator,migrations:e.migrations,projectAccessKey:e.projectAccessKey})}getAddress(){return Promise.resolve(this.address)}get version(){return this.migrator.lastMigration().version}get coders(){const e=this.migrator.lastMigration();return{signature:e.signatureCoder,config:e.configCoder}}network(e){const r=te.from(e),n=this.networks.find(i=>r.eq(i.chainId));if(!n)throw new Error(`Network not found for chainId ${e}`);return n}providerFor(e){const r=this.network(e);if(!r.provider&&!r.rpcUrl)throw new Error(`Provider not found for chainId ${e}`);return r.provider||new by(o1(r.rpcUrl,this.projectAccessKey,this.jwt),{name:"",chainId:te.from(e).toNumber()})}reader(e){return or.eq(e)?new zte:new we.reader.OnChainReader(this.providerFor(e))}relayer(e){const r=this.network(e);if(!r.relayer)throw new Error(`Relayer not found for chainId ${e}`);return WN(r.relayer)?r.relayer:new qN(Fo({},r.relayer,this.projectAccessKey?{projectAccessKey:this.projectAccessKey}:{jwtAuth:this.jwt}))}setOrchestrator(e){this.orchestrator=e}setJwt(e){this.jwt=e}contextFor(e){const r=this.contexts[e];if(!r)throw new Error(`Context not found for version ${e}`);return r}walletForStatus(e,r){const n=sn.coderFor(r.version);return this.walletFor(e,this.contextFor(r.version),r.config,n)}walletFor(e,r,n,i){const s=or.eq(e);return new c1({config:n,context:r,chainId:e,coders:i,relayer:s?void 0:this.relayer(e),address:this.address,orchestrator:this.orchestrator,reader:this.reader(e)})}async status(e,r=!1){var n=this;const i=this.reader(e).isDeployed(this.address),s=this.tracker.imageHashOfCounterfactualWallet({wallet:this.address}).then(P=>{if(!P)throw new Error(`Counterfactual imageHash not found for wallet ${this.address}`);return P}),o=s.then(P=>LN.counterfactualVersion(this.address,P.imageHash,Object.values(this.contexts))),a=async function(){if(!await i)return o;const M=await n.reader(e).implementation(n.address);if(!M)throw new Error(`Implementation not found for wallet ${n.address}`);const L=Object.values(n.contexts);for(let j=0;j0?m[m.length-1].nextImageHash:d,y=await this.tracker.configOfImageHash({imageHash:v});if(!y)throw new Error(`Config not found for imageHash ${v}`);const b=await i,E=await s,S=sn.coderFor(h).config.checkpointOf(y);return{original:Fo({},E,{version:await o}),onChain:{imageHash:f,config:await l,version:u,deployed:b},fullyMigrated:h===this.version,signedMigrations:p,version:h,presignedConfigurations:m,imageHash:v,config:y,checkpoint:S,canOnchainValidate:u===this.version&&b}}mustBeFullyMigrated(e){if(!e.fullyMigrated)throw new Error(`Wallet ${this.address} is not fully migrated`)}async predecorateSignedTransactions(e,r){const n=await this.orchestrator.predecorateSignedTransactions({chainId:r}),i=await this.predecorateTransactions([],e,r);return we.transaction.fromTransactionish(this.address,i).length>0&&n.push(await this.signTransactions(i,r)),n}async predecorateTransactions(e,r,n){if(r.onChain.imageHash!==r.imageHash){const s=await this.walletForStatus(n,r).buildUpdateConfigurationTransaction(r.config);return[Array.isArray(e)?e:[e],s.transactions].flat()}return e}async decorateTransactions(e,r,n){var i,s;if(!Array.isArray(e))return this.decorateTransactions([e],r,n);n=(i=n)!=null?i:e[0].chainId;const o=await this.buildBootstrapTransactions(r,n),a=o.transactions.length>0;if(!a&&e.length===1)return e[0];const{entrypoint:c}=a?o:e[0],l={entrypoint:c,chainId:n,intent:(s=e[0])==null?void 0:s.intent,transactions:[...o.transactions,...e.map(u=>({to:u.entrypoint,data:we.transaction.encodeBundleExecData(u),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}))]};if(!r.onChain.deployed){const u=we.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,n,l.transactions);l.intent===void 0?l.intent={id:u,wallet:this.address}:l.intent.id=u}return l}async decorateSignature(e,r){if(!r.presignedConfigurations||r.presignedConfigurations.length===0)return e;const n=this.coders.signature,i=r.presignedConfigurations.map(o=>o.signature),s=n.chainSignatures(e,i);return n.trim(s)}async publishWitness(){const e=Oe(St(`This is a Sequence account woo! ${Date.now()}`)),r=await this.signDigest(e,0,!1),n=this.coders.signature.decode(r),i=this.coders.signature.signaturesOfDecoded(n);return this.tracker.saveWitnesses({wallet:this.address,digest:e,chainId:0,signatures:i})}async signDigest(e,r,n=!0,i="ignore",s){const o=or.eq(r)?this.networks[0].chainId:r,a=await this.status(o);if(this.mustBeFullyMigrated(a),!a.canOnchainValidate&&i==="throw")throw new Error("Wallet cannot validate onchain");const l=await this.walletForStatus(r,a).signDigest(e,s),u=n?this.decorateSignature(l,a):l;if(!a.canOnchainValidate)switch(i){case"ignore":return u;case"eip6492":return this.buildEIP6492Signature(await u,a,r)}return u}buildOnChainSignature(e){const r=we.signature.subdigestOf({digest:le(e),chainId:0,address:this.address}),n=le(r),i=this.coders.config.fromSimple({threshold:32768,checkpoint:0,signers:[],subdigests:[n]}),s=new wr(Jr.mainModule.abi),o={entrypoint:this.address,transactions:[{to:this.address,data:s.encodeFunctionData("setExtraImageHash",[this.coders.config.imageHashOf(i),"57896044618658097711785492504343953926634992332820282019728792003956564819968"]),gasLimit:25e4}]};this.tracker.saveWalletConfig({config:i});const a=this.coders.signature.encodeSigners(i,new Map,[n],0).encoded;return{bundle:o,signature:a}}async buildEIP6492Signature(e,r,n){const i=await this.buildBootstrapTransactions(r,n);if(i.transactions.length===0)throw new Error("Cannot build EIP-6492 signature without bootstrap transactions");const s=_n.encode(["address","bytes","bytes"],[i.entrypoint,we.transaction.encodeBundleExecData(i),e]);return Qe(["bytes","bytes32"],[s,we.EIP6492.EIP_6492_SUFFIX])}async editConfig(e){const r=await this.status(0).then(i=>i.config),n=this.coders.config.editConfig(r,Fo({},e,{checkpoint:this.coders.config.checkpointOf(r).add(1)}));return this.updateConfig(n)}async updateConfig(e){if(!this.coders.config.isWalletConfig(e))throw new Error(`Invalid config for wallet ${this.address}`);const r=this.coders.config.imageHashOf(e),n=this.coders.signature.hashSetImageHash(r),i=await this.signDigest(n,0,!1);await this.tracker.savePresignedConfiguration({wallet:this.address,nextConfig:e,signature:i});const s=await this.tracker.configOfImageHash({imageHash:r,noCache:!0});if(!s||this.coders.config.imageHashOf(s)!==r)throw Error(`Reverse lookup failed for imageHash ${r}`)}async buildBootstrapTransactions(e,r){var n;const i=await this.orchestrator.buildDeployTransaction({chainId:r}),s=(n=i==null?void 0:i.transactions)!=null?n:[];if(!e.onChain.deployed){const c=c1.buildDeployTransaction(e.original.context,e.original.imageHash);s.push(...c.transactions)}s.length,s.push(...e.signedMigrations.map(c=>({to:c.tx.entrypoint,data:we.transaction.encodeBundleExecData(c.tx),value:0,gasLimit:0,revertOnError:!0,delegateCall:!1})));const o=e.signedMigrations.length>0?e.signedMigrations[0].tx.intent.id:we.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,r,s),{guestModule:a}=this.contextFor(e.version);return{entrypoint:a,transactions:s,chainId:r,intent:{id:o,wallet:this.address}}}async bootstrapTransactions(e,r){const n=r||await this.status(e);return this.buildBootstrapTransactions(n,e)}async doBootstrap(e,r,n){const i=await this.bootstrapTransactions(e,n);return this.relayer(e).relay(Fo({},i,{chainId:e}),r)}signMessage(e,r,n="ignore"){return this.signDigest(Oe(e),r,!0,n)}async signTransactions(e,r,n,i){const s=n||await this.status(r);this.mustBeFullyMigrated(s);const o=this.walletForStatus(r,s),a={address:this.address,digest:"",chainId:r,config:{version:this.version},decorate:!0,cantValidateBehavior:"ignore"},c=i!=null&&i.serial?{serial:!0}:(i==null?void 0:i.nonceSpace)!==void 0?{space:i.nonceSpace}:void 0,l=await o.signTransactions(e,c,a);return Fo({},l,{signature:await this.decorateSignature(l.signature,s)})}async signMigrations(e,r){const n=await this.status(e);if(n.fullyMigrated)return!1;const i=this.walletForStatus(e,n),s=r(i.config),o=await this.migrator.signNextMigration(this.address,n.version,i,s);if(!o)return!1;await this.tracker.saveWalletConfig({config:s});const a=sn.coderFor(s.version).config,c=a.imageHashOf(s),l=await this.tracker.configOfImageHash({imageHash:c,noCache:!0});if(!l||a.imageHashOf(l)!==c)throw Error(`Reverse lookup failed for imageHash ${c}`);return await this.tracker.saveMigration(this.address,o,this.contexts),!0}async signAllMigrations(e){var r=this;const n=[];return{signedMigrations:(await Promise.all(this.networks.map(async function(o){try{return await r.signMigrations(o.chainId,e)}catch(a){return console.warn(`Failed to sign migrations for chain ${o.chainId}`,a),n.push(o.chainId),null}}))).filter(o=>o!==null),failedChains:n}}async isMigratedAllChains(){var e=this;const r=[];return{migratedAllChains:(await Promise.all(this.networks.map(async function(s){try{return await e.status(s.chainId)}catch(o){return r.push(s.chainId),console.warn(`Failed to get status for chain ${s.chainId}`,o),{fullyMigrated:!0}}}))).every(s=>s.fullyMigrated),failedChains:r}}async sendSignedTransactions(e,r,n,i,s){if(!Array.isArray(e))return this.sendSignedTransactions([e],r,n,i,s);const o=i||await this.status(r);this.mustBeFullyMigrated(o);const a=await this.decorateTransactions(e,o,r);return s==null||s(a),this.relayer(r).relay(a,n)}async fillGasLimits(e,r,n){return this.walletForStatus(r,n||await this.status(r)).fillGasLimits(e)}async gasRefundQuotes(e,r,n,i,s){const o=i||await this.status(r),a=this.walletForStatus(r,o),c=await this.predecorateTransactions(e,o,r),l=we.transaction.fromTransactionish(this.address,c),u=a.coders.config.buildStubSignature(a.config,n),f=le(Ts(32)),d={chainId:r,intent:{id:f,wallet:this.address},signature:u,transactions:l,entrypoint:this.address,nonce:0},h=await this.decorateTransactions(d,o),p=we.transaction.encodeBundleExecData(h),m=await this.relayer(r).getFeeOptionsRaw(h.entrypoint,p,s);return Fo({},m,{decorated:h})}async prepareTransactions(e){const r=await this.status(e.chainId),n=await this.fillGasLimits(e.txs,e.chainId,r),i=await this.gasRefundQuotes(n,e.chainId,e.stubSignatureOverrides,r,{simulate:e.simulateForFeeOptions}),s=we.transaction.unwind(this.address,i.decorated.transactions);return{transactions:n,flatDecorated:s,feeOptions:i.options,feeQuote:i.quote}}async sendTransaction(e,r,n,i=!1,s,o){const a=await this.status(r),c=i?e:await this.predecorateTransactions(e,a,r),u=we.transaction.fromTransactionish(this.address,c).length>0?await this.signTransactions(c,r,void 0,o):void 0,f=await this.orchestrator.predecorateSignedTransactions({chainId:r}),d=[];return u!==void 0&&u.transactions.length>0&&d.push(u),d.push(...f.filter(h=>h.transactions.length>0)),this.sendSignedTransactions(d,r,n,void 0,s)}async signTypedData(e,r,n,i,s="ignore"){const o=sp({domain:e,types:r,message:n});return this.signDigest(o,i,!0,s)}async getSigners(){var e=this;const r=n=>n.length?n[n.length-1]:void 0;return(await Promise.all(this.networks.map(async function({chainId:n,name:i}){try{var s;const o=await e.status(n);let a=(s=r(o.presignedConfigurations))==null?void 0:s.nextImageHash;if(!a&&o.onChain.version!==o.version){const f=r(o.signedMigrations);if(f){const{toVersion:d,toConfig:h}=f;a=sn.genericCoderFor(d).config.imageHashOf(h)}}a||(a=o.onChain.imageHash);const c=await e.tracker.configOfImageHash({imageHash:a});if(!c)throw new Error(`unable to find config for image hash ${a}`);return sn.genericCoderFor(c.version).config.signersOf(c).map(f=>Fo({},f,{network:n}))}catch(o){return console.warn(`unable to get signers on network ${n} ${i}`,o),[]}}))).flat()}async getAllSigners(){var e=this;const r=[];return await Promise.all(this.networks.map(async function(n){const i=n.chainId,s=await e.status(i,!0),o=[s.onChain.imageHash,...s.onChain.version!==s.version?s.signedMigrations.map(a=>sn.coderFor(a.toVersion).config.imageHashOf(a.toConfig)):[],...s.presignedConfigurations.map(a=>a.nextImageHash)];return Promise.all(o.map(async function(a,c){const l=c===o.length-1,u=await e.tracker.configOfImageHash({imageHash:a});if(!u){console.warn(`AllSigners may be incomplete, config not found for imageHash ${a}`);return}sn.genericCoderFor(u.version).config.signersOf(u).forEach(h=>{const p=r.find(m=>m.address===h.address&&m.network===i);if(p&&l&&p.flaggedForRemoval){p.flaggedForRemoval=!1;return}p||r.push({address:h.address,weight:h.weight,network:i,flaggedForRemoval:!l})})}))})),r}}function qte(t){return t instanceof Xo}const Wte=Object.freeze(Object.defineProperty({__proto__:null,Account:Xo,isAccount:qte},Symbol.toStringTag,{value:"Module"}));function Py(){return Py=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Or({},n)).then(i=>Rr(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Or({},n)).then(i=>Rr(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Or({},n)).then(i=>Rr(i).then(s=>({status:s.status}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),Or({},n)).then(i=>Rr(i).then(s=>({chainID:s.chainID}))),this.getEtherBalance=(n,i)=>this.fetch(this.url("GetEtherBalance"),Or(n,i)).then(s=>Rr(s).then(o=>({balance:o.balance}))),this.getTokenBalances=(n,i)=>this.fetch(this.url("GetTokenBalances"),Or(n,i)).then(s=>Rr(s).then(o=>({page:o.page,balances:o.balances}))),this.getTokenSupplies=(n,i)=>this.fetch(this.url("GetTokenSupplies"),Or(n,i)).then(s=>Rr(s).then(o=>({page:o.page,contractType:o.contractType,tokenIDs:o.tokenIDs}))),this.getTokenSuppliesMap=(n,i)=>this.fetch(this.url("GetTokenSuppliesMap"),Or(n,i)).then(s=>Rr(s).then(o=>({supplies:o.supplies}))),this.getBalanceUpdates=(n,i)=>this.fetch(this.url("GetBalanceUpdates"),Or(n,i)).then(s=>Rr(s).then(o=>({page:o.page,balances:o.balances}))),this.getTransactionHistory=(n,i)=>this.fetch(this.url("GetTransactionHistory"),Or(n,i)).then(s=>Rr(s).then(o=>({page:o.page,transactions:o.transactions}))),this.syncBalance=(n,i)=>this.fetch(this.url("SyncBalance"),Or(n,i)).then(s=>Rr(s).then(o=>({}))),this.fetchTransactionReceipt=(n,i)=>this.fetch(this.url("FetchTransactionReceipt"),Or(n,i)).then(s=>Rr(s).then(o=>({receipt:o.receipt}))),this.getOrderbookOrders=(n,i)=>this.fetch(this.url("GetOrderbookOrders"),Or(n,i)).then(s=>Rr(s).then(o=>({page:o.page,orders:o.orders}))),this.getTopOrders=(n,i)=>this.fetch(this.url("GetTopOrders"),Or(n,i)).then(s=>Rr(s).then(o=>({orders:o.orders}))),this.fetchTransactionReceiptWithFilter=(n,i)=>this.fetch(this.url("FetchTransactionReceiptWithFilter"),Or(n,i)).then(s=>Rr(s).then(o=>({receipt:o.receipt}))),this.getAllWebhookListeners=(n,i)=>this.fetch(this.url("GetAllWebhookListeners"),Or(n,i)).then(s=>Rr(s).then(o=>({listeners:o.listeners}))),this.getWebhookListener=(n,i)=>this.fetch(this.url("GetWebhookListener"),Or(n,i)).then(s=>Rr(s).then(o=>({listener:o.listener}))),this.addWebhookListener=(n,i)=>this.fetch(this.url("AddWebhookListener"),Or(n,i)).then(s=>Rr(s).then(o=>({status:o.status,listener:o.listener}))),this.updateWebhookListener=(n,i)=>this.fetch(this.url("UpdateWebhookListener"),Or(n,i)).then(s=>Rr(s).then(o=>({status:o.status}))),this.removeWebhookListener=(n,i)=>this.fetch(this.url("RemoveWebhookListener"),Or(n,i)).then(s=>Rr(s).then(o=>({status:o.status}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Or=(t={},e={})=>({method:"POST",headers:Py({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Rr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),pk=typeof Bn=="object"?Bn.fetch:window.fetch;class bC extends KN{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,pk),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=Py({},s.headers,o),pk(i,s)},this.fetch=this._fetch}}const ere=Object.freeze(Object.defineProperty({__proto__:null,ContractType:_s,EventLogDataType:Qte,EventLogType:Kte,Indexer:KN,OrderStatus:Yte,SequenceIndexer:bC,SortOrder:Zte,TransactionStatus:Jte,TransactionType:Xte,TxnTransferType:yn,WebRPCSchemaHash:Gte,WebRPCSchemaVersion:Vte,WebRPCVersion:Hte},Symbol.toStringTag,{value:"Module"}));function l1(){return l1=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Ve({},n)).then(i=>Ge(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Ve({},n)).then(i=>Ge(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Ve({},n)).then(i=>Ge(i).then(s=>({status:s.status}))),this.getTokenMetadata=(n,i)=>this.fetch(this.url("GetTokenMetadata"),Ve(n,i)).then(s=>Ge(s).then(o=>({tokenMetadata:o.tokenMetadata}))),this.refreshTokenMetadata=(n,i)=>this.fetch(this.url("RefreshTokenMetadata"),Ve(n,i)).then(s=>Ge(s).then(o=>({taskId:o.taskId}))),this.enqueueTokensForRefresh=(n,i)=>this.fetch(this.url("EnqueueTokensForRefresh"),Ve(n,i)).then(s=>Ge(s).then(o=>({taskId:o.taskId}))),this.getTokenRefreshStatus=(n,i)=>this.fetch(this.url("GetTokenRefreshStatus"),Ve(n,i)).then(s=>Ge(s).then(o=>({status:o.status}))),this.getTokenRefreshResult=(n,i)=>this.fetch(this.url("GetTokenRefreshResult"),Ve(n,i)).then(s=>Ge(s).then(o=>({status:o.status,tokens:o.tokens,failureReasons:o.failureReasons}))),this.cancelRefreshJob=(n,i)=>this.fetch(this.url("CancelRefreshJob"),Ve(n,i)).then(s=>Ge(s).then(o=>({ok:o.ok}))),this.getTokenMetadataBatch=(n,i)=>this.fetch(this.url("GetTokenMetadataBatch"),Ve(n,i)).then(s=>Ge(s).then(o=>({contractTokenMetadata:o.contractTokenMetadata}))),this.searchTokenMetadata=(n,i)=>this.fetch(this.url("SearchTokenMetadata"),Ve(n,i)).then(s=>Ge(s).then(o=>({page:o.page,tokenMetadata:o.tokenMetadata}))),this.searchTokenIDs=(n,i)=>this.fetch(this.url("SearchTokenIDs"),Ve(n,i)).then(s=>Ge(s).then(o=>({page:o.page,tokenIds:o.tokenIds}))),this.tokenCollectionFilters=(n,i)=>this.fetch(this.url("TokenCollectionFilters"),Ve(n,i)).then(s=>Ge(s).then(o=>({filters:o.filters}))),this.getContractInfo=(n,i)=>this.fetch(this.url("GetContractInfo"),Ve(n,i)).then(s=>Ge(s).then(o=>({contractInfo:o.contractInfo}))),this.getContractInfoBatch=(n,i)=>this.fetch(this.url("GetContractInfoBatch"),Ve(n,i)).then(s=>Ge(s).then(o=>({contractInfoMap:o.contractInfoMap}))),this.searchContractInfo=(n,i)=>this.fetch(this.url("SearchContractInfo"),Ve(n,i)).then(s=>Ge(s).then(o=>({contractInfoList:o.contractInfoList}))),this.searchContractInfoBatch=(n,i)=>this.fetch(this.url("SearchContractInfoBatch"),Ve(n,i)).then(s=>Ge(s).then(o=>({contractInfoByChain:o.contractInfoByChain}))),this.searchMetadata=(n,i)=>this.fetch(this.url("SearchMetadata"),Ve(n,i)).then(s=>Ge(s).then(o=>({tokenMetadata:o.tokenMetadata,contractInfo:o.contractInfo}))),this.getNiftyswapTokenQuantity=(n,i)=>this.fetch(this.url("GetNiftyswapTokenQuantity"),Ve(n,i)).then(s=>Ge(s).then(o=>({quantity:o.quantity}))),this.getNiftyswapUnitPrices=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPrices"),Ve(n,i)).then(s=>Ge(s).then(o=>({prices:o.prices}))),this.getNiftyswapUnitPricesWithQuantities=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPricesWithQuantities"),Ve(n,i)).then(s=>Ge(s).then(o=>({prices:o.prices}))),this.addContractToMintMonitor=(n,i)=>this.fetch(this.url("AddContractToMintMonitor"),Ve(n,i)).then(s=>Ge(s).then(o=>({ok:o.ok}))),this.removeContractFromMintMonitor=(n,i)=>this.fetch(this.url("RemoveContractFromMintMonitor"),Ve(n,i)).then(s=>Ge(s).then(o=>({ok:o.ok}))),this.mintMonitorJobStatus=(n,i)=>this.fetch(this.url("MintMonitorJobStatus"),Ve(n,i)).then(s=>Ge(s).then(o=>({task:o.task}))),this.mintMonitorTriggerJob=(n,i)=>this.fetch(this.url("MintMonitorTriggerJob"),Ve(n,i)).then(s=>Ge(s).then(o=>({ok:o.ok}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}class YN{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Collections/",this.createCollection=(n,i)=>this.fetch(this.url("CreateCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({collection:o.collection}))),this.getCollection=(n,i)=>this.fetch(this.url("GetCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({collection:o.collection}))),this.listCollections=(n,i)=>this.fetch(this.url("ListCollections"),Ve(n,i)).then(s=>Ge(s).then(o=>({page:o.page,collections:o.collections}))),this.updateCollection=(n,i)=>this.fetch(this.url("UpdateCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({collection:o.collection}))),this.deleteCollection=(n,i)=>this.fetch(this.url("DeleteCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({status:o.status}))),this.publishCollection=(n,i)=>this.fetch(this.url("PublishCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({collection:o.collection}))),this.unpublishCollection=(n,i)=>this.fetch(this.url("UnpublishCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({collection:o.collection}))),this.createToken=(n,i)=>this.fetch(this.url("CreateToken"),Ve(n,i)).then(s=>Ge(s).then(o=>({token:o.token,assets:o.assets}))),this.getToken=(n,i)=>this.fetch(this.url("GetToken"),Ve(n,i)).then(s=>Ge(s).then(o=>({token:o.token,assets:o.assets}))),this.listTokens=(n,i)=>this.fetch(this.url("ListTokens"),Ve(n,i)).then(s=>Ge(s).then(o=>({page:o.page,tokens:o.tokens}))),this.updateToken=(n,i)=>this.fetch(this.url("UpdateToken"),Ve(n,i)).then(s=>Ge(s).then(o=>({token:o.token}))),this.deleteToken=(n,i)=>this.fetch(this.url("DeleteToken"),Ve(n,i)).then(s=>Ge(s).then(o=>({status:o.status}))),this.createAsset=(n,i)=>this.fetch(this.url("CreateAsset"),Ve(n,i)).then(s=>Ge(s).then(o=>({asset:o.asset}))),this.getAsset=(n,i)=>this.fetch(this.url("GetAsset"),Ve(n,i)).then(s=>Ge(s).then(o=>({asset:o.asset}))),this.updateAsset=(n,i)=>this.fetch(this.url("UpdateAsset"),Ve(n,i)).then(s=>Ge(s).then(o=>({asset:o.asset}))),this.deleteAsset=(n,i)=>this.fetch(this.url("DeleteAsset"),Ve(n,i)).then(s=>Ge(s).then(o=>({status:o.status}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Ve=(t={},e={})=>({method:"POST",headers:l1({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Ge=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),Iy=typeof Bn=="object"?Bn.fetch:window.fetch;class xC extends QN{constructor(e="https://metadata.sequence.app",r,n){super(e.endsWith("/")?e.slice(0,-1):e,Iy),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=l1({},s.headers,o),Iy(i,s)},this.fetch=this._fetch}}class cre extends YN{constructor(e="https://metadata.sequence.app",r){super(e.endsWith("/")?e.slice(0,-1):e,Iy),this.jwtAuth=r,this._fetch=(n,i)=>{const s={},o=this.jwtAuth;return o&&o.length>0&&(s.Authorization=`BEARER ${o}`),i.headers=l1({},i.headers,s),Iy(n,i)},this.fetch=this._fetch}}const lre=Object.freeze(Object.defineProperty({__proto__:null,Collections:YN,ContractType:ire,Metadata:QN,PropertyType:sre,SequenceCollections:cre,SequenceMetadata:xC,SwapType:ore,TaskStatus:are,WebRPCSchemaHash:nre,WebRPCSchemaVersion:rre,WebRPCVersion:tre},Symbol.toStringTag,{value:"Module"}));function ure(t,e){const r=t.replace("ipfs://ipfs/","").replace("ipfs://","");return t.startsWith("ipfs://")?`${e}${r}`:t}function fre(t){return t.startsWith("ipfs://")}class dre{constructor(e,r,n=1e3){this.provider=e,this.solver=r,this.window=n,this.pending=new Map}async runByEIP5719(e,r,n){const i=`${e}-${r}-${n}`,s=Date.now();if(this.pending.has(i)&&s-this.pending.get(i).timestamp10)throw new Error("EIP5719 - Too many tries");if(we.signer.canRecover(n)){const c=we.signer.recoverSigner(r,n);if(c&&c.toLowerCase()===t.toLowerCase())return n}try{if(await we.signer.isValidSignature(t,r,n,e))return n}catch{}const o=await pre(hre(t,e).getAlternativeSignature(r));if(!o||o==="")throw new Error("EIP5719 - Invalid signature and no alternative signature");const a=le(await(i||new mre).resolve(o));if(!a||a==="")throw new Error("EIP5719 - Empty alternative signature");if(a===le(n))throw new Error("EIP5719 - Alternative signature is invalid or the same");return JN(t,e,r,a,i,s+1)}class mre{constructor(e="https://cloudflare-ipfs.com/ipfs/"){var r=this;this.gateway=e,this.uri=n=>fre(n)?ure(n,this.gateway):n,this.resolve=async function(n){const i=r.uri(n),s=await fetch(i);if(!s.ok)throw new Error(`URISolverIPFS - Failed to fetch ${i}`);return await s.text()}}}const vre=(t,e)=>e.some(r=>t instanceof r);let mk,vk;function yre(){return mk||(mk=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function gre(){return vk||(vk=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const XN=new WeakMap,A6=new WeakMap,ZN=new WeakMap,Vx=new WeakMap,wC=new WeakMap;function bre(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(Pc(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&XN.set(r,t)}).catch(()=>{}),wC.set(e,t),e}function xre(t){if(A6.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});A6.set(t,e)}let _6={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return A6.get(t);if(e==="objectStoreNames")return t.objectStoreNames||ZN.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Pc(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function wre(t){_6=t(_6)}function Ere(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(Gx(this),e,...r);return ZN.set(n,e.sort?e.sort():[e]),Pc(n)}:gre().includes(t)?function(...e){return t.apply(Gx(this),e),Pc(XN.get(this))}:function(...e){return Pc(t.apply(Gx(this),e))}}function Cre(t){return typeof t=="function"?Ere(t):(t instanceof IDBTransaction&&xre(t),vre(t,yre())?new Proxy(t,_6):t)}function Pc(t){if(t instanceof IDBRequest)return bre(t);if(Vx.has(t))return Vx.get(t);const e=Cre(t);return e!==t&&(Vx.set(t,e),wC.set(e,t)),e}const Gx=t=>wC.get(t);function Sre(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=Pc(o);return n&&o.addEventListener("upgradeneeded",c=>{n(Pc(o.result),c.oldVersion,c.newVersion,Pc(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const kre=["get","getKey","getAll","getAllKeys","count"],Are=["put","add","delete","clear"],Kx=new Map;function yk(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Kx.get(e))return Kx.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=Are.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||kre.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return Kx.set(e,s),s}wre(t=>({...t,get:(e,r,n)=>yk(e,r)||t.get(e,r,n),has:(e,r)=>!!yk(e,r)||t.has(e,r)}));class _re{constructor(){this.loadPresignedConfiguration=void 0,this.savePresignedConfiguration=void 0,this.saveWitnesses=void 0,this.configOfImageHash=void 0,this.saveWalletConfig=void 0,this.imageHashOfCounterfactualWallet=void 0,this.saveCounterfactualWallet=void 0,this.walletsOfSigner=void 0}}var Pre=Object.freeze({__proto__:null,ConfigTracker:_re});class Ire{constructor(e){this.tracker=e}async loadPresignedConfiguration(e){return console.debug("? loadPresignedConfiguration"),Tn(e,"? "),Tn(await this.tracker.loadPresignedConfiguration(e),"! ")}savePresignedConfiguration(e){return console.debug("? savePresignedConfiguration"),Tn(e,"? "),this.tracker.savePresignedConfiguration(e)}saveWitnesses(e){return console.debug("? saveWitnesses"),Tn(e,"? "),this.tracker.saveWitnesses(e)}async configOfImageHash(e){return console.debug("? configOfImageHash"),Tn(e,"? "),Tn(await this.tracker.configOfImageHash(e),"! ")}saveWalletConfig(e){return console.debug("? saveWalletConfig"),Tn(e,"? "),this.tracker.saveWalletConfig(e)}async imageHashOfCounterfactualWallet(e){return console.debug("? imageHashOfCounterfactualWallet"),Tn(e,"? "),Tn(await this.tracker.imageHashOfCounterfactualWallet(e),"! ")}saveCounterfactualWallet(e){return console.debug("? saveCounterfactualWallet"),Tn(e,"? "),this.tracker.saveCounterfactualWallet(e)}async walletsOfSigner(e){return console.debug("? walletsOfSigner"),Tn(e,"? "),Tn(await this.tracker.walletsOfSigner(e),"! ")}async getMigration(e,r,n,i){return console.debug("? getMigration"),Tn({address:e,fromImageHash:r,fromVersion:n,chainId:i},"? "),Tn(await this.tracker.getMigration(e,r,n,i),"! ")}saveMigration(e,r,n){return console.debug("? saveMigration"),Tn({address:e,signed:r,contexts:n},"? "),this.tracker.saveMigration(e,r,n)}}function Tn(t,e=""){switch(t){case void 0:console.debug(e+"undefined");break;default:JSON.stringify(t,void 0,2).split(` -`).map(r=>e+r).forEach(r=>console.debug(r));break}return t}var Tre=Object.freeze({__proto__:null,DebugConfigTracker:Ire});function Fc(){return Fc=Object.assign?Object.assign.bind():function(t){for(var e=1;ePromise.resolve(this.configs[e]),this.saveConfig=(e,r)=>(this.configs[e]=r,Promise.resolve()),this.loadV2Node=e=>Promise.resolve(this.v2Nodes[e]),this.saveV2Node=(e,r)=>(this.v2Nodes[e]=r,Promise.resolve()),this.loadCounterfactualWallet=e=>Promise.resolve(this.counterfactualWallets[e]),this.saveCounterfactualWallet=(e,r,n)=>(this.counterfactualWallets[e]={imageHash:r,context:n},Promise.resolve()),this.loadPayloadOfSubdigest=e=>Promise.resolve(this.payloads[e]),this.savePayloadOfSubdigest=(e,r)=>(this.payloads[e]=r,Promise.resolve()),this.loadSubdigestsOfSigner=e=>Promise.resolve(Object.keys(this.signatures[e]||{})),this.loadSignatureOfSubdigest=(e,r)=>{var n;return Promise.resolve((n=this.signatures[e])==null?void 0:n[r])},this.saveSignatureOfSubdigest=(e,r,n)=>(this.signatures[e]||(this.signatures[e]={}),this.signatures[e][r]=n,Promise.resolve()),this.loadMigrationsSubdigest=(e,r,n)=>{var i;return Promise.resolve(((i=this.migrations[e])==null||(i=i[r])==null?void 0:i[n])||[])},this.saveMigrationsSubdigest=(e,r,n,i,s)=>(this.migrations[e]||(this.migrations[e]={}),this.migrations[e][r]||(this.migrations[e][r]={}),this.migrations[e][r][n]||(this.migrations[e][r][n]=[]),this.migrations[e][r][n].push({subdigest:i,toImageHash:s}),Promise.resolve())}}function Yf(t){if(t===void 0)return;const e={};for(const r of Object.keys(t)){const n=t[r];n._isBigNumber===!0&&n._hex!==void 0&&typeof n._hex=="string"&&n._hex.length!==""?e[r]=te.from(n):Array.isArray(n)?e[r]=n.map(i=>Yf(i)):typeof n=="object"&&n!==null?e[r]=Yf(n):e[r]=n}return e}class Ore{constructor(e){var r=this;this.dbName=e,this._lazyDb=void 0,this.loadConfig=async function(n){return(await r.getDb()).get("configs",n).then(s=>Yf(s))},this.saveConfig=async function(n,i){await(await r.getDb()).put("configs",i,n)},this.loadV2Node=async function(n){return(await r.getDb()).get("v2Nodes",n).then(s=>Yf(s))},this.saveV2Node=async function(n,i){await(await r.getDb()).put("v2Nodes",i,n)},this.loadCounterfactualWallet=async function(n){return(await r.getDb()).get("counterfactualWallets",n)},this.saveCounterfactualWallet=async function(n,i,s){await(await r.getDb()).put("counterfactualWallets",{imageHash:i,context:s},n)},this.loadPayloadOfSubdigest=async function(n){return(await r.getDb()).get("payloads",n).then(s=>Yf(s))},this.savePayloadOfSubdigest=async function(n,i){await(await r.getDb()).put("payloads",i,n)},this.loadSubdigestsOfSigner=async function(n){return(await(await r.getDb()).getAllKeysFromIndex("signatures","signer",IDBKeyRange.only(n))).map(o=>o.split("-")[0])},this.loadSignatureOfSubdigest=async function(n,i){const o=await(await r.getDb()).get("signatures",[i,n].join("-"));return o==null?void 0:o.signature},this.saveSignatureOfSubdigest=async function(n,i,s){await(await r.getDb()).put("signatures",{signature:s,signer:n},[i,n].join("-"))},this.loadMigrationsSubdigest=async function(n,i,s){return(await(await r.getDb()).getAllFromIndex("migrations","jump",IDBKeyRange.only([n,i,s]))).map(c=>({subdigest:c.subdigest,toImageHash:c.toImageHash}))},this.saveMigrationsSubdigest=async function(n,i,s,o,a){await(await r.getDb()).put("migrations",{wallet:n,fromVersion:i,toVersion:s,subdigest:o,toImageHash:a},o)}}async getDb(){if(this._lazyDb)return this._lazyDb;const e=this.dbName;return this._lazyDb=await Sre(e,1,{upgrade(r,n,i,s){console.log(`upgrading ${e} from ${n} to ${i} - ${s}`),n===0&&(r.createObjectStore("configs"),r.createObjectStore("v2Nodes"),r.createObjectStore("counterfactualWallets"),r.createObjectStore("payloads"),r.createObjectStore("signatures").createIndex("signer","signer",{unique:!1}),r.createObjectStore("migrations").createIndex("jump",["wallet","fromVersion","toVersion"]))}}),this._lazyDb}}function tD(t){return t.left!==void 0&&t.right!==void 0}function rD(t){return t.weight!==void 0&&t.threshold!==void 0&&t.tree!==void 0}function P6(t){return t.version===2&&t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&typeof t.tree=="string"}var Rre=Object.freeze({__proto__:null,isPlainNode:tD,isPlainNested:rD,isPlainV2Config:P6,MemoryTrackerStore:eD,recreateBigNumbers:Yf,IndexedDBStore:Ore});class EC{constructor(e,r=new eD,n=!1){var i=this;this.provider=e,this.store=r,this.useEIP5719=n,this.cachedEIP5719=void 0,this.loadTopology=async function(s){const o=await i.store.loadV2Node(s);if(!o)return{nodeHash:s};if(tD(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return rD(o)?{weight:te.from(o.weight),threshold:te.from(o.threshold),tree:await i.loadTopology(o.tree)}:o},this.saveTopology=async function(s){if(Ze.config.isNodeLeaf(s))return;const o=Ze.config.hashNode(s);if(Ze.config.isNode(s)){const a=i.saveTopology(s.left),c=i.saveTopology(s.right),l=i.store.saveV2Node(o,{left:Ze.config.hashNode(s.left),right:Ze.config.hashNode(s.right)});await Promise.all([a,c,l]);return}if(Ze.config.isNestedLeaf(s)){const a=i.saveTopology(s.tree),c=i.store.saveV2Node(o,{weight:te.from(s.weight).toString(),threshold:te.from(s.threshold).toString(),tree:Ze.config.hashNode(s.tree)});await Promise.all([a,c]);return}if(Ze.config.isSignerLeaf(s))return i.store.saveV2Node(o,{address:s.address,weight:s.weight});if(Ze.config.isSubdigestLeaf(s))return i.store.saveV2Node(o,{subdigest:s.subdigest});throw new Error(`Unknown topology type: ${s}`)},this.saveWalletConfig=async function(s){const{config:o}=s;if(Vo.config.ConfigCoder.isWalletConfig(o)){const a=Vo.config.ConfigCoder.imageHashOf(o);return i.store.saveConfig(a,o)}if(Ze.config.ConfigCoder.isWalletConfig(o)){const a=Ze.config.ConfigCoder.imageHashOf(o);if(Ze.config.isComplete(o.tree))return i.store.saveConfig(a,o)}},this.configOfImageHashCache={},this.configOfImageHash=async function(s){const{imageHash:o}=s;if(i.configOfImageHashCache[s.imageHash])return i.configOfImageHashCache[s.imageHash];const a=await i.store.loadConfig(o);if(a){if(a.version===1||a.version===2&&!P6(a))return i.configOfImageHashCache[s.imageHash]=a,a;if(P6(a)){const c={version:2,threshold:te.from(a.threshold),checkpoint:te.from(a.checkpoint),tree:await i.loadTopology(a.tree)};return i.configOfImageHashCache[s.imageHash]=c,c}throw new Error(`Unknown config type: ${a}`)}},this.saveCounterfactualWallet=async function(s){const{config:o,context:a}=s,c=sn.genericCoderFor(o.version).config.imageHashOf(o);await Promise.all([i.saveWalletConfig({config:o}),...a.map(l=>{const u=we.context.addressOf(l,c);return i.store.saveCounterfactualWallet(u,c,l)})])},this.imageHashOfCounterfactualWallet=async function(s){const{wallet:o}=s,a=await i.store.loadCounterfactualWallet(o);if(a)return{imageHash:a.imageHash,context:a.context}},this.savePayload=async function(s){const{payload:o}=s,a=we.signature.subdigestOf(o);await i.store.savePayloadOfSubdigest(a,o)},this.payloadOfSubdigestCache={},this.payloadOfSubdigest=async function(s){if(i.payloadOfSubdigestCache[s.subdigest])return i.payloadOfSubdigestCache[s.subdigest];const{subdigest:o}=s,a=await i.store.loadPayloadOfSubdigest(o);return a&&(i.payloadOfSubdigestCache[o]=a),a},this.savePresignedConfiguration=async function(s){const o=Ze.signature.SignatureCoder.decode(s.signature),a=sn.genericCoderFor(s.nextConfig.version).config.imageHashOf(s.nextConfig),c=Ze.chained.messageSetImageHash(a),l=Oe(c),u={message:c,address:s.wallet,chainId:0,digest:l},f=i.savePayload({payload:u}),d=i.saveWalletConfig({config:s.nextConfig}),h=await Ze.signature.SignatureCoder.recover(o,u,i.provider),p=Ze.signature.signaturesOf(h.config.tree);await Promise.all([f,d,i.saveWalletConfig({config:h.config}),...p.map(m=>i.store.saveSignatureOfSubdigest(m.address,h.subdigest,m.signature))])},this.loadPresignedConfiguration=async function(s){const{wallet:o,fromImageHash:a,longestPath:c}=s,l=await i.configOfImageHash({imageHash:a});if(!l||!Ze.config.ConfigCoder.isWalletConfig(l))return[];const u=Ze.config.signersOf(l.tree).map(E=>E.address),f=await Promise.all(u.map(E=>i.store.loadSubdigestsOfSigner(E))),d=[...new Set(f.flat())],p=(await Promise.all([...new Set(d)].map(async function(E){return Fc({},await i.payloadOfSubdigest({subdigest:E}),{subdigest:E})}))).filter(E=>(E==null?void 0:E.message)&&(E==null?void 0:E.address)&&E.address===o).map(E=>({payload:E,nextImageHash:Ze.chained.decodeMessageSetImageHash(E.message)})).filter(E=>E==null?void 0:E.nextImageHash);let m;const y=(await Promise.all(p.map(async function({nextImageHash:E,payload:S}){const P=await i.configOfImageHash({imageHash:E});if(!P||!Ze.config.isWalletConfig(P))return;const M=te.from(P.checkpoint);return{nextConfig:P,nextCheckpoint:M,nextImageHash:E,payload:S}}))).filter(E=>E!==void 0).filter(E=>E.nextCheckpoint.gt(l.checkpoint)).sort((E,S)=>E.nextCheckpoint.gt(S.nextCheckpoint)?c?1:-1:c?-1:1);for(const E of y){const{nextConfig:S,nextCheckpoint:P,nextImageHash:M,payload:L}=E;if(m){const K=m.checkpoint;if(c){if(P.gte(K))continue}else if(P.lte(K))continue}const j=new Map((await Promise.all(u.map(async function(K){const Q=await i.store.loadSignatureOfSubdigest(K,L.subdigest);if(!Q)return[K,void 0];const Y=le(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(K,L.subdigest,Q):Q),F=we.signer.tryRecoverSigner(L.subdigest,Y)!==K;return[K,{isDynamic:F,signature:Y}]}))).filter(K=>!!K[1]));if(j.size===0)continue;const H=Ze.signature.SignatureCoder.encodeSigners(l,j,[],0);H.weight.lt(l.threshold)||(m={nextImageHash:M,checkpoint:te.from(S.checkpoint),signature:H.encoded})}if(!m)return[];const b=await i.loadPresignedConfiguration({wallet:o,fromImageHash:m.nextImageHash,longestPath:c});return[{wallet:o,nextImageHash:m.nextImageHash,signature:m.signature},...b]},this.saveWitnesses=async function(s){const o={digest:s.digest,address:s.wallet,chainId:s.chainId},a=we.signature.subdigestOf(o);await Promise.all([i.savePayload({payload:o}),...s.signatures.filter(c=>we.signer.canRecover(c)).map(c=>{const l=we.signer.recoverSigner(a,c);return i.store.saveSignatureOfSubdigest(l,a,c)})])},this.walletsOfSigner=async function(s){const o=await i.store.loadSubdigestsOfSigner(s.signer),a=await Promise.all(o.map(l=>i.payloadOfSubdigest({subdigest:l}))).then(l=>l.filter(u=>u!==void 0)),c=[];for(const l of a){const u=l.address;if(c.find(h=>h.wallet===u))continue;const f=we.signature.subdigestOf(l),d=await i.store.loadSignatureOfSubdigest(s.signer,f);d&&c.push({wallet:u,proof:{digest:l.digest,chainId:te.from(l.chainId),signature:le(d)}})}return c},this.cachedEIP5719=new dre(e)}async saveMigration(e,r,n){const i=r.fromVersion;if(i!==1)throw new Error("Migration not supported");if(!Ze.config.isWalletConfig(r.toConfig))throw new Error("Invalid to config");const{newImageHash:s,address:o}=BN.v1v2.decodeTransaction(r.tx,n);if(o!==e)throw new Error("Invalid migration transaction - address");if(Ze.config.ConfigCoder.imageHashOf(r.toConfig)!=s)throw new Error("Invalid migration transaction - config");const a=we.transaction.packMetaTransactionsData(r.tx.nonce,r.tx.transactions),c=Oe(a),l={chainId:r.tx.chainId,message:a,address:e,digest:c},u=we.signature.subdigestOf(l),f=this.savePayload({payload:l}),d=this.saveWalletConfig({config:r.toConfig}),h=Vo.signature.SignatureCoder.decode(r.tx.signature),p=await Vo.signature.SignatureCoder.recover(h,l,this.provider),m=Vo.signature.SignatureCoder.signaturesOf(p.config);await Promise.all([f,d,this.saveWalletConfig({config:p.config}),this.store.saveMigrationsSubdigest(e,i,i+1,u,s),...m.map(v=>this.store.saveSignatureOfSubdigest(v.address,p.subdigest,v.signature))])}async getMigration(e,r,n,i){var s=this;const[o,a]=await Promise.all([this.configOfImageHash({imageHash:r}),this.store.loadMigrationsSubdigest(e,n,n+1)]),c=sn.coderFor(n);return!o||!c.config.isWalletConfig(o)?void 0:(await Promise.all(a.map(async function(u){const{subdigest:f,toImageHash:d}=u,h=await s.payloadOfSubdigest({subdigest:f});if(!h||!h.message||!te.from(i).eq(h.chainId))return;const p=c.config.signersOf(o).map(E=>E.address),m=new Map((await Promise.all(p.map(async function(E){const S=await s.store.loadSignatureOfSubdigest(E,f);if(!S)return[E,void 0];const P=le(s.useEIP5719?await s.cachedEIP5719.runByEIP5719(E,f,S):S),M=we.signer.tryRecoverSigner(f,P)!==E;return[E,{isDynamic:M,signature:P}]}))).filter(E=>!!E[1])),v=c.signature.encodeSigners(o,m,[],i);if(!v||v.weightu.filter(f=>f!==void 0)))[0]}updateProvider(e){this.provider=e}}var $re=Object.freeze({__proto__:null,LocalConfigTracker:EC});let Qx=function(t){return t.EIP712="EIP712",t.EthSign="EthSign",t.EIP1271="EIP1271",t}({});class Mre{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Sessions/",this.ping=n=>this.fetch(this.url("Ping"),ys({},n)).then(i=>gs(i).then(s=>({}))),this.config=(n,i)=>this.fetch(this.url("Config"),ys(n,i)).then(s=>gs(s).then(o=>({version:o.version,config:o.config}))),this.wallets=(n,i)=>this.fetch(this.url("Wallets"),ys(n,i)).then(s=>gs(s).then(o=>({wallets:o.wallets}))),this.deployHash=(n,i)=>this.fetch(this.url("DeployHash"),ys(n,i)).then(s=>gs(s).then(o=>({deployHash:o.deployHash,context:o.context}))),this.configUpdates=(n,i)=>this.fetch(this.url("ConfigUpdates"),ys(n,i)).then(s=>gs(s).then(o=>({updates:o.updates}))),this.migrations=(n,i)=>this.fetch(this.url("Migrations"),ys(n,i)).then(s=>gs(s).then(o=>({migrations:o.migrations}))),this.saveConfig=(n,i)=>this.fetch(this.url("SaveConfig"),ys(n,i)).then(s=>gs(s).then(o=>({}))),this.saveWallet=(n,i)=>this.fetch(this.url("SaveWallet"),ys(n,i)).then(s=>gs(s).then(o=>({}))),this.saveSignature=(n,i)=>this.fetch(this.url("SaveSignature"),ys(n,i)).then(s=>gs(s).then(o=>({}))),this.saveSignerSignatures=(n,i)=>this.fetch(this.url("SaveSignerSignatures"),ys(n,i)).then(s=>gs(s).then(o=>({}))),this.saveMigration=(n,i)=>this.fetch(this.url("SaveMigration"),ys(n,i)).then(s=>gs(s).then(o=>({}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const ys=(t={},e={})=>({method:"POST",headers:Fc({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),gs=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});class Nre{constructor(e,r=!0){this.onlyRecoverable=r,this.sessions=void 0,this.sessions=new Mre(e,fetch)}async loadPresignedConfiguration(e){try{const{updates:r}=await this.sessions.configUpdates({wallet:e.wallet,fromImageHash:e.fromImageHash,allUpdates:e.longestPath});return r.map(({toImageHash:n,signature:i})=>({wallet:e.wallet,nextImageHash:n,signature:i}))}catch(r){if(Yx(r))return[];throw r}}async savePresignedConfiguration(e){const r=e.nextConfig,n=sn.genericCoderFor(r.version).config.imageHashOf(r),i=Ze.signature.setImageHashStruct(n),s=Oe(i);await this.sessions.saveSignature({wallet:e.wallet,digest:s,chainID:"0",signature:e.signature,toConfig:dm(r)})}async saveWitnesses(e){let r=e.signatures;this.onlyRecoverable&&(r=r.filter(n=>we.signer.canRecover(n))),await this.sessions.saveSignerSignatures({wallet:e.wallet,digest:e.digest,chainID:Pf(e.chainId),signatures:r})}async configOfImageHash(e){try{const{version:r,config:n}=await this.sessions.config(e);return Dre(r,n)}catch(r){if(Yx(r))return;throw r}}async saveWalletConfig(e){const r=dm(e.config);await this.sessions.saveConfig({version:e.config.version,config:r})}async imageHashOfCounterfactualWallet(e){try{const{deployHash:r,context:n}=await this.sessions.deployHash(e);return{imageHash:r,context:n}}catch(r){if(Yx(r))return;throw r}}async saveCounterfactualWallet(e){const r=dm(e.config);await this.sessions.saveWallet({version:e.config.version,deployConfig:r})}async walletsOfSigner(e){const{wallets:r}=await this.sessions.wallets(e);return Object.entries(r).map(([n,{digest:i,chainID:s,type:o,signature:a}])=>{switch(o){case Qx.EIP712:a+=le(we.signer.SigType.EIP712).slice(2);break;case Qx.EthSign:a+=le(we.signer.SigType.ETH_SIGN).slice(2);break;case Qx.EIP1271:a+=le(we.signer.SigType.WALLET_BYTES32).slice(2);break}return{wallet:n,proof:{digest:i,signature:a,chainId:te.from(s)}}})}async getMigration(e,r,n,i){var s=this;const o=Pf(i),{migrations:a}=await this.sessions.migrations({wallet:e,fromVersion:n,fromImageHash:r,chainID:o}),c=async function(f){const d=a[f];if(d){const h=Object.keys(d).map(Number).sort((p,m)=>m-p);for(const p of h)for(const[m,v]of Object.entries(d[p]))try{const y=await s.configOfImageHash({imageHash:m});if(y)return{fromVersion:n,toVersion:p,toConfig:y,tx:{entrypoint:v.executor,transactions:v.transactions,nonce:v.nonce,signature:v.signature,chainId:f,intent:{id:we.transaction.subdigestOfTransactions(e,f,v.nonce,v.transactions),wallet:e}}}}catch(y){console.error(y)}}},l=await c(o);if(l)return l;for(const u in a)if(u!==o){const f=await c(u);if(f)return f}}async saveMigration(e,r,n){await this.sessions.saveMigration({wallet:e,fromVersion:r.fromVersion,toVersion:r.toVersion,toConfig:dm(r.toConfig),executor:r.tx.entrypoint,transactions:r.tx.transactions.map(Lre),nonce:Pf(r.tx.nonce),signature:r.tx.signature,chainID:Pf(r.tx.chainId)})}}function dm(t){switch(t.version){case 1:if(Vo.config.ConfigCoder.isWalletConfig(t))return{threshold:ql(t.threshold),signers:t.signers.map(({weight:e,address:r})=>({weight:ql(e),address:r}))};throw new Error(`not a v${t.version} config: ${t}`);case 2:if(Ze.config.ConfigCoder.isWalletConfig(t))return{threshold:ql(t.threshold),checkpoint:ql(t.checkpoint),tree:hv(t.tree)};throw new Error(`not a v${t.version} config: ${t}`);default:throw new Error(`unknown version ${t.version}`)}}function hv(t){return Ze.config.isNode(t)?{left:hv(t.left),right:hv(t.right)}:Ze.config.isSignerLeaf(t)?{weight:ql(t.weight),address:t.address}:Ze.config.isNestedLeaf(t)?{weight:ql(t.weight),threshold:ql(t.threshold),tree:hv(t.tree)}:Ze.config.isNodeLeaf(t)?{node:t.nodeHash}:Fc({},t)}function Dre(t,e){switch(t){case 1:return Fc({},e,{version:t});case 2:return Fc({},e,{version:t,tree:pv(e.tree)});default:throw new Error(`unknown version ${t}`)}}function pv(t){switch(typeof t){case"object":const e=Fc({},t);return e.left!==void 0&&(e.left=pv(e.left)),e.right!==void 0&&(e.right=pv(e.right)),e.tree!==void 0&&(e.tree=pv(e.tree)),e.node!==void 0&&(e.nodeHash=e.node,delete e.node),e;default:throw new Error(`v2 config tree ${t} is not an object`)}}function Lre(t){return{to:t.to,value:t.value!==void 0?Pf(t.value):void 0,data:t.data!==void 0?le(t.data):void 0,gasLimit:t.gasLimit!==void 0?Pf(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function ql(t){return te.from(t).toNumber()}function Pf(t){return te.from(t).toString()}function Yx(t){return typeof t=="object"&&t.status===404}var jre=Object.freeze({__proto__:null,RemoteConfigTracker:Nre});function I6(t,e,r){return new Promise(n=>{let i=0;t.forEach(s=>s.then(o=>{r(o)?n(o):(i++,i===t.length&&n(e))}).catch(()=>{i++,i===t.length&&n(e)}))})}async function Jh(t,e){return Promise.all(t.map(r=>r.catch(()=>e)))}class Bre{constructor(e){this.trackers=e}async configOfImageHash(e){const r=this.trackers.map(async function(a,c){return{res:await a.configOfImageHash(e),i:c}}),n=await I6(r,void 0,a=>(a==null?void 0:a.res)===void 0?!1:sn.genericCoderFor(a.res.version).config.isComplete(a.res));if(n!=null&&n.res)return this.saveWalletConfig({config:n.res,skipTracker:n.i}),n.res;const i=new EC(void 0),s=await Jh(r,void 0);for(const a of s)a!=null&&a.res&&await i.saveWalletConfig({config:a.res});const o=await i.configOfImageHash(e);return o&&this.saveWalletConfig({config:o}),o}async saveWalletConfig(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveWalletConfig(e)}))}async imageHashOfCounterfactualWallet(e){const r=await I6(this.trackers.map(n=>n.imageHashOfCounterfactualWallet(e)),void 0,n=>!!n);return r&&this.configOfImageHash({imageHash:r.imageHash}).then(n=>{n&&this.saveCounterfactualWallet({config:n,context:[r.context]})}),r}async saveCounterfactualWallet(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveCounterfactualWallet(e)}))}async walletsOfSigner(e){const r=await Jh(this.trackers.map(o=>o.walletsOfSigner(e)),[]).then(o=>o.flat()),n={};for(const o of r)n[o.wallet]=o.proof;const i=Object.keys(n).map(o=>({wallet:o,proof:n[o]})),s=new Map;return i.forEach(({wallet:o,proof:{digest:a,chainId:c,signature:l}})=>{const u=`${o}-${a}-${c}`;let f=s.get(u);f||(f={wallet:o,digest:a,chainId:c,signatures:[]},s.set(u,f)),f.signatures.push(l)}),s.forEach(o=>this.saveWitnesses(o)),i}async saveWitnesses(e){await Promise.all(this.trackers.map(r=>r.saveWitnesses(e)))}async loadPresignedConfiguration(e){var r=this;const n=await Jh(this.trackers.map(c=>c.loadPresignedConfiguration(e)),[]),s=(await Jh(n.map(async function(c){const l=c[c.length-1],u=await r.configOfImageHash({imageHash:l.nextImageHash});if(u)return{checkpoint:sn.genericCoderFor(u.version).config.checkpointOf(u),result:c}}),void 0)).reduce((c,l)=>l&&(!c||l.checkpoint.gt(c.checkpoint))?l:c);if(!s)return[];const o=new Map,a=c=>(o.has(c)||o.set(c,this.configOfImageHash({imageHash:c})),o.get(c));return s.result.forEach(async function(c){const l=await a(c.nextImageHash);l&&r.savePresignedConfiguration({wallet:e.wallet,nextConfig:l,signature:c.signature})}),s.result}async savePresignedConfiguration(e){await Promise.all(this.trackers.map(r=>r.savePresignedConfiguration(e)))}async getMigration(e,r,n,i){return(await Promise.all(this.trackers.map(o=>o.getMigration(e,r,n,i)))).find(o=>!!o)}async saveMigration(e,r,n){await Promise.all(this.trackers.map(i=>i.saveMigration(e,r,n)))}}class Fre{constructor(e,r,n){this.tracker=e,this.cache=r,this.contexts=n}async loadPresignedConfiguration(e){var r=this;const n=[this.tracker.loadPresignedConfiguration(e),this.cache.loadPresignedConfiguration(e)];let i;const[s,o]=await Promise.all(n);if(s.length>0&&o.length>0&&s[s.length-1].nextImageHash===o[o.length-1].nextImageHash)i=e.longestPath===!0?s.length>o.length?s:o:s.lengthf&&(!u||f.checkpoint.gt(u.checkpoint))?f:u))==null?void 0:c.result)!=null?a:[]}return i||[]}async savePresignedConfiguration(e){await Promise.all([this.tracker.savePresignedConfiguration(e),this.cache.savePresignedConfiguration(e)])}async configOfImageHash(e){if(e.noCache!==!0){const n=await this.cache.configOfImageHash(e);if(n)return n}const r=await this.tracker.configOfImageHash(e);return r&&await this.cache.saveWalletConfig({config:r}),r}async saveWalletConfig(e){await Promise.all([this.tracker.saveWalletConfig(e),this.cache.saveWalletConfig(e)])}async imageHashOfCounterfactualWallet(e){if(e.noCache!==!0){const n=await this.cache.imageHashOfCounterfactualWallet(e);if(n)return n}const r=await this.tracker.imageHashOfCounterfactualWallet(e);if(r){const n=await this.configOfImageHash({imageHash:r.imageHash});n&&await this.cache.saveCounterfactualWallet({config:n,context:[r.context]})}return r}async saveCounterfactualWallet(e){await Promise.all([this.tracker.saveCounterfactualWallet(e),this.cache.saveCounterfactualWallet(e)])}async walletsOfSigner(e){if(e.noCache)return this.tracker.walletsOfSigner(e);const r=await Promise.all([this.tracker.walletsOfSigner(e),this.cache.walletsOfSigner(e)]),n=new Map;for(const i of r)for(const s of i)n.set(s.wallet,s);return Array.from(n.values())}async saveWitnesses(e){await Promise.all([this.tracker.saveWitnesses(e),this.cache.saveWitnesses(e)])}async getMigration(e,r,n,i){const s=await this.cache.getMigration(e,r,n,i);if(s)return s;const o=await this.tracker.getMigration(e,r,n,i);return o&&await this.cache.saveMigration(e,o,this.contexts),o}async saveMigration(e,r,n){await Promise.all([this.tracker.saveMigration(e,r,n),this.cache.saveMigration(e,r,n)])}}class gk{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${Oe(St(JSON.stringify(i,Ure)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}}function Ure(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function zre(t){return t instanceof nD}class nD{constructor(e,r=50,n=!1){this.tracker=e,this.window=r,this.verbose=n,this.cache=new gk}invalidateCache(){this.cache=new gk}configOfImageHash(e){return this.cache.do("configOfImageHash",this.window,r=>this.tracker.configOfImageHash(r),e)}getMigration(e,r,n,i){return this.cache.do("getMigration",this.window,(...s)=>this.tracker.getMigration(...s),e,r,n,i)}saveMigration(e,r,n){return this.cache.do("saveMigration",void 0,(...i)=>this.tracker.saveMigration(...i),e,r,n)}loadPresignedConfiguration(e){return this.cache.do("loadPresignedConfiguration",this.window,r=>this.tracker.loadPresignedConfiguration(r),e)}savePresignedConfiguration(e){return this.cache.do("savePresignedConfiguration",void 0,r=>this.tracker.savePresignedConfiguration(r),e)}saveWitnesses(e){return this.cache.do("saveWitnesses",void 0,r=>this.tracker.saveWitnesses(r),e)}saveWalletConfig(e){return this.cache.do("saveWalletConfig",void 0,r=>this.tracker.saveWalletConfig(r),e)}imageHashOfCounterfactualWallet(e){return this.cache.do("imageHashOfCounterfactualWallet",void 0,r=>this.tracker.imageHashOfCounterfactualWallet(r),e)}saveCounterfactualWallet(e){return this.cache.do("saveCounterfactualWallet",void 0,r=>this.tracker.saveCounterfactualWallet(r),e)}walletsOfSigner(e){return this.cache.do("walletsOfSigner",this.window,r=>this.tracker.walletsOfSigner(r),e)}updateProvider(e){this.tracker instanceof EC&&this.tracker.updateProvider(e)}}var CC=Object.freeze({__proto__:null,debug:Tre,local:$re,remote:jre,stores:Rre,raceUntil:I6,allSafe:Jh,MultipleTracker:Bre,CachedTracker:Fre,isDedupedTracker:zre,DedupedTracker:nD});const qre=Object.freeze(Object.defineProperty({__proto__:null,tracker:Pre,trackers:CC},Symbol.toStringTag,{value:"Module"})),iD=60*60*24*7,Wre=60;class bk{constructor(e,r,n={},i){this.account=e,this.settings=r,this.status=n,this._initialAuthRequest=void 0,this.proofStrings=new Map,this.onAuthCallbacks=[],this.apiClient=void 0,this.metadataClient=void 0,this.indexerClients=new Map,this.projectAccessKey=void 0,this.projectAccessKey=i}now(){return Math.floor(Date.now()/1e3)}get expiration(){var e;return Math.max((e=this.settings.metadata.expiration)!=null?e:iD,120)}onAuth(e){return this.onAuthCallbacks.push(e),()=>this.onAuthCallbacks=this.onAuthCallbacks.filter(r=>r!==e)}async dump(){return this.status.jwt?{jwt:{token:await this.status.jwt.token,expiration:this.status.jwt.expiration},metadata:this.status.metadata}:{metadata:this.settings.metadata}}auth(e=5){var r=this;return this._initialAuthRequest?this._initialAuthRequest:(this._initialAuthRequest=async function(){const n=r.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");let i;for(let s=1;;s++)try{i=(await r.getJWT(!0)).token;break}catch(o){if(s===e)throw console.error(`couldn't authenticate after ${e} attempts`,o),o}return new c0(n,void 0,i)}(),this._initialAuthRequest)}async getJWT(e){var r=this;const n=this.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");if(this.status.jwt){const l=this.status.jwt,u=await l.token;if(this.now(){throw this.status.jwt=void 0,l}),expiration:o};return this.status.jwt=a,a.token.then(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"fulfilled",value:l})}catch{}})}).catch(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"rejected",reason:l})}catch{}})}),{token:await a.token,expiration:o}}getProofStringKey(){return`${this.account.address} - ${this.settings.metadata.name}`}async isProofStringValid(e){try{const r=new s1,n=te.from(this.settings.sequenceApiChainId),i=Ms(this.account.networks,n);if(!i)throw Error("No network found");return r.chainId=n.toNumber(),r.provider=new by(o1(i.rpcUrl,this.projectAccessKey),{name:"",chainId:n.toNumber()}),await r.decodeProof(e),!0}catch{return!1}}async getAPIClient(e=!0){if(!this.apiClient){const r=this.settings.sequenceApiUrl;if(!r)throw Error("No sequence api url");const n=(await this.getJWT(e)).token;this.apiClient=new c0(r,void 0,n)}return this.apiClient}async getMetadataClient(e=!0){if(!this.metadataClient){const r=(await this.getJWT(e)).token;this.metadataClient=new xC(this.settings.sequenceMetadataUrl,void 0,r)}return this.metadataClient}async getIndexerClient(e,r=!0){const n=Ms(this.account.networks,e);if(!n)throw Error(`No network for chain ${e}`);if(!this.indexerClients.has(n.chainId))if(n.indexer)this.indexerClients.set(n.chainId,n.indexer);else if(n.indexerUrl){const i=(await this.getJWT(r)).token;this.indexerClients.set(n.chainId,new bC(n.indexerUrl,void 0,i))}else throw Error(`No indexer url for chain ${e}`);return this.indexerClients.get(n.chainId)}getProofString(e){if(this.proofStrings.has(e)){const c=this.proofStrings.get(e);if(this.now()(r.signature=c,n.encodeProof(r,!0))).catch(c=>{throw this.proofStrings.delete(e),c}),expiration:o};return this.proofStrings.set(e,a),a}}const sD=async(t,e,r)=>{const n=Be(await t.getAddress());if(!n||n===""||n==="0x")throw oD;const i=new pb;if(i.address=n,!r||!r.app||r.app==="")throw new SC("authorization options requires app to be set");i.claims.app=r.app,i.claims.ogn=r.origin,i.claims.n=r.nonce,i.setExpiryIn(r.expiry?Math.max(r.expiry,200):iD);const s=i.messageTypedData(),o=GM(e);i.signature=await(t instanceof Xo?t.signTypedData(s.domain,s.types,s.message,o,"eip6492"):t.signTypedData(s.domain,s.types,s.message,o));const c=await new s1().encodeProof(i,!0);return{typedData:s,proofString:c}};class SC extends Error{constructor(e){super(e),this.name="AuthError"}}const oD=new SC("auth error: account address is empty");function Dl(){return Dl=Object.assign?Object.assign.bind():function(t){for(var e=1;eK.wallet));let j;if(L){if(f==null||f(L),j=new Xo({address:L,tracker:E,networks:b,contexts:y,orchestrator:m,projectAccessKey:v}),l&&l.length>0){let K=await j.status(P);if(K.original.version!==K.version||j.version!==K.version){const{migratedAllChains:F,failedChains:w}=await j.isMigratedAllChains();if(w.some(k=>T6.includes(k)))throw Error(`Failed to fetch account status on ${w.join(", ")}`);if(!F){if(p&&!await p(j))throw Error("Migration cancelled, cannot open session");const{failedChains:k}=await j.signAllMigrations(h||(N=>N));if(k.some(N=>T6.includes(N)))throw Error(`Failed to sign migrations on ${k.join(", ")}`);CC.isDedupedTracker(E)&&E.invalidateCache();let R;if([R,K]=await Promise.all([j.isMigratedAllChains().then(N=>N.migratedAllChains),j.status(P)]),!R)throw Error("Failed to migrate account")}}K.onChain.version!==K.version&&await j.doBootstrap(P,void 0,K);const Q=K.config,Y=j.coders.config.editConfig(Q,{add:l,threshold:c});if(j.coders.config.imageHashOf(Q)!==j.coders.config.imageHashOf(Y)){const F=j.coders.config.editConfig(Y,{checkpoint:j.coders.config.checkpointOf(Q).add(1)});await j.updateConfig(F)}}}else{if(!l||l.length===0)throw Error("Cannot create new account without signers");if(!c)throw Error("Cannot create new account without threshold");if(j=await Xo.new({config:{threshold:c,checkpoint:0,signers:l},tracker:E,contexts:y,orchestrator:m,networks:b,projectAccessKey:v}),f==null||f(j.address),await j.publishWitness(),!(await E.walletsOfSigner({signer:a,noCache:!0})).some(Q=>Q.wallet===j.address))throw Error("Account not found on tracker")}let H;return S&&(H=new bk(j,S),H.auth(),H.onAuth(K=>{K.status==="fulfilled"&&j.setJwt(K.value)})),new E0(b,y,j,H)}static async load(e){const{dump:r,settings:n,editConfigOnMigration:i,onMigration:s,orchestrator:o}=e,{contexts:a,networks:c,tracker:l,services:u}=Dl({},mv,n);let f;if(aD(r)){var d,h,p;const S=r.config.address||we.context.addressOf(a[1],Vo.config.ConfigCoder.imageHashOf(Dl({},r.config,{version:1}))),P=((d=(h=r.jwt)==null?void 0:h.expiration)!=null?d:0)M.migratedAllChains)){if(s&&!await s(f))throw Error("Migration cancelled, cannot open session");if(console.log("Migrating account..."),await f.signAllMigrations(i),!await f.isMigratedAllChains().then(M=>M.migratedAllChains))throw Error("Failed to migrate account")}}else if(cD(r)){var m,v,y;const S=((m=(v=r.jwt)==null?void 0:v.expiration)!=null?m:0)async(n,i,s)=>{const o=s.messageDigest();return{isValid:await t(i).isValidSignature(s.address,o,s.signature)}},Vre=Object.freeze(Object.defineProperty({__proto__:null,AuthError:SC,CRITICAL_CHAINS:T6,ErrAccountIsRequired:oD,Session:E0,SessionSettingsDefault:mv,ValidateSequenceWalletProof:Hre,isSessionDumpV1:aD,isSessionDumpV2:cD,signAuthorization:sD},Symbol.toStringTag,{value:"Module"}));function Ty(){return Ty=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),On({},n)).then(i=>Rn(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),On({},n)).then(i=>Rn(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),On({},n)).then(i=>Rn(i).then(s=>({status:s.status}))),this.getSignerConfig=(n,i)=>this.fetch(this.url("GetSignerConfig"),On(n,i)).then(s=>Rn(s).then(o=>({signerConfig:o.signerConfig}))),this.sign=(n,i)=>this.fetch(this.url("Sign"),On(n,i)).then(s=>Rn(s).then(o=>({sig:o.sig}))),this.signWith=(n,i)=>this.fetch(this.url("SignWith"),On(n,i)).then(s=>Rn(s).then(o=>({sig:o.sig}))),this.authMethods=(n,i)=>this.fetch(this.url("AuthMethods"),On(n,i)).then(s=>Rn(s).then(o=>({methods:o.methods,active:o.active}))),this.setPIN=(n,i)=>this.fetch(this.url("SetPIN"),On(n,i)).then(s=>Rn(s).then(o=>({}))),this.resetPIN=(n,i)=>this.fetch(this.url("ResetPIN"),On(n,i)).then(s=>Rn(s).then(o=>({}))),this.createTOTP=(n,i)=>this.fetch(this.url("CreateTOTP"),On(n,i)).then(s=>Rn(s).then(o=>({uri:o.uri}))),this.commitTOTP=(n,i)=>this.fetch(this.url("CommitTOTP"),On(n,i)).then(s=>Rn(s).then(o=>({codes:o.codes}))),this.resetTOTP=(n,i)=>this.fetch(this.url("ResetTOTP"),On(n,i)).then(s=>Rn(s).then(o=>({}))),this.reset2FA=(n,i)=>this.fetch(this.url("Reset2FA"),On(n,i)).then(s=>Rn(s).then(o=>({}))),this.recoveryCodes=(n,i)=>this.fetch(this.url("RecoveryCodes"),On(n,i)).then(s=>Rn(s).then(o=>({codes:o.codes}))),this.resetRecoveryCodes=(n,i)=>this.fetch(this.url("ResetRecoveryCodes"),On(n,i)).then(s=>Rn(s).then(o=>({codes:o.codes}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const On=(t={},e={})=>({method:"POST",headers:Ty({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Rn=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),Kre=typeof Bn=="object"?Bn.fetch:window.fetch;class Qre{constructor(e,r,n=!1){this.address=e,this.url=r,this.appendSuffix=n,this.guard=void 0,this.guard=new Gre(r,Kre)}async getAddress(){return this.address}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}async sign(e,r){var n;if(!we.isWalletSignRequestMetadata(r))throw new Error("expected sequence signature request metadata");const i=r.guardTotpCode,s=sn.genericCoderFor(r.config.version),{encoded:o}=s.signature.encodeSigners(r.config,(n=r.parts)!=null?n:new Map,[],r.chainId);return(await this.guard.signWith({signer:this.address,request:{msg:le(e),auxData:this.packMsgAndSig(r.address,r.digest,o,r.chainId),chainId:te.from(r.chainId).toNumber()},token:i?{id:Oy.TOTP,token:i}:void 0})).sig}notifyStatusChange(e,r,n){}async getAuthMethods(e){let r;if("jwt"in e)r=await this.guard.authMethods({},{Authorization:`BEARER ${e.jwt}`});else{const n=await O6(e);r=await this.guard.authMethods({proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}return Ty({},r,{methods:r.methods.map(Yre)})}async setPin(e,r){const n=await Th(r);e===void 0?await this.guard.resetPIN({timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`}):await this.guard.setPIN({pin:e,timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`})}resetPin(e){return this.setPin(void 0,e)}async createTotp(e){const r=await Th(e),{uri:n}=await this.guard.createTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return new URL(n)}async commitTotp(e,r){const{codes:n}=await this.guard.commitTOTP({token:e},{Authorization:`BEARER ${r}`});return n}async resetTotp(e){const r=await Th(e);await this.guard.resetTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`})}async reset2fa(e,r){if("jwt"in r)await this.guard.reset2FA({code:e},{Authorization:`BEARER ${r.jwt}`});else{const n=await O6(r);await this.guard.reset2FA({code:e,proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}}async getRecoveryCodes(e){const r=await Th(e),{codes:n}=await this.guard.recoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}async resetRecoveryCodes(e){const r=await Th(e),{codes:n}=await this.guard.resetRecoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}packMsgAndSig(e,r,n,i){return _n.encode(["address","uint256","bytes","bytes"],[e,i,r,n])}suffix(){return this.appendSuffix?[3]:[]}}let Oy=function(t){return t.PIN="PIN",t.TOTP="TOTP",t}({});function Yre(t){switch(t){case Oy.PIN:case Oy.TOTP:return t;default:throw new Error(`unknown auth method '${t}'`)}}function lD(t){return"signerAddress"in t&&typeof t.signerAddress=="string"}async function O6(t){if(lD(t))return t;{const e=k6.isSapientSigner(t.signer)?t.signer:new k6.SignerWrapper(t.signer),r=await e.getAddress(),n=new Date,i=uD(t.walletAddress,n),s=sp(i);return{walletAddress:t.walletAddress,timestamp:n,signerAddress:r,signature:le(await e.sign(s,{}))}}}async function Th(t){if("wallet"in t){var e;const r=new Date,n=fD(r),i=await t.wallet.signTypedData(n.domain,n.types,n.message,(e=n.domain.chainId)!=null?e:1,"eip6492");return{jwt:t.jwt,timestamp:r,signature:i}}else return t}function uD(t,e){return{domain:dD,types:{AuthMethods:[{name:"wallet",type:"address"},{name:"timestamp",type:"string"}]},message:{wallet:Be(t),timestamp:hD(e)}}}function fD(t){return{domain:dD,types:{AuthUpdate:[{name:"timestamp",type:"string"}]},message:{timestamp:hD(t)}}}const dD={name:"Sequence Guard",version:"1",chainId:1};function hD(t){return t.toUTCString().replace("GMT","UTC")}const Jre=Object.freeze(Object.defineProperty({__proto__:null,AuthMethod:Oy,GuardSigner:Qre,getAuthUpdateProofTypedData:fD,getOwnershipProofTypedData:uD,isSignedOwnershipProof:lD,signOwnershipProof:O6},Symbol.toStringTag,{value:"Module"}));function Ry(){return Ry=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(n,i,s)=>{if(this.batchableJsonRpcMethods.find(o=>o===i.method)){this.queue.push({request:i,callback:s,next:n}),this.options.verbose&&console.log("Scheduling call",i.method),this.scheduleExecution();return}return this.options.verbose&&console.log("Forwarded call",i.method),n(i,s)},this.run=async function(){r.options.verbose&&console.log("Processing multicall");const n=Math.min(r.options.batchSize,r.queue.length);if(n===0){r.options.verbose&&console.log("Skip multicall, empty queue");return}if(n===1){r.forward(r.queue[0]),r.queue=[],r.options.verbose&&console.log("Skip multicall, single item");return}r.options.verbose&&console.log("Resolving",n);var a=r.queue.slice(0,n);r.queue=n===r.queue.length?[]:r.queue.slice(n),r.options.verbose&&console.log("Updated queue",r.queue.length),r.queue.length!==0&&(r.options.verbose&&console.log("Scheduling next batch"),r.scheduleExecution());const i=a[0].next;let s;var[a,c]=xk(a,h=>{try{if(h.next!==i)return!1;switch(h.request.method){case Fr.ethCall:if(h.request.params[0].from||h.request.params[0].gasPrice||h.request.params[0].value)return!1;case Fr.ethGetBalance:case Fr.ethGetCode:const p=Zre(h.request.params[1]);if(s===void 0&&(s=p),!ene(p,s))return!1}return!0}catch{return!1}});if(c.length!==0&&(r.options.verbose&&console.log("Forwarding incompatible calls",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls are incompatible");return}let o=a.map(h=>{try{switch(h.request.method){case Fr.ethCall:return{delegateCall:!1,revertOnError:!1,target:h.request.params[0].to,data:h.request.params[0].data,gasLimit:h.request.params[0].gas?h.request.params[0].gas:0,value:0};case Fr.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callCode"),[h.request.params[0]])};case Fr.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callBalanceOf"),[h.request.params[0]])};default:return null}}catch{return null}});var[a,c]=xk(a,(h,p)=>o[p]!==void 0);if(o=o.filter(h=>h),c.length!==0&&(r.options.verbose&&console.log("Forwarding calls on error",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls had encoding errors");return}let l;try{r.options.verbose&&console.log("Encoding multicall"),l=r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("multiCall"),[o])}catch(h){r.options.verbose&&console.warn("Error encoding multicall, forwarding one by one",h),r.forward(a);return}const u=XE(),f=await Xre(JE(i)({id:u,jsonrpc:vd,method:Fr.ethCall,params:[{to:r.options.contract,value:0,data:l},te.isBigNumber(s)?s.toNumber():s]}),h=>({jsonrpc:vd,id:u,result:void 0,error:h}));if(f.error)return r.options.verbose&&console.warn("Error calling multicall, forwarding one by one",f.error),r.forward(a);let d;try{d=r.multicallInterface.decodeFunctionResult(r.multicallInterface.getFunction("multiCall"),f.result)}catch(h){r.options.verbose&&console.warn("Error decoding multicall result, forwarding one by one",h),r.forward(a);return}r.options.verbose&&console.log("Got response for",a.length),a.forEach((h,p)=>{if(!d[0][p])r.options.verbose&&console.warn(`Multicall error for ${h.request.method} not found`),r.forward(h);else switch(h.request.method){case Fr.ethCall:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:d[1][p]});break;case Fr.ethGetCode:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:_n.decode(["bytes"],d[1][p])[0]});break;case Fr.ethGetBalance:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:_n.decode(["uint256"],d[1][p])[0]});break}})},this.options=e?Ry({},es.DefaultOptions,e):es.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach(r=>r.next(r.request,r.callback)):e.next(e.request,e.callback)}static isMulticall(e){return e&&e.handle!==void 0&&e.conf!==void 0&&es.isMulticallOptions(e.options)}static isMulticallOptions(e){return e!==void 0&&e.batchSize!==void 0&&e.timeWindow!==void 0&&e.contract!==void 0}}es.DefaultOptions=Ry({},tne);const pD=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];class rne extends hb{constructor(e,r){var n;super(e.getNetwork()),n=this,this.provider=e,this.multicall=void 0,this.getResolver=async function(i){const s=n.provider;if(s.getResolver){const o=await s.getResolver(await i);return o?new a6(n,o.address,o.name):null}return s.getResolver(await i)},this.next=async function(i,s){try{switch(i.method){case Fr.ethCall:n.callback(i,s,await n.provider.call(i.params[0],i.params[1]));break;case Fr.ethGetCode:n.callback(i,s,await n.provider.getCode(i.params[0],i.params[1]));break;case Fr.ethGetBalance:n.callback(i,s,await n.provider.getBalance(i.params[0],i.params[1]));break}}catch(o){n.callback(i,s,void 0,o)}},this.listenerCount=e.listenerCount.bind(e),this.multicall=es.isMulticall(r)?r:new es(r),pD.forEach(i=>{e[i]!==void 0&&(this[i]=(...s)=>e[i](...s))})}callback(e,r,n,i){r(i,{jsonrpc:vd,id:e.id,result:n,error:i})}async call(e,r){return this.rpcCall(Fr.ethCall,e,r)}async getCode(e,r){return this.rpcCall(Fr.ethGetCode,e,r)}async getBalance(e,r){return this.rpcCall(Fr.ethGetBalance,e,r)}async rpcCall(e,...r){const n=XE();return(await JE(this.multicall.handle)(this.next,{jsonrpc:vd,id:n,method:e,params:r})).result}}class nne{constructor(e,r){if(this.provider=e,this.multicall=void 0,this.multicall=es.isMulticall(r)?r:new es(r),e.send){const n=async function(s,o){e.send(s,o)};this.send=(i,s)=>{this.multicall.handle(n,i,s)}}if(e.sendAsync){const n=async function(s,o){e.sendAsync(s,o)};this.sendAsync=(i,s)=>{this.multicall.handle(n,i,s)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}}const ine=t=>e=>{const r=es.isMulticall(t)?t:new es(t);return(n,i)=>r.handle(e,n,i)};var sne=Object.freeze({__proto__:null,ProxyMethods:pD,MulticallProvider:rne,MulticallExternalProvider:nne,multicallMiddleware:ine});const one=Object.freeze(Object.defineProperty({__proto__:null,Multicall:es,providers:sne},Symbol.toStringTag,{value:"Module"}));var mD={exports:{}};(function(t,e){(function(r){var n=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(O){return Object.prototype.toString.call(O)==="[object Array]"},s=10,o=typeof nn=="object"&&typeof nn.nextTick=="function",a=typeof Symbol=="function",c=typeof Reflect=="object",l=typeof setImmediate=="function",u=l?setImmediate:setTimeout,f=a?c&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(A){var O=Object.getOwnPropertyNames(A);return O.push.apply(O,Object.getOwnPropertySymbols(A)),O}:Object.keys;function d(){this._events={},this._conf&&h.call(this,this._conf)}function h(A){A&&(this._conf=A,A.delimiter&&(this.delimiter=A.delimiter),A.maxListeners!==r&&(this._maxListeners=A.maxListeners),A.wildcard&&(this.wildcard=A.wildcard),A.newListener&&(this._newListener=A.newListener),A.removeListener&&(this._removeListener=A.removeListener),A.verboseMemoryLeak&&(this.verboseMemoryLeak=A.verboseMemoryLeak),A.ignoreErrors&&(this.ignoreErrors=A.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function p(A,O){var B="(node) warning: possible EventEmitter memory leak detected. "+A+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(B+=" Event name: "+O+"."),typeof nn<"u"&&nn.emitWarning){var I=new Error(B);I.name="MaxListenersExceededWarning",I.emitter=this,I.count=A,nn.emitWarning(I)}else console.error(B),console.trace&&console.trace()}var m=function(A,O,B){var I=arguments.length;switch(I){case 0:return[];case 1:return[A];case 2:return[A,O];case 3:return[A,O,B];default:for(var C=new Array(I);I--;)C[I]=arguments[I];return C}};function v(A,O){for(var B={},I,C=A.length,D=O?O.length:0,z=0;z0;)A=D[W],z.call(_,A,B[A]);this._listeners={},this._listenersCount=0,G()}}});function b(A,O,B,I){var C=Object.assign({},O);if(!A)return C;if(typeof A!="object")throw TypeError("options must be an object");var D=Object.keys(A),z=D.length,_,W,G;function J(se){throw Error('Invalid "'+_+'" option value'+(se?". Reason: "+se:""))}for(var ee=0;ee0;)if(_===A[W])return D;z(O)}}var P=S(["function"]),M=S(["object","function"]);function L(A,O,B){var I,C,D=0,z,_=new A(function(W,G,J){B=b(B,{timeout:0,overload:!1},{timeout:function(oe,be){return oe*=1,(typeof oe!="number"||oe<0||!Number.isFinite(oe))&&be("timeout must be a positive number"),oe}}),I=!B.overload&&typeof A.prototype.cancel=="function"&&typeof J=="function";function ee(){C&&(C=null),D&&(clearTimeout(D),D=0)}var se=function(oe){ee(),W(oe)},ie=function(oe){ee(),G(oe)};I?O(se,ie,J):(C=[function(oe){ie(oe||Error("canceled"))}],O(se,ie,function(oe){if(z)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof oe!="function")throw TypeError("onCancel callback must be a function");C.push(oe)}),z=!0),B.timeout>0&&(D=setTimeout(function(){var oe=Error("timeout");oe.code="ETIMEDOUT",D=0,_.cancel(oe),G(oe)},B.timeout))});return I||(_.cancel=function(W){if(C){for(var G=C.length,J=1;J0;)ie=Ee[_],ie!=="_listeners"&&(Ue=H(A,O,B[ie],I+1,C),Ue&&(se?se.push.apply(se,Ue):se=Ue));return se}else if($e==="**"){for(ve=I+1===C||I+2===C&&ge==="*",ve&&B._listeners&&(se=H(A,O,B,C,C)),Ee=f(B),_=Ee.length;_-- >0;)ie=Ee[_],ie!=="_listeners"&&(ie==="*"||ie==="**"?(B[ie]._listeners&&!ve&&(Ue=H(A,O,B[ie],C,C),Ue&&(se?se.push.apply(se,Ue):se=Ue)),Ue=H(A,O,B[ie],I,C)):ie===ge?Ue=H(A,O,B[ie],I+2,C):Ue=H(A,O,B[ie],I,C),Ue&&(se?se.push.apply(se,Ue):se=Ue));return se}else B[$e]&&(se=H(A,O,B[$e],I+1,C));if(oe=B["*"],oe&&H(A,O,oe,I+1,C),be=B["**"],be)if(I0;)ie=Ee[_],ie!=="_listeners"&&(ie===ge?H(A,O,be[ie],I+2,C):ie===$e?H(A,O,be[ie],I+1,C):(he={},he[ie]=be[ie],H(A,O,{"**":he},I+1,C)));else be._listeners?H(A,O,be,C,C):be["*"]&&be["*"]._listeners&&H(A,O,be["*"],C,C);return se}function K(A,O,B){var I=0,C=0,D,z=this.delimiter,_=z.length,W;if(typeof A=="string")if((D=A.indexOf(z))!==-1){W=new Array(5);do W[I++]=A.slice(C,D),C=D+_;while((D=A.indexOf(z,C))!==-1);W[I++]=A.slice(C)}else W=[A],I=1;else W=A,I=A.length;if(I>1){for(D=0;D+10&&G._listeners.length>this._maxListeners&&(G._listeners.warned=!0,p.call(this,G._listeners.length,J))):G._listeners=O,!0;return!0}function Q(A,O,B,I){for(var C=f(A),D=C.length,z,_,W,G=A._listeners,J;D-- >0;)_=C[D],z=A[_],_==="_listeners"?W=B:W=B?B.concat(_):[_],J=I||typeof _=="symbol",G&&O.push(J?W:W.join(this.delimiter)),typeof z=="object"&&Q.call(this,z,O,W,J);return O}function Y(A){for(var O=f(A),B=O.length,I,C,D;B-- >0;)C=O[B],I=A[C],I&&(D=!0,C!=="_listeners"&&!Y(I)&&delete A[C]);return D}function F(A,O,B){this.emitter=A,this.event=O,this.listener=B}F.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function w(A,O,B){if(B===!0)C=!0;else if(B===!1)I=!0;else{if(!B||typeof B!="object")throw TypeError("options should be an object or true");var I=B.async,C=B.promisify,D=B.nextTick,z=B.objectify}if(I||D||C){var _=O,W=O._origin||O;if(D&&!o)throw Error("process.nextTick is not supported");C===r&&(C=O.constructor.name==="AsyncFunction"),O=function(){var G=arguments,J=this,ee=this.event;return C?D?Promise.resolve():new Promise(function(se){u(se)}).then(function(){return J.event=ee,_.apply(J,G)}):(D?nn.nextTick:u)(function(){J.event=ee,_.apply(J,G)})},O._async=!0,O._origin=W}return[O,z?new F(this,A,O):this]}function k(A){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,h.call(this,A)}k.EventEmitter2=k,k.prototype.listenTo=function(A,O,B){if(typeof A!="object")throw TypeError("target musts be an object");var I=this;B=b(B,{on:r,off:r,reducers:r},{on:P,off:P,reducers:M});function C(D){if(typeof D!="object")throw TypeError("events must be an object");var z=B.reducers,_=j.call(I,A),W;_===-1?W=new y(I,A,B):W=I._observers[_];for(var G=f(D),J=G.length,ee,se=typeof z=="function",ie=0;ie0;)C=B[I],(!A||C._target===A)&&(C.unsubscribe(O),D=!0);return D},k.prototype.delimiter=".",k.prototype.setMaxListeners=function(A){A!==r&&(this._maxListeners=A,this._conf||(this._conf={}),this._conf.maxListeners=A)},k.prototype.getMaxListeners=function(){return this._maxListeners},k.prototype.event="",k.prototype.once=function(A,O,B){return this._once(A,O,!1,B)},k.prototype.prependOnceListener=function(A,O,B){return this._once(A,O,!0,B)},k.prototype._once=function(A,O,B,I){return this._many(A,1,O,B,I)},k.prototype.many=function(A,O,B,I){return this._many(A,O,B,!1,I)},k.prototype.prependMany=function(A,O,B,I){return this._many(A,O,B,!0,I)},k.prototype._many=function(A,O,B,I,C){var D=this;if(typeof B!="function")throw new Error("many only accepts instances of Function");function z(){return--O===0&&D.off(A,z),B.apply(this,arguments)}return z._origin=B,this._on(A,z,I,C)},k.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var A=arguments[0],O,B=this.wildcard,I,C,D,z,_;if(A==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(B&&(O=A,A!=="newListener"&&A!=="removeListener"&&typeof A=="object")){if(C=A.length,a){for(D=0;D3)for(I=new Array(W-1),z=1;z3)for(C=new Array(G-1),_=1;_0&&this._events[A].length>this._maxListeners&&(this._events[A].warned=!0,p.call(this,this._events[A].length,A))):this._events[A]=O,C)},k.prototype.off=function(A,O){if(typeof O!="function")throw new Error("removeListener only takes instances of Function");var B,I=[];if(this.wildcard){var C=typeof A=="string"?A.split(this.delimiter):A.slice();if(I=H.call(this,null,C,this.listenerTree,0),!I)return this}else{if(!this._events[A])return this;B=this._events[A],I.push({_listeners:B})}for(var D=0;D0){for(I=this._all,O=0,B=I.length;O0;)I=O[B[D]],typeof I=="function"?C.push(I):C.push.apply(C,I);return C}else{if(this.wildcard){if(z=this.listenerTree,!z)return[];var _=[],W=typeof A=="string"?A.split(this.delimiter):A.slice();return H.call(this,_,W,z,0),_}return O?(I=O[A],I?typeof I=="function"?[I]:I:[]):[]}},k.prototype.eventNames=function(A){var O=this._events;return this.wildcard?Q.call(this,this.listenerTree,[],null,A):O?f(O):[]},k.prototype.listenerCount=function(A){return this.listeners(A).length},k.prototype.hasListeners=function(A){if(this.wildcard){var O=[],B=typeof A=="string"?A.split(this.delimiter):A.slice();return H.call(this,O,B,this.listenerTree,0),O.length>0}var I=this._events,C=this._all;return!!(C&&C.length||I&&(A===r?f(I).length:I[A]))},k.prototype.listenersAny=function(){return this._all?this._all:[]},k.prototype.waitFor=function(A,O){var B=this,I=typeof O;return I==="number"?O={timeout:O}:I==="function"&&(O={filter:O}),O=b(O,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:P,Promise:E}),L(O.Promise,function(C,D,z){function _(){var W=O.filter;if(!(W&&!W.apply(B,arguments)))if(B.off(A,_),O.handleError){var G=arguments[0];G?D(G):C(m.apply(null,arguments).slice(1))}else C(m.apply(null,arguments))}z(function(){B.off(A,_)}),B._on(A,_,!1)},{timeout:O.timeout,overload:O.overload})};function R(A,O,B){B=b(B,{Promise,timeout:0,overload:!1},{Promise:E});var I=B.Promise;return L(I,function(C,D,z){var _;if(typeof A.addEventListener=="function"){_=function(){C(m.apply(null,arguments))},z(function(){A.removeEventListener(O,_)}),A.addEventListener(O,_,{once:!0});return}var W=function(){G&&A.removeListener("error",G),C(m.apply(null,arguments))},G;O!=="error"&&(G=function(J){A.removeListener(O,W),D(J)},A.once("error",G)),z(function(){G&&A.removeListener("error",G),A.removeListener(O,W)}),A.once(O,W)},{timeout:B.timeout,overload:B.overload})}var N=k.prototype;Object.defineProperties(k,{defaultMaxListeners:{get:function(){return N._maxListeners},set:function(A){if(typeof A!="number"||A<0||Number.isNaN(A))throw TypeError("n must be a non-negative number");N._maxListeners=A},enumerable:!0},once:{value:R,writable:!0,configurable:!0}}),Object.defineProperties(N,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof r=="function"&&r.amd?r(function(){return k}):t.exports=k})()})(mD);var Cb=mD.exports;function ane(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function cne(t,...e){if(!ane(t))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function wk(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function lne(t,e){cne(t);const r=e.outputLen;if(t.lengthnew DataView(t.buffer,t.byteOffset,t.byteLength),Vs=(t,e)=>t<<32-e|t>>>e,une=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!une)throw new Error("Non little-endian hardware is not supported");const fne=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function dne(t){if(!vD(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rt().update(yD(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function vne(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}class yne extends pne{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Jx(this.buffer)}update(e){wk(this);const{view:r,buffer:n,blockLen:i}=this;e=yD(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&r,bne=(t,e,r)=>t&e^t&r^e&r,xne=new Uint32Array([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]),Ka=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qa=new Uint32Array(64);class wne extends yne{constructor(){super(64,32,8,!1),this.A=Ka[0]|0,this.B=Ka[1]|0,this.C=Ka[2]|0,this.D=Ka[3]|0,this.E=Ka[4]|0,this.F=Ka[5]|0,this.G=Ka[6]|0,this.H=Ka[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)Qa[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){const d=Qa[f-15],h=Qa[f-2],p=Vs(d,7)^Vs(d,18)^d>>>3,m=Vs(h,17)^Vs(h,19)^h>>>10;Qa[f]=m+Qa[f-7]+p+Qa[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let f=0;f<64;f++){const d=Vs(a,6)^Vs(a,11)^Vs(a,25),h=u+d+gne(a,c,l)+xne[f]+Qa[f]|0,m=(Vs(n,2)^Vs(n,13)^Vs(n,22))+bne(n,i,s)|0;u=l,l=c,c=a,a=o+h|0,o=s,s=i,i=n,n=h+m|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,l,u)}roundClean(){Qa.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Ene=mne(()=>new wne);var Cne=class{constructor(t,e){ct(this,"hostname");ct(this,"fetch");ct(this,"path","/rpc/Databeat/");ct(this,"ping",(t,e)=>this.fetch(this.url("Ping"),Oh({},t,e)).then(r=>Rh(r).then(n=>({status:n.status})),r=>{throw uf.new({cause:`fetch(): ${r.message||""}`})}));ct(this,"version",(t,e)=>this.fetch(this.url("Version"),Oh({},t,e)).then(r=>Rh(r).then(n=>({version:n.version})),r=>{throw uf.new({cause:`fetch(): ${r.message||""}`})}));ct(this,"runtimeStatus",(t,e)=>this.fetch(this.url("RuntimeStatus"),Oh({},t,e)).then(r=>Rh(r).then(n=>({status:n.status})),r=>{throw uf.new({cause:`fetch(): ${r.message||""}`})}));ct(this,"tick",(t,e,r)=>this.fetch(this.url("Tick"),Oh(t,e,r)).then(n=>Rh(n).then(i=>({ok:i.ok})),n=>{throw uf.new({cause:`fetch(): ${n.message||""}`})}));ct(this,"rawEvents",(t,e,r)=>this.fetch(this.url("RawEvents"),Oh(t,e,r)).then(n=>Rh(n).then(i=>({ok:i.ok})),n=>{throw uf.new({cause:`fetch(): ${n.message||""}`})}));this.hostname=t,this.fetch=(r,n)=>e(r,n)}url(t){return this.hostname+this.path+t}},Oh=(t={},e={},r=null)=>({method:"POST",headers:{...e,"Content-Type":"application/json"},body:JSON.stringify(t||{}),signal:r}),Rh=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),SD.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(Fne[n]||Vr).new(r)}return r}),Vr=class gD extends Error{constructor(r,n,i,s,o){super(i);ct(this,"name");ct(this,"code");ct(this,"message");ct(this,"status");ct(this,"cause");ct(this,"msg");this.name=r||"WebrpcError",this.code=typeof n=="number"?n:0,this.message=i||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof s=="number"?s:0,this.cause=o,Object.setPrototypeOf(this,gD.prototype)}static new(r){return new this(r.error,r.code,r.message||r.msg,r.status,r.cause)}},Sne=class bD extends Vr{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,bD.prototype)}},uf=class xD extends Vr{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,xD.prototype)}},kne=class wD extends Vr{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,wD.prototype)}},Ane=class ED extends Vr{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,ED.prototype)}},_ne=class CD extends Vr{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,CD.prototype)}},SD=class kD extends Vr{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,kD.prototype)}},Pne=class AD extends Vr{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,AD.prototype)}},Ine=class _D extends Vr{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,_D.prototype)}},Tne=class PD extends Vr{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,PD.prototype)}},One=class ID extends Vr{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,ID.prototype)}},Rne=class TD extends Vr{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,TD.prototype)}},$ne=class OD extends Vr{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,OD.prototype)}},Mne=class RD extends Vr{constructor(e="PermissionDenied",r=2e3,n="Permission denied",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,RD.prototype)}},Nne=class $D extends Vr{constructor(e="SessionExpired",r=2001,n="Session expired",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,$D.prototype)}},Dne=class MD extends Vr{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,MD.prototype)}},Lne=class ND extends Vr{constructor(e="InvalidAppKey",r=4e3,n="Invalid app key",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,ND.prototype)}},jne=class DD extends Vr{constructor(e="QueryFailed",r=4001,n="DB query failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,DD.prototype)}},Bne=class LD extends Vr{constructor(e="InvalidProjectId",r=4002,n="Invalid project id",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,LD.prototype)}},Fne={0:Sne,[-1]:uf,[-2]:kne,[-3]:Ane,[-4]:_ne,[-5]:SD,[-6]:Pne,[-7]:Ine,[-8]:Tne,[-9]:One,[-10]:Rne,1e3:$ne,2e3:Mne,2001:Nne,3e3:Dne,4e3:Lne,4001:jne,4002:Bne},Une=class extends Cne{constructor(e,r){const n=typeof Bn=="object"?Bn.fetch.bind(Bn):window.fetch.bind(window);super(e.endsWith("/")?e.slice(0,-1):e,n);ct(this,"_globalFetch");ct(this,"_fetch",(e,r)=>{var n;if(this.auth){let i={};((n=this.auth.jwt)==null?void 0:n.length)>0&&(i.Authorization=`BEARER ${this.auth.jwt}`),this.auth.headers&&(i={...i,...this.auth.headers}),r.headers={...r.headers,...i}}return this._globalFetch(e,r)});this.auth=r,this._globalFetch=n,this.fetch=this._fetch}},Ek=150,Sl={defaultEnabled:!0,noop:!1,privacy:{userIdHash:!0,userAgentSalt:!1},userIdentTracking:!1,strictMode:!1,flushInterval:500,initProps:()=>({})},zne=class{constructor(t,e,r){ct(this,"rpc");ct(this,"auth");ct(this,"options");ct(this,"enabled");ct(this,"ident");ct(this,"userId");ct(this,"sessionId");ct(this,"allowUserTracking");ct(this,"projectId");ct(this,"queue");ct(this,"flushTimeout");ct(this,"defaultProps");ct(this,"previousPageKey");ct(this,"ts");ct(this,"flush",async()=>{if(this.flushTimeout!==null&&(clearTimeout(this.flushTimeout),this.flushTimeout=null),!this.enabled||this.options.noop||this.options.strictMode&&!this.allowUserTracking||this.queue.length===0)return;const t=this.dedupedQueue();this.queue=[];try{await this.rpc.tick({events:t})}catch(e){console.warn(`databeat flush failed: ${e}`)}});ct(this,"dedupedQueue",()=>{const t=new Map;for(let e=0;eEk&&(this.queue=this.queue.splice(this.queue.length-Ek)),this.enabled&&(e&&e.flush?await this.flush():this.flushTimeout===null&&(this.flushTimeout=setTimeout(()=>{this.flush()},this.options.flushInterval)))}trackView(t={}){const e={...this.defaultProps,...t},r=Sk(),n=`${r}:${JSON.stringify(e)}:${this.userId}:${this.sessionId}`;this.previousPageKey!==n&&(this.previousPageKey=n,this.track({event:"VIEW",source:r,props:e}))}isEnabled(){return this.enabled}isAnon(){return this.ident===0}getIdent(){return this.ident}getUserId(){return this.userId}getSessionId(){return this.sessionId}getStorageTS(){if(this.ts)return this.ts;const t=R6();if(!(t==null||t.id===null))return this.ts=t.ts,this.ts}enable(){if(!jD(this.auth)){this.enabled=!1;return}Zo()&&(this.enabled=!0,this.ts=Vu({on:this.enabled,id:this.userId,it:this.ident,ut:this.allowUserTracking}),this.identify())}disable(){Zo()&&(this.enabled=!1,this.ts=Vu({on:this.enabled,id:this.userId,it:this.ident,ut:this.allowUserTracking}))}},Zo=()=>typeof window=="object"&&typeof window.localStorage=="object"&&typeof window.localStorage.getItem=="function"&&typeof window.localStorage.setItem=="function",Ck=(t,e)=>{if(!jD(e))return!1;if(!Zo())return!0;const r=R6();return r===null?t??!0:r.on},jD=t=>{var e;return!!(((e=t==null?void 0:t.jwt)==null?void 0:e.length)>0||t!=null&&t.headers&&Object.keys(t.headers).length>0)},Sk=()=>{try{return window.location.pathname}catch{return""}},qne=()=>{if(!Zo())return{};const t=new URL(window.location.href).searchParams,e={};return e.origin=window.location.origin,t.get("ref")&&t.get("ref")!==""&&(e.ref=t.get("ref")||""),t.get("source")&&t.get("source")!==""&&(e.source=t.get("source")||""),t.get("utm_source")&&t.get("utm_source")!==""&&(e.utmSource=t.get("utm_source")||""),t.get("utm_campaign")&&t.get("utm_campaign")!==""&&(e.utmCampaign=t.get("utm_campaign")||""),t.get("utm_medium")&&t.get("utm_medium")!==""&&(e.utmMedium=t.get("utm_medium")||""),t.get("utm_content")&&t.get("utm_content")!==""&&(e.utmContent=t.get("utm_content")||""),t.get("utm_term")&&t.get("utm_term")!==""&&(e.utmTerm=t.get("utm_term")||""),document.referrer&&document.referrer!==""&&(e.referrer=document.referrer),t.get("gclid")&&t.get("gclid")!==""&&(e.gclid=t.get("gclid")||""),e},$y="_dbeat",R6=()=>{try{return JSON.parse(window.localStorage.getItem($y))}catch{return null}},Vu=t=>{try{return t.ts||(t.ts=Math.floor(Date.now()/1e3)),window.localStorage.setItem($y,JSON.stringify(t)),t.ts}catch{return}},Wne=(t,e,r)=>{if(!t||t===null||t==="")return{userId:`${Math.floor(Math.random()*1e14)}`,ident:0};if(r.userIdentTracking&&e)return{userId:t,ident:2};if(r.privacy.userIdHash===!0||!r.userIdentTracking||!e)return Zo()&&r.privacy.userAgentSalt===!0&&(t=t+":"+navigator.userAgent),r.privacy.extraSalt&&r.privacy.extraSalt.length>0&&(t=t+":"+r.privacy.extraSalt),{userId:dne(Ene(t)).substring(0,50),ident:1};throw new Error("invalid configuration")},Hne=()=>{if(Zo()&&typeof window.sessionStorage=="object"&&typeof window.sessionStorage.getItem=="function"&&typeof window.sessionStorage.setItem=="function"){const e=window.sessionStorage.getItem($y);if(e&&e.length>0)return e;{const r=kk(16);return window.sessionStorage.setItem($y,r),r}}else return kk(16)},kk=t=>{let e="";for(let r=0;r++Vne;class fp{constructor(){var e=this;this.pendingMessageRequests=[],this.responseCallbacks=new Map,this.state=void 0,this.confirmationOnly=!1,this.events=new Cb.EventEmitter2,this.openPayload=void 0,this.connectPayload=void 0,this.accountsChangedPayload=void 0,this.networksPayload=void 0,this.walletContextPayload=void 0,this._sessionId=void 0,this._init=void 0,this._registered=void 0,this.sendAsync=async function(r,n,i){e.state===Ui.CLOSED&&(e.confirmationOnly=!0),e.openWallet(void 0,{type:"jsonRpcRequest",method:r.method},i);try{e.isOpened()||await e.waitUntilOpened();const s=await e.sendMessageRequest({idx:zD(),type:tt.MESSAGE,data:r,chainId:i});n(void 0,s.data)}catch(s){n(s)}},this.sendMessageRequest=async function(r){return new Promise((n,i)=>{(!r.idx||r.idx<=0)&&r.type!=="init"&&i(new Error("message idx not set"));const s=(a,c)=>{if(a)i(a);else if(c)n(c);else throw new Error("no valid response to return")},o=r.idx;e.responseCallbacks.get(o)?i(new Error("duplicate message idx, should never happen")):e.responseCallbacks.set(o,s),e.isOpened()?e.sendMessage(r):(Se.debug("pushing to pending requests",r),e.pendingMessageRequests.push(r))})},this.waitUntilOpened=async function(r=kC){let n=!1;return Promise.race([new Promise((i,s)=>{const o=setTimeout(()=>{clearTimeout(o),n||(e.state=Ui.CLOSED,e.events.emit("close",{code:1005,message:"opening wallet timed out"})),s(new Error("opening wallet timed out"))},r)}),new Promise(i=>{if(e.isOpened()){var s;n=!0,i((s=e.openPayload)==null?void 0:s.session);return}e.events.once("open",o=>{e.openPayload=o,n=!0,i(o.session)})})])},this.waitUntilConnected=async function(){await e.waitUntilOpened();const r=new Promise(i=>{if(e.connectPayload){i(e.connectPayload);return}e.events.once("connect",s=>{e.connectPayload=s,i(s)})}),n=new Promise((i,s)=>{e.events.once("close",o=>{s(o?new Error(`wallet closed due to ${JSON.stringify(o)}`):new Error("user closed the wallet"))})});return Promise.race([r,n])},this.state=Ui.CLOSED,this._registered=!1,this._init=tr.NIL}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}openWallet(e,r,n){throw new Error("abstract method")}closeWallet(){throw new Error("abstract method")}isOpened(){return this.registered&&this.state===Ui.OPENED}isConnected(){var e;const r=(e=this.openPayload)==null?void 0:e.session;return this.registered&&r!==void 0&&!!r.accountAddress&&r.accountAddress.length===42&&!!r.networks&&r.networks.length>0}handleMessage(e){var r=this;if(e.type===tt.INIT){Se.debug("MessageProvider, received INIT message",e);const{nonce:c}=e.data;if(!c||c.length==0){Se.error("invalid init nonce");return}this._init=tr.OK,this.sendMessage({idx:-1,type:tt.INIT,data:{sessionId:this._sessionId,nonce:c}})}if(this._init!==tr.OK)return;Se.debug("RECEIVED MESSAGE FROM WALLET",e.idx,e);const n=e.idx,i=this.responseCallbacks.get(n);if(n&&this.responseCallbacks.delete(n),e.type===tt.OPEN&&!this.isOpened()){var s,o;if(this._sessionId&&this._sessionId!==((s=e.data)==null?void 0:s.sessionId)){Se.debug("open event received from wallet, but does not match sessionId",this._sessionId);return}if((o=e.data)!=null&&o.error){var a;const c=new Error(`opening wallet failed: received ${(a=e.data)==null?void 0:a.error}`);throw Se.error(c),this.close(),c}this.state=Ui.OPENED,this.openPayload=e.data,this.events.emit("open",this.openPayload),this.pendingMessageRequests.length!==0&&this.pendingMessageRequests.splice(0,this.pendingMessageRequests.length).forEach(async function(l){r.sendMessage(l)});return}if(e.type===tt.MESSAGE){if(this.confirmationOnly&&setTimeout(()=>{this.responseCallbacks.size===0&&this.closeWallet()},500),!i)throw new Error("impossible state");if(i){this.events.emit("message",e),i(e.data.error,e);return}}if(e.type===tt.ACCOUNTS_CHANGED){this.accountsChangedPayload={accounts:[]},e.data&&e.data.length>0?(this.accountsChangedPayload={accounts:[Be(e.data[0])],origin:e.origin},this.events.emit("accountsChanged",this.accountsChangedPayload.accounts,this.accountsChangedPayload.origin)):this.events.emit("accountsChanged",[],e.origin);return}if(e.type===tt.CHAIN_CHANGED){this.events.emit("chainChanged",e.data,e.origin);return}if(e.type===tt.NETWORKS){this.networksPayload=e.data,this.events.emit("networks",this.networksPayload);return}if(e.type===tt.WALLET_CONTEXT){this.walletContextPayload=e.data,this.events.emit("walletContext",this.walletContextPayload);return}e.type===tt.CLOSE&&this.state!==Ui.CLOSED&&this.close(e.data),e.type===tt.CONNECT&&(this.connectPayload=e.data,this.events.emit("connect",this.connectPayload)),e.type===tt.DISCONNECT&&this.isConnected()&&(this.events.emit("disconnect",e.data,e.origin),this.close())}sendMessage(e){throw new Error("abstract method")}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}emit(e,...r){return this.events.emit(e,...r)}close(e){this.state!==Ui.CLOSED&&(this.state=Ui.CLOSED,this.confirmationOnly=!1,this._sessionId=void 0,Se.info("closing wallet and flushing!"),this.pendingMessageRequests.length=0,this.responseCallbacks.forEach(r=>{r(ei({},new Error("wallet closed"),{code:4001}))}),this.responseCallbacks.clear(),this.connectPayload=void 0,this.openPayload=void 0,this.accountsChangedPayload=void 0,this.networksPayload=void 0,this.walletContextPayload=void 0,this.events.emit("close",e))}}function Gne(t){return Kne.some(e=>e.predicate(t))}const Kne=[{name:"Decentraland Exception",predicate:Yne},{name:"0x v3 Exception",predicate:Jne}],Qne=/^Decentraland Login\nEphemeral address: 0x[a-fA-F0-9]{40}\nExpiration: (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/;function Yne(t){try{const e=cs(t);return Qne.test(e)}catch{return!1}}function Jne(t){const e=new wr(Xne);try{return e.decodeFunctionData("OrderWithHash",t),!0}catch{return!1}}const Xne=[{inputs:[{components:[{internalType:"address",name:"makerAddress",type:"address"},{internalType:"address",name:"takerAddress",type:"address"},{internalType:"address",name:"feeRecipientAddress",type:"address"},{internalType:"address",name:"senderAddress",type:"address"},{internalType:"uint256",name:"makerAssetAmount",type:"uint256"},{internalType:"uint256",name:"takerAssetAmount",type:"uint256"},{internalType:"uint256",name:"makerFee",type:"uint256"},{internalType:"uint256",name:"takerFee",type:"uint256"},{internalType:"uint256",name:"expirationTimeSeconds",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes",name:"makerAssetData",type:"bytes"},{internalType:"bytes",name:"takerAssetData",type:"bytes"},{internalType:"bytes",name:"makerFeeAssetData",type:"bytes"},{internalType:"bytes",name:"takerFeeAssetData",type:"bytes"}],internalType:"struct IEIP1271Data.Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderWithHash",outputs:[],stateMutability:"pure",type:"function"}],vv=St(`Ethereum Signed Message: -`),AC=t=>Ds(t)?fe(t):St(t),Sb=t=>{const e=AC(t);return Gne(e)?e:wt([vv,St(String(e.length)),e])},Zne=t=>{if(JSON.stringify(t.slice(0,vv.length))!==JSON.stringify(vv))return t;const e=t.slice(vv.length),r=String(e.length).length;let n,i;try{i=Number(cs(e.slice(0,r)))}catch{i=Number(le(e.slice(0,r)))}return i>e.length||!Number.isInteger(i)?n=r-1:n=r,e.slice(n)},gd=async(t,e,r,n)=>new we.reader.OnChainReader(n).isValidSignature(t,e,r),qD=async(t,e,r,n)=>{const i=Sb(e),s=YE(i);return gd(t,s,r,n)},WD=(t,e,r,n)=>gd(t,sp(e),r,n),My=()=>window.location.protocol==="chrome-extension:"||window.location.protocol==="moz-extension:",HD=()=>!!navigator.userAgent.match(/UnitySequence/i),VD=t=>t.onChain.deployed&&t.fullyMigrated;class GD{constructor(){this.callbacks=[],this.store={}}getItem(e){return this.store[e]||null}setItem(e,r){this.store[e]=r,this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){delete this.store[e]}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}class u1{static isAvailable(){return typeof window=="object"&&typeof window.localStorage=="object"}constructor(){if(this.callbacks=[],!u1.isAvailable())throw new Error("LocalStorage is not available");window.addEventListener("storage",e=>{const{key:r}=e;this.callbacks.filter(i=>i.key===r).forEach(i=>i.cb(this.getItem(r)))})}getItem(e){return window.localStorage.getItem(e)}setItem(e,r){window.localStorage.setItem(e,r),this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){window.localStorage.removeItem(e),this.callbacks.filter(r=>r.key===e).forEach(r=>r.cb(null))}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}function Ny(){return u1.isAvailable()?new u1:new GD}async function KD(t){return Array.isArray(t)?Promise.all(t.map(e=>At(e))):At(t)}const Ak="@sequence.transportSession";class dp{constructor(e){var r=this;this.walletRequestHandler=void 0,this._sessionId=void 0,this._registered=void 0,this._init=void 0,this._initNonce=void 0,this._initCallback=void 0,this.appOrigin=void 0,this.sendAsync=async function(n,i,s){throw new Error("abstract method")},this.handleMessage=async function(n){const i=n;if(r._init!==tr.OK){if(i.type===tt.INIT)if(r.isValidInitAck(n))r._initCallback&&r._initCallback();else{r._initCallback&&r._initCallback("invalid init");return}return}switch(i.type){case tt.OPEN:{if(r._init!==tr.OK)return;const s={sessionId:i.data.sessionId,intent:i.data.intent,networkId:i.data.networkId};await r.open(s);return}case tt.CLOSE:return r._init!==tr.OK,void 0;case tt.MESSAGE:{const s=await r.walletRequestHandler.sendMessageRequest(i);r.sendMessage(s),s.data.error;return}default:Se.error(`unexpected payload type ${i.type}`)}},this.sendMessageRequest=async function(n){return r.walletRequestHandler.sendMessageRequest(n)},this.open=async function({sessionId:n,intent:i,networkId:s}){n&&(r._sessionId=DM(n),r.saveTransportSession({sessionId:n,intent:i,networkId:s})),r.walletRequestHandler.setOpenIntent(i),await r.init();let o;try{if(s){const a=eC(s);if(a)o=a.chainId;else throw new Error(`unknown network ${s}`)}else o=r.walletRequestHandler.defaultChainId()}catch(a){console.error(a)}if(i&&i.type==="connect"&&i.options){const a=i.options,c=a;if(r.appOrigin&&c!=null&&c.origin){if(!My()&&c.origin!==r.appOrigin)throw new Error("origin is invalid")}else!r.appOrigin&&c!=null&&c.origin?a.origin=jM(c.origin):r.appOrigin&&(a.origin=r.appOrigin);a.app&&(a.app=LM(a.app)),a.networkId?s=a.networkId:s&&(a.networkId=s),r.walletRequestHandler.setConnectOptions(a)}else r.walletRequestHandler.setConnectOptions(void 0);if(await r.walletRequestHandler.getAccount(),await r.walletRequestHandler.isSignedIn())if(i&&i.type==="connect"){(!o||o<=0)&&console.log("Failed to set default network on open"),r.notifyOpen({sessionId:r._sessionId});try{const a=await r.walletRequestHandler.promptConnect(i.options);a.connected&&r.walletRequestHandler.notifyConnect(a)}catch(a){Se.warn("promptConnect not connected:",a)}finally{(!i.options||i.options.keepWalletOpened!==!0)&&r.notifyClose()}}else{if(!o||o<=0)return r.notifyOpen({sessionId:r._sessionId,error:`failed to open wallet on network ${s}`}),!1;r.notifyOpen({sessionId:r._sessionId,chainId:`${o}`,session:await r.walletRequestHandler.walletSession(o)})}else return r.notifyOpen({sessionId:r._sessionId}),!0;return!0},this.saveTransportSession=n=>{Ny().setItem(Ak,JSON.stringify(n))},this.getCachedTransportSession=async function(){const n=Ny().getItem(Ak);try{return n?JSON.parse(n):null}catch{return console.error(`unable to parse transport session: ${n}`),null}},this.walletRequestHandler=e,this._init=tr.NIL,this.walletRequestHandler.on("connect",n=>{this.registered&&this.notifyConnect(n)}),this.walletRequestHandler.on("disconnect",(n,i)=>{this.registered&&this.notifyDisconnect(n,i)}),this.walletRequestHandler.on("accountsChanged",(n,i)=>{this.registered&&this.notifyAccountsChanged(n,i)}),this.walletRequestHandler.on("networks",n=>{this.registered&&(this.notifyNetworks(n),!n||n.length===0?this.notifyChainChanged("0x0"):this.notifyChainChanged(Zi(n.find(i=>i.isDefaultChain).chainId)))}),this.walletRequestHandler.on("chainChanged",(n,i)=>{this.notifyChainChanged(n,i)}),this.walletRequestHandler.on("walletContext",n=>{!this.registered||!n||this.notifyWalletContext(n)}),this.walletRequestHandler.on("close",n=>{this.registered&&this.notifyClose(n)})}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}sendMessage(e){throw new Error("abstract method")}notifyOpen(e){const{chainId:r,sessionId:n,session:i,error:s}=e;this.sendMessage({idx:-1,type:tt.OPEN,data:{chainId:r,sessionId:n,session:i,error:s}})}notifyClose(e){this.sendMessage({idx:-1,type:tt.CLOSE,data:e?{error:e}:null})}notifyConnect(e){this.sendMessage({idx:-1,type:tt.CONNECT,data:e})}notifyDisconnect(e,r){this.sendMessage({idx:-1,type:tt.DISCONNECT,data:e?{error:e}:null,origin:r})}notifyAccountsChanged(e,r){this.sendMessage({idx:-1,type:tt.ACCOUNTS_CHANGED,data:e,origin:r})}notifyChainChanged(e,r){this.sendMessage({idx:-1,type:tt.CHAIN_CHANGED,data:e,origin:r})}notifyNetworks(e){this.sendMessage({idx:-1,type:tt.NETWORKS,data:e})}notifyWalletContext(e){this.sendMessage({idx:-1,type:tt.WALLET_CONTEXT,data:e})}isValidInitAck(e){if(this._init===tr.OK)return Se.warn("isValidInitAck, already in init'd state, so inquiry is invalid."),!1;if(e.type!==tt.INIT)return Se.warn("isValidInitAck, invalid message type, expecting init"),!1;const{sessionId:r,nonce:n}=e.data;return!r||r.length===0||!n||n.length===0?(Se.error("invalid init ack"),!1):r!==this._sessionId||n!==this._initNonce?(Se.error("invalid init ack match"),!1):!0}init(){return new Promise((e,r)=>{if(this._init===tr.OK){e();return}if(this._init!==tr.NIL||this._initCallback){r("transport init is in progress");return}const n=setTimeout(()=>{Se.warn("transport init timed out"),this._initCallback&&this._initCallback("transport init timed out")},kC/2);this._initCallback=i=>{this._initCallback=void 0,clearTimeout(n),i?r(i):(this._init=tr.OK,e())},this._initNonce=`${performance.now()}`,this.sendMessage({idx:-1,type:tt.INIT,data:{nonce:this._initNonce}}),this._init=tr.SENT_NONCE})}}class eie{constructor(){this.app=void 0,this.wallet=void 0;const e=new $6,r=new $6;e.conn=r,r.conn=e,this.app=e,this.wallet=r}}class $6{constructor(){this.conn=void 0,this.events=new Cb.EventEmitter2,this.handleMessage=e=>{throw new Error("ProxyMessageChannelPort is not registered")},this.sendMessage=e=>{this.conn.handleMessage(e),e.type==="open"&&this.events.emit("open",e),e.type==="close"&&this.events.emit("close",e),e.type==="connect"&&this.events.emit("connect",e),e.type==="disconnect"&&this.events.emit("disconnect",e)}}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}}class QD extends fp{constructor(e){if(super(),this.port=void 0,this.register=()=>{this.port.handleMessage=r=>{this.handleMessage(r)},this.on("open",(...r)=>{this.port.events.emit("open",...r)}),this.on("close",(...r)=>{this.port.events.emit("close",...r)}),this.on("connect",(...r)=>{this.port.events.emit("connect",...r)}),this.on("disconnect",(...r)=>{this.port.events.emit("disconnect",...r)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),this.events.removeAllListeners(),this.port.handleMessage=void 0},this.openWallet=(r,n,i)=>{if(this.state===Ui.CLOSED){this.state=Ui.OPENING;const s=`${performance.now()}`;this._sessionId=s,this.sendMessage({idx:-1,type:tt.OPEN,data:{path:r,intent:n,networkId:i,sessionId:s}})}},this.state=Ui.CLOSED,this.port=e,!e)throw new Error("port argument cannot be empty");this._init=tr.OK}closeWallet(){this.sendMessage({idx:-1,type:tt.CLOSE,data:null}),this.close()}sendMessage(e){if(!e.idx)throw new Error("message idx is empty");this.port.sendMessage(e)}}class tie extends dp{constructor(e,r){super(e),this.port=void 0,this.port=r,this._init=tr.OK}register(){this.port.handleMessage=e=>{this.handleMessage(e)},this._registered=!0}async restoreSession(){const e=await this.getCachedTransportSession();e&&this.open(e)}unregister(){this.port.handleMessage=void 0,this._registered=!1}sendMessage(e){this.port.sendMessage(e)}}function YD(t){var e;if((e=window.ue)!=null&&e.sequencewallettransport&&!window.logsOverriddenForUnreal){var r;const n=(r=window.ue)==null?void 0:r.sequencewallettransport;console.log=(...i)=>{n.logfromjs(`${t}: ${Xx(i)}`)},console.warn=(...i)=>{n.warnfromjs(`${t}: ${Xx(i)}`)},console.error=(...i)=>{n.errorfromjs(`${t}: ${Xx(i)}`)},window.logsOverriddenForUnreal=!0}}function Xx(t){return t.map(e=>typeof e=="object"?e instanceof Error?e.message:JSON.stringify(e):String(e)).join(" ")}let Gu;class JD extends fp{constructor(e){super(),this.walletURL=void 0,this.register=()=>{var r;YD("dapp"),Gu&&(Gu.unregister(),Gu=this),(r=window.ue)!=null&&r.sequencewallettransport&&(window.ue.sequencewallettransport.onmessagefromwallet=this.onUnrealCallback),Gu=this,this._registered=!0,console.log("registering transport!")},this.unregister=()=>{var r;this._registered=!1,this.closeWallet(),Gu===this&&(Gu=void 0),((r=window.ue)==null||(r=r.sequencewallettransport)==null?void 0:r.onmessagefromwallet)===this.onUnrealCallback&&delete window.ue.sequencewallettransport.onmessagefromwallet,this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.isOpened()){console.log("wallet already open!");return}console.log("opening wallet!");const s=new URL(this.walletURL.href),o=new up;r&&(s.pathname=r.toLowerCase()),this._init=tr.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&o.set("intent",KE(n)),i&&o.set("net",`${i}`),s.search=o.toString(),console.log("opening wallet to",s.href),window.open(s.href)},this.onUnrealCallback=r=>{if(!r)throw new Error("ProviderMessage object is empty");this.handleMessage(r)},this.walletURL=new URL(e)}closeWallet(){this.close()}sendMessage(e){var r;const n=typeof e!="string"?JSON.stringify(e):e;console.log("Sending message to wallet:",n),(r=window.ue)==null||(r=r.sequencewallettransport)==null||r.sendmessagetowallet(n)}}class rie extends dp{constructor(e){super(e),this.onMessageFromUnreal=r=>{Se.debug("RECEIVED MESSAGE",r),this.handleMessage(r)},this.getUnrealTransportSession=r=>{const n=new up(r);return{sessionId:n.get("sid"),networkId:n.get("net"),intent:QE(n.get("intent"))}},this._init=tr.NIL}async register(e){var r;if(((r=window.ue)==null?void 0:r.sequencewallettransport)===void 0)return;YD("wallet");const{search:n}=new URL(e||window.location.href);let i=this.getUnrealTransportSession(n);if(!!i.sessionId||(i=await this.getCachedTransportSession()),!i){Se.error("unreal session is undefined");return}window.ue.sequencewallettransport.onmessagefromsequencejs=this.onMessageFromUnreal,this._registered=!0,this.open(i).then(o=>{if(!o){var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}`;Se.error(c),this.notifyClose({message:c}),window.close()}}).catch(o=>{var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}, due to: ${o}`;Se.error(c),this.notifyClose({message:c}),window.close()})}unregister(){var e;((e=window.ue)==null||(e=e.sequencewallettransport)==null?void 0:e.onmessagefromsequencejs)===this.onMessageFromUnreal&&delete window.ue.sequencewallettransport.onmessagefromsequencejs,this._registered=!1}sendMessage(e){var r;if(e.type!==tt.INIT&&this._init!==tr.OK){Se.error("impossible state, should not be calling postMessage until inited");return}const n=JSON.stringify(e);(r=window.ue)==null||(r=r.sequencewallettransport)==null||r.sendmessagetosequencejs(n)}}const _C="sequence-extension-message-handler";class nie extends dp{constructor(e,r){super(e),this.runtime=r,this.port=void 0,this._init=tr.OK}register(){this._registered=!0,this.port=this.runtime.connect({name:_C})}sendMessage(e){Se.info("[ExtensionMessageHandler send]",e),this.port.postMessage(e)}}class XD extends fp{constructor(e){super(),this.register=()=>{this._registered=!0},e.onConnect.addListener(r=>{r.name===_C&&(this._init=tr.OK,r.onMessage.addListener(n=>{this.handleMessage(n)}))})}sendMessage(e){}unregister(){}openWallet(e,r,n){}closeWallet(){}}class iie extends Cb.EventEmitter2{constructor(e){var r;super(),r=this,this.stream=e,this.responseCallbacks=new Map,this._messageIdx=0,this.nextMessageIdx=()=>++this._messageIdx,this.handleMessage=n=>{if(!n.type||!n.data)return;Se.info("[received message]",n);const i=n.idx,s=this.responseCallbacks.get(i);switch(i&&this.responseCallbacks.delete(i),n.type){case tt.MESSAGE:if(s)this.emit(tt.MESSAGE,n),s(n.data.error,n);else throw new Error("impossible state");break;case tt.DISCONNECT:case tt.ACCOUNTS_CHANGED:case tt.CHAIN_CHANGED:this.emit(n.type,n.data);break;default:console.error("unknown message type",n);break}},this.sendMessageRequest=async function(n){return new Promise((i,s)=>{(!n.idx||n.idx<=0)&&s(new Error("message idx not set"));const o=(c,l)=>{if(c)s(c);else if(l)i(l);else throw new Error("no valid response to return")},{idx:a}=n;r.responseCallbacks.get(a)?s(new Error("duplicate message idx, should never happen")):r.responseCallbacks.set(a,o),r.sendMessage(n)})},this.stream.on("data",this.handleMessage)}sendMessage(e){this.stream.writable||console.error("window post message stream is not writable"),this.stream.write(e)}}let Ku;class ZD extends fp{constructor(e){super(),this.walletURL=void 0,this.walletWindow=void 0,this.register=()=>{Ku&&(Ku.unregister(),Ku=this),window.addEventListener("message",this.onWindowEvent),Ku=this,this.on("open",()=>{const r=this.walletWindow,n=setInterval(()=>{r&&r.closed&&(clearInterval(n),this.close())},500)}),this.on("close",()=>{this.walletWindow&&(this.walletWindow.close(),this.walletWindow=null)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),Ku===this&&(Ku=void 0),window.removeEventListener("message",this.onWindowEvent),this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.walletWindow&&this.isOpened()){this.walletWindow.focus();return}const s=new URL(this.walletURL.href),o=new up;r&&r!==""&&(s.pathname=r.toLowerCase()),this._init=tr.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&(n.type==="connect"&&(n.options||(n.options={app:window.location.origin}),!My()&&!HD()&&n.options&&(n.options.origin=window.location.origin)),o.set("intent",KE(n))),i&&o.set("net",`${i}`);let a,c;My()?(a=[450,750],c=[Math.abs(window.screen.width/2-a[0]/2),Math.abs(window.screen.height/2-a[1]/2)]):(a=[450,750],c=[Math.abs(window.screenX+window.innerWidth/2-a[0]/2),Math.abs(window.screenY+window.innerHeight/2-a[1]/2)]);const l=`toolbar=0,location=0,menubar=0,scrollbars=yes,status=yes,width=${a[0]},height=${a[1]},left=${c[0]},top=${c[1]}`;s.search=o.toString(),this.walletWindow=window.open(s.href,"sequence.app",l)},this.onWindowEvent=r=>{if(r.origin!==this.walletURL.origin)return;let n;try{n=JSON.parse(r.data)}catch{return}if(!n)throw new Error("ProviderMessage object is empty");this.handleMessage(n)},this.walletURL=new URL(e)}closeWallet(){var e;this.close(),(e=this.walletWindow)==null||e.close()}sendMessage(e){if(!this.walletWindow){Se.warn("WindowMessageProvider: sendMessage failed as walletWindow is unavailable");return}const r=typeof e!="string"?JSON.stringify(e):e;this.walletWindow.postMessage(r,this.walletURL.origin)}}class sie extends dp{constructor(e){var r;super(e),r=this,this.parentWindow=void 0,this._isPopup=!1,this.onWindowEvent=async function(n){if(!n.origin||n.origin===""||r.appOrigin&&n.origin!==r.appOrigin)return;let i;try{i=JSON.parse(n.data)}catch{return}if(Se.debug("RECEIVED MESSAGE",i),r._init!==tr.OK&&r.isValidInitAck(i)&&(r.appOrigin=n.origin),r._init===tr.OK&&(!r.appOrigin||r.appOrigin.length<8)){Se.error("impossible state, init.OK and appOrigin required");return}r.handleMessage(i)},this.getWindowTransportSession=n=>{const i=new up(n);return{sessionId:i.get("sid"),networkId:i.get("net"),intent:QE(i.get("intent"))}},this._init=tr.NIL}async register(e){const r=parent.window.opener!==null;if(this._isPopup=r,r!==!0)return;const{pathname:n,search:i}=new URL(e||window.location.href);let s=this.getWindowTransportSession(i);if(!!s.sessionId||(s=await this.getCachedTransportSession()),!s){Se.error("window session is undefined");return}this.parentWindow=parent.window.opener,window.addEventListener("message",this.onWindowEvent,!1),this._registered=!0,this.open(s).then(a=>{if(!a){var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}`;Se.error(l),this.notifyClose({message:l}),window.close()}}).catch(a=>{var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}, due to: ${a}`;Se.error(l),this.notifyClose({message:l}),window.close()})}unregister(){window.removeEventListener("message",this.onWindowEvent),this._registered=!1}sendMessage(e){const r=JSON.stringify(e);e.type===tt.INIT?this.postMessage(r,!0):this.postMessage(r)}get isPopup(){return this._isPopup}postMessage(e,r=!1){if(r!==!0&&this._init!==tr.OK){Se.error("impossible state, should not be calling postMessage until inited");return}r?this.parentWindow.postMessage(e,"*"):this.appOrigin&&this.appOrigin.length>4?this.parentWindow.postMessage(e,this.appOrigin):Se.error("unable to postMessage as parentOrigin is invalid")}}function eL(t){return t&&typeof t=="object"&&(t.windowTransport&&typeof t.windowTransport=="object"||t.proxyTransport&&typeof t.proxyTransport=="object"||t.extensionTransport&&typeof t.extensionTransport=="object"||t.unrealTransport&&typeof t.unrealTransport=="object")&&(t.windowTransport&&t.windowTransport.enabled||t.proxyTransport&&t.proxyTransport.enabled||t.extensionTransport&&t.extensionTransport.enabled||t.unrealTransport&&t.unrealTransport.enabled)}class kb{constructor(...e){var r=this;this.messageProviders=void 0,this.provider=void 0,this.register=()=>{if(this.messageProviders.length===1){this.provider=this.messageProviders[0],this.provider.register();return}this.messageProviders.forEach(n=>{n.register(),n.once("open",()=>{this.provider||(this.provider=n,this.messageProviders.forEach(i=>{this.provider!==i&&i.unregister()}))})})},this.unregister=()=>{this.messageProviders.forEach(n=>n.unregister()),this.provider=void 0},this.openWallet=(n,i,s)=>{if(this.provider){this.provider.openWallet(n,i,s);return}this.messageProviders.forEach(o=>o.openWallet(n,i,s))},this.sendAsync=async function(n,i,s){if(r.provider){r.provider.sendAsync(n,i,s);return}throw new Error("impossible state, wallet must be opened first")},this.sendMessageRequest=async function(n){if(r.provider)return r.provider.sendMessageRequest(n);throw new Error("impossible state, wallet must be opened first")},this.waitUntilOpened=async function(){return r.provider?r.provider.waitUntilOpened():Promise.race(r.messageProviders.map(n=>n.waitUntilOpened()))},this.waitUntilConnected=async function(){if(r.provider)return r.provider.waitUntilConnected();throw new Error("impossible state, wallet must be opened first")},this.messageProviders=e,this.provider=void 0}static new(e){var r,n,i,s;const o=new kb;if((r=e.windowTransport)!=null&&r.enabled&&typeof window=="object"&&e.walletAppURL){const a=new ZD(e.walletAppURL);o.add(a)}if((n=e.proxyTransport)!=null&&n.enabled){const a=new QD(e.proxyTransport.appPort);o.add(a)}if((i=e.extensionTransport)!=null&&i.enabled){const a=new XD(e.extensionTransport.runtime);o.add(a)}if((s=e.unrealTransport)!=null&&s.enabled&&e.windowTransport&&e.walletAppURL){const a=new JD(e.walletAppURL);o.add(a)}return o.register(),o}add(...e){this.messageProviders.push(...e)}closeWallet(){this.provider&&this.provider.closeWallet()}isOpened(){return this.provider?this.provider.isOpened():!1}isConnected(){return this.provider?this.provider.isConnected():!1}on(e,r){if(this.provider){this.provider.on(e,r);return}this.messageProviders.forEach(n=>{n.on(e,r)})}once(e,r){if(this.provider){this.provider.once(e,r);return}this.messageProviders.forEach(n=>{n.once(e,r)})}emit(e,...r){if(this.provider)return this.provider.emit(e,...r);for(let n=0;ncie(t,i))}function cie(t,e){if(e.to.toLowerCase()===t.toLowerCase()&&e.data){const r=fe(e.data);if(r.length>=4&&!lie(r))throw new Error("self calls are forbidden")}if(e.delegateCall)throw new Error("delegate calls are forbidden")}function lie(t){const e=new wr(Jr.mainModule.abi);try{return e.decodeFunctionData("createContract",t),!0}catch{return!1}}const uie=1e4;class fie{constructor(e,r,n){var i=this;this.account=void 0,this.signerReadyCallbacks=[],this.prompter=void 0,this.networks=void 0,this._openIntent=void 0,this._connectOptions=void 0,this.events=new Cb.EventEmitter2,this.onConnectOptionsChange=void 0,this.promptConnect=async function(s){if(!s&&!i._connectOptions)throw new Error("prompter connect options are empty");if(!i.prompter)return i.connect(s);const o=await i.prompter.promptConnect(s||i._connectOptions).catch(c=>({connected:!1})),a=o;return a.connected&&!a.session&&(a.session=await i.walletSession(s==null?void 0:s.networkId)),o},this.sendAsync=async function(s,o,a){const c={jsonrpc:"2.0",id:s.id,result:null};await i.getAccount();try{var l;if((!i.account||i.account===null)&&!die.includes(s.method))throw UD;const f=i.account;if(!f)throw new Error("WalletRequestHandler: wallet account is not configured");const d=(l=i.account)==null?void 0:l.providerFor(a??i.defaultChainId());if(!d)throw new Error(`WalletRequestHandler: wallet provider is not configured for chainId ${a}`);const h=d instanceof ha?d:void 0;switch(s.method){case"net_version":{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send("net_version",[]);c.result=p;break}case"eth_chainId":{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send("eth_chainId",[]);c.result=p;break}case"eth_accounts":{const p=f.address;c.result=[p];break}case"eth_getBalance":{const[p,m]=s.params,v=await d.getBalance(p,m);c.result=v.toHexString();break}case"sequence_sign":case"personal_sign":case"eth_sign":{let p;switch(s.method){case"sequence_sign":case"personal_sign":{const[b,E]=s.params;p=b;break}case"eth_sign":{const[b,E]=s.params;p=E;break}}let m="";const v=Sb(p),y=s.method==="sequence_sign";if(i.prompter===null?m=await f.signMessage(v,a??i.defaultChainId(),y?"eip6492":"ignore"):m=await i.prompter.promptSignMessage({chainId:a,message:v,eip6492:y},i.connectOptions),m&&m.length>0)c.result=m;else throw new Error("declined by user");break}case"sequence_signTypedData_v4":case"eth_signTypedData":case"eth_signTypedData_v4":{const[p,m]=s.params;let v;if(typeof m=="string")try{v=JSON.parse(m)}catch(E){console.warn("walletRequestHandler: error parsing typedData",E)}else v=m;if(!v||!v.domain||!v.types||!v.message)throw new Error("invalid typedData object");let y="";const b=s.method==="sequence_signTypedData_v4";if(i.prompter===null?y=await f.signTypedData(v.domain,v.types,v.message,a??i.defaultChainId(),b?"eip6492":"ignore"):y=await i.prompter.promptSignMessage({chainId:a,typedData:v,eip6492:b},i.connectOptions),y&&y.length>0)c.result=y;else throw new Error("declined by user");break}case"eth_sendTransaction":{const p=aie(s.params[0]).map(v=>("gas"in v&&v.gasLimit===void 0&&(v.gasLimit=v.gas,delete v.gas),v));_k(f.address,p);let m="";if(i.prompter===null){var u;const v=await f.sendTransaction(p,a??i.defaultChainId());m=(u=v==null?void 0:v.hash)!=null?u:""}else m=await i.prompter.promptSendTransaction(p,a,i.connectOptions);if(m)c.result=m;else throw new Error("declined by user");break}case"eth_signTransaction":{const[p]=s.params;if(Be(p.from)!==f.address)throw new Error("sender address does not match wallet");_k(f.address,p),i.prompter===null?c.result=await f.signTransactions(p,a??i.defaultChainId()):c.result=await i.prompter.promptSignTransaction(p,a,i.connectOptions);break}case"eth_sendRawTransaction":{if(we.transaction.isSignedTransactionBundle(s.params[0])){const p=te.from(s.params[0].chainId).toNumber(),m=await f.relayer(p).relay(s.params[0]);c.result=m.hash}else{const p=await d.sendTransaction(s.params[0]);c.result=p.hash}break}case"eth_getTransactionCount":{const p=Be(s.params[0]),m=s.params[1],v=await d.getTransactionCount(p,m);c.result=te.from(v).toHexString();break}case"eth_blockNumber":{c.result=await d.getBlockNumber();break}case"eth_getBlockByNumber":{c.result=await d.getBlock(s.params[0]);break}case"eth_getBlockByHash":{c.result=await d.getBlock(s.params[0]);break}case"eth_getTransactionByHash":{c.result=await d.getTransaction(s.params[0]);break}case"eth_call":{const[p,m]=s.params;c.result=await d.call(p,m);break}case"eth_getCode":{const[p,m]=s.params;c.result=await d.getCode(p,m);break}case"eth_estimateGas":{const[p]=s.params;c.result=await d.estimateGas(p);break}case"eth_gasPrice":{const p=await d.getGasPrice();c.result=p.toHexString();break}case"wallet_switchEthereumChain":{const[p]=s.params;if(!p.chainId||p.chainId.length===0)throw new Error("invalid chainId");const m=te.from(p.chainId);i.setDefaultChainId(m.toNumber()),c.result=null;break}case"sequence_getWalletContext":{c.result=f.contexts;break}case"sequence_getWalletConfig":{const[p]=s.params;p?c.result=[(await f.status(p)).onChain.config]:c.result=await Promise.all(f.networks.map(async function(m){return(await f.status(m.chainId)).onChain.config}));break}case"sequence_getWalletState":{const[p]=s.params;p?c.result=[Pk(p,await f.status(p))]:c.result=await Promise.all(f.networks.map(async function(m){const v=await f.status(m.chainId);return Pk(m.chainId,v)}));break}case"sequence_getNetworks":{c.result=await i.getNetworks(!0);break}case"sequence_isSequence":{c.result=!0;break}case"sequence_updateConfig":throw new Error("sequence_updateConfig method is not allowed from a dapp");case"sequence_publishConfig":throw new Error("sequence_publishConfig method is not allowed from a dapp");case"sequence_gasRefundOptions":break;case"sequence_getNonce":break;case"sequence_relay":break;case"sequence_setDefaultNetwork":{const[p]=s.params;if(!p)throw new Error("invalid request, method argument defaultChainId cannot be empty");i.setDefaultChainId(p),c.result=await i.getNetworks(!0);break}default:{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send(s.method,s.params);c.result=p}}}catch(f){Se.error(f),c.result=null,c.error=ei({},new Error(f),{code:4001})}o(void 0,c)},this.isSignedIn=async function(){return await i.signerReady(),!!i.account},this.getAccount=async function(){if(await i.signerReady(),i.account===void 0)throw new Error("signerReady failed resolve");return i.account},this.account=e,this.prompter=r,this.networks=n}defaultChainId(){var e,r;return(e=(r=this.prompter)==null?void 0:r.getDefaultChainId())!=null?e:this.networks[0].chainId}async signIn(e,r={}){this.setAccount(e);const{connect:n,defaultNetworkId:i}=r;if(n){const a=this._connectOptions;let c;if(this.prompter!==null){var s;c=await((s=this.prompter)==null?void 0:s.promptSignInConnect(a))}else c=await this.connect(a);this.notifyConnect(c),(!a||a.keepWalletOpened!==!0)&&this.notifyClose()}if(i&&this.defaultChainId()!==i){var o;await((o=this.prompter)==null?void 0:o.promptChangeNetwork(i))}}signOut(){this.account&&this.notifyDisconnect(),this.setAccount(null)}signerReset(){this.account=void 0}signerReady(e=uie){return new Promise((r,n)=>{this.account!==void 0?r():(setTimeout(()=>{this.account===void 0&&(this.signerReadyCallbacks=[],n("signerReady timed out"))},e),this.signerReadyCallbacks.push(r))})}async connect(e){var r,n;if(!this.account)return{connected:!1,chainId:"0x0",error:"unable to connect without signed in account"};const i=(r=(n=e==null?void 0:e.networkId)!=null?n:this.defaultChainId())!=null?r:ue.MAINNET,s=eC(i).chainId,o={connected:!0,chainId:Zi(s)};if(e&&e.authorize){const a={app:e.app,origin:e.origin,expiry:e.expiry,nonce:e.authorizeNonce};try{o.proof=await sD(this.account,s,a)}catch(c){return Se.warn(`connect, signAuthorization failed for options: ${JSON.stringify(e)}, due to: ${c.message}`),{connected:!1,chainId:"0x0",error:`signAuthorization failed: ${c.message}`}}}return o.session=this.walletSession(s),o}sendMessageRequest(e){return new Promise(r=>{this.sendAsync(e.data,(n,i)=>{const s=ei({},e,{data:i});r(s)},e.chainId)})}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}async getAddress(){var e,r;return(e=(r=this.account)==null?void 0:r.address)!=null?e:""}get openIntent(){return this._openIntent}setOpenIntent(e){this._openIntent=e}get connectOptions(){return this._connectOptions}setConnectOptions(e){var r;this._connectOptions=e,(r=this.onConnectOptionsChange)==null||r.call(this,e)}async setDefaultChainId(e){var r;return await((r=this.prompter)==null?void 0:r.promptChangeNetwork(e)),this.defaultChainId()}async getNetworks(e){return this.account?e?this.account.networks.map(r=>{const n=ei({},r);return n.provider=void 0,n.relayer=void 0,n}):this.account.networks:(Se.warn("signer not set: getNetworks is returning an empty list"),[])}walletSession(e){if(!this.account)return;const r={walletContext:this.account.contexts,accountAddress:this.account.address,networks:this.account.networks.map(i=>ei({},i,{provider:void 0,relayer:void 0}))};if(e){const i=Ms(r.networks,e);if(i){var n;(n=r.networks)==null||n.forEach(s=>delete s.isDefaultChain),i.isDefaultChain=!0}}return r}notifyConnect(e,r){var n;if(console.log("emit connect",e),this.events.emit("connect",e),(n=e.session)!=null&&n.accountAddress){var i;this.events.emit("accountsChanged",[(i=e.session)==null?void 0:i.accountAddress],r)}}notifyDisconnect(e){this.events.emit("accountsChanged",[],e),this.events.emit("disconnect",void 0,e)}notifyChainChanged(e,r){this.events.emit("chainChanged",Zi(e),r)}async notifyNetworks(e){const r=e||await this.getNetworks(!0);if(this.events.emit("networks",r),r.length>0){const n=r.find(i=>i.chainId===this.defaultChainId());n&&this.events.emit("chainChanged",Zi(n.chainId))}else this.events.emit("chainChanged","0x0")}async notifyWalletContext(){if(!this.account){Se.warn("signer not set: skipping to notify wallet context");return}const e=this.account.contexts;this.events.emit("walletContext",e)}notifyClose(e){this.events.emit("close",e)}setAccount(e){if(this.account=e,e!==void 0){for(let r=0;rc.canOnchainValidate||c.original.version===2&&n,o=await r.status(i);if(s(o))return!0;if(await e.promptConfirmWalletDeploy(i,this.connectOptions)){const c=await r.status(i);return s(c)?!0:(Se.error("WalletRequestHandler: result for promptConfirmWalletDeploy is not correct"),!1)}return!1}}function Pk(t,e){return{context:e.original.context,config:e.onChain.config,address:we.context.addressOf(e.original.context,e.original.imageHash),chainId:t,deployed:e.onChain.deployed,imageHash:e.imageHash,lastImageHash:e.onChain.imageHash,published:!0,status:e}}const die=["net_version","eth_chainId","eth_getBalance","eth_getTransactionCount","eth_blockNumber","eth_getBlockByNumber","eth_getBlockByHash","eth_getTransactionByHash","eth_getCode","eth_estimateGas","eth_gasPrice","sequence_getWalletContext","sequence_getNetworks","sequence_setDefaultNetwork"];class Hd{get utils(){return this.provider.utils}constructor(e,r){this.client=e,this.provider=r,this.singleNetworkSigners={},this._isSigner=!0,this._isSequenceSigner=!0}async getAddress(){return this.client.getAddress()}connect(e){if(!Vd.is(e))throw new Error("SequenceSigner can only be connected to a SequenceProvider");return new Hd(this.client,e)}getSigner(e){if(!e)return this;const r=this.provider.toChainId(e);return this.singleNetworkSigners[r]||(this.singleNetworkSigners[r]=new PC(this.client,this.provider,r)),this.singleNetworkSigners[r]}useChainId(e){return this.provider.toChainId(e)||this.client.getChainId()}async signMessage(e,r){const{eip6492:n=!0}=r||{},i=this.useChainId(r==null?void 0:r.chainId);return this.client.signMessage(e,{eip6492:n,chainId:i})}async signTypedData(e,r,n,i){const{eip6492:s=!0}=i||{},o=this.useChainId(i==null?void 0:i.chainId);return this.client.signTypedData({domain:e,types:r,message:n},{eip6492:s,chainId:o})}getProvider(e){return this.provider.getProvider(e)}async sendTransaction(e,r){const n=this.useChainId(r==null?void 0:r.chainId),i=await KD(e),s=await this.client.sendTransaction(i,{chainId:n}),o=this.getProvider(n);try{return await Jo(async function(){const a=await o.getTransaction(s);return a?o._wrapTransaction(a,s):void 0},{onceBlock:o})}catch(a){throw a.transactionHash=s,a}}async getWalletConfig(e){const r=this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}getNetworks(){return this.client.getNetworks()}async getBalance(e,r){return this.getProvider(r==null?void 0:r.chainId).getBalance(this.getAddress(),e)}async estimateGas(e,r){return this.getProvider(r==null?void 0:r.chainId).estimateGas(e)}async call(e,r,n){return this.getProvider(n==null?void 0:n.chainId).call(e,r)}getChainId(){return Promise.resolve(this.client.getChainId())}async getGasPrice(e){return this.getProvider(e==null?void 0:e.chainId).getGasPrice()}async getFeeData(e){return this.getProvider(e==null?void 0:e.chainId).getFeeData()}async resolveName(e){const r=await this.provider.resolveName(e);if(r===null)throw new Error(`ENS name not found: ${e}`);return r}_checkProvider(e){}populateTransaction(e){throw new Error("SequenceSigner does not support populateTransaction")}checkTransaction(e){throw new Error("SequenceSigner does not support checkTransaction")}getTransactionCount(e){throw new Error("SequenceSigner does not support getTransactionCount")}signTransaction(e){throw new Error("SequenceWallet does not support signTransaction, use sendTransaction instead.")}static is(e){return e&&typeof e=="object"&&e._isSequenceSigner===!0}}class PC extends Hd{constructor(e,r,n){super(e,r.getProvider(n)),this.chainId=n,this._isSingleNetworkSequenceSigner=!0}_useChainId(e){const r=this.provider.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This signer only supports the network ${this.chainId}, but ${r} was requested.`);return r||this.provider.toChainId(this.chainId)}useChainId(e){return this._useChainId(e)}getChainId(){return Promise.resolve(this.provider.toChainId(this.chainId))}getProvider(e){return super.getProvider(this._useChainId(e))}getSigner(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceSigner===!0}}class hie{constructor(e){if(this.signer=e,PC.is(e))throw new Error("WalletUtils does not support SingleNetworkSequenceSigner")}signMessage(e,r,n){return this.signer.signMessage(e,{chainId:r,eip6492:n})}signTypedData(e,r,n,i,s){return this.signer.signTypedData(e,r,n,{chainId:i,eip6492:s})}async isValidSignature(e,r,n,i){return gd(e,r,n,this.signer.getProvider(i))}async isValidMessageSignature(e,r,n,i){const s=this.signer.getProvider(i),o=Sb(r),a=YE(o);return gd(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,sp(r),n,i)}}class Vd extends hb{constructor(e,r,n=md){super(e.getChainId()),this.client=e,this.providerFor=r,this.networks=n,this.singleNetworkProviders={},this._isSequenceProvider=!0,this.utils=void 0,this.signer=void 0,e.onConnect(i=>{this.emit("connect",i)}),e.onDisconnect(i=>{this.emit("disconnect",i)}),e.onDefaultChainIdChanged(i=>{this.emit("chainChanged",i)}),e.onAccountsChanged(i=>{this.emit("accountsChanged",i)}),this.signer=new Hd(this.client,this),this.utils=new hie(this.signer)}getSigner(e){return this.signer.getSigner(e)}connect(e){return this.client.connect(e)}disconnect(){return this.client.disconnect()}isConnected(){return this.client.isConnected()}getSession(){return this.client.getSession()}listAccounts(){return[this.client.getAddress()]}getAddress(){return this.client.getAddress()}getNetworks(){return this.client.getNetworks()}getChainId(){return this.client.getChainId()}setDefaultChainId(e){return this.client.setDefaultChainId(this.toChainId(e))}isOpened(){return this.client.isOpened()}closeWallet(){return this.client.closeWallet()}getWalletContext(){return this.client.getWalletContext()}async getWalletConfig(e){const r=await this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}authorize(e){return this.client.connect(ei({},e,{authorize:!0}))}async openWallet(e,r){return await this.client.openWallet(e,r),!0}toChainId(e){if(e===void 0)return;const r=Ms(this.networks,e);if(!r)throw new Error(`Unsupported network ${e}`);return r.chainId}async useChainId(e){return this.toChainId(e)||this.client.getChainId()}getProvider(e){if(!e)return this;const r=this.toChainId(e);return this.singleNetworkProviders[r]||(this.singleNetworkProviders[r]=new rL(this.client,this.providerFor,r)),this.singleNetworkProviders[r]}async _getSubprovider(e){const r=await this.useChainId(e),n=this.providerFor(r);if(!n)throw new Error(`Unsupported network ${r}`);return n}async perform(e,r){var n;if(e==="eth_chainId")return Zi(await this.useChainId());if(e==="eth_accounts")return[this.client.getAddress()];if(e==="wallet_switchEthereumChain"){const o=r[0],a=tL(o);return this.setDefaultChainId(a)}if(e==="eth_sendTransaction"||e==="eth_sign"||e==="eth_signTypedData"||e==="eth_signTypedData_v4"||e==="personal_sign"||e==="sequence_sign"||e==="sequence_signTypedData_v4")return this.client.send({method:e,params:r},this.getChainId());const i=await this._getSubprovider(),s=(n=i.prepareRequest(e,r))!=null?n:[e,r];return i.send(s[0],s[1])}send(e,r){return this.perform(e,r)}request(e){return this.perform(e.method,e.params)}async detectNetwork(){const e=this.client.getChainId(),r=Ms(this.networks,e);if(!r)throw new Error(`Unknown network ${e}`);return r}async waitForTransaction(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).waitForTransaction(e,r,n)}async getBlockNumber(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getBlockNumber()}async getGasPrice(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getGasPrice()}async getBalance(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBalance(e,r)}async getTransactionCount(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getTransactionCount(e,r)}async getCode(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getCode(e,r)}async getStorageAt(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).getStorageAt(e,r,n)}async call(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).call(e,r)}async estimateGas(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).estimateGas(e)}async getBlock(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getBlock(e)}async getTransaction(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getTransaction(e)}async getLogs(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getLogs(e)}async supportsENS(){return(await this.getNetworks()).some(r=>r.chainId===1)}async getResolver(e){return await this.supportsENS()?(await this._getSubprovider(1)).getResolver(e):null}async resolveName(e){return gE(await e)?e:await this.supportsENS()?(await this._getSubprovider(1)).resolveName(e):null}async lookupAddress(e){return await this.supportsENS()?(await this._getSubprovider(1)).lookupAddress(e):null}async getAvatar(e){return await this.supportsENS()?(await this._getSubprovider(1)).getAvatar(e):null}}Vd.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function tL(t){return typeof t=="object"?tL(t.chainId):te.from(t).toNumber()}class rL extends Vd{constructor(e,r,n){super(e,r),this.chainId=n,this._isSingleNetworkSequenceProvider=!0}_useChainId(e){const r=this.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This provider only supports the network ${this.chainId}, but ${r} was requested.`);return r||super.toChainId(this.chainId)}useChainId(e){return Promise.resolve(this._useChainId(e))}getChainId(){return super.toChainId(this.chainId)}async getNetwork(){const e=await this.client.getNetworks(),r=Ms(e,this.chainId);if(!r)throw new Error(`Unsupported network ${this.chainId}`);return r}getProvider(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}getSigner(e){return super.getSigner(this._useChainId(e))}setDefaultChainId(e){throw new Error(`This provider only supports the network ${this.chainId}; use the parent provider to switch networks.`)}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceProvider===!0}}class pie extends zne{}const mie=(t,e)=>{e||(e="https://nodes.sequence.app");const r=!t,n={};return t&&(n.headers={"X-Access-Key":t}),new pie(e,n,{noop:r,defaultEnabled:!0,privacy:{userIdHash:!0,userAgentSalt:!1},initProps:()=>Zo()?{origin:window.location.origin}:{}})};var vie={name:"@0xsequence/provider",version:"1.9.17",description:"provider sub-package for Sequence",repository:"https://github.com/0xsequence/sequence.js/tree/master/packages/provider",source:"src/index.ts",main:"dist/0xsequence-provider.cjs.js",module:"dist/0xsequence-provider.esm.js",author:"Horizon Blockchain Games",license:"Apache-2.0",scripts:{test:"pnpm test:concurrently 'pnpm test:run'","test:run":"pnpm test:file tests/**/*.spec.ts","test:file":"NODE_OPTIONS='--import tsx' mocha --timeout 30000",typecheck:"tsc --noEmit","test:concurrently":"concurrently -k --success first 'pnpm start:hardhat1' 'pnpm start:hardhat2'","start:hardhat1":"pnpm start:hardhat1:verbose > /dev/null 2>&1","start:hardhat2":"pnpm start:hardhat2:verbose > /dev/null 2>&1","start:hardhat1:verbose":"hardhat node --config hardhat1.config.js --hostname 0.0.0.0 --port 9595","start:hardhat2:verbose":"hardhat node --config hardhat2.config.js --hostname 0.0.0.0 --port 8595"},dependencies:{"@0xsequence/abi":"workspace:*","@0xsequence/account":"workspace:*","@0xsequence/auth":"workspace:*","@0xsequence/core":"workspace:*","@0xsequence/migration":"workspace:*","@0xsequence/network":"workspace:*","@0xsequence/relayer":"workspace:*","@0xsequence/utils":"workspace:*","@0xsequence/wallet":"workspace:*","@databeat/tracker":"^0.9.1",eventemitter2:"^6.4.5","webextension-polyfill":"^0.10.0"},peerDependencies:{ethers:">=5.5 < 6"},devDependencies:{"@types/webextension-polyfill":"^0.10.0",ethers:"^5.7.2",hardhat:"^2.20.1"},files:["src","dist"]};class Jl{constructor(e){this.store=e}connectedSession(){const e=this.getSession();if(e&&e.accountAddress&&e.walletContext&&e.networks)return{accountAddress:e.accountAddress,walletContext:e.walletContext,networks:e.networks};throw new Error("Sequence session not connected")}hasSession(){var e;return((e=this.getSession())==null?void 0:e.accountAddress)!==void 0}setSession(e){return this.store.setItem(Jl.SESSION_LOCALSTORE_KEY,JSON.stringify(e))}getSession(){const e=this.store.getItem(Jl.SESSION_LOCALSTORE_KEY);if(e)return JSON.parse(e)}async clearSession(){return this.store.removeItem(Jl.SESSION_LOCALSTORE_KEY)}}Jl.SESSION_LOCALSTORE_KEY="@sequence.session";class Xl{constructor(e,r=1){this.store=e,this.startingChainId=r,this.callbacks=[],e.onItemChange(Xl.SESSION_CHAIN_ID_KEY,n=>{if(n){const i=parseInt(n);this.callbacks.forEach(s=>s(i))}})}onDefaultChainIdChanged(e){return this.callbacks.push(e),()=>{this.callbacks=this.callbacks.filter(r=>r!==e)}}setDefaultChainId(e){e!==this.getDefaultChainId()&&this.store.setItem(Xl.SESSION_CHAIN_ID_KEY,e.toString())}getDefaultChainId(){const e=this.store.getItem(Xl.SESSION_CHAIN_ID_KEY);return!e||e.length===0?this.startingChainId:parseInt(e)}}Xl.SESSION_CHAIN_ID_KEY="@sequence.session.defaultChainId";class IC{constructor(e,r,n){var i,s;if(this.session=void 0,this.defaultChainId=void 0,this.callbacks={},this.transport=void 0,this.defaultEIP6492=void 0,this.projectAccessKey=void 0,this.analytics=void 0,eL(e))this.transport=kb.new(e);else if(BD(e))this.transport=e;else throw new Error("Invalid transport");const o=n==null?void 0:n.defaultChainId;if(this.defaultEIP6492=(i=n==null?void 0:n.defaultEIP6492)!=null?i:!1,this.session=new Jl(r),this.defaultChainId=new Xl(r,o),this.transport.on("accountsChanged",l=>{var u;l.length>1&&console.warn("SequenceClient: wallet-webapp returned more than one account"),(u=this.callbacks.accountsChanged)==null||u.forEach(f=>f(l))}),this.transport.on("connect",l=>{var u;const f=Zi(this.getChainId());(u=this.callbacks.connect)==null||u.forEach(d=>d(ei({},l,{chainId:f})))}),this.transport.on("disconnect",(l,u)=>{var f;(f=this.callbacks.disconnect)==null||f.forEach(d=>d(l,u))}),this.transport.on("networks",l=>{var u;(u=this.callbacks.networks)==null||u.forEach(f=>f(l))}),this.transport.on("walletContext",l=>{var u;(u=this.callbacks.walletContext)==null||u.forEach(f=>f(l))}),this.transport.on("open",l=>{var u;(u=this.callbacks.open)==null||u.forEach(f=>f(l))}),this.transport.on("close",()=>{var l;(l=this.callbacks.close)==null||l.forEach(u=>u())}),this.transport.on("chainChanged",(l,u)=>{var f;(f=this.callbacks.chainChanged)==null||f.forEach(d=>d(l,u))}),this.defaultChainId.onDefaultChainIdChanged(l=>{var u;const f=Zi(l);(u=this.callbacks.chainChanged)==null||u.forEach(d=>d(f))}),n!=null&&n.projectAccessKey&&(this.projectAccessKey=n.projectAccessKey),this.projectAccessKey&&n!=null&&n.analytics&&(this.analytics=mie(this.projectAccessKey)),(s=this.session.getSession())!=null&&s.accountAddress){var a,c;(a=this.analytics)==null||a.identify((c=this.session.getSession())==null||(c=c.accountAddress)==null?void 0:c.toLowerCase())}}registerCallback(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),()=>{this.callbacks[e]=this.callbacks[e].filter(n=>n!==r)}}onOpen(e){return this.registerCallback("open",e)}onClose(e){return this.registerCallback("close",e)}onConnect(e){return this.registerCallback("connect",e)}onDisconnect(e){return this.registerCallback("disconnect",e)}onNetworks(e){return this.registerCallback("networks",e)}onAccountsChanged(e){return this.registerCallback("accountsChanged",e)}onWalletContext(e){return this.registerCallback("walletContext",e)}onChainChanged(e){return this.registerCallback("chainChanged",e)}onDefaultChainIdChanged(e){return this.registerCallback("chainChanged",e)}getChainId(){return this.defaultChainId.getDefaultChainId()}setDefaultChainId(e){return this.defaultChainId.setDefaultChainId(e)}async openWallet(e,r){return this.transport.openWallet(e,r,this.getChainId()),await this.transport.waitUntilOpened(),this.isOpened()}closeWallet(){return this.transport.closeWallet()}isOpened(){return this.transport.isOpened()}isConnected(){return this.session.hasSession()}getSession(){return this.session.getSession()}getAddress(){return this.session.connectedSession().accountAddress}async connect(e){if((e==null?void 0:e.authorizeVersion)===void 0&&(e.authorizeVersion=2),(e==null?void 0:e.refresh)===!0&&this.disconnect(),e.projectAccessKey=this.projectAccessKey,e&&e.authorize){if(!e.app)throw new Error("connecting with 'authorize' option also requires 'app' to be set");e.authorizeVersion===void 0&&(e.authorizeVersion=2)}await this.openWallet(void 0,{type:"connect",options:ei({},e,{networkId:this.getChainId(),clientVersion:vie.version})});const r=await this.transport.waitUntilConnected().catch(s=>s instanceof Error?{connected:!1,error:s.message}:{connected:!1,error:JSON.stringify(s)});if(r.chainId&&(r.chainId=te.from(r.chainId).toString()),r.connected){var n;if(!r.session)throw new Error("impossible state, connect response is missing session");if(this.session.setSession(r.session),(n=r.session)!=null&&n.accountAddress){var i;(i=this.analytics)==null||i.identify(r.session.accountAddress.toLowerCase())}}return r}disconnect(){var e;return this.isOpened()&&this.closeWallet(),(e=this.analytics)==null||e.reset(),this.session.clearSession()}send(e,r){return e.method=this.mapSignMethod(e.method),new Promise((n,i)=>{this.transport.sendAsync(e,(s,o)=>{s?i(s):o===void 0?i(new Error(`Got undefined response for request: ${e}`)):typeof o=="object"&&o.error?i(o.error):typeof o=="object"&&o.result?n(o.result):i(new Error(`Got invalid response for request: ${e}`))},r||this.getChainId())})}async getNetworks(e){const r=this.session.connectedSession();return e&&(r.networks=await this.send({method:"sequence_getNetworks"}),this.session.setSession(r)),r.networks}signMethod(e){return(e==null?void 0:e.eip6492)===void 0?"personal_sign":e.eip6492?"sequence_sign":"legacy_sign"}signTypedDataMethod(e){return(e==null?void 0:e.eip6492)===void 0?"eth_signTypedData_v4":e.eip6492?"sequence_signTypedData_v4":"legacy_signTypedData_v4"}mapSignMethod(e){return e==="personal_sign"?this.defaultEIP6492?"sequence_sign":"personal_sign":e==="eth_signTypedData_v4"?this.defaultEIP6492?"sequence_signTypedData_v4":"eth_signTypedData_v4":e==="legacy_sign"?"personal_sign":e==="legacy_signTypedData_v4"?"eth_signTypedData_v4":e}async signMessage(e,r){var n;const i=this.signMethod(r);return(n=this.analytics)==null||n.track({event:"SIGN_MESSAGE_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),e=le(AC(e)),this.send({method:i,params:[e,this.getAddress()]},r==null?void 0:r.chainId)}async signTypedData(e,r){var n;const i=this.signTypedDataMethod(r),s=kr.getPayload(e.domain,e.types,e.message);return(n=this.analytics)==null||n.track({event:"SIGN_TYPED_DATA_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),this.send({method:i,params:[this.getAddress(),s]},(r==null?void 0:r.chainId)||e.domain.chainId&&te.from(e.domain.chainId).toNumber()||this.getChainId())}async sendTransaction(e,r){var n;const i=Array.isArray(e)?e:[e],s=oie(i);return(n=this.analytics)==null||n.track({event:"SEND_TRANSACTION_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),this.send({method:"eth_sendTransaction",params:[s]},r==null?void 0:r.chainId)}async getWalletContext(){return this.send({method:"sequence_getWalletContext"})}async getOnchainWalletConfig(e){const r=await this.send({method:"sequence_getWalletConfig",params:[(e==null?void 0:e.chainId)||this.getChainId()]},e==null?void 0:e.chainId);return Array.isArray(r)?r[0]:r}}const M6={transports:{walletAppURL:"https://sequence.app",windowTransport:{enabled:!0},proxyTransport:{enabled:!1}},defaultNetwork:1,analytics:!0};let uo;const nL=(t,e)=>{var r,n,i;if(!t||typeof t!="string")throw new Error("Please pass a projectAccessKey in initWallet.");if(uo)return uo;const s=ei({},M6,e,{transports:ei({},M6.transports,e==null?void 0:e.transports)}),o={},a=(r=(n=s.networks)==null?void 0:n.filter(h=>{h.rpcUrl!==void 0&&h.chainId!==void 0&&md.find(p=>p.chainId===h.chainId)}))!=null?r:[],c=md.map(h=>{var p;const m=(p=s.networks)==null?void 0:p.find(v=>v.chainId===h.chainId);return m?ei({},h,m):h}).concat(a).map(h=>(h.rpcUrl.includes(t)||(h.rpcUrl=h.rpcUrl+`/${t}`),h)),l=h=>{if(!o[h]){var p;const m=(p=c.find(b=>b.chainId===h))==null?void 0:p.rpcUrl;if(!m)throw new Error(`no rpcUrl found for chainId: ${h}`);const v=new ha(m),y=new tC([ZM,XM,new rC],new Ey(v));o[h]=new lM(y,h)}return o[h]},u=s.defaultNetwork?(i=Ms(c,s.defaultNetwork))==null?void 0:i.chainId:void 0;if(!u&&s.defaultNetwork)throw new Error(`defaultNetwork not found for chainId: ${s.defaultNetwork}`);const f=s.localStorage||Ny(),d=new IC(s.transports,f,{defaultChainId:u,defaultEIP6492:s.defaultEIP6492,projectAccessKey:t,analytics:s.analytics});return uo=new Vd(d,l),uo},iL=()=>{uo&&(uo.client.closeWallet(),uo.client.transport.unregister(),uo=void 0)},sL=()=>{if(!uo)throw new Error("Wallet has not been initialized, call sequence.initWallet(config) first.");return uo},yie=Object.freeze(Object.defineProperty({__proto__:null,BaseInjectedTransport:iie,BaseProviderTransport:fp,BaseWalletTransport:dp,CHANNEL_ID:_C,DefaultChainIdTracker:Xl,DefaultProviderConfig:M6,ErrSignedInRequired:UD,EventType:tt,ExtensionMessageHandler:nie,ExtensionMessageProvider:XD,InitState:tr,LocalStorage:u1,MemoryItemStore:GD,MuxMessageProvider:kb,OpenState:Ui,PROVIDER_OPEN_TIMEOUT:kC,ProviderError:FD,ProxyMessageChannel:eie,ProxyMessageChannelPort:$6,ProxyMessageHandler:tie,ProxyMessageProvider:QD,SequenceClient:IC,SequenceClientSession:Jl,SequenceProvider:Vd,SequenceSigner:Hd,SingleNetworkSequenceProvider:rL,SingleNetworkSequenceSigner:PC,UnrealMessageHandler:rie,UnrealMessageProvider:JD,WalletRequestHandler:fie,WindowMessageHandler:sie,WindowMessageProvider:ZD,WindowSessionParams:up,getWallet:sL,initWallet:nL,isBrowserExtension:My,isMuxTransportTemplate:eL,isProviderTransport:BD,isUnityPlugin:HD,isValidMessageSignature:qD,isValidSignature:gd,isValidTypedDataSignature:WD,isWalletUpToDate:VD,messageToBytes:AC,nextMessageIdx:zD,prefixEIP191Message:Sb,resolveArrayProperties:KD,trimEIP191Prefix:Zne,unregisterWallet:iL,useBestStore:Ny},Symbol.toStringTag,{value:"Module"}));function Pn(t,e){return e.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(t)}var gie=Pn({__proto__:null},[OG]),bie=Pn({__proto__:null},[DG]),xie=Pn({__proto__:null},[Vre]),wie=Pn({__proto__:null},[Jre]),Eie=Pn({__proto__:null},[ere]),Cie=Pn({__proto__:null},[lre]),Sie=Pn({__proto__:null},[one]),kie=Pn({__proto__:null},[Aee]),Aie=Pn({__proto__:null},[yie]),_ie=Pn({__proto__:null},[Dte]);const Pie=we.transaction;var Iie=Object.freeze({__proto__:null,transactions:Pie}),Tie=Pn({__proto__:null,isValidSignature:gd,isValidMessageSignature:qD,isValidTypedDataSignature:WD,isWalletUpToDate:VD},[fee]),Oie=Pn({__proto__:null},[mte]),Rie=Pn({__proto__:null},[Lte]),$ie=Pn({__proto__:null},[qre]),Mie=Pn({__proto__:null},[wte]),Nie=Pn({__proto__:null},[Wte]),vu=Object.freeze({__proto__:null,abi:gie,api:bie,auth:xie,guard:wie,indexer:Eie,metadata:Cie,multicall:Sie,network:kie,provider:Aie,relayer:_ie,transactions:Iie,utils:Tie,core:Oie,signhub:Rie,sessions:$ie,migration:Mie,account:Nie,initWallet:nL,getWallet:sL,unregisterWallet:iL,SequenceProvider:Vd,SequenceClient:IC,SequenceSigner:Hd});const oL="%[a-f0-9]{2}",Ik=new RegExp("("+oL+")|([^%]+?)","gi"),Tk=new RegExp("("+oL+")+","gi");function N6(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;const r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],N6(r),N6(n))}function Die(t){try{return decodeURIComponent(t)}catch{let e=t.match(Ik)||[];for(let r=1;rt==null,Uie=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),D6=Symbol("encodeFragmentIdentifier");function zie(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const i=r.length;return n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[$r(e,t),"[",i,"]"].join("")]:[...r,[$r(e,t),"[",$r(i,t),"]=",$r(n,t)].join("")]};case"bracket":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[$r(e,t),"[]"].join("")]:[...r,[$r(e,t),"[]=",$r(n,t)].join("")];case"colon-list-separator":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[$r(e,t),":list="].join("")]:[...r,[$r(e,t),":list=",$r(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e=t.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(n,i)=>i===void 0||t.skipNull&&i===null||t.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[$r(r,t),e,$r(i,t)].join("")]:[[n,$r(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,$r(e,t)]:[...r,[$r(e,t),"=",$r(n,t)].join("")]}}function qie(t){let e;switch(t.arrayFormat){case"index":return(r,n,i)=>{if(e=/\[(\d*)]$/.exec(r),r=r.replace(/\[\d*]$/,""),!e){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][e[1]]=n};case"bracket":return(r,n,i)=>{if(e=/(\[])$/.exec(r),r=r.replace(/\[]$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"colon-list-separator":return(r,n,i)=>{if(e=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"comma":case"separator":return(r,n,i)=>{const s=typeof n=="string"&&n.includes(t.arrayFormatSeparator),o=typeof n=="string"&&!s&&Wo(n,t).includes(t.arrayFormatSeparator);n=o?Wo(n,t):n;const a=s||o?n.split(t.arrayFormatSeparator).map(c=>Wo(c,t)):n===null?n:Wo(n,t);i[r]=a};case"bracket-separator":return(r,n,i)=>{const s=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!s){i[r]=n&&Wo(n,t);return}const o=n===null?[]:n.split(t.arrayFormatSeparator).map(a=>Wo(a,t));if(i[r]===void 0){i[r]=o;return}i[r]=[...i[r],...o]};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[...[i[r]].flat(),n]}}}function cL(t){if(typeof t!="string"||t.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function $r(t,e){return e.encode?e.strict?Uie(t):encodeURIComponent(t):t}function Wo(t,e){return e.decode?jie(t):t}function lL(t){return Array.isArray(t)?t.sort():typeof t=="object"?lL(Object.keys(t)).sort((e,r)=>Number(e)-Number(r)).map(e=>t[e]):t}function uL(t){const e=t.indexOf("#");return e!==-1&&(t=t.slice(0,e)),t}function Wie(t){let e="";const r=t.indexOf("#");return r!==-1&&(e=t.slice(r)),e}function Ok(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&typeof t=="string"&&t.trim()!==""?t=Number(t):e.parseBooleans&&t!==null&&(t.toLowerCase()==="true"||t.toLowerCase()==="false")&&(t=t.toLowerCase()==="true"),t}function TC(t){t=uL(t);const e=t.indexOf("?");return e===-1?"":t.slice(e+1)}function OC(t,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e},cL(e.arrayFormatSeparator);const r=qie(e),n=Object.create(null);if(typeof t!="string"||(t=t.trim().replace(/^[?#&]/,""),!t))return n;for(const i of t.split("&")){if(i==="")continue;const s=e.decode?i.replace(/\+/g," "):i;let[o,a]=aL(s,"=");o===void 0&&(o=s),a=a===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:Wo(a,e),r(Wo(o,e),a,n)}for(const[i,s]of Object.entries(n))if(typeof s=="object"&&s!==null)for(const[o,a]of Object.entries(s))s[o]=Ok(a,e);else n[i]=Ok(s,e);return e.sort===!1?n:(e.sort===!0?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((i,s)=>{const o=n[s];return i[s]=o&&typeof o=="object"&&!Array.isArray(o)?lL(o):o,i},Object.create(null))}function fL(t,e){if(!t)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},cL(e.arrayFormatSeparator);const r=o=>e.skipNull&&Fie(t[o])||e.skipEmptyString&&t[o]==="",n=zie(e),i={};for(const[o,a]of Object.entries(t))r(o)||(i[o]=a);const s=Object.keys(i);return e.sort!==!1&&s.sort(e.sort),s.map(o=>{const a=t[o];return a===void 0?"":a===null?$r(o,e):Array.isArray(a)?a.length===0&&e.arrayFormat==="bracket-separator"?$r(o,e)+"[]":a.reduce(n(o),[]).join("&"):$r(o,e)+"="+$r(a,e)}).filter(o=>o.length>0).join("&")}function dL(t,e){var i;e={decode:!0,...e};let[r,n]=aL(t,"#");return r===void 0&&(r=t),{url:((i=r==null?void 0:r.split("?"))==null?void 0:i[0])??"",query:OC(TC(t),e),...e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:Wo(n,e)}:{}}}function hL(t,e){e={encode:!0,strict:!0,[D6]:!0,...e};const r=uL(t.url).split("?")[0]||"",n=TC(t.url),i={...OC(n,{sort:!1}),...t.query};let s=fL(i,e);s&&(s=`?${s}`);let o=Wie(t.url);if(t.fragmentIdentifier){const a=new URL(r);a.hash=t.fragmentIdentifier,o=e[D6]?a.hash:`#${t.fragmentIdentifier}`}return`${r}${s}${o}`}function pL(t,e,r){r={parseFragmentIdentifier:!0,[D6]:!1,...r};const{url:n,query:i,fragmentIdentifier:s}=dL(t,r);return hL({url:n,query:Bie(i,e),fragmentIdentifier:s},r)}function Hie(t,e,r){const n=Array.isArray(e)?i=>!e.includes(i):(i,s)=>!e(i,s);return pL(t,n,r)}const mL=Object.freeze(Object.defineProperty({__proto__:null,exclude:Hie,extract:TC,parse:OC,parseUrl:dL,pick:pL,stringify:fL,stringifyUrl:hL},Symbol.toStringTag,{value:"Module"})),RC=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Ab=x.createContext({});function Vie(){return x.useContext(Ab).visualElement}const hp=x.createContext(null),_b=typeof document<"u",Dy=_b?x.useLayoutEffect:x.useEffect,vL=x.createContext({strict:!1});function Gie(t,e,r,n){const i=Vie(),s=x.useContext(vL),o=x.useContext(hp),a=x.useContext(RC).reducedMotion,c=x.useRef();n=n||s.renderer,!c.current&&n&&(c.current=n(t,{visualState:e,parent:i,props:r,presenceId:o?o.id:void 0,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;return Dy(()=>{l&&l.render()}),(window.HandoffAppearAnimations?Dy:x.useEffect)(()=>{l&&l.animationState&&l.animationState.animateChanges()}),l}function If(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Kie(t,e,r){return x.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):If(r)&&(r.current=n))},[e])}function f1(t){return typeof t=="string"||Array.isArray(t)}function Pb(t){return typeof t=="object"&&typeof t.start=="function"}const Qie=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Ib(t){return Pb(t.animate)||Qie.some(e=>f1(t[e]))}function yL(t){return!!(Ib(t)||t.variants)}function Yie(t,e){if(Ib(t)){const{initial:r,animate:n}=t;return{initial:r===!1||f1(r)?r:void 0,animate:f1(n)?n:void 0}}return t.inherit!==!1?e:{}}function Jie(t){const{initial:e,animate:r}=Yie(t,x.useContext(Ab));return x.useMemo(()=>({initial:e,animate:r}),[Rk(e),Rk(r)])}function Rk(t){return Array.isArray(t)?t.join(" "):t}const No=t=>({isEnabled:e=>t.some(r=>!!e[r])}),d1={measureLayout:No(["layout","layoutId","drag"]),animation:No(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:No(["exit"]),drag:No(["drag","dragControls"]),focus:No(["whileFocus"]),hover:No(["whileHover","onHoverStart","onHoverEnd"]),tap:No(["whileTap","onTap","onTapStart","onTapCancel"]),pan:No(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:No(["whileInView","onViewportEnter","onViewportLeave"])};function Xie(t){for(const e in t)e==="projectionNodeConstructor"?d1.projectionNodeConstructor=t[e]:d1[e].Component=t[e]}function Tb(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const C0={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Zie=1;function ese(){return Tb(()=>{if(C0.hasEverUpdated)return Zie++})}const $C=x.createContext({});class tse extends g.Component{getSnapshotBeforeUpdate(){const{visualElement:e,props:r}=this.props;return e&&e.setProps(r),null}componentDidUpdate(){}render(){return this.props.children}}const gL=x.createContext({}),rse=Symbol.for("motionComponentSymbol");function nse({preloadedFeatures:t,createVisualElement:e,projectionNodeConstructor:r,useRender:n,useVisualState:i,Component:s}){t&&Xie(t);function o(c,l){const u={...x.useContext(RC),...c,layoutId:ise(c)},{isStatic:f}=u;let d=null;const h=Jie(c),p=f?void 0:ese(),m=i(c,f);if(!f&&_b){h.visualElement=Gie(s,m,u,e);const v=x.useContext(vL).strict,y=x.useContext(gL);h.visualElement&&(d=h.visualElement.loadFeatures(u,v,t,p,r||d1.projectionNodeConstructor,y))}return x.createElement(tse,{visualElement:h.visualElement,props:u},d,x.createElement(Ab.Provider,{value:h},n(s,c,p,Kie(m,h.visualElement,l),m,f,h.visualElement)))}const a=x.forwardRef(o);return a[rse]=s,a}function ise({layoutId:t}){const e=x.useContext($C).id;return e&&t!==void 0?e+"-"+t:t}function sse(t){function e(n,i={}){return nse(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const ose=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function MC(t){return typeof t!="string"||t.includes("-")?!1:!!(ose.indexOf(t)>-1||/[A-Z]/.test(t))}const Ly={};function ase(t){Object.assign(Ly,t)}const jy=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Gd=new Set(jy);function bL(t,{layout:e,layoutId:r}){return Gd.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!Ly[t]||t==="opacity")}const ui=t=>!!(t!=null&&t.getVelocity),cse={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},lse=(t,e)=>jy.indexOf(t)-jy.indexOf(e);function use({transform:t,transformKeys:e},{enableHardwareAcceleration:r=!0,allowTransformNone:n=!0},i,s){let o="";e.sort(lse);for(const a of e)o+=`${cse[a]||a}(${t[a]}) `;return r&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,i?"":o):n&&i&&(o="none"),o}function xL(t){return t.startsWith("--")}const fse=(t,e)=>e&&typeof t=="number"?e.transform(t):t,bd=(t,e,r)=>Math.min(Math.max(r,t),e),Pu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},S0={...Pu,transform:t=>bd(0,1,t)},hm={...Pu,default:1},k0=t=>Math.round(t*1e5)/1e5,h1=/(-)?([\d]*\.?[\d])+/g,L6=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,dse=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function pp(t){return typeof t=="string"}const mp=t=>({test:e=>pp(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ya=mp("deg"),go=mp("%"),Pe=mp("px"),hse=mp("vh"),pse=mp("vw"),$k={...go,parse:t=>go.parse(t)/100,transform:t=>go.transform(t*100)},Mk={...Pu,transform:Math.round},wL={borderWidth:Pe,borderTopWidth:Pe,borderRightWidth:Pe,borderBottomWidth:Pe,borderLeftWidth:Pe,borderRadius:Pe,radius:Pe,borderTopLeftRadius:Pe,borderTopRightRadius:Pe,borderBottomRightRadius:Pe,borderBottomLeftRadius:Pe,width:Pe,maxWidth:Pe,height:Pe,maxHeight:Pe,size:Pe,top:Pe,right:Pe,bottom:Pe,left:Pe,padding:Pe,paddingTop:Pe,paddingRight:Pe,paddingBottom:Pe,paddingLeft:Pe,margin:Pe,marginTop:Pe,marginRight:Pe,marginBottom:Pe,marginLeft:Pe,rotate:Ya,rotateX:Ya,rotateY:Ya,rotateZ:Ya,scale:hm,scaleX:hm,scaleY:hm,scaleZ:hm,skew:Ya,skewX:Ya,skewY:Ya,distance:Pe,translateX:Pe,translateY:Pe,translateZ:Pe,x:Pe,y:Pe,z:Pe,perspective:Pe,transformPerspective:Pe,opacity:S0,originX:$k,originY:$k,originZ:Pe,zIndex:Mk,fillOpacity:S0,strokeOpacity:S0,numOctaves:Mk};function NC(t,e,r,n){const{style:i,vars:s,transform:o,transformKeys:a,transformOrigin:c}=t;a.length=0;let l=!1,u=!1,f=!0;for(const d in e){const h=e[d];if(xL(d)){s[d]=h;continue}const p=wL[d],m=fse(h,p);if(Gd.has(d)){if(l=!0,o[d]=m,a.push(d),!f)continue;h!==(p.default||0)&&(f=!1)}else d.startsWith("origin")?(u=!0,c[d]=m):i[d]=m}if(e.transform||(l||n?i.transform=use(t,r,f,n):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:h="50%",originZ:p=0}=c;i.transformOrigin=`${d} ${h} ${p}`}}const DC=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function EL(t,e,r){for(const n in e)!ui(e[n])&&!bL(n,r)&&(t[n]=e[n])}function mse({transformTemplate:t},e,r){return x.useMemo(()=>{const n=DC();return NC(n,e,{enableHardwareAcceleration:!r},t),Object.assign({},n.vars,n.style)},[e])}function vse(t,e,r){const n=t.style||{},i={};return EL(i,n,t),Object.assign(i,mse(t,e,r)),t.transformValues?t.transformValues(i):i}function yse(t,e,r){const n={},i=vse(t,e,r);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),n.style=i,n}const gse=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","viewport"]);function By(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||gse.has(t)}let CL=t=>!By(t);function bse(t){t&&(CL=e=>e.startsWith("on")?!By(e):t(e))}try{bse(require("@emotion/is-prop-valid").default)}catch{}function xse(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(CL(i)||r===!0&&By(i)||!e&&!By(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function Nk(t,e,r){return typeof t=="string"?t:Pe.transform(e+r*t)}function wse(t,e,r){const n=Nk(e,t.x,t.width),i=Nk(r,t.y,t.height);return`${n} ${i}`}const Ese={offset:"stroke-dashoffset",array:"stroke-dasharray"},Cse={offset:"strokeDashoffset",array:"strokeDasharray"};function Sse(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?Ese:Cse;t[s.offset]=Pe.transform(-n);const o=Pe.transform(e),a=Pe.transform(r);t[s.array]=`${o} ${a}`}function LC(t,{attrX:e,attrY:r,originX:n,originY:i,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...c},l,u,f){if(NC(t,c,l,f),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:p}=t;d.transform&&(p&&(h.transform=d.transform),delete d.transform),p&&(n!==void 0||i!==void 0||h.transform)&&(h.transformOrigin=wse(p,n!==void 0?n:.5,i!==void 0?i:.5)),e!==void 0&&(d.x=e),r!==void 0&&(d.y=r),s!==void 0&&Sse(d,s,o,a,!1)}const SL=()=>({...DC(),attrs:{}}),jC=t=>typeof t=="string"&&t.toLowerCase()==="svg";function kse(t,e,r,n){const i=x.useMemo(()=>{const s=SL();return LC(s,e,{enableHardwareAcceleration:!1},jC(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};EL(s,t.style,t),i.style={...s,...i.style}}return i}function Ase(t=!1){return(r,n,i,s,{latestValues:o},a)=>{const l=(MC(r)?kse:yse)(n,o,a,r),f={...xse(n,typeof r=="string",t),...l,ref:s},{children:d}=n,h=x.useMemo(()=>ui(d)?d.get():d,[d]);return i&&(f["data-projection-id"]=i),x.createElement(r,{...f,children:h})}}const BC=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function kL(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const AL=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function _L(t,e,r,n){kL(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(AL.has(i)?i:BC(i),e.attrs[i])}function FC(t,e){const{style:r}=t,n={};for(const i in r)(ui(r[i])||e.style&&ui(e.style[i])||bL(i,t))&&(n[i]=r[i]);return n}function PL(t,e){const r=FC(t,e);for(const n in t)if(ui(t[n])||ui(e[n])){const i=n==="x"||n==="y"?"attr"+n.toUpperCase():n;r[i]=t[n]}return r}function UC(t,e,r,n={},i={}){return typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),e}const Fy=t=>Array.isArray(t),_se=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Pse=t=>Fy(t)?t[t.length-1]||0:t;function yv(t){const e=ui(t)?t.get():t;return _se(e)?e.toValue():e}function Ise({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:r},n,i,s){const o={latestValues:Tse(n,i,s,t),renderState:e()};return r&&(o.mount=a=>r(n,a,o)),o}const IL=t=>(e,r)=>{const n=x.useContext(Ab),i=x.useContext(hp),s=()=>Ise(t,e,n,i);return r?s():Tb(s)};function Tse(t,e,r,n){const i={},s=n(t,{});for(const d in s)i[d]=yv(s[d]);let{initial:o,animate:a}=t;const c=Ib(t),l=yL(t);e&&l&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=r?r.initial===!1:!1;u=u||o===!1;const f=u?a:o;return f&&typeof f!="boolean"&&!Pb(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=UC(t,h);if(!p)return;const{transitionEnd:m,transition:v,...y}=p;for(const b in y){let E=y[b];if(Array.isArray(E)){const S=u?E.length-1:0;E=E[S]}E!==null&&(i[b]=E)}for(const b in m)i[b]=m[b]}),i}const Ose={useVisualState:IL({scrapeMotionValuesFromProps:PL,createRenderState:SL,onMount:(t,e,{renderState:r,latestValues:n})=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}LC(r,n,{enableHardwareAcceleration:!1},jC(e.tagName),t.transformTemplate),_L(e,r)}})},Rse={useVisualState:IL({scrapeMotionValuesFromProps:FC,createRenderState:DC})};function $se(t,{forwardMotionProps:e=!1},r,n,i){return{...MC(t)?Ose:Rse,preloadedFeatures:r,useRender:Ase(e),createVisualElement:n,projectionNodeConstructor:i,Component:t}}var Rt;(function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"})(Rt||(Rt={}));function Ob(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function j6(t,e,r,n){x.useEffect(()=>{const i=t.current;if(r&&i)return Ob(i,e,r,n)},[t,e,r,n])}function Mse({whileFocus:t,visualElement:e}){const{animationState:r}=e,n=x.useCallback(()=>{r&&r.setActive(Rt.Focus,!0)},[r]),i=x.useCallback(()=>{r&&r.setActive(Rt.Focus,!1)},[r]);j6(e,"focus",t?n:void 0),j6(e,"blur",t?i:void 0)}const TL=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function zC(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const OL=t=>e=>TL(e)&&t(e,zC(e));function Jf(t,e,r,n){return Ob(t,e,OL(r),n)}function Uy(t,e,r,n){return j6(t,e,r&&OL(r),n)}function RL(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const Dk=RL("dragHorizontal"),Lk=RL("dragVertical");function $L(t){let e=!1;if(t==="y")e=Lk();else if(t==="x")e=Dk();else{const r=Dk(),n=Lk();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function ML(){const t=$L(!0);return t?(t(),!1):!0}function jk(t,e,r,n){return(i,s)=>{i.type==="touch"||ML()||(r&&t.animationState&&t.animationState.setActive(Rt.Hover,e),n&&n(i,s))}}function Nse({onHoverStart:t,onHoverEnd:e,whileHover:r,visualElement:n}){Uy(n,"pointerenter",x.useMemo(()=>t||r?jk(n,!0,!!r,t):void 0,[t,!!r,n]),{passive:!t}),Uy(n,"pointerleave",x.useMemo(()=>e||r?jk(n,!1,!!r,e):void 0,[t,!!r,n]),{passive:!e})}const NL=(t,e)=>e?t===e?!0:NL(t,e.parentElement):!1;function qC(t){return x.useEffect(()=>()=>t(),[])}const Dse=(t,e)=>r=>e(t(r)),Rb=(...t)=>t.reduce(Dse);function Lse({onTap:t,onTapStart:e,onTapCancel:r,whileTap:n,visualElement:i,...s}){const o=t||e||r||n,a=x.useRef(!1),c=x.useRef(null),l={passive:!(e||t||r||s.onPointerDown)};function u(){c.current&&c.current(),c.current=null}function f(){return u(),a.current=!1,i.getProps().whileTap&&i.animationState&&i.animationState.setActive(Rt.Tap,!1),!ML()}function d(m,v){var y,b,E,S;f()&&(NL(i.current,m.target)?(S=(E=i.getProps()).onTap)===null||S===void 0||S.call(E,m,v):(b=(y=i.getProps()).onTapCancel)===null||b===void 0||b.call(y,m,v))}function h(m,v){var y,b;f()&&((b=(y=i.getProps()).onTapCancel)===null||b===void 0||b.call(y,m,v))}const p=x.useCallback((m,v)=>{var y;if(u(),a.current)return;a.current=!0,c.current=Rb(Jf(window,"pointerup",d,l),Jf(window,"pointercancel",h,l));const b=i.getProps();b.whileTap&&i.animationState&&i.animationState.setActive(Rt.Tap,!0),(y=b.onTapStart)===null||y===void 0||y.call(b,m,v)},[!!e,i]);Uy(i,"pointerdown",o?p:void 0,l),qC(u)}const B6=new WeakMap,Zx=new WeakMap,jse=t=>{const e=B6.get(t.target);e&&e(t)},Bse=t=>{t.forEach(jse)};function Fse({root:t,...e}){const r=t||document;Zx.has(r)||Zx.set(r,{});const n=Zx.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(Bse,{root:t,...e})),n[i]}function Use(t,e,r){const n=Fse(e);return B6.set(t,r),n.observe(t),()=>{B6.delete(t),n.unobserve(t)}}function zse({visualElement:t,whileInView:e,onViewportEnter:r,onViewportLeave:n,viewport:i={}}){const s=x.useRef({hasEnteredView:!1,isInView:!1});let o=!!(e||r||n);i.once&&s.current.hasEnteredView&&(o=!1),(typeof IntersectionObserver>"u"?Hse:Wse)(o,s.current,t,i)}const qse={some:0,all:1};function Wse(t,e,r,{root:n,margin:i,amount:s="some",once:o}){x.useEffect(()=>{if(!t||!r.current)return;const a={root:n==null?void 0:n.current,rootMargin:i,threshold:typeof s=="number"?s:qse[s]},c=l=>{const{isIntersecting:u}=l;if(e.isInView===u||(e.isInView=u,o&&!u&&e.hasEnteredView))return;u&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(Rt.InView,u);const f=r.getProps(),d=u?f.onViewportEnter:f.onViewportLeave;d&&d(l)};return Use(r.current,a,c)},[t,n,i,s])}function Hse(t,e,r,{fallback:n=!0}){x.useEffect(()=>{!t||!n||requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:i}=r.getProps();i&&i(null),r.animationState&&r.animationState.setActive(Rt.InView,!0)})},[t])}const vc=t=>e=>(t(e),null),Vse={inView:vc(zse),tap:vc(Lse),focus:vc(Mse),hover:vc(Nse)};function DL(){const t=x.useContext(hp);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=x.useId();return x.useEffect(()=>n(i),[]),!e&&r?[!1,()=>r&&r(i)]:[!0]}function LL(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n/^\-?\d*\.?\d+$/.test(t),Kse=t=>/^0[^.\s]+$/.test(t),na={delta:0,timestamp:0},jL=1/60*1e3,Qse=typeof performance<"u"?()=>performance.now():()=>Date.now(),BL=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Qse()),jL);function Yse(t){let e=[],r=[],n=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const f=u&&i,d=f?e:r;return l&&o.add(c),d.indexOf(c)===-1&&(d.push(c),f&&i&&(n=e.length)),c},cancel:c=>{const l=r.indexOf(c);l!==-1&&r.splice(l,1),o.delete(c)},process:c=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let l=0;l(t[e]=Yse(()=>p1=!0),t),{}),Sn=vp.reduce((t,e)=>{const r=$b[e];return t[e]=(n,i=!1,s=!1)=>(p1||Zse(),r.schedule(n,i,s)),t},{}),Uc=vp.reduce((t,e)=>(t[e]=$b[e].cancel,t),{}),ew=vp.reduce((t,e)=>(t[e]=()=>$b[e].process(na),t),{}),Xse=t=>$b[t].process(na),FL=t=>{p1=!1,na.delta=F6?jL:Math.max(Math.min(t-na.timestamp,Jse),1),na.timestamp=t,U6=!0,vp.forEach(Xse),U6=!1,p1&&(F6=!1,BL(FL))},Zse=()=>{p1=!0,F6=!0,U6||BL(FL)};function WC(t,e){t.indexOf(e)===-1&&t.push(e)}function HC(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class VC{constructor(){this.subscriptions=[]}add(e){return WC(this.subscriptions,e),()=>HC(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class toe{constructor(e,r={}){this.version="8.5.5",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(n,i=!0)=>{this.prev=this.current,this.current=n;const{delta:s,timestamp:o}=na;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,Sn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Sn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=eoe(this.current),this.owner=r.owner}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new VC);const n=this.events[e].add(r);return e==="change"?()=>{n(),Sn.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?GC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xd(t,e){return new toe(t,e)}const KC=(t,e)=>r=>!!(pp(r)&&dse.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),UL=(t,e,r)=>n=>{if(!pp(n))return n;const[i,s,o,a]=n.match(h1);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},roe=t=>bd(0,255,t),tw={...Pu,transform:t=>Math.round(roe(t))},Wl={test:KC("rgb","red"),parse:UL("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+tw.transform(t)+", "+tw.transform(e)+", "+tw.transform(r)+", "+k0(S0.transform(n))+")"};function noe(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const z6={test:KC("#"),parse:noe,transform:Wl.transform},Tf={test:KC("hsl","hue"),parse:UL("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+go.transform(k0(e))+", "+go.transform(k0(r))+", "+k0(S0.transform(n))+")"},$n={test:t=>Wl.test(t)||z6.test(t)||Tf.test(t),parse:t=>Wl.test(t)?Wl.parse(t):Tf.test(t)?Tf.parse(t):z6.parse(t),transform:t=>pp(t)?t:t.hasOwnProperty("red")?Wl.transform(t):Tf.transform(t)},zL="${c}",qL="${n}";function ioe(t){var e,r;return isNaN(t)&&pp(t)&&(((e=t.match(h1))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(L6))===null||r===void 0?void 0:r.length)||0)>0}function zy(t){typeof t=="number"&&(t=`${t}`);const e=[];let r=0,n=0;const i=t.match(L6);i&&(r=i.length,t=t.replace(L6,zL),e.push(...i.map($n.parse)));const s=t.match(h1);return s&&(n=s.length,t=t.replace(h1,qL),e.push(...s.map(Pu.parse))),{values:e,numColors:r,numNumbers:n,tokenised:t}}function WL(t){return zy(t).values}function HL(t){const{values:e,numColors:r,tokenised:n}=zy(t),i=e.length;return s=>{let o=n;for(let a=0;atypeof t=="number"?0:t;function ooe(t){const e=WL(t);return HL(t)(e.map(soe))}const zc={test:ioe,parse:WL,createTransformer:HL,getAnimatableNone:ooe},aoe=new Set(["brightness","contrast","saturate","opacity"]);function coe(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(h1)||[];if(!n)return t;const i=r.replace(n,"");let s=aoe.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const loe=/([a-z-]*)\(.*?\)/g,q6={...zc,getAnimatableNone:t=>{const e=t.match(loe);return e?e.map(coe).join(" "):t}},uoe={...wL,color:$n,backgroundColor:$n,outlineColor:$n,fill:$n,stroke:$n,borderColor:$n,borderTopColor:$n,borderRightColor:$n,borderBottomColor:$n,borderLeftColor:$n,filter:q6,WebkitFilter:q6},QC=t=>uoe[t];function YC(t,e){var r;let n=QC(t);return n!==q6&&(n=zc),(r=n.getAnimatableNone)===null||r===void 0?void 0:r.call(n,e)}const VL=t=>e=>e.test(t),foe={test:t=>t==="auto",parse:t=>t},GL=[Pu,Pe,go,Ya,pse,hse,foe],$h=t=>GL.find(VL(t)),doe=[...GL,$n,zc],hoe=t=>doe.find(VL(t));function poe(t){const e={};return t.values.forEach((r,n)=>e[n]=r.get()),e}function moe(t){const e={};return t.values.forEach((r,n)=>e[n]=r.getVelocity()),e}function Mb(t,e,r){const n=t.getProps();return UC(n,e,r!==void 0?r:n.custom,poe(t),moe(t))}function voe(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,xd(r))}function yoe(t,e){const r=Mb(t,e);let{transitionEnd:n={},transition:i={},...s}=r?t.makeTargetAnimatable(r,!1):{};s={...s,...n};for(const o in s){const a=Pse(s[o]);voe(t,o,a)}}function goe(t,e,r){var n,i;const s=Object.keys(e).filter(a=>!t.hasValue(a)),o=s.length;if(o)for(let a=0;at*1e3,Coe={current:!1},JC=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,XC=t=>e=>1-t(1-e),ZC=t=>t*t,Soe=XC(ZC),e4=JC(ZC),br=(t,e,r)=>-r*t+r*e+t;function rw(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function koe({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,c=2*r-a;i=rw(c,a,t+1/3),s=rw(c,a,t),o=rw(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}const nw=(t,e,r)=>{const n=t*t;return Math.sqrt(Math.max(0,r*(e*e-n)+n))},Aoe=[z6,Wl,Tf],_oe=t=>Aoe.find(e=>e.test(t));function Bk(t){const e=_oe(t);let r=e.parse(t);return e===Tf&&(r=koe(r)),r}const KL=(t,e)=>{const r=Bk(t),n=Bk(e),i={...r};return s=>(i.red=nw(r.red,n.red,s),i.green=nw(r.green,n.green,s),i.blue=nw(r.blue,n.blue,s),i.alpha=br(r.alpha,n.alpha,s),Wl.transform(i))};function QL(t,e){return typeof t=="number"?r=>br(t,e,r):$n.test(t)?KL(t,e):JL(t,e)}const YL=(t,e)=>{const r=[...t],n=r.length,i=t.map((s,o)=>QL(s,e[o]));return s=>{for(let o=0;o{const r={...t,...e},n={};for(const i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=QL(t[i],e[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}},JL=(t,e)=>{const r=zc.createTransformer(e),n=zy(t),i=zy(e);return n.numColors===i.numColors&&n.numNumbers>=i.numNumbers?Rb(YL(n.values,i.values),r):o=>`${o>0?e:t}`},Hy=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},Fk=(t,e)=>r=>br(t,e,r);function Ioe(t){return typeof t=="number"?Fk:typeof t=="string"?$n.test(t)?KL:JL:Array.isArray(t)?YL:typeof t=="object"?Poe:Fk}function Toe(t,e,r){const n=[],i=r||Ioe(t[0]),s=t.length-1;for(let o=0;ot[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=Toe(e,n,i),a=o.length,c=l=>{let u=0;if(a>1)for(;uc(bd(t[0],t[s-1],l)):c}const t4=t=>t,ZL=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,Ooe=1e-7,Roe=12;function $oe(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=ZL(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>Ooe&&++a$oe(s,0,1,t,r);return s=>s===0||s===1?s:ZL(i(s),e,n)}const tj=t=>1-Math.sin(Math.acos(t)),r4=XC(tj),Moe=JC(r4),rj=ej(.33,1.53,.69,.99),n4=XC(rj),Noe=JC(n4),Doe=t=>(t*=2)<1?.5*n4(t):.5*(2-Math.pow(2,-10*(t-1))),Loe={linear:t4,easeIn:ZC,easeInOut:e4,easeOut:Soe,circIn:tj,circInOut:Moe,circOut:r4,backIn:n4,backInOut:Noe,backOut:rj,anticipate:Doe},Uk=t=>{if(Array.isArray(t)){Wy(t.length===4);const[e,r,n,i]=t;return ej(e,r,n,i)}else if(typeof t=="string")return Loe[t];return t},joe=t=>Array.isArray(t)&&typeof t[0]!="number";function Boe(t,e){return t.map(()=>e||e4).splice(0,t.length-1)}function Foe(t){const e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function Uoe(t,e){return t.map(r=>r*e)}function W6({keyframes:t,ease:e=e4,times:r,duration:n=300}){t=[...t];const i=joe(e)?e.map(Uk):Uk(e),s={done:!1,value:t[0]},o=Uoe(r&&r.length===t.length?r:Foe(t),n);function a(){return XL(o,t,{ease:Array.isArray(i)?i:Boe(t,i)})}let c=a();return{next:l=>(s.value=c(l),s.done=l>=n,s),flipTarget:()=>{t.reverse(),c=a()}}}const iw=.001,zoe=.01,qoe=10,Woe=.05,Hoe=1;function Voe({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s,o=1-e;o=bd(Woe,Hoe,o),t=bd(zoe,qoe,t/1e3),o<1?(i=l=>{const u=l*o,f=u*t,d=u-r,h=H6(l,o),p=Math.exp(-f);return iw-d/h*p},s=l=>{const f=l*o*t,d=f*r+r,h=Math.pow(o,2)*Math.pow(l,2)*t,p=Math.exp(-f),m=H6(Math.pow(l,2),o);return(-i(l)+iw>0?-1:1)*((d-h)*p)/m}):(i=l=>{const u=Math.exp(-l*t),f=(l-r)*t+1;return-iw+u*f},s=l=>{const u=Math.exp(-l*t),f=(r-l)*(t*t);return u*f});const a=5/t,c=Koe(i,s,a);if(t=t*1e3,isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*n;return{stiffness:l,damping:o*2*Math.sqrt(n*l),duration:t}}}const Goe=12;function Koe(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function Joe(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!zk(t,Yoe)&&zk(t,Qoe)){const r=Voe(t);e={...e,...r,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}const Xoe=5;function nj({keyframes:t,restDelta:e,restSpeed:r,...n}){let i=t[0],s=t[t.length-1];const o={done:!1,value:i},{stiffness:a,damping:c,mass:l,velocity:u,duration:f,isResolvedFromDuration:d}=Joe(n);let h=Zoe,p=u?-(u/1e3):0;const m=c/(2*Math.sqrt(a*l));function v(){const y=s-i,b=Math.sqrt(a/l)/1e3,E=Math.abs(y)<5;if(r||(r=E?.01:2),e||(e=E?.005:.5),m<1){const S=H6(b,m);h=P=>{const M=Math.exp(-m*b*P);return s-M*((p+m*b*y)/S*Math.sin(S*P)+y*Math.cos(S*P))}}else if(m===1)h=S=>s-Math.exp(-b*S)*(y+(p+b*y)*S);else{const S=b*Math.sqrt(m*m-1);h=P=>{const M=Math.exp(-m*b*P),L=Math.min(S*P,300);return s-M*((p+m*b*y)*Math.sinh(L)+S*y*Math.cosh(L))/S}}}return v(),{next:y=>{const b=h(y);if(d)o.done=y>=f;else{let E=p;if(y!==0)if(m<1){const M=Math.max(0,y-Xoe);E=GC(b-h(M),y-M)}else E=0;const S=Math.abs(E)<=r,P=Math.abs(s-b)<=e;o.done=S&&P}return o.value=o.done?s:b,o},flipTarget:()=>{p=-p,[i,s]=[s,i],v()}}}nj.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const Zoe=t=>0;function eae({keyframes:t=[0],velocity:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){const o=t[0],a={done:!1,value:o};let c=r*e;const l=o+c,u=s===void 0?l:s(l);return u!==l&&(c=u-o),{next:f=>{const d=-c*Math.exp(-f/n);return a.done=!(d>i||d<-i),a.value=a.done?u:u+d,a},flipTarget:()=>{}}}const tae={decay:eae,keyframes:W6,tween:W6,spring:nj};function ij(t,e,r=0){return t-e-r}function rae(t,e=0,r=0,n=!0){return n?ij(e+-t,e,r):e-(t-e)+r}function nae(t,e,r,n){return n?t>=e+r:t<=-r}const iae=t=>{const e=({delta:r})=>t(r);return{start:()=>Sn.update(e,!0),stop:()=>Uc.update(e)}};function Vy({duration:t,driver:e=iae,elapsed:r=0,repeat:n=0,repeatType:i="loop",repeatDelay:s=0,keyframes:o,autoplay:a=!0,onPlay:c,onStop:l,onComplete:u,onRepeat:f,onUpdate:d,type:h="keyframes",...p}){var m,v;const y=r;let b,E=0,S=t,P=!1,M=!0,L;const j=tae[o.length>2?"keyframes":h]||W6,H=o[0],K=o[o.length-1];let Q={done:!1,value:H};!((v=(m=j).needsInterpolation)===null||v===void 0)&&v.call(m,H,K)&&(L=XL([0,100],[H,K],{clamp:!1}),o=[0,100]);const Y=j({...p,duration:t,keyframes:o});function F(){E++,i==="reverse"?(M=E%2===0,r=rae(r,S,s,M)):(r=ij(r,S,s),i==="mirror"&&Y.flipTarget()),P=!1,f&&f()}function w(){b&&b.stop(),u&&u()}function k(N){M||(N=-N),r+=N,P||(Q=Y.next(Math.max(0,r)),L&&(Q.value=L(Q.value)),P=M?Q.done:r<=0),d&&d(Q.value),P&&(E===0&&(S=S!==void 0?S:r),E{l&&l(),b&&b.stop()},set currentTime(N){r=y,k(N)},sample:N=>{r=y;const A=t&&typeof t=="number"?Math.max(t*.5,50):50;let O=0;for(k(0);O<=N;){const B=N-O;k(Math.min(B,A)),O+=A}return Q}}}function sae(t){return!t||Array.isArray(t)||typeof t=="string"&&sj[t]}const Xh=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,sj={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xh([0,.65,.55,1]),circOut:Xh([.55,0,1,.45]),backIn:Xh([.31,.01,.66,-.59]),backOut:Xh([.33,1.53,.69,.99])};function oae(t){if(t)return Array.isArray(t)?Xh(t):sj[t]}function aae(t,e,r,{delay:n=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:c}={}){return t.animate({[e]:r,offset:c},{delay:n,duration:i,easing:oae(a),fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const qk={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},sw={},oj={};for(const t in qk)oj[t]=()=>(sw[t]===void 0&&(sw[t]=qk[t]()),sw[t]);function cae(t,{repeat:e,repeatType:r="loop"}){const n=e&&r!=="loop"&&e%2===1?0:t.length-1;return t[n]}const lae=new Set(["opacity"]),pm=10;function uae(t,e,{onUpdate:r,onComplete:n,...i}){if(!(oj.waapi()&&lae.has(e)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0))return!1;let{keyframes:o,duration:a=300,elapsed:c=0,ease:l}=i;if(i.type==="spring"||!sae(i.ease)){if(i.repeat===1/0)return;const f=Vy({...i,elapsed:0});let d={done:!1,value:o[0]};const h=[];let p=0;for(;!d.done&&p<2e4;)d=f.sample(p),h.push(d.value),p+=pm;o=h,a=p-pm,l="linear"}const u=aae(t.owner.current,e,o,{...i,delay:-c,duration:a,ease:l});return u.onfinish=()=>{t.set(cae(o,i)),Sn.update(()=>u.cancel()),n&&n()},{get currentTime(){return u.currentTime||0},set currentTime(f){u.currentTime=f},stop:()=>{const{currentTime:f}=u;if(f){const d=Vy({...i,autoplay:!1});t.setWithVelocity(d.sample(f-pm).value,d.sample(f).value,pm)}Sn.update(()=>u.cancel())}}}function aj(t,e){const r=performance.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(Uc.read(n),t(s-e))};return Sn.read(n,!0),()=>Uc.read(n)}function fae({keyframes:t,elapsed:e,onUpdate:r,onComplete:n}){const i=()=>{r&&r(t[t.length-1]),n&&n()};return e?{stop:aj(i,-e)}:i()}function dae({keyframes:t,velocity:e=0,min:r,max:n,power:i=.8,timeConstant:s=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:f,onComplete:d,onStop:h}){const p=t[0];let m;function v(S){return r!==void 0&&Sn}function y(S){return r===void 0?n:n===void 0||Math.abs(r-S){var M;f==null||f(P),(M=S.onUpdate)===null||M===void 0||M.call(S,P)},onComplete:d,onStop:h})}function E(S){b({type:"spring",stiffness:o,damping:a,restDelta:c,...S})}if(v(p))E({velocity:e,keyframes:[p,y(p)]});else{let S=i*e+p;typeof l<"u"&&(S=l(S));const P=y(S),M=P===r?-1:1;let L,j;const H=K=>{L=j,j=K,e=GC(K-L,na.delta),(M===1&&K>P||M===-1&&Km==null?void 0:m.stop()}}const kl=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),mm=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),ow=()=>({type:"keyframes",ease:"linear",duration:.3}),hae={type:"keyframes",duration:.8},Wk={x:kl,y:kl,z:kl,rotate:kl,rotateX:kl,rotateY:kl,rotateZ:kl,scaleX:mm,scaleY:mm,scale:mm,opacity:ow,backgroundColor:ow,color:ow,default:mm},pae=(t,{keyframes:e})=>e.length>2?hae:(Wk[t]||Wk.default)(e[1]),V6=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&zc.test(e)&&!e.startsWith("url("));function mae({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}function Hk(t){return t===0||typeof t=="string"&&parseFloat(t)===0&&t.indexOf(" ")===-1}function Vk(t){return typeof t=="number"?0:YC("",t)}function cj(t,e){return t[e]||t.default||t}function vae(t,e,r,n){const i=V6(e,r);let s=n.from!==void 0?n.from:t.get();return s==="none"&&i&&typeof r=="string"?s=YC(e,r):Hk(s)&&typeof r=="string"?s=Vk(r):!Array.isArray(r)&&Hk(r)&&typeof s=="string"&&(r=Vk(s)),Array.isArray(r)?(r[0]===null&&(r[0]=s),r):[s,r]}const i4=(t,e,r,n={})=>i=>{const s=cj(n,t)||{},o=s.delay||n.delay||0;let{elapsed:a=0}=n;a=a-gv(o);const c=vae(e,t,r,s),l=c[0],u=c[c.length-1],f=V6(t,l),d=V6(t,u);let h={keyframes:c,velocity:e.getVelocity(),...s,elapsed:a,onUpdate:v=>{e.set(v),s.onUpdate&&s.onUpdate(v)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(!f||!d||Coe.current||s.type===!1)return fae(h);if(s.type==="inertia")return dae(h);mae(s)||(h={...h,...pae(t,h)}),h.duration&&(h.duration=gv(h.duration)),h.repeatDelay&&(h.repeatDelay=gv(h.repeatDelay));const p=e.owner,m=p&&p.current;if(p&&m instanceof HTMLElement&&!(p!=null&&p.getProps().onUpdate)){const v=uae(e,t,h);if(v)return v}return Vy(h)};function yae(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>G6(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=G6(t,e,r);else{const i=typeof e=="function"?Mb(t,e,r.custom):e;n=lj(t,i,r)}return n.then(()=>t.notify("AnimationComplete",e))}function G6(t,e,r={}){var n;const i=Mb(t,e,r.custom);let{transition:s=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>lj(t,i,r):()=>Promise.resolve(),a=!((n=t.variantChildren)===null||n===void 0)&&n.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:d}=s;return gae(t,e,u+l,f,d,r)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,u]=c==="beforeChildren"?[o,a]:[a,o];return l().then(u)}else return Promise.all([o(),a(r.delay)])}function lj(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");n&&(o=n);const u=[],f=i&&((s=t.animationState)===null||s===void 0?void 0:s.getState()[i]);for(const d in c){const h=t.getValue(d),p=c[d];if(!h||p===void 0||f&&xae(f,d))continue;const m={delay:r,elapsed:0,...o};if(window.HandoffAppearAnimations&&!h.hasAnimated){const y=t.getProps()[Eoe];y&&(m.elapsed=window.HandoffAppearAnimations(y,d,h,Sn))}let v=h.start(i4(d,h,p,t.shouldReduceMotion&&Gd.has(d)?{type:!1}:m));qy(l)&&(l.add(d),v=v.then(()=>l.remove(d))),u.push(v)}return Promise.all(u).then(()=>{a&&yoe(t,a)})}function gae(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,c=i===1?(l=0)=>l*n:(l=0)=>a-l*n;return Array.from(t.variantChildren).sort(bae).forEach((l,u)=>{l.notify("AnimationStart",e),o.push(G6(l,e,{...s,delay:r+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function bae(t,e){return t.sortNodePosition(e)}function xae({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}const s4=[Rt.Animate,Rt.InView,Rt.Focus,Rt.Hover,Rt.Tap,Rt.Drag,Rt.Exit],wae=[...s4].reverse(),Eae=s4.length;function Cae(t){return e=>Promise.all(e.map(({animation:r,options:n})=>yae(t,r,n)))}function Sae(t){let e=Cae(t);const r=Aae();let n=!0;const i=(c,l)=>{const u=Mb(t,l);if(u){const{transition:f,transitionEnd:d,...h}=u;c={...c,...h,...d}}return c};function s(c){e=c(t)}function o(c,l){const u=t.getProps(),f=t.getVariantContext(!0)||{},d=[],h=new Set;let p={},m=1/0;for(let y=0;ym&&P;const K=Array.isArray(S)?S:[S];let Q=K.reduce(i,{});M===!1&&(Q={});const{prevResolvedValues:Y={}}=E,F={...Y,...Q},w=k=>{H=!0,h.delete(k),E.needsAnimating[k]=!0};for(const k in F){const R=Q[k],N=Y[k];p.hasOwnProperty(k)||(R!==N?Fy(R)&&Fy(N)?!LL(R,N)||j?w(k):E.protectedKeys[k]=!0:R!==void 0?w(k):h.add(k):R!==void 0&&h.has(k)?w(k):E.protectedKeys[k]=!0)}E.prevProp=S,E.prevResolvedValues=Q,E.isActive&&(p={...p,...Q}),n&&t.blockInitialAnimation&&(H=!1),H&&!L&&d.push(...K.map(k=>({animation:k,options:{type:b,...c}})))}if(h.size){const y={};h.forEach(b=>{const E=t.getBaseTarget(b);E!==void 0&&(y[b]=E)}),d.push({animation:y})}let v=!!d.length;return n&&u.initial===!1&&!t.manuallyAnimateOnMount&&(v=!1),n=!1,v?e(d):Promise.resolve()}function a(c,l,u){var f;if(r[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(c,l)}),r[c].isActive=l;const d=o(u,c);for(const h in r)r[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r}}function kae(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!LL(e,t):!1}function Al(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Aae(){return{[Rt.Animate]:Al(!0),[Rt.InView]:Al(),[Rt.Hover]:Al(),[Rt.Tap]:Al(),[Rt.Drag]:Al(),[Rt.Focus]:Al(),[Rt.Exit]:Al()}}const _ae={animation:vc(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=Sae(t)),Pb(e)&&x.useEffect(()=>e.subscribe(t),[e])}),exit:vc(t=>{const{custom:e,visualElement:r}=t,[n,i]=DL(),s=x.useContext(hp);x.useEffect(()=>{r.isPresent=n;const o=r.animationState&&r.animationState.setActive(Rt.Exit,!n,{custom:s&&s.custom||e});o&&!n&&o.then(i)},[n])})},Gk=(t,e)=>Math.abs(t-e);function Pae(t,e){const r=Gk(t.x,e.x),n=Gk(t.y,e.y);return Math.sqrt(r**2+n**2)}class uj{constructor(e,r,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const l=cw(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,f=Pae(l.offset,{x:0,y:0})>=3;if(!u&&!f)return;const{point:d}=l,{timestamp:h}=na;this.history.push({...d,timestamp:h});const{onStart:p,onMove:m}=this.handlers;u||(p&&p(this.lastMoveEvent,l),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,l)},this.handlePointerMove=(l,u)=>{this.lastMoveEvent=l,this.lastMoveEventInfo=aw(u,this.transformPagePoint),Sn.update(this.updatePoint,!0)},this.handlePointerUp=(l,u)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,h=cw(l.type==="pointercancel"?this.lastMoveEventInfo:aw(u,this.transformPagePoint),this.history);this.startEvent&&f&&f(l,h),d&&d(l,h)},!TL(e))return;this.handlers=r,this.transformPagePoint=n;const i=zC(e),s=aw(i,this.transformPagePoint),{point:o}=s,{timestamp:a}=na;this.history=[{...o,timestamp:a}];const{onSessionStart:c}=r;c&&c(e,cw(s,this.history)),this.removeListeners=Rb(Jf(window,"pointermove",this.handlePointerMove),Jf(window,"pointerup",this.handlePointerUp),Jf(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Uc.update(this.updatePoint)}}function aw(t,e){return e?{point:e(t.point)}:t}function Kk(t,e){return{x:t.x-e.x,y:t.y-e.y}}function cw({point:t},e){return{point:t,delta:Kk(t,fj(e)),offset:Kk(t,Iae(e)),velocity:Tae(e,.1)}}function Iae(t){return t[0]}function fj(t){return t[t.length-1]}function Tae(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=fj(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>gv(e)));)r--;if(!n)return{x:0,y:0};const s=(i.timestamp-n.timestamp)/1e3;if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function _i(t){return t.max-t.min}function K6(t,e=0,r=.01){return Math.abs(t-e)<=r}function Qk(t,e,r,n=.5){t.origin=n,t.originPoint=br(e.min,e.max,t.origin),t.scale=_i(r)/_i(e),(K6(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=br(r.min,r.max,t.origin)-t.originPoint,(K6(t.translate)||isNaN(t.translate))&&(t.translate=0)}function A0(t,e,r,n){Qk(t.x,e.x,r.x,n==null?void 0:n.originX),Qk(t.y,e.y,r.y,n==null?void 0:n.originY)}function Yk(t,e,r){t.min=r.min+e.min,t.max=t.min+_i(e)}function Oae(t,e,r){Yk(t.x,e.x,r.x),Yk(t.y,e.y,r.y)}function Jk(t,e,r){t.min=e.min-r.min,t.max=t.min+_i(e)}function _0(t,e,r){Jk(t.x,e.x,r.x),Jk(t.y,e.y,r.y)}function Rae(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?br(r,t,n.max):Math.min(t,r)),t}function Xk(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function $ae(t,{top:e,left:r,bottom:n,right:i}){return{x:Xk(t.x,r,i),y:Xk(t.y,e,n)}}function Zk(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=Hy(e.min,e.max-n,t.min):n>i&&(r=Hy(t.min,t.max-i,e.min)),bd(0,1,r)}function Dae(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const Q6=.35;function Lae(t=Q6){return t===!1?t=0:t===!0&&(t=Q6),{x:eA(t,"left","right"),y:eA(t,"top","bottom")}}function eA(t,e,r){return{min:tA(t,e),max:tA(t,r)}}function tA(t,e){return typeof t=="number"?t:t[e]||0}const rA=()=>({translate:0,scale:1,origin:0,originPoint:0}),P0=()=>({x:rA(),y:rA()}),nA=()=>({min:0,max:0}),Br=()=>({x:nA(),y:nA()});function Js(t){return[t("x"),t("y")]}function dj({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function jae({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Bae(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function lw(t){return t===void 0||t===1}function Y6({scale:t,scaleX:e,scaleY:r}){return!lw(t)||!lw(e)||!lw(r)}function Il(t){return Y6(t)||hj(t)||t.z||t.rotate||t.rotateX||t.rotateY}function hj(t){return iA(t.x)||iA(t.y)}function iA(t){return t&&t!=="0%"}function Gy(t,e,r){const n=t-r,i=e*n;return r+i}function sA(t,e,r,n,i){return i!==void 0&&(t=Gy(t,i,n)),Gy(t,r,n)+e}function J6(t,e=0,r=1,n,i){t.min=sA(t.min,e,r,n,i),t.max=sA(t.max,e,r,n,i)}function pj(t,{x:e,y:r}){J6(t.x,e.translate,e.scale,e.originPoint),J6(t.y,r.translate,r.scale,r.originPoint)}function Fae(t,e,r,n=!1){var i,s;const o=r.length;if(!o)return;e.x=e.y=1;let a,c;for(let l=0;l1.0000000000001||t<.999999999999?t:1}function sc(t,e){t.min=t.min+e,t.max=t.max+e}function aA(t,e,[r,n,i]){const s=e[i]!==void 0?e[i]:.5,o=br(t.min,t.max,s);J6(t,e[r],e[n],o,e.scale)}const Uae=["x","scaleX","originX"],zae=["y","scaleY","originY"];function Of(t,e){aA(t.x,e,Uae),aA(t.y,e,zae)}function mj(t,e){return dj(Bae(t.getBoundingClientRect(),e))}function qae(t,e,r){const n=mj(t,r),{scroll:i}=e;return i&&(sc(n.x,i.offset.x),sc(n.y,i.offset.y)),n}const Wae=new WeakMap;class Hae{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Br(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){if(this.visualElement.isPresent===!1)return;const n=a=>{this.stopAnimation(),r&&this.snapToCursor(zC(a,"page").point)},i=(a,c)=>{var l;const{drag:u,dragPropagation:f,onDragStart:d}=this.getProps();u&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=$L(u),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Js(h=>{var p,m;let v=this.getAxisMotionValue(h).get()||0;if(go.test(v)){const y=(m=(p=this.visualElement.projection)===null||p===void 0?void 0:p.layout)===null||m===void 0?void 0:m.layoutBox[h];y&&(v=_i(y)*(parseFloat(v)/100))}this.originPoint[h]=v}),d==null||d(a,c),(l=this.visualElement.animationState)===null||l===void 0||l.setActive(Rt.Drag,!0))},s=(a,c)=>{const{dragPropagation:l,dragDirectionLock:u,onDirectionLock:f,onDrag:d}=this.getProps();if(!l&&!this.openGlobalLock)return;const{offset:h}=c;if(u&&this.currentDirection===null){this.currentDirection=Vae(h),this.currentDirection!==null&&(f==null||f(this.currentDirection));return}this.updateAxis("x",c.point,h),this.updateAxis("y",c.point,h),this.visualElement.render(),d==null||d(a,c)},o=(a,c)=>this.stop(a,c);this.panSession=new uj(e,{onSessionStart:n,onStart:i,onMove:s,onSessionEnd:o},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s==null||s(e,r)}cancel(){var e,r;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)===null||e===void 0||e.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(r=this.visualElement.animationState)===null||r===void 0||r.setActive(Rt.Drag,!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!vm(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=Rae(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:r}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;e&&If(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=$ae(n.layoutBox,e):this.constraints=!1,this.elastic=Lae(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Js(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=Dae(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!If(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=qae(n,i.root,this.visualElement.getTransformPagePoint());let o=Mae(i.layout.layoutBox,s);if(r){const a=r(jae(o));this.hasMutatedConstraints=!!a,a&&(o=dj(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Js(u=>{if(!vm(u,r,this.currentDirection))return;let f=(c==null?void 0:c[u])||{};o&&(f={min:0,max:0});const d=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:n?e[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,p)});return Promise.all(l).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(i4(e,n,0,r))}stopAnimation(){Js(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){var r;const n="_drag"+e.toUpperCase(),i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,((r=this.visualElement.getProps().initial)===null||r===void 0?void 0:r[e])||0)}snapToCursor(e){Js(r=>{const{drag:n}=this.getProps();if(!vm(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-br(o,a,.5))}})}scalePositionWithinConstraints(){var e;if(!this.visualElement.current)return;const{drag:r,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!If(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Js(a=>{const c=this.getAxisMotionValue(a);if(c){const l=c.get();s[a]=Nae({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",(e=i.root)===null||e===void 0||e.updateScroll(),i.updateLayout(),this.resolveConstraints(),Js(a=>{if(!vm(a,r,null))return;const c=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];c.set(br(l,u,s[a]))})}addListeners(){var e;if(!this.visualElement.current)return;Wae.set(this.visualElement,this);const r=this.visualElement.current,n=Jf(r,"pointerdown",l=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();If(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&((e=s.root)===null||e===void 0||e.updateScroll(),s.updateLayout()),i();const a=Ob(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Js(f=>{const d=this.getAxisMotionValue(f);d&&(this.originPoint[f]+=l[f].translate,d.set(d.get()+l[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),c==null||c()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Q6,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function vm(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Vae(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}function Gae(t){const{dragControls:e,visualElement:r}=t,n=Tb(()=>new Hae(r));x.useEffect(()=>e&&e.subscribe(n),[n,e]),x.useEffect(()=>n.addListeners(),[n])}function Kae({onPan:t,onPanStart:e,onPanEnd:r,onPanSessionStart:n,visualElement:i}){const s=t||e||r||n,o=x.useRef(null),{transformPagePoint:a}=x.useContext(RC),c={onSessionStart:n,onStart:e,onMove:t,onEnd:(u,f)=>{o.current=null,r&&r(u,f)}};x.useEffect(()=>{o.current!==null&&o.current.updateHandlers(c)});function l(u){o.current=new uj(u,c,{transformPagePoint:a})}Uy(i,"pointerdown",s&&l),qC(()=>o.current&&o.current.end())}const Qae={pan:vc(Kae),drag:vc(Gae)};function X6(t){return typeof t=="string"&&t.startsWith("var(--")}const vj=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Yae(t){const e=vj.exec(t);if(!e)return[,];const[,r,n]=e;return[r,n]}function Z6(t,e,r=1){const[n,i]=Yae(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);return s?s.trim():X6(i)?Z6(i,e,r+1):i}function Jae(t,{...e},r){const n=t.current;if(!(n instanceof Element))return{target:e,transitionEnd:r};r&&(r={...r}),t.values.forEach(i=>{const s=i.get();if(!X6(s))return;const o=Z6(s,n);o&&i.set(o)});for(const i in e){const s=e[i];if(!X6(s))continue;const o=Z6(s,n);o&&(e[i]=o,r&&r[i]===void 0&&(r[i]=s))}return{target:e,transitionEnd:r}}const Xae=new Set(["width","height","top","left","right","bottom","x","y"]),yj=t=>Xae.has(t),Zae=t=>Object.keys(t).some(yj),cA=t=>t===Pu||t===Pe;var lA;(function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"})(lA||(lA={}));const uA=(t,e)=>parseFloat(t.split(", ")[e]),fA=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/);if(i)return uA(i[1],e);{const s=n.match(/^matrix\((.+)\)$/);return s?uA(s[1],t):0}},ece=new Set(["x","y","z"]),tce=jy.filter(t=>!ece.has(t));function rce(t){const e=[];return tce.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e.length&&t.render(),e}const dA={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:fA(4,13),y:fA(5,14)},nce=(t,e,r)=>{const n=e.measureViewportBox(),i=e.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",t.display||"block"),r.forEach(l=>{a[l]=dA[l](n,s)}),e.render();const c=e.measureViewportBox();return r.forEach(l=>{const u=e.getValue(l);u&&u.jump(a[l]),t[l]=dA[l](c,s)}),t},ice=(t,e,r={},n={})=>{e={...e},n={...n};const i=Object.keys(e).filter(yj);let s=[],o=!1;const a=[];if(i.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=r[c],f=$h(u);const d=e[c];let h;if(Fy(d)){const p=d.length,m=d[0]===null?1:0;u=d[m],f=$h(u);for(let v=m;v=0?window.pageYOffset:null,l=nce(e,t,a);return s.length&&s.forEach(([u,f])=>{t.getValue(u).set(f)}),t.render(),_b&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:n}}else return{target:e,transitionEnd:n}};function sce(t,e,r,n){return Zae(e)?ice(t,e,r,n):{target:e,transitionEnd:n}}const oce=(t,e,r,n)=>{const i=Jae(t,e,n);return e=i.target,n=i.transitionEnd,sce(t,e,r,n)},e3={current:null},gj={current:!1};function ace(){if(gj.current=!0,!!_b)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>e3.current=t.matches;t.addListener(e),e()}else e3.current=!1}function cce(t,e,r){const{willChange:n}=e;for(const i in e){const s=e[i],o=r[i];if(ui(s))t.addValue(i,s),qy(n)&&n.add(i);else if(ui(o))t.addValue(i,xd(s,{owner:t})),qy(n)&&n.remove(i);else if(o!==s)if(t.hasValue(i)){const a=t.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=t.getStaticValue(i);t.addValue(i,xd(a!==void 0?a:s,{owner:t}))}}for(const i in r)e[i]===void 0&&t.removeValue(i);return e}const bj=Object.keys(d1),lce=bj.length,hA=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class uce{constructor({parent:e,props:r,reducedMotionConfig:n,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Sn.render(this.render,!1,!0);const{latestValues:o,renderState:a}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=r.initial?{...o}:{},this.renderState=a,this.parent=e,this.props=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=Ib(r),this.isVariantNode=yL(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...l}=this.scrapeMotionValuesFromProps(r,{});for(const u in l){const f=l[u];o[u]!==void 0&&ui(f)&&(f.set(o[u],!1),qy(c)&&c.add(u))}}scrapeMotionValuesFromProps(e,r){return{}}mount(e){var r;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(r=this.parent)===null||r===void 0?void 0:r.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),gj.current||ace(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:e3.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var e,r,n;(e=this.projection)===null||e===void 0||e.unmount(),Uc.update(this.notifyUpdate),Uc.render(this.render),this.valueSubscriptions.forEach(i=>i()),(r=this.removeFromVariantTree)===null||r===void 0||r.call(this),(n=this.parent)===null||n===void 0||n.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(e,r){const n=Gd.has(e),i=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Sn.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...r},n,i,s,o,a){const c=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:h,layoutRoot:p})}return c}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Br()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}makeTargetAnimatable(e,r=!0){return this.makeTargetAnimatableFromInstance(e,this.props,r)}setProps(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const r=this.props;this.props=e;for(let n=0;nn.variantChildren.delete(e)}addValue(e,r){r!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,r)),this.values.set(e,r),this.latestValues[e]=r.get()}removeValue(e){var r;this.values.delete(e),(r=this.valueSubscriptions.get(e))===null||r===void 0||r(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=xd(r,{owner:this}),this.addValue(e,n)),n}readValue(e){return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props,i=typeof n=="string"||typeof n=="object"?(r=UC(this.props,n))===null||r===void 0?void 0:r[e]:void 0;if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!ui(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new VC),this.events[e].add(r)}notify(e,...r){var n;(n=this.events[e])===null||n===void 0||n.notify(...r)}}const xj=["initial",...s4],fce=xj.length;class wj extends uce{sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){var n;return(n=e.style)===null||n===void 0?void 0:n[r]}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:r,...n},{transformValues:i},s){let o=xoe(n,e||{},this);if(i&&(r&&(r=i(r)),n&&(n=i(n)),o&&(o=i(o))),s){goe(this,n,o);const a=oce(this,n,o,r);r=a.transitionEnd,n=a.target}return{transition:e,transitionEnd:r,...n}}}function dce(t){return window.getComputedStyle(t)}class hce extends wj{readValueFromInstance(e,r){if(Gd.has(r)){const n=QC(r);return n&&n.default||0}else{const n=dce(e),i=(xL(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return mj(e,r)}build(e,r,n,i){NC(e,r,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,r){return FC(e,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ui(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}renderInstance(e,r,n,i){kL(e,r,n,i)}}class pce extends wj{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){var n;return Gd.has(r)?((n=QC(r))===null||n===void 0?void 0:n.default)||0:(r=AL.has(r)?r:BC(r),e.getAttribute(r))}measureInstanceViewportBox(){return Br()}scrapeMotionValuesFromProps(e,r){return PL(e,r)}build(e,r,n,i){LC(e,r,n,this.isSVGTag,i.transformTemplate)}renderInstance(e,r,n,i){_L(e,r,n,i)}mount(e){this.isSVGTag=jC(e.tagName),super.mount(e)}}const mce=(t,e)=>MC(t)?new pce(e,{enableHardwareAcceleration:!1}):new hce(e,{enableHardwareAcceleration:!0});function pA(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Mh={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Pe.test(t))t=parseFloat(t);else return t;const r=pA(t,e.target.x),n=pA(t,e.target.y);return`${r}% ${n}%`}},mA="_$css",vce={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=t.includes("var("),s=[];i&&(t=t.replace(vj,h=>(s.push(h),mA)));const o=zc.parse(t);if(o.length>5)return n;const a=zc.createTransformer(t),c=typeof o[0]!="number"?1:0,l=r.x.scale*e.x,u=r.y.scale*e.y;o[0+c]/=l,o[1+c]/=u;const f=br(l,u,.5);typeof o[2+c]=="number"&&(o[2+c]/=f),typeof o[3+c]=="number"&&(o[3+c]/=f);let d=a(o);if(i){let h=0;d=d.replace(mA,()=>{const p=s[h];return h++,p})}return d}};class yce extends g.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;ase(bce),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),C0.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Sn.postRender(()=>{var a;!((a=o.getStack())===null||a===void 0)&&a.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r!=null&&r.group&&r.group.remove(i),n!=null&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e==null||e()}render(){return null}}function gce(t){const[e,r]=DL(),n=x.useContext($C);return g.createElement(yce,{...t,layoutGroup:n,switchLayoutGroup:x.useContext(gL),isPresent:e,safeToRemove:r})}const bce={borderRadius:{...Mh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Mh,borderTopRightRadius:Mh,borderBottomLeftRadius:Mh,borderBottomRightRadius:Mh,boxShadow:vce},xce={measureLayout:gce};function wce(t,e,r={}){const n=ui(t)?t:xd(t);return n.start(i4("",n,e,r)),{stop:()=>n.stop(),isAnimating:()=>n.isAnimating()}}const Ej=["TopLeft","TopRight","BottomLeft","BottomRight"],Ece=Ej.length,vA=t=>typeof t=="string"?parseFloat(t):t,yA=t=>typeof t=="number"||Pe.test(t);function Cce(t,e,r,n,i,s){i?(t.opacity=br(0,r.opacity!==void 0?r.opacity:1,Sce(n)),t.opacityExit=br(e.opacity!==void 0?e.opacity:1,0,kce(n))):s&&(t.opacity=br(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(Hy(t,e,n))}function bA(t,e){t.min=e.min,t.max=e.max}function bs(t,e){bA(t.x,e.x),bA(t.y,e.y)}function xA(t,e,r,n,i){return t-=e,t=Gy(t,1/r,n),i!==void 0&&(t=Gy(t,1/i,n)),t}function Ace(t,e=0,r=1,n=.5,i,s=t,o=t){if(go.test(e)&&(e=parseFloat(e),e=br(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=br(s.min,s.max,n);t===s&&(a-=e),t.min=xA(t.min,e,r,a,i),t.max=xA(t.max,e,r,a,i)}function wA(t,e,[r,n,i],s,o){Ace(t,e[r],e[n],e[i],e.scale,s,o)}const _ce=["x","scaleX","originX"],Pce=["y","scaleY","originY"];function EA(t,e,r,n){wA(t.x,e,_ce,r==null?void 0:r.x,n==null?void 0:n.x),wA(t.y,e,Pce,r==null?void 0:r.y,n==null?void 0:n.y)}function CA(t){return t.translate===0&&t.scale===1}function Sj(t){return CA(t.x)&&CA(t.y)}function kj(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function SA(t){return _i(t.x)/_i(t.y)}class Ice{constructor(){this.members=[]}add(e){WC(this.members,e),e.scheduleRender()}remove(e){if(HC(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){var n;const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,r&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),!((n=e.root)===null||n===void 0)&&n.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var r,n,i,s,o;(n=(r=e.options).onExitComplete)===null||n===void 0||n.call(r),(o=(i=e.resumingFrom)===null||i===void 0?void 0:(s=i.options).onExitComplete)===null||o===void 0||o.call(s)})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function kA(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y;if((i||s)&&(n=`translate3d(${i}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{rotate:c,rotateX:l,rotateY:u}=r;c&&(n+=`rotate(${c}deg) `),l&&(n+=`rotateX(${l}deg) `),u&&(n+=`rotateY(${u}deg) `)}const o=t.x.scale*e.x,a=t.y.scale*e.y;return(o!==1||a!==1)&&(n+=`scale(${o}, ${a})`),n||"none"}const Tce=(t,e)=>t.depth-e.depth;class Oce{constructor(){this.children=[],this.isDirty=!1}add(e){WC(this.children,e),this.isDirty=!0}remove(e){HC(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Tce),this.isDirty=!1,this.children.forEach(e)}}const AA=["","X","Y","Z"],_A=1e3;let Rce=0;function Aj({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o,a={},c=e==null?void 0:e()){this.id=Rce++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Nce),this.nodes.forEach(jce),this.nodes.forEach(Bce)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=o,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0,o&&this.root.registerPotentialNode(o,this);for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=aj(h,250),C0.hasAnimatedSinceResize&&(C0.hasAnimatedSinceResize=!1,this.nodes.forEach(IA))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&f&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:m})=>{var v,y,b,E,S;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const P=(y=(v=this.options.transition)!==null&&v!==void 0?v:f.getDefaultTransition())!==null&&y!==void 0?y:Wce,{onLayoutAnimationStart:M,onLayoutAnimationComplete:L}=f.getProps(),j=!this.targetLayout||!kj(this.targetLayout,m)||p,H=!h&&p;if(this.options.layoutRoot||!((b=this.resumeFrom)===null||b===void 0)&&b.instance||H||h&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,H);const K={...cj(P,"layout"),onPlay:M,onComplete:L};(f.shouldReduceMotion||this.options.layoutRoot)&&(K.delay=0,K.type=!1),this.startAnimation(K)}else!h&&this.animationProgress===0&&IA(this),this.isLead()&&((S=(E=this.options).onExitComplete)===null||S===void 0||S.call(E));this.targetLayout=m})}unmount(){var o,a;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(o=this.getStack())===null||o===void 0||o.remove(this),(a=this.parent)===null||a===void 0||a.children.delete(this),this.instance=void 0,Uc.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var o;return this.isAnimationBlocked||((o=this.parent)===null||o===void 0?void 0:o.isTreeAnimationBlocked())||!1}startUpdate(){var o;this.isUpdateBlocked()||(this.isUpdating=!0,(o=this.nodes)===null||o===void 0||o.forEach(Fce),this.animationId++)}getTransformTemplate(){var o;return(o=this.options.visualElement)===null||o===void 0?void 0:o.getProps().transformTemplate}willUpdate(o=!0){var a,c,l;if(this.root.isUpdateBlocked()){(c=(a=this.options).onExitComplete)===null||c===void 0||c.call(a);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var o;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{var E;const S=b/1e3;TA(h.x,o.x,S),TA(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((E=this.relativeParent)===null||E===void 0)&&E.layout)&&(_0(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),zce(this.relativeTarget,this.relativeTargetOrigin,p,S)),m&&(this.animationValues=d,Cce(d,f,this.latestValues,S,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)===null||a===void 0||a.stop(),this.resumingFrom&&((c=this.resumingFrom.currentAnimation)===null||c===void 0||c.stop()),this.pendingAnimation&&(Uc.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Sn.update(()=>{C0.hasAnimatedSinceResize=!0,this.currentAnimation=wce(0,_A,{...o,onUpdate:l=>{var u;this.mixTargetDelta(l),(u=o.onUpdate)===null||u===void 0||u.call(o,l)},onComplete:()=>{var l;(l=o.onComplete)===null||l===void 0||l.call(o),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var o;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(o=this.getStack())===null||o===void 0||o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var o;this.currentAnimation&&((o=this.mixTargetDelta)===null||o===void 0||o.call(this,_A),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&_j(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Br();const f=_i(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const d=_i(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+d}bs(a,c),Of(a,u),A0(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){var c,l,u;this.sharedNodes.has(o)||this.sharedNodes.set(o,new Ice),this.sharedNodes.get(o).add(a),a.promote({transition:(c=a.options.initialPromotionConfig)===null||c===void 0?void 0:c.transition,preserveFollowOpacity:(u=(l=a.options.initialPromotionConfig)===null||l===void 0?void 0:l.shouldPreserveFollowOpacity)===null||u===void 0?void 0:u.call(l,a)})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.rotate||c.rotateX||c.rotateY||c.rotateZ)&&(a=!0),!a)return;const l={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(PA),this.root.sharedNodes.clear()}}}function $ce(t){t.updateLayout()}function Mce(t){var e,r,n;const i=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=t.layout,{animationType:a}=t.options,c=i.source!==t.layout.source;a==="size"?Js(h=>{const p=c?i.measuredBox[h]:i.layoutBox[h],m=_i(p);p.min=s[h].min,p.max=p.min+m}):_j(a,i.layoutBox,s)&&Js(h=>{const p=c?i.measuredBox[h]:i.layoutBox[h],m=_i(s[h]);p.max=p.min+m});const l=P0();A0(l,s,i.layoutBox);const u=P0();c?A0(u,t.applyTransform(o,!0),i.measuredBox):A0(u,s,i.layoutBox);const f=!Sj(l);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:m}=h;if(p&&m){const v=Br();_0(v,i.layoutBox,p.layoutBox);const y=Br();_0(y,s,m.layoutBox),kj(v,y)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=v,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:i,delta:u,layoutDelta:l,hasLayoutChanged:f,hasRelativeTargetChanged:d})}else t.isLead()&&((n=(r=t.options).onExitComplete)===null||n===void 0||n.call(r));t.options.transition=void 0}function Nce(t){t.isProjectionDirty||(t.isProjectionDirty=!!(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=!!(t.parent&&t.parent.isTransformDirty))}function Dce(t){t.clearSnapshot()}function PA(t){t.clearMeasurements()}function Lce(t){const{visualElement:e}=t.options;e!=null&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function IA(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function jce(t){t.resolveTargetDelta()}function Bce(t){t.calcProjection()}function Fce(t){t.resetRotation()}function Uce(t){t.removeLeadSnapshot()}function TA(t,e,r){t.translate=br(e.translate,0,r),t.scale=br(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function OA(t,e,r,n){t.min=br(e.min,r.min,n),t.max=br(e.max,r.max,n)}function zce(t,e,r,n){OA(t.x,e.x,r.x,n),OA(t.y,e.y,r.y,n)}function qce(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Wce={duration:.45,ease:[.4,0,.1,1]};function Hce(t,e){let r=t.root;for(let s=t.path.length-1;s>=0;s--)if(t.path[s].instance){r=t.path[s];break}const i=(r&&r!==t.root?r.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function RA(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Vce(t){RA(t.x),RA(t.y)}function _j(t,e,r){return t==="position"||t==="preserve-aspect"&&!K6(SA(e),SA(r),.2)}const Gce=Aj({attachResizeListener:(t,e)=>Ob(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),uw={current:void 0},Kce=Aj({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!uw.current){const t=new Gce(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),uw.current=t}return uw.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Qce={..._ae,...Vse,...Qae,...xce},Ic=sse((t,e)=>$se(t,e,Qce,mce,Kce));function Pj(){const t=x.useRef(!1);return Dy(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Yce(){const t=Pj(),[e,r]=x.useState(0),n=x.useCallback(()=>{t.current&&r(e+1)},[e]);return[x.useCallback(()=>Sn.postRender(n),[n]),e]}class Jce extends x.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Xce({children:t,isPresent:e}){const r=x.useId(),n=x.useRef(null),i=x.useRef({width:0,height:0,top:0,left:0});return x.useInsertionEffect(()=>{const{width:s,height:o,top:a,left:c}=i.current;if(e||!n.current||!s||!o)return;n.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` +)[]`,s6=(t,e)=>{const r=[],n=new xr(Yr.mainModule.abi);for(const i of e){const s=fe(i.data||"0x");if(i.to===t&&le(s.slice(0,4))===dN){const o=s.slice(4),a=_n.decode([hN],o)[0];r.push(...s6(i.to,a.map(c=>on({},c,{to:c.target}))))}else try{const o=n.decodeFunctionData("execute",s)[0],a=s6(t,o.map(c=>on({},c,{to:c.target})));r.push(...a)}catch{r.push(i)}}return r};var Bee=Object.freeze({__proto__:null,MetaTransactionsType:cb,intendTransactionBundle:Iee,intendedTransactionID:Tee,unpackMetaTransactionsData:Oee,packMetaTransactionsData:oN,digestOfTransactions:aN,subdigestOfTransactions:Ree,subdigestOfGuestModuleTransactions:$ee,toSequenceTransactions:cN,toSequenceTransaction:iC,isSequenceTransaction:lb,hasSequenceTransactions:lN,sequenceTxAbiEncode:J0,fromTxAbiEncode:Mee,encodeNonce:Nee,decodeNonce:Dee,fromTransactionish:Lee,isTransactionBundle:uN,isSignedTransactionBundle:fN,encodeBundleExecData:jee,selfExecuteSelector:dN,selfExecuteAbi:hN,unwind:s6});const pN="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",Fee="0x6492649264926492649264926492649264926492649264926492649264926492";async function mN(t,e,r,n){return await t.call({data:Et([pN,new Wg().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}var Uee=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:pN,EIP_6492_SUFFIX:Fee,validateEIP6492Offchain:mN});class zee{constructor(e){this.provider=e,this.isDeployedCache=new Set}module(e){return new Od(e,[...Yr.mainModuleUpgradable.abi,...Yr.mainModule.abi,...Yr.erc1271.abi],this.provider)}async isDeployed(e){if(this.isDeployedCache.has(e))return!0;const n=(await this.provider.getCode(e).then(i=>fe(i))).length!==0;return n&&this.isDeployedCache.add(e),n}async implementation(e){const r=_n.encode(["address"],[e]),n=await this.provider.getStorageAt(e,r).then(i=>fe(i));if(n.length===20)return Be(le(n));if(n.length===32)return _n.decode(["address"],n)[0]}async imageHash(e){try{return await this.module(e).imageHash()}catch{}}async nonce(e,r=0){try{return await this.module(e).readNonce(r)}catch(n){if(!await this.isDeployed(e))return 0;throw n}}async isValidSignature(e,r,n){return mN(this.provider,e,r,n)}}var qee=Object.freeze({__proto__:null,OnChainReader:zee});function Wee(t){return t&&t.address&&t.digest&&t.chainId!==void 0&&t.config}var we=Object.freeze({__proto__:null,config:iee,signature:see,context:Pee,signer:fee,EIP1271:cee,transaction:Bee,reader:qee,EIP6492:Uee,isWalletSignRequestMetadata:Wee});const o6=[{config:GE,signature:VE},{config:ab,signature:ob}];function vN(t){const e=t-1;if(e<0||e>=o6.length)throw new Error(`No coder for version: ${t}`);return o6[e]}function Hee(t){return vN(t)}var nn=Object.freeze({__proto__:null,ALL_CODERS:o6,coderFor:vN,genericCoderFor:Hee});const yN=[qo,Ze],Vee=Object.freeze(Object.defineProperty({__proto__:null,allVersions:yN,commons:we,universal:nn,v1:qo,v2:Ze},Symbol.toStringTag,{value:"Module"}));function Gee(t,e,r){for(let n=0;ne.version)&&(e=r);if(e===void 0)throw new Error("No migrations");return e}async getAllMigratePresignedTransaction(e){const{address:r,fromImageHash:n,fromVersion:i,chainId:s}=e;let o=n,a=i;const c=Object.values(this.contexts),l=[];for(let u=1;ufe(s).length===0))return QS;if(!n.provider)throw new Error("signer.provider is not set, but is required");return n.provider.estimateGas({from:e,to:i.to,data:i.data,value:i.value})}))).map(i=>({executed:!0,succeeded:!0,gasUsed:te.from(i).toNumber(),gasLimit:te.from(i).toNumber()}))}async getNonce(e,r,n){if(!this.provider)throw new Error("provider is not set");if(await this.provider.getCode(e)==="0x")return 0;r===void 0&&(r=0);const s=await new Od(e,Yr.mainModule.abi,this.provider).readNonce(r,{blockTag:n});return we.transaction.encodeNonce(r,s)}async wait(e,r,n=this.waitPollRate,i=5){var s=this;typeof e!="string"&&(e=we.transaction.intendedTransactionID(e));let o=!1;const a=async function(u,f){let d=0;for(;!o;){try{return await u()}catch(h){if(d++,i!==void 0&&d>=i)throw Se.error(`giving up after ${d} failed attempts${f?`: ${f}`:""}`,h),h;Se.warn(`attempt #${d} failed${f?`: ${f}`:""}`,h)}n>0&&await new Promise(h=>setTimeout(h,n))}throw new Error(`timed out after ${d} failed attempts${f?`: ${f}`:""}`)},c=async function(){let u=s.fromBlockLog;if(u<0&&(u=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number")+u),typeof e!="string")throw new Error("impossible");const f=e.replace("0x","");for(;!o;){const d=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number"),h=await a(()=>s.provider.getLogs({fromBlock:Math.max(0,u-s.deltaBlocksLog),toBlock:d,topics:["0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881"]}),`unable to get NonceChange logs for blocks ${Math.max(0,u-s.deltaBlocksLog)} to ${d}`);u=d;const m=(await Promise.all(h.map(v=>a(()=>s.provider.getTransactionReceipt(v.transactionHash),`unable to get receipt for transaction ${v.transactionHash}`)))).find(v=>v.logs.find(y=>y.topics.length===0&&y.data.replace("0x","")===f||y.topics.length===1&&y.topics[0]==="0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7"&&y.data.length>=64&&y.data.replace("0x","").startsWith(f)));if(m)return $c({receipt:m},await a(()=>s.provider.getTransaction(m.transactionHash),`unable to get transaction ${m.transactionHash}`));o||await new Promise(v=>setTimeout(v,n))}throw new Error(`Timeout waiting for transaction receipt ${e}`)};return r!==void 0?Promise.race([c(),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):c()}}function ete(t){return t.signer!==void 0&&Tc.isSigner(t.signer)}class tte extends EN{constructor(e){if(super(Tc.isSigner(e)?{provider:e.provider}:$c({},e,{provider:e.signer.provider})),this.signer=void 0,this.txnOptions=void 0,this.signer=Tc.isSigner(e)?e:e.signer,!this.signer.provider)throw new Error("Signer must have a provider")}async getFeeOptions(e,...r){return{options:[]}}async getFeeOptionsRaw(e,r,n){return{options:[]}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}setTransactionOptions(e){this.txnOptions=e}async relay(e,r,n=!0){r!==void 0&&Se.warn("LocalRelayer doesn't accept fee quotes");const i=we.transaction.encodeBundleExecData(e),s=this.signer.sendTransaction($c({to:e.entrypoint,data:i},this.txnOptions,{gasLimit:9e6}));if(n){const o=await s;return o.receipt=await o.wait(),o}else return s}}const rte="v1",nte="v0.4.1",ite="13cf0e854e8127ae83218cc188ef0e7456241c96";let cc=function(t){return t.UNKNOWN="UNKNOWN",t.DROPPED="DROPPED",t.QUEUED="QUEUED",t.SENT="SENT",t.SUCCEEDED="SUCCEEDED",t.PARTIALLY_FAILED="PARTIALLY_FAILED",t.FAILED="FAILED",t}({}),ste=function(t){return t.SEND="SEND",t.RECEIVE="RECEIVE",t.BRIDGE_DEPOSIT="BRIDGE_DEPOSIT",t.BRIDGE_WITHDRAW="BRIDGE_WITHDRAW",t.BURN="BURN",t.UNKNOWN="UNKNOWN",t}({}),ote=function(t){return t.UNKNOWN="UNKNOWN",t.ERC20_TOKEN="ERC20_TOKEN",t.ERC1155_TOKEN="ERC1155_TOKEN",t}({}),ate=function(t){return t.DESC="DESC",t.ASC="ASC",t}({});class CN{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Relayer/",this.ping=n=>this.fetch(this.url("Ping"),xt({},n)).then(i=>wt(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),xt({},n)).then(i=>wt(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),xt({},n)).then(i=>wt(i).then(s=>({status:s.status}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),xt({},n)).then(i=>wt(i).then(s=>({data:s.data}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),xt({},n)).then(i=>wt(i).then(s=>({chainID:s.chainID}))),this.sendMetaTxn=(n,i)=>this.fetch(this.url("SendMetaTxn"),xt(n,i)).then(s=>wt(s).then(o=>({status:o.status,txnHash:o.txnHash}))),this.getMetaTxnNonce=(n,i)=>this.fetch(this.url("GetMetaTxnNonce"),xt(n,i)).then(s=>wt(s).then(o=>({nonce:o.nonce}))),this.getMetaTxnReceipt=(n,i)=>this.fetch(this.url("GetMetaTxnReceipt"),xt(n,i)).then(s=>wt(s).then(o=>({receipt:o.receipt}))),this.simulate=(n,i)=>this.fetch(this.url("Simulate"),xt(n,i)).then(s=>wt(s).then(o=>({results:o.results}))),this.updateMetaTxnGasLimits=(n,i)=>this.fetch(this.url("UpdateMetaTxnGasLimits"),xt(n,i)).then(s=>wt(s).then(o=>({payload:o.payload}))),this.feeTokens=n=>this.fetch(this.url("FeeTokens"),xt({},n)).then(i=>wt(i).then(s=>({isFeeRequired:s.isFeeRequired,tokens:s.tokens}))),this.feeOptions=(n,i)=>this.fetch(this.url("FeeOptions"),xt(n,i)).then(s=>wt(s).then(o=>({options:o.options,sponsored:o.sponsored,quote:o.quote}))),this.getMetaTxnNetworkFeeOptions=(n,i)=>this.fetch(this.url("GetMetaTxnNetworkFeeOptions"),xt(n,i)).then(s=>wt(s).then(o=>({options:o.options}))),this.getMetaTransactions=(n,i)=>this.fetch(this.url("GetMetaTransactions"),xt(n,i)).then(s=>wt(s).then(o=>({page:o.page,transactions:o.transactions}))),this.sentTransactions=(n,i)=>this.fetch(this.url("SentTransactions"),xt(n,i)).then(s=>wt(s).then(o=>({page:o.page,transactions:o.transactions}))),this.pendingTransactions=(n,i)=>this.fetch(this.url("PendingTransactions"),xt(n,i)).then(s=>wt(s).then(o=>({page:o.page,transactions:o.transactions}))),this.getGasTank=(n,i)=>this.fetch(this.url("GetGasTank"),xt(n,i)).then(s=>wt(s).then(o=>({gasTank:o.gasTank}))),this.addGasTank=(n,i)=>this.fetch(this.url("AddGasTank"),xt(n,i)).then(s=>wt(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.updateGasTank=(n,i)=>this.fetch(this.url("UpdateGasTank"),xt(n,i)).then(s=>wt(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.getGasSponsor=(n,i)=>this.fetch(this.url("GetGasSponsor"),xt(n,i)).then(s=>wt(s).then(o=>({gasSponsor:o.gasSponsor}))),this.listGasSponsors=(n,i)=>this.fetch(this.url("ListGasSponsors"),xt(n,i)).then(s=>wt(s).then(o=>({page:o.page,gasSponsors:o.gasSponsors}))),this.addGasSponsor=(n,i)=>this.fetch(this.url("AddGasSponsor"),xt(n,i)).then(s=>wt(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.updateGasSponsor=(n,i)=>this.fetch(this.url("UpdateGasSponsor"),xt(n,i)).then(s=>wt(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.removeGasSponsor=(n,i)=>this.fetch(this.url("RemoveGasSponsor"),xt(n,i)).then(s=>wt(s).then(o=>({status:o.status}))),this.reportGasSponsorUsage=(n,i)=>this.fetch(this.url("ReportGasSponsorUsage"),xt(n,i)).then(s=>wt(s).then(o=>({gasSponsorUsage:o.gasSponsorUsage}))),this.nextGasTankBalanceAdjustmentNonce=(n,i)=>this.fetch(this.url("NextGasTankBalanceAdjustmentNonce"),xt(n,i)).then(s=>wt(s).then(o=>({nonce:o.nonce}))),this.adjustGasTankBalance=(n,i)=>this.fetch(this.url("AdjustGasTankBalance"),xt(n,i)).then(s=>wt(s).then(o=>({status:o.status,adjustment:o.adjustment}))),this.getGasTankBalanceAdjustment=(n,i)=>this.fetch(this.url("GetGasTankBalanceAdjustment"),xt(n,i)).then(s=>wt(s).then(o=>({adjustment:o.adjustment}))),this.listGasTankBalanceAdjustments=(n,i)=>this.fetch(this.url("ListGasTankBalanceAdjustments"),xt(n,i)).then(s=>wt(s).then(o=>({page:o.page,adjustments:o.adjustments}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const xt=(t={},e={})=>({method:"POST",headers:$c({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),wt=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});var cd=Object.freeze({__proto__:null,WebRPCVersion:rte,WebRPCSchemaVersion:nte,WebRPCSchemaHash:ite,ETHTxnStatus:cc,TransferType:ste,FeeTokenType:ote,SortOrder:ate,Relayer:CN});const cte=[cc.DROPPED,cc.SUCCEEDED,cc.PARTIALLY_FAILED,cc.FAILED],lte=[cc.DROPPED,cc.PARTIALLY_FAILED,cc.FAILED];function ute(t){return t.url!==void 0&&typeof t.url=="string"&&t.provider!==void 0&&Pa.isProvider(t.provider)}const fte=typeof Bn=="object"?Bn.fetch:window.fetch;class SN{constructor(e){if(this.options=e,this.service=void 0,this.provider=void 0,this._fetch=(r,n)=>{const i={},{jwtAuth:s,projectAccessKey:o}=this.options;return s&&s.length>0&&(i.Authorization=`BEARER ${s}`),o&&o.length>0&&(i["X-Access-Key"]=o),n.headers=$c({},n.headers,i),fte(r,n)},this.service=new CN(e.url,this._fetch),Pa.isProvider(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=Y0(e.provider.url,n,r);this.provider=new ay(i)}}async waitReceipt(e,r=1e3,n=5,i){typeof e!="string"&&(e=we.transaction.intendedTransactionID(e)),Se.info(`[rpc-relayer/waitReceipt] waiting for ${e}`);let s=0;for(;i===void 0||!i();){try{const{receipt:o}=await this.service.getMetaTxnReceipt({metaTxID:e});if(o&&o.txnReceipt&&o.txnReceipt!=="null"&&cte.includes(o.status))return{receipt:o}}catch(o){if(s++,s===n)throw o}(i===void 0||!i())&&await new Promise(o=>setTimeout(o,r))}throw new Error(`Cancelled waiting for transaction receipt ${e}`)}async simulate(e,...r){const i=_n.encode([we.transaction.MetaTransactionsType],[we.transaction.sequenceTxAbiEncode(r)]);return(await this.service.simulate({wallet:e,transactions:i})).results}async getFeeOptions(e,...r){const n=await this.service.feeTokens();if(n.isFeeRequired){const i=n.tokens.map(c=>c.symbol).join(", ");Se.info(`[rpc-relayer/getFeeOptions] relayer fees are required, accepted tokens are ${i}`);const s=await this.getNonce(e);if(!this.provider)throw Se.warn("[rpc-relayer/getFeeOptions] provider not set, needed for stub signature"),new Error("provider is not set");const{options:o,quote:a}=await this.service.feeOptions({wallet:e,to:e,data:we.transaction.encodeBundleExecData({entrypoint:e,transactions:r,nonce:s})});return Se.info(`[rpc-relayer/getFeeOptions] got refund options ${JSON.stringify(o)}`),{options:o,quote:{_tag:"FeeQuote",_quote:a}}}else return Se.info("[rpc-relayer/getFeeOptions] relayer fees are not required"),{options:[]}}async getFeeOptionsRaw(e,r,n){const{options:i,quote:s}=await this.service.feeOptions({wallet:e,to:e,data:le(r),simulate:n==null?void 0:n.simulate});return{options:i,quote:{_tag:"FeeQuote",_quote:s}}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}async getNonce(e,r){Se.info(`[rpc-relayer/getNonce] get nonce for wallet ${e} space: ${r}`);const n=r!==void 0?te.from(r).toHexString():void 0,i=await this.service.getMetaTxnNonce({walletContractAddress:e,space:n}),s=te.from(i.nonce),[o,a]=we.transaction.decodeNonce(s);return Se.info(`[rpc-relayer/getNonce] got next nonce for wallet ${e} ${a} space: ${o}`),s}async relay(e,r,n=!0){var i=this;Se.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(e)} with quote ${JSON.stringify(r)}`);let s;if(r!==void 0&&(typeof r._quote=="string"?s=r._quote:Se.warn("[rpc-relayer/relay] ignoring invalid fee quote")),!this.provider)throw Se.warn("[rpc-relayer/relay] provider not set, failed relay"),new Error("provider is not set");const o=we.transaction.encodeBundleExecData(e),a=await this.service.sendMetaTxn({call:{walletAddress:e.intent.wallet,contract:e.entrypoint,input:o},quote:s});if(Se.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(a)}`),n)return this.wait(e.intent.id);{const c={hash:e.intent.id,confirmations:0,from:e.intent.wallet,wait:u=>Promise.reject(new Error("impossible"))},l=async function(f){var d;if(!i.provider)throw new Error("cannot wait for receipt, relayer has no provider set");const h=await i.wait(e.intent.id),p=(d=h.receipt)==null?void 0:d.transactionHash;if(!p)throw new Error("cannot wait for receipt, unknown native transaction hash");return Object.assign(c,h),i.provider.waitForTransaction(p,f)};return c.wait=l,c}}async wait(e,r,n=1e3,i=5){var s=this;let o=!1;const{receipt:a}=await(r!==void 0?Promise.race([this.waitReceipt(e,n,i,()=>o),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):this.waitReceipt(e,n,i));if(!a.txnReceipt||lte.includes(a.status))throw new dte(a);const c=JSON.parse(a.txnReceipt);return{blockHash:c.blockHash,blockNumber:te.from(c.blockNumber).toNumber(),confirmations:1,from:typeof e=="string"?void 0:e.intent.wallet,hash:c.transactionHash,raw:a.txnReceipt,receipt:c,wait:async function(l){return s.provider.waitForTransaction(c.transactionHash,l)}}}}class dte{constructor(e){this.receipt=e}}function kN(t){return typeof t=="object"&&typeof t.simulate=="function"&&typeof t.getFeeOptions=="function"&&typeof t.gasRefundOptions=="function"&&typeof t.getNonce=="function"&&typeof t.relay=="function"&&typeof t.wait=="function"}const hte=Object.freeze(Object.defineProperty({__proto__:null,LocalRelayer:tte,ProviderRelayer:EN,ProviderRelayerDefaults:wN,RpcRelayer:SN,RpcRelayerProto:cd,isLocalRelayerOptions:ete,isProviderRelayerOptions:Zee,isRelayer:kN,isRpcRelayerOptions:ute,proto:cd},Symbol.toStringTag,{value:"Module"}));function AN(t){return t.getAddress!==void 0&&t.buildDeployTransaction!==void 0&&t.predecorateSignedTransactions!==void 0&&t.decorateTransactions!==void 0&&t.sign!==void 0&&t.notifyStatusChange!==void 0}class _N{constructor(e,r=!0){this.signer=e,this.eoa=r}getAddress(){return this.signer.getAddress()}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}sign(e,r){return this.signer.signMessage(e)}notifyStatusChange(e,r,n){}suffix(){return[2]}}var f6=Object.freeze({__proto__:null,isSapientSigner:AN,SignerWrapper:_N});let lc=function(t){return t[t.INITIAL=0]="INITIAL",t[t.SIGNING=1]="SIGNING",t[t.SIGNED=2]="SIGNED",t[t.ERROR=3]="ERROR",t}({});function PN(t){return t===void 0||t.state===lc.INITIAL||t.state===lc.SIGNING}class ub{constructor(e,r=ub.randomTag()){this.tag=r,this.observers=[],this.signers=[],this.count=0,this.setSigners(e)}static randomTag(){return`default-${le(Ps(8)).slice(2)}`}pullId(){return`${this.tag}-${this.count++}`}setSigners(e){this.signers=e.map(r=>AN(r)?r:new _N(r))}async getSigners(){return Promise.all(this.signers.map(async function(e){return e.getAddress()}))}subscribe(e){return this.observers.push(e),()=>{this.observers=this.observers.filter(r=>r!==e)}}async notifyObservers(e,r,n){await Promise.all([...this.signers.map(async function(i){return i.notifyStatusChange(e,r,n)}),...this.observers.map(async function(i){return i(r,n)})])}async buildDeployTransaction(e){let r;for(const n of this.signers){const i=await n.buildDeployTransaction(e);r===void 0?r=i:i!=null&&i.transactions&&(r.transactions=i.transactions.concat(r.transactions))}return r}async predecorateSignedTransactions(e){const r=[];for(const n of this.signers)r.push(...await n.predecorateSignedTransactions(e??{}));return r}async decorateTransactions(e,r){for(const n of this.signers)e=await n.decorateTransactions(e,r??{});return e}signMessage(e){var r=this;const n=this.pullId();return new Promise(async function(i){const{message:s,metadata:o,callback:a,candidates:c}=e,l={ended:!1,message:s,signers:{}};let u=o??{};const f=m=>{u=m,r.notifyObservers(n,l,u)},d=()=>{try{r.notifyObservers(n,l,u);const m=Object.entries(l.signers).filter(([v,y])=>PN(y));if(a&&a(l,f)||m.length===0){l.ended=!0,i(l),r.notifyObservers(n,l,u);return}}catch(m){console.error("Error while notifying observers",m)}};let h=r.signers;if(c){const m=await Promise.all(r.signers.map(async function(v){return v.getAddress()}));h=r.signers.filter((v,y)=>c.includes(m[y]))}const p=await Promise.allSettled(h.map(async function(m){const v=await m.getAddress();l.signers[v]={state:lc.SIGNING,request:m.sign(s,o??{}).then(y=>{const b=m.suffix();return l.signers[v]={state:lc.SIGNED,signature:y,suffix:b},d(),y}).catch(y=>{throw l.signers[v]={state:lc.ERROR,error:y},d(),y})}}));for(let m=0;m_t(e))):_t(t)}const JS=t=>{const e=new Map;for(const r of Object.keys(t.signers)){const n=t.signers[r];if(n.state===lc.SIGNED){const i=fe(n.suffix),s=Qe(["bytes","bytes"],[n.signature,i]);e.set(r,{signature:s,isDynamic:i.length!==1||i[0]!==2})}}return e};class X0 extends Tc{constructor(e){if(or.eq(e.chainId)&&!e.coders.signature.supportsNoChainId)throw new Error(`Sequence version ${e.config.version} doesn't support chainId 0`);super(),this.context=void 0,this.config=void 0,this.address=void 0,this.chainId=void 0,this.provider=void 0,this.relayer=void 0,this.coders=void 0,this.orchestrator=void 0,this._reader=void 0,this.context=e.context,this.config=e.config,this.orchestrator=e.orchestrator,this.coders=e.coders,this.address=e.address,this.chainId=e.chainId,this.provider=e.provider,this.relayer=e.relayer,this._reader=e.reader}static newWallet(e){const r=we.context.addressOf(e.context,e.coders.config.imageHashOf(e.config));return new X0(ec({},e,{address:r}))}reader(){if(this._reader)return this._reader;if(!this.provider)throw new Error("Wallet status provider requires a provider");return new we.reader.OnChainReader(this.provider)}setConfig(e){this.config=e}setOrchestrator(e){this.orchestrator=e}setAddress(e){this.address=e}getSigners(){return this.orchestrator.getSigners()}async getAddress(){return this.address}async decorateTransactions(e){const r=await this.orchestrator.decorateTransactions(e);if(await this.reader().isDeployed(this.address))return r;const n=[{to:r.entrypoint,data:we.transaction.encodeBundleExecData(r),revertOnError:!0}],i=await this.buildDeployTransaction();return i&&n.unshift(...i.transactions),{entrypoint:this.context.guestModule,chainId:this.chainId,intent:r.intent,transactions:n}}async buildDeployTransaction(e){if(e!=null&&e.ignoreDeployed&&await this.reader().isDeployed(this.address))return;const r=this.coders.config.imageHashOf(this.config);if(we.context.addressOf(this.context,r)!==this.address)throw new Error(`First address of config ${r} doesn't match wallet address ${this.address}`);const n=X0.buildDeployTransaction(this.context,r);if(e!=null&&e.includeChildren){const i=await this.orchestrator.buildDeployTransaction(e);i&&(n.transactions=i.transactions.concat(n.transactions))}return n}async deploy(e){const r=await this.buildDeployTransaction(e);if(r!==void 0){if(!this.relayer)throw new Error("Wallet deploy requires a relayer");return this.relayer.relay(ec({},r,{chainId:this.chainId,intent:{id:le(Ps(32)),wallet:this.address}}))}}static buildDeployTransaction(e,r){const n=new xr(Yr.factory.abi);return{entrypoint:e.guestModule,transactions:[{to:e.factory,data:n.encodeFunctionData(n.getFunction("deploy"),[e.mainModule,r]),gasLimit:1e5,delegateCall:!1,revertOnError:!0,value:0}]}}async buildUpdateConfigurationTransaction(e){if(this.coders.config.update.isKindUsed){const r=await this.reader().implementation(this.address),n=r&&r===this.context.mainModuleUpgradable;return this.coders.config.update.buildTransaction(this.address,e,this.context,n?"later":"first")}return this.coders.config.update.buildTransaction(this.address,e,this.context)}async getNonce(e=0){const r=await this.reader().nonce(this.address,e);if(r===void 0)throw new Error("Unable to determine nonce");return r}async signDigest(e,r){const n=Z5(this.address,this.chainId,e);if(this.coders.config.hasSubdigest(this.config,n))return this.coders.signature.encodeSigners(this.config,new Map,[n],this.chainId).encoded;const i=ec({},r,{digest:e,chainId:this.chainId,address:this.address,config:this.config}),s=fe(n),o=await this.orchestrator.signMessage({candidates:this.coders.config.signersOf(this.config).map(c=>c.address),message:s,metadata:i,callback:(c,l)=>{const u=JS(c),f=ec({},i,{parts:u});return l(f),this.coders.signature.hasEnoughSigningPower(this.config,u)}}),a=JS(o);return this.coders.signature.encodeSigners(this.config,a,[],this.chainId).encoded}signMessage(e){return this.signDigest(Oe(e),{message:e})}signTransactionBundle(e){if(e.entrypoint!==this.address)throw new Error(`Invalid entrypoint: ${e.entrypoint} !== ${this.address}`);return this.signTransactions(e.transactions,e.nonce)}async fetchNonceOrSpace(e){let r;if(e&&e.space!==void 0)r=te.from(e.space);else{if(e===void 0)return this.randomNonce();if(e&&e.serial===!0)r=0;else return e}const n=await this.reader().nonce(this.address,r);if(n===void 0)throw new Error("Unable to determine nonce");return we.transaction.encodeNonce(r,n)}randomNonce(){const e=te.from(le(Ps(12)));return we.transaction.encodeNonce(e,0)}async signTransactions(e,r,n){const i=await YS(e),s=we.transaction.fromTransactionish(this.address,i);s.length===0&&s.push({to:this.address,data:"0x",value:0,gasLimit:0,delegateCall:!1,revertOnError:!0});const o=await this.fetchNonceOrSpace(r),a=we.transaction.digestOfTransactions(o,s),c=ec({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:Z5(this.address,this.chainId,a),wallet:this.address},chainId:this.chainId,transactions:s,entrypoint:this.address,nonce:o,signature:l}}async sendSignedTransaction(e,r){if(!this.relayer)throw new Error("Wallet sendTransaction requires a relayer");return this.relayer.relay(e,r)}async sendTransaction(e,r){let n;(r==null?void 0:r.nonce)!==void 0?n=r.nonce:r!=null&&r.serial?n={serial:!0}:n=this.randomNonce();const i=await this.signTransactions(e,n),s=await this.decorateTransactions(i);return this.sendSignedTransaction(s,r==null?void 0:r.quote)}async fillGasLimits(e){const r=await YS(e),n=we.transaction.fromTransactionish(this.address,r),i=this.relayer;if(!i)throw new Error("Wallet fillGasLimits requires a relayer");const s=await i.simulate(this.address,...n);return n.map((o,a)=>{const c=o.gasLimit?te.from(o.gasLimit).toNumber():s[a].gasLimit;return ec({},o,s[a],{gasLimit:c})})}connect(e,r){return this.provider=e,this.relayer=r,this}signTransaction(e){throw new Error("Method not implemented.")}}function jo(){return jo=Object.assign?Object.assign.bind():function(t){for(var e=1;emte(t[e])):!1}function yte(t){if(!t)return[];const e=te.from(t.value);switch(t.token.type){case cd.FeeTokenType.UNKNOWN:return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.to,value:e.toHexString(),data:[]}];case cd.FeeTokenType.ERC20_TOKEN:if(!t.token.contractAddress)throw new Error("No contract address for ERC-20 fee option");return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.token.contractAddress,value:0,data:new xr([{constant:!1,inputs:[{type:"address"},{type:"uint256"}],name:"transfer",outputs:[],type:"function"}]).encodeFunctionData("transfer",[t.to,e.toHexString()])}];default:throw new Error(`Unhandled fee token type ${t.token.type}`)}}class gte{constructor(e,r,n){this.account=e,this.chainId=r,this.options=n,this._isSigner=!0}get provider(){return this.account.providerFor(this.chainId)}async getAddress(){return this.account.address}signMessage(e){var r,n;return this.account.signMessage(e,this.chainId,(r=(n=this.options)==null?void 0:n.cantValidateBehavior)!=null?r:"throw")}async defaultSelectFee(e,r){if(r.length===0)return;const n=[{constant:!0,inputs:[{type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],type:"function"}];for(const i of r)if(i.token.type===cd.FeeTokenType.UNKNOWN){if((await this.getBalance()).gte(te.from(i.value)))return i}else if(i.token.contractAddress&&i.token.type===cd.FeeTokenType.ERC20_TOKEN&&(await new Od(i.token.contractAddress,n,this.provider).balanceOf(this.account.address)).gte(te.from(i.value)))return i;throw new Error("No fee option available - not enough balance")}async sendTransaction(e,r){var n,i,s,o,a;const c=vte(e)?await _t(e):e,l=await this.account.prepareTransactions({txs:c,chainId:this.chainId,stubSignatureOverrides:(n=(i=this.options)==null?void 0:i.stubSignatureOverrides)!=null?n:new Map,simulateForFeeOptions:r==null?void 0:r.simulateForFeeOptions}),f=await((s=(o=this.options)==null?void 0:o.selectFee)!=null?s:this.defaultSelectFee.bind(this))(c,l.feeOptions),d=[...l.transactions,...yte(f)];return this.account.sendTransaction(d,this.chainId,l.feeQuote,void 0,void 0,((a=this.options)==null?void 0:a.nonceSpace)!==void 0?{nonceSpace:this.options.nonceSpace}:void 0)}getBalance(e){return this.provider.getBalance(this.account.address,e)}call(e,r){return this.provider.call(e,r)}async resolveName(e){const r=await this.provider.resolveName(e);if(!r)throw new Error(`Could not resolve name ${e}`);return r}connect(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}getTransactionCount(e){throw new Error("Method not implemented.")}estimateGas(e){throw new Error("Method not implemented.")}getChainId(){return Promise.resolve(te.from(this.chainId).toNumber())}getGasPrice(){throw new Error("Method not implemented.")}getFeeData(){throw new Error("Method not implemented.")}checkTransaction(e){throw new Error("Method not implemented.")}populateTransaction(e){throw new Error("Method not implemented.")}_checkProvider(e){throw new Error("Method not implemented.")}}class bte{async isDeployed(e){return!1}async implementation(e){}async imageHash(e){}async nonce(e,r){return or}async isValidSignature(e,r,n){throw new Error("Method not supported.")}}class Qo{constructor(e){this.address=void 0,this.networks=void 0,this.tracker=void 0,this.contexts=void 0,this.migrator=void 0,this.migrations=void 0,this.orchestrator=void 0,this.jwt=void 0,this.projectAccessKey=void 0,this.address=Be(e.address),this.contexts=e.contexts,this.tracker=e.tracker,this.networks=e.networks,this.orchestrator=e.orchestrator,this.jwt=e.jwt,this.projectAccessKey=e.projectAccessKey,this.migrations=e.migrations||u6.DefaultMigrations,this.migrator=new l6.Migrator(e.tracker,this.migrations,this.contexts)}getSigner(e,r){return new gte(this,e,r)}static async new(e){var r;const i=new l6.Migrator(e.tracker,(r=e.migrations)!=null?r:u6.DefaultMigrations,e.contexts).lastMigration(),s=i.configCoder,o=s.fromSimple(e.config),a=s.imageHashOf(o),c=e.contexts[i.version],l=we.context.addressOf(c,a);return await e.tracker.saveCounterfactualWallet({config:o,context:Object.values(e.contexts)}),new Qo({address:l,tracker:e.tracker,contexts:e.contexts,networks:e.networks,orchestrator:e.orchestrator,migrations:e.migrations,projectAccessKey:e.projectAccessKey})}getAddress(){return Promise.resolve(this.address)}get version(){return this.migrator.lastMigration().version}get coders(){const e=this.migrator.lastMigration();return{signature:e.signatureCoder,config:e.configCoder}}network(e){const r=te.from(e),n=this.networks.find(i=>r.eq(i.chainId));if(!n)throw new Error(`Network not found for chainId ${e}`);return n}providerFor(e){const r=this.network(e);if(!r.provider&&!r.rpcUrl)throw new Error(`Provider not found for chainId ${e}`);return r.provider||new ay(Y0(r.rpcUrl,this.projectAccessKey,this.jwt),{name:"",chainId:te.from(e).toNumber()})}reader(e){return or.eq(e)?new bte:new we.reader.OnChainReader(this.providerFor(e))}relayer(e){const r=this.network(e);if(!r.relayer)throw new Error(`Relayer not found for chainId ${e}`);return kN(r.relayer)?r.relayer:new SN(jo({},r.relayer,this.projectAccessKey?{projectAccessKey:this.projectAccessKey}:{jwtAuth:this.jwt}))}setOrchestrator(e){this.orchestrator=e}setJwt(e){this.jwt=e}contextFor(e){const r=this.contexts[e];if(!r)throw new Error(`Context not found for version ${e}`);return r}walletForStatus(e,r){const n=nn.coderFor(r.version);return this.walletFor(e,this.contextFor(r.version),r.config,n)}walletFor(e,r,n,i){const s=or.eq(e);return new X0({config:n,context:r,chainId:e,coders:i,relayer:s?void 0:this.relayer(e),address:this.address,orchestrator:this.orchestrator,reader:this.reader(e)})}async status(e,r=!1){var n=this;const i=this.reader(e).isDeployed(this.address),s=this.tracker.imageHashOfCounterfactualWallet({wallet:this.address}).then(P=>{if(!P)throw new Error(`Counterfactual imageHash not found for wallet ${this.address}`);return P}),o=s.then(P=>gN.counterfactualVersion(this.address,P.imageHash,Object.values(this.contexts))),a=async function(){if(!await i)return o;const M=await n.reader(e).implementation(n.address);if(!M)throw new Error(`Implementation not found for wallet ${n.address}`);const L=Object.values(n.contexts);for(let j=0;j0?m[m.length-1].nextImageHash:d,y=await this.tracker.configOfImageHash({imageHash:v});if(!y)throw new Error(`Config not found for imageHash ${v}`);const b=await i,E=await s,S=nn.coderFor(h).config.checkpointOf(y);return{original:jo({},E,{version:await o}),onChain:{imageHash:f,config:await l,version:u,deployed:b},fullyMigrated:h===this.version,signedMigrations:p,version:h,presignedConfigurations:m,imageHash:v,config:y,checkpoint:S,canOnchainValidate:u===this.version&&b}}mustBeFullyMigrated(e){if(!e.fullyMigrated)throw new Error(`Wallet ${this.address} is not fully migrated`)}async predecorateSignedTransactions(e,r){const n=await this.orchestrator.predecorateSignedTransactions({chainId:r}),i=await this.predecorateTransactions([],e,r);return we.transaction.fromTransactionish(this.address,i).length>0&&n.push(await this.signTransactions(i,r)),n}async predecorateTransactions(e,r,n){if(r.onChain.imageHash!==r.imageHash){const s=await this.walletForStatus(n,r).buildUpdateConfigurationTransaction(r.config);return[Array.isArray(e)?e:[e],s.transactions].flat()}return e}async decorateTransactions(e,r,n){var i,s;if(!Array.isArray(e))return this.decorateTransactions([e],r,n);n=(i=n)!=null?i:e[0].chainId;const o=await this.buildBootstrapTransactions(r,n),a=o.transactions.length>0;if(!a&&e.length===1)return e[0];const{entrypoint:c}=a?o:e[0],l={entrypoint:c,chainId:n,intent:(s=e[0])==null?void 0:s.intent,transactions:[...o.transactions,...e.map(u=>({to:u.entrypoint,data:we.transaction.encodeBundleExecData(u),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}))]};if(!r.onChain.deployed){const u=we.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,n,l.transactions);l.intent===void 0?l.intent={id:u,wallet:this.address}:l.intent.id=u}return l}async decorateSignature(e,r){if(!r.presignedConfigurations||r.presignedConfigurations.length===0)return e;const n=this.coders.signature,i=r.presignedConfigurations.map(o=>o.signature),s=n.chainSignatures(e,i);return n.trim(s)}async publishWitness(){const e=Oe(kt(`This is a Sequence account woo! ${Date.now()}`)),r=await this.signDigest(e,0,!1),n=this.coders.signature.decode(r),i=this.coders.signature.signaturesOfDecoded(n);return this.tracker.saveWitnesses({wallet:this.address,digest:e,chainId:0,signatures:i})}async signDigest(e,r,n=!0,i="ignore",s){const o=or.eq(r)?this.networks[0].chainId:r,a=await this.status(o);if(this.mustBeFullyMigrated(a),!a.canOnchainValidate&&i==="throw")throw new Error("Wallet cannot validate onchain");const l=await this.walletForStatus(r,a).signDigest(e,s),u=n?this.decorateSignature(l,a):l;if(!a.canOnchainValidate)switch(i){case"ignore":return u;case"eip6492":return this.buildEIP6492Signature(await u,a,r)}return u}buildOnChainSignature(e){const r=we.signature.subdigestOf({digest:le(e),chainId:0,address:this.address}),n=le(r),i=this.coders.config.fromSimple({threshold:32768,checkpoint:0,signers:[],subdigests:[n]}),s=new xr(Yr.mainModule.abi),o={entrypoint:this.address,transactions:[{to:this.address,data:s.encodeFunctionData("setExtraImageHash",[this.coders.config.imageHashOf(i),"57896044618658097711785492504343953926634992332820282019728792003956564819968"]),gasLimit:25e4}]};this.tracker.saveWalletConfig({config:i});const a=this.coders.signature.encodeSigners(i,new Map,[n],0).encoded;return{bundle:o,signature:a}}async buildEIP6492Signature(e,r,n){const i=await this.buildBootstrapTransactions(r,n);if(i.transactions.length===0)throw new Error("Cannot build EIP-6492 signature without bootstrap transactions");const s=_n.encode(["address","bytes","bytes"],[i.entrypoint,we.transaction.encodeBundleExecData(i),e]);return Qe(["bytes","bytes32"],[s,we.EIP6492.EIP_6492_SUFFIX])}async editConfig(e){const r=await this.status(0).then(i=>i.config),n=this.coders.config.editConfig(r,jo({},e,{checkpoint:this.coders.config.checkpointOf(r).add(1)}));return this.updateConfig(n)}async updateConfig(e){if(!this.coders.config.isWalletConfig(e))throw new Error(`Invalid config for wallet ${this.address}`);const r=this.coders.config.imageHashOf(e),n=this.coders.signature.hashSetImageHash(r),i=await this.signDigest(n,0,!1);await this.tracker.savePresignedConfiguration({wallet:this.address,nextConfig:e,signature:i});const s=await this.tracker.configOfImageHash({imageHash:r,noCache:!0});if(!s||this.coders.config.imageHashOf(s)!==r)throw Error(`Reverse lookup failed for imageHash ${r}`)}async buildBootstrapTransactions(e,r){var n;const i=await this.orchestrator.buildDeployTransaction({chainId:r}),s=(n=i==null?void 0:i.transactions)!=null?n:[];if(!e.onChain.deployed){const c=X0.buildDeployTransaction(e.original.context,e.original.imageHash);s.push(...c.transactions)}s.length,s.push(...e.signedMigrations.map(c=>({to:c.tx.entrypoint,data:we.transaction.encodeBundleExecData(c.tx),value:0,gasLimit:0,revertOnError:!0,delegateCall:!1})));const o=e.signedMigrations.length>0?e.signedMigrations[0].tx.intent.id:we.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,r,s),{guestModule:a}=this.contextFor(e.version);return{entrypoint:a,transactions:s,chainId:r,intent:{id:o,wallet:this.address}}}async bootstrapTransactions(e,r){const n=r||await this.status(e);return this.buildBootstrapTransactions(n,e)}async doBootstrap(e,r,n){const i=await this.bootstrapTransactions(e,n);return this.relayer(e).relay(jo({},i,{chainId:e}),r)}signMessage(e,r,n="ignore"){return this.signDigest(Oe(e),r,!0,n)}async signTransactions(e,r,n,i){const s=n||await this.status(r);this.mustBeFullyMigrated(s);const o=this.walletForStatus(r,s),a={address:this.address,digest:"",chainId:r,config:{version:this.version},decorate:!0,cantValidateBehavior:"ignore"},c=i!=null&&i.serial?{serial:!0}:(i==null?void 0:i.nonceSpace)!==void 0?{space:i.nonceSpace}:void 0,l=await o.signTransactions(e,c,a);return jo({},l,{signature:await this.decorateSignature(l.signature,s)})}async signMigrations(e,r){const n=await this.status(e);if(n.fullyMigrated)return!1;const i=this.walletForStatus(e,n),s=r(i.config),o=await this.migrator.signNextMigration(this.address,n.version,i,s);if(!o)return!1;await this.tracker.saveWalletConfig({config:s});const a=nn.coderFor(s.version).config,c=a.imageHashOf(s),l=await this.tracker.configOfImageHash({imageHash:c,noCache:!0});if(!l||a.imageHashOf(l)!==c)throw Error(`Reverse lookup failed for imageHash ${c}`);return await this.tracker.saveMigration(this.address,o,this.contexts),!0}async signAllMigrations(e){var r=this;const n=[];return{signedMigrations:(await Promise.all(this.networks.map(async function(o){try{return await r.signMigrations(o.chainId,e)}catch(a){return console.warn(`Failed to sign migrations for chain ${o.chainId}`,a),n.push(o.chainId),null}}))).filter(o=>o!==null),failedChains:n}}async isMigratedAllChains(){var e=this;const r=[];return{migratedAllChains:(await Promise.all(this.networks.map(async function(s){try{return await e.status(s.chainId)}catch(o){return r.push(s.chainId),console.warn(`Failed to get status for chain ${s.chainId}`,o),{fullyMigrated:!0}}}))).every(s=>s.fullyMigrated),failedChains:r}}async sendSignedTransactions(e,r,n,i,s){if(!Array.isArray(e))return this.sendSignedTransactions([e],r,n,i,s);const o=i||await this.status(r);this.mustBeFullyMigrated(o);const a=await this.decorateTransactions(e,o,r);return s==null||s(a),this.relayer(r).relay(a,n)}async fillGasLimits(e,r,n){return this.walletForStatus(r,n||await this.status(r)).fillGasLimits(e)}async gasRefundQuotes(e,r,n,i,s){const o=i||await this.status(r),a=this.walletForStatus(r,o),c=await this.predecorateTransactions(e,o,r),l=we.transaction.fromTransactionish(this.address,c),u=a.coders.config.buildStubSignature(a.config,n),f=le(Ps(32)),d={chainId:r,intent:{id:f,wallet:this.address},signature:u,transactions:l,entrypoint:this.address,nonce:0},h=await this.decorateTransactions(d,o),p=we.transaction.encodeBundleExecData(h),m=await this.relayer(r).getFeeOptionsRaw(h.entrypoint,p,s);return jo({},m,{decorated:h})}async prepareTransactions(e){const r=await this.status(e.chainId),n=await this.fillGasLimits(e.txs,e.chainId,r),i=await this.gasRefundQuotes(n,e.chainId,e.stubSignatureOverrides,r,{simulate:e.simulateForFeeOptions}),s=we.transaction.unwind(this.address,i.decorated.transactions);return{transactions:n,flatDecorated:s,feeOptions:i.options,feeQuote:i.quote}}async sendTransaction(e,r,n,i=!1,s,o){const a=await this.status(r),c=i?e:await this.predecorateTransactions(e,a,r),u=we.transaction.fromTransactionish(this.address,c).length>0?await this.signTransactions(c,r,void 0,o):void 0,f=await this.orchestrator.predecorateSignedTransactions({chainId:r}),d=[];return u!==void 0&&u.transactions.length>0&&d.push(u),d.push(...f.filter(h=>h.transactions.length>0)),this.sendSignedTransactions(d,r,n,void 0,s)}async signTypedData(e,r,n,i,s="ignore"){const o=G1({domain:e,types:r,message:n});return this.signDigest(o,i,!0,s)}async getSigners(){var e=this;const r=n=>n.length?n[n.length-1]:void 0;return(await Promise.all(this.networks.map(async function({chainId:n,name:i}){try{var s;const o=await e.status(n);let a=(s=r(o.presignedConfigurations))==null?void 0:s.nextImageHash;if(!a&&o.onChain.version!==o.version){const f=r(o.signedMigrations);if(f){const{toVersion:d,toConfig:h}=f;a=nn.genericCoderFor(d).config.imageHashOf(h)}}a||(a=o.onChain.imageHash);const c=await e.tracker.configOfImageHash({imageHash:a});if(!c)throw new Error(`unable to find config for image hash ${a}`);return nn.genericCoderFor(c.version).config.signersOf(c).map(f=>jo({},f,{network:n}))}catch(o){return console.warn(`unable to get signers on network ${n} ${i}`,o),[]}}))).flat()}async getAllSigners(){var e=this;const r=[];return await Promise.all(this.networks.map(async function(n){const i=n.chainId,s=await e.status(i,!0),o=[s.onChain.imageHash,...s.onChain.version!==s.version?s.signedMigrations.map(a=>nn.coderFor(a.toVersion).config.imageHashOf(a.toConfig)):[],...s.presignedConfigurations.map(a=>a.nextImageHash)];return Promise.all(o.map(async function(a,c){const l=c===o.length-1,u=await e.tracker.configOfImageHash({imageHash:a});if(!u){console.warn(`AllSigners may be incomplete, config not found for imageHash ${a}`);return}nn.genericCoderFor(u.version).config.signersOf(u).forEach(h=>{const p=r.find(m=>m.address===h.address&&m.network===i);if(p&&l&&p.flaggedForRemoval){p.flaggedForRemoval=!1;return}p||r.push({address:h.address,weight:h.weight,network:i,flaggedForRemoval:!l})})}))})),r}}function xte(t){return t instanceof Qo}const wte=Object.freeze(Object.defineProperty({__proto__:null,Account:Qo,isAccount:xte},Symbol.toStringTag,{value:"Module"}));function vy(){return vy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Tr({},n)).then(i=>Or(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Tr({},n)).then(i=>Or(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Tr({},n)).then(i=>Or(i).then(s=>({status:s.status}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),Tr({},n)).then(i=>Or(i).then(s=>({chainID:s.chainID}))),this.getEtherBalance=(n,i)=>this.fetch(this.url("GetEtherBalance"),Tr(n,i)).then(s=>Or(s).then(o=>({balance:o.balance}))),this.getTokenBalances=(n,i)=>this.fetch(this.url("GetTokenBalances"),Tr(n,i)).then(s=>Or(s).then(o=>({page:o.page,balances:o.balances}))),this.getTokenSupplies=(n,i)=>this.fetch(this.url("GetTokenSupplies"),Tr(n,i)).then(s=>Or(s).then(o=>({page:o.page,contractType:o.contractType,tokenIDs:o.tokenIDs}))),this.getTokenSuppliesMap=(n,i)=>this.fetch(this.url("GetTokenSuppliesMap"),Tr(n,i)).then(s=>Or(s).then(o=>({supplies:o.supplies}))),this.getBalanceUpdates=(n,i)=>this.fetch(this.url("GetBalanceUpdates"),Tr(n,i)).then(s=>Or(s).then(o=>({page:o.page,balances:o.balances}))),this.getTransactionHistory=(n,i)=>this.fetch(this.url("GetTransactionHistory"),Tr(n,i)).then(s=>Or(s).then(o=>({page:o.page,transactions:o.transactions}))),this.syncBalance=(n,i)=>this.fetch(this.url("SyncBalance"),Tr(n,i)).then(s=>Or(s).then(o=>({}))),this.fetchTransactionReceipt=(n,i)=>this.fetch(this.url("FetchTransactionReceipt"),Tr(n,i)).then(s=>Or(s).then(o=>({receipt:o.receipt}))),this.getOrderbookOrders=(n,i)=>this.fetch(this.url("GetOrderbookOrders"),Tr(n,i)).then(s=>Or(s).then(o=>({page:o.page,orders:o.orders}))),this.getTopOrders=(n,i)=>this.fetch(this.url("GetTopOrders"),Tr(n,i)).then(s=>Or(s).then(o=>({orders:o.orders}))),this.fetchTransactionReceiptWithFilter=(n,i)=>this.fetch(this.url("FetchTransactionReceiptWithFilter"),Tr(n,i)).then(s=>Or(s).then(o=>({receipt:o.receipt}))),this.getAllWebhookListeners=(n,i)=>this.fetch(this.url("GetAllWebhookListeners"),Tr(n,i)).then(s=>Or(s).then(o=>({listeners:o.listeners}))),this.getWebhookListener=(n,i)=>this.fetch(this.url("GetWebhookListener"),Tr(n,i)).then(s=>Or(s).then(o=>({listener:o.listener}))),this.addWebhookListener=(n,i)=>this.fetch(this.url("AddWebhookListener"),Tr(n,i)).then(s=>Or(s).then(o=>({status:o.status,listener:o.listener}))),this.updateWebhookListener=(n,i)=>this.fetch(this.url("UpdateWebhookListener"),Tr(n,i)).then(s=>Or(s).then(o=>({status:o.status}))),this.removeWebhookListener=(n,i)=>this.fetch(this.url("RemoveWebhookListener"),Tr(n,i)).then(s=>Or(s).then(o=>({status:o.status}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Tr=(t={},e={})=>({method:"POST",headers:vy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Or=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),XS=typeof Bn=="object"?Bn.fetch:window.fetch;class sC extends IN{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,XS),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=vy({},s.headers,o),XS(i,s)},this.fetch=this._fetch}}const Ote=Object.freeze(Object.defineProperty({__proto__:null,ContractType:ks,EventLogDataType:Ate,EventLogType:kte,Indexer:IN,OrderStatus:_te,SequenceIndexer:sC,SortOrder:Tte,TransactionStatus:Pte,TransactionType:Ite,TxnTransferType:yn,WebRPCSchemaHash:Ste,WebRPCSchemaVersion:Cte,WebRPCVersion:Ete},Symbol.toStringTag,{value:"Module"}));function Z0(){return Z0=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Ve({},n)).then(i=>Ge(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Ve({},n)).then(i=>Ge(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Ve({},n)).then(i=>Ge(i).then(s=>({status:s.status}))),this.getTokenMetadata=(n,i)=>this.fetch(this.url("GetTokenMetadata"),Ve(n,i)).then(s=>Ge(s).then(o=>({tokenMetadata:o.tokenMetadata}))),this.refreshTokenMetadata=(n,i)=>this.fetch(this.url("RefreshTokenMetadata"),Ve(n,i)).then(s=>Ge(s).then(o=>({taskId:o.taskId}))),this.enqueueTokensForRefresh=(n,i)=>this.fetch(this.url("EnqueueTokensForRefresh"),Ve(n,i)).then(s=>Ge(s).then(o=>({taskId:o.taskId}))),this.getTokenRefreshStatus=(n,i)=>this.fetch(this.url("GetTokenRefreshStatus"),Ve(n,i)).then(s=>Ge(s).then(o=>({status:o.status}))),this.getTokenRefreshResult=(n,i)=>this.fetch(this.url("GetTokenRefreshResult"),Ve(n,i)).then(s=>Ge(s).then(o=>({status:o.status,tokens:o.tokens,failureReasons:o.failureReasons}))),this.cancelRefreshJob=(n,i)=>this.fetch(this.url("CancelRefreshJob"),Ve(n,i)).then(s=>Ge(s).then(o=>({ok:o.ok}))),this.getTokenMetadataBatch=(n,i)=>this.fetch(this.url("GetTokenMetadataBatch"),Ve(n,i)).then(s=>Ge(s).then(o=>({contractTokenMetadata:o.contractTokenMetadata}))),this.searchTokenMetadata=(n,i)=>this.fetch(this.url("SearchTokenMetadata"),Ve(n,i)).then(s=>Ge(s).then(o=>({page:o.page,tokenMetadata:o.tokenMetadata}))),this.searchTokenIDs=(n,i)=>this.fetch(this.url("SearchTokenIDs"),Ve(n,i)).then(s=>Ge(s).then(o=>({page:o.page,tokenIds:o.tokenIds}))),this.tokenCollectionFilters=(n,i)=>this.fetch(this.url("TokenCollectionFilters"),Ve(n,i)).then(s=>Ge(s).then(o=>({filters:o.filters}))),this.getContractInfo=(n,i)=>this.fetch(this.url("GetContractInfo"),Ve(n,i)).then(s=>Ge(s).then(o=>({contractInfo:o.contractInfo}))),this.getContractInfoBatch=(n,i)=>this.fetch(this.url("GetContractInfoBatch"),Ve(n,i)).then(s=>Ge(s).then(o=>({contractInfoMap:o.contractInfoMap}))),this.searchContractInfo=(n,i)=>this.fetch(this.url("SearchContractInfo"),Ve(n,i)).then(s=>Ge(s).then(o=>({contractInfoList:o.contractInfoList}))),this.searchContractInfoBatch=(n,i)=>this.fetch(this.url("SearchContractInfoBatch"),Ve(n,i)).then(s=>Ge(s).then(o=>({contractInfoByChain:o.contractInfoByChain}))),this.searchMetadata=(n,i)=>this.fetch(this.url("SearchMetadata"),Ve(n,i)).then(s=>Ge(s).then(o=>({tokenMetadata:o.tokenMetadata,contractInfo:o.contractInfo}))),this.getNiftyswapTokenQuantity=(n,i)=>this.fetch(this.url("GetNiftyswapTokenQuantity"),Ve(n,i)).then(s=>Ge(s).then(o=>({quantity:o.quantity}))),this.getNiftyswapUnitPrices=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPrices"),Ve(n,i)).then(s=>Ge(s).then(o=>({prices:o.prices}))),this.getNiftyswapUnitPricesWithQuantities=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPricesWithQuantities"),Ve(n,i)).then(s=>Ge(s).then(o=>({prices:o.prices}))),this.addContractToMintMonitor=(n,i)=>this.fetch(this.url("AddContractToMintMonitor"),Ve(n,i)).then(s=>Ge(s).then(o=>({ok:o.ok}))),this.removeContractFromMintMonitor=(n,i)=>this.fetch(this.url("RemoveContractFromMintMonitor"),Ve(n,i)).then(s=>Ge(s).then(o=>({ok:o.ok}))),this.mintMonitorJobStatus=(n,i)=>this.fetch(this.url("MintMonitorJobStatus"),Ve(n,i)).then(s=>Ge(s).then(o=>({task:o.task}))),this.mintMonitorTriggerJob=(n,i)=>this.fetch(this.url("MintMonitorTriggerJob"),Ve(n,i)).then(s=>Ge(s).then(o=>({ok:o.ok}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}class ON{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Collections/",this.createCollection=(n,i)=>this.fetch(this.url("CreateCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({collection:o.collection}))),this.getCollection=(n,i)=>this.fetch(this.url("GetCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({collection:o.collection}))),this.listCollections=(n,i)=>this.fetch(this.url("ListCollections"),Ve(n,i)).then(s=>Ge(s).then(o=>({page:o.page,collections:o.collections}))),this.updateCollection=(n,i)=>this.fetch(this.url("UpdateCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({collection:o.collection}))),this.deleteCollection=(n,i)=>this.fetch(this.url("DeleteCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({status:o.status}))),this.publishCollection=(n,i)=>this.fetch(this.url("PublishCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({collection:o.collection}))),this.unpublishCollection=(n,i)=>this.fetch(this.url("UnpublishCollection"),Ve(n,i)).then(s=>Ge(s).then(o=>({collection:o.collection}))),this.createToken=(n,i)=>this.fetch(this.url("CreateToken"),Ve(n,i)).then(s=>Ge(s).then(o=>({token:o.token,assets:o.assets}))),this.getToken=(n,i)=>this.fetch(this.url("GetToken"),Ve(n,i)).then(s=>Ge(s).then(o=>({token:o.token,assets:o.assets}))),this.listTokens=(n,i)=>this.fetch(this.url("ListTokens"),Ve(n,i)).then(s=>Ge(s).then(o=>({page:o.page,tokens:o.tokens}))),this.updateToken=(n,i)=>this.fetch(this.url("UpdateToken"),Ve(n,i)).then(s=>Ge(s).then(o=>({token:o.token}))),this.deleteToken=(n,i)=>this.fetch(this.url("DeleteToken"),Ve(n,i)).then(s=>Ge(s).then(o=>({status:o.status}))),this.createAsset=(n,i)=>this.fetch(this.url("CreateAsset"),Ve(n,i)).then(s=>Ge(s).then(o=>({asset:o.asset}))),this.getAsset=(n,i)=>this.fetch(this.url("GetAsset"),Ve(n,i)).then(s=>Ge(s).then(o=>({asset:o.asset}))),this.updateAsset=(n,i)=>this.fetch(this.url("UpdateAsset"),Ve(n,i)).then(s=>Ge(s).then(o=>({asset:o.asset}))),this.deleteAsset=(n,i)=>this.fetch(this.url("DeleteAsset"),Ve(n,i)).then(s=>Ge(s).then(o=>({status:o.status}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Ve=(t={},e={})=>({method:"POST",headers:Z0({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Ge=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),yy=typeof Bn=="object"?Bn.fetch:window.fetch;class oC extends TN{constructor(e="https://metadata.sequence.app",r,n){super(e.endsWith("/")?e.slice(0,-1):e,yy),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=Z0({},s.headers,o),yy(i,s)},this.fetch=this._fetch}}class Bte extends ON{constructor(e="https://metadata.sequence.app",r){super(e.endsWith("/")?e.slice(0,-1):e,yy),this.jwtAuth=r,this._fetch=(n,i)=>{const s={},o=this.jwtAuth;return o&&o.length>0&&(s.Authorization=`BEARER ${o}`),i.headers=Z0({},i.headers,s),yy(n,i)},this.fetch=this._fetch}}const Fte=Object.freeze(Object.defineProperty({__proto__:null,Collections:ON,ContractType:Nte,Metadata:TN,PropertyType:Dte,SequenceCollections:Bte,SequenceMetadata:oC,SwapType:Lte,TaskStatus:jte,WebRPCSchemaHash:Mte,WebRPCSchemaVersion:$te,WebRPCVersion:Rte},Symbol.toStringTag,{value:"Module"}));function Ute(t,e){const r=t.replace("ipfs://ipfs/","").replace("ipfs://","");return t.startsWith("ipfs://")?`${e}${r}`:t}function zte(t){return t.startsWith("ipfs://")}class qte{constructor(e,r,n=1e3){this.provider=e,this.solver=r,this.window=n,this.pending=new Map}async runByEIP5719(e,r,n){const i=`${e}-${r}-${n}`,s=Date.now();if(this.pending.has(i)&&s-this.pending.get(i).timestamp10)throw new Error("EIP5719 - Too many tries");if(we.signer.canRecover(n)){const c=we.signer.recoverSigner(r,n);if(c&&c.toLowerCase()===t.toLowerCase())return n}try{if(await we.signer.isValidSignature(t,r,n,e))return n}catch{}const o=await Hte(Wte(t,e).getAlternativeSignature(r));if(!o||o==="")throw new Error("EIP5719 - Invalid signature and no alternative signature");const a=le(await(i||new Vte).resolve(o));if(!a||a==="")throw new Error("EIP5719 - Empty alternative signature");if(a===le(n))throw new Error("EIP5719 - Alternative signature is invalid or the same");return RN(t,e,r,a,i,s+1)}class Vte{constructor(e="https://cloudflare-ipfs.com/ipfs/"){var r=this;this.gateway=e,this.uri=n=>zte(n)?Ute(n,this.gateway):n,this.resolve=async function(n){const i=r.uri(n),s=await fetch(i);if(!s.ok)throw new Error(`URISolverIPFS - Failed to fetch ${i}`);return await s.text()}}}const Gte=(t,e)=>e.some(r=>t instanceof r);let ZS,ek;function Kte(){return ZS||(ZS=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Qte(){return ek||(ek=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const $N=new WeakMap,d6=new WeakMap,MN=new WeakMap,$x=new WeakMap,aC=new WeakMap;function Yte(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(Ec(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&$N.set(r,t)}).catch(()=>{}),aC.set(e,t),e}function Jte(t){if(d6.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});d6.set(t,e)}let h6={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return d6.get(t);if(e==="objectStoreNames")return t.objectStoreNames||MN.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Ec(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function Xte(t){h6=t(h6)}function Zte(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(Mx(this),e,...r);return MN.set(n,e.sort?e.sort():[e]),Ec(n)}:Qte().includes(t)?function(...e){return t.apply(Mx(this),e),Ec($N.get(this))}:function(...e){return Ec(t.apply(Mx(this),e))}}function ere(t){return typeof t=="function"?Zte(t):(t instanceof IDBTransaction&&Jte(t),Gte(t,Kte())?new Proxy(t,h6):t)}function Ec(t){if(t instanceof IDBRequest)return Yte(t);if($x.has(t))return $x.get(t);const e=ere(t);return e!==t&&($x.set(t,e),aC.set(e,t)),e}const Mx=t=>aC.get(t);function tre(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=Ec(o);return n&&o.addEventListener("upgradeneeded",c=>{n(Ec(o.result),c.oldVersion,c.newVersion,Ec(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const rre=["get","getKey","getAll","getAllKeys","count"],nre=["put","add","delete","clear"],Nx=new Map;function tk(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Nx.get(e))return Nx.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=nre.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||rre.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return Nx.set(e,s),s}Xte(t=>({...t,get:(e,r,n)=>tk(e,r)||t.get(e,r,n),has:(e,r)=>!!tk(e,r)||t.has(e,r)}));class ire{constructor(){this.loadPresignedConfiguration=void 0,this.savePresignedConfiguration=void 0,this.saveWitnesses=void 0,this.configOfImageHash=void 0,this.saveWalletConfig=void 0,this.imageHashOfCounterfactualWallet=void 0,this.saveCounterfactualWallet=void 0,this.walletsOfSigner=void 0}}var sre=Object.freeze({__proto__:null,ConfigTracker:ire});class ore{constructor(e){this.tracker=e}async loadPresignedConfiguration(e){return console.debug("? loadPresignedConfiguration"),Tn(e,"? "),Tn(await this.tracker.loadPresignedConfiguration(e),"! ")}savePresignedConfiguration(e){return console.debug("? savePresignedConfiguration"),Tn(e,"? "),this.tracker.savePresignedConfiguration(e)}saveWitnesses(e){return console.debug("? saveWitnesses"),Tn(e,"? "),this.tracker.saveWitnesses(e)}async configOfImageHash(e){return console.debug("? configOfImageHash"),Tn(e,"? "),Tn(await this.tracker.configOfImageHash(e),"! ")}saveWalletConfig(e){return console.debug("? saveWalletConfig"),Tn(e,"? "),this.tracker.saveWalletConfig(e)}async imageHashOfCounterfactualWallet(e){return console.debug("? imageHashOfCounterfactualWallet"),Tn(e,"? "),Tn(await this.tracker.imageHashOfCounterfactualWallet(e),"! ")}saveCounterfactualWallet(e){return console.debug("? saveCounterfactualWallet"),Tn(e,"? "),this.tracker.saveCounterfactualWallet(e)}async walletsOfSigner(e){return console.debug("? walletsOfSigner"),Tn(e,"? "),Tn(await this.tracker.walletsOfSigner(e),"! ")}async getMigration(e,r,n,i){return console.debug("? getMigration"),Tn({address:e,fromImageHash:r,fromVersion:n,chainId:i},"? "),Tn(await this.tracker.getMigration(e,r,n,i),"! ")}saveMigration(e,r,n){return console.debug("? saveMigration"),Tn({address:e,signed:r,contexts:n},"? "),this.tracker.saveMigration(e,r,n)}}function Tn(t,e=""){switch(t){case void 0:console.debug(e+"undefined");break;default:JSON.stringify(t,void 0,2).split(` +`).map(r=>e+r).forEach(r=>console.debug(r));break}return t}var are=Object.freeze({__proto__:null,DebugConfigTracker:ore});function Mc(){return Mc=Object.assign?Object.assign.bind():function(t){for(var e=1;ePromise.resolve(this.configs[e]),this.saveConfig=(e,r)=>(this.configs[e]=r,Promise.resolve()),this.loadV2Node=e=>Promise.resolve(this.v2Nodes[e]),this.saveV2Node=(e,r)=>(this.v2Nodes[e]=r,Promise.resolve()),this.loadCounterfactualWallet=e=>Promise.resolve(this.counterfactualWallets[e]),this.saveCounterfactualWallet=(e,r,n)=>(this.counterfactualWallets[e]={imageHash:r,context:n},Promise.resolve()),this.loadPayloadOfSubdigest=e=>Promise.resolve(this.payloads[e]),this.savePayloadOfSubdigest=(e,r)=>(this.payloads[e]=r,Promise.resolve()),this.loadSubdigestsOfSigner=e=>Promise.resolve(Object.keys(this.signatures[e]||{})),this.loadSignatureOfSubdigest=(e,r)=>{var n;return Promise.resolve((n=this.signatures[e])==null?void 0:n[r])},this.saveSignatureOfSubdigest=(e,r,n)=>(this.signatures[e]||(this.signatures[e]={}),this.signatures[e][r]=n,Promise.resolve()),this.loadMigrationsSubdigest=(e,r,n)=>{var i;return Promise.resolve(((i=this.migrations[e])==null||(i=i[r])==null?void 0:i[n])||[])},this.saveMigrationsSubdigest=(e,r,n,i,s)=>(this.migrations[e]||(this.migrations[e]={}),this.migrations[e][r]||(this.migrations[e][r]={}),this.migrations[e][r][n]||(this.migrations[e][r][n]=[]),this.migrations[e][r][n].push({subdigest:i,toImageHash:s}),Promise.resolve())}}function zf(t){if(t===void 0)return;const e={};for(const r of Object.keys(t)){const n=t[r];n._isBigNumber===!0&&n._hex!==void 0&&typeof n._hex=="string"&&n._hex.length!==""?e[r]=te.from(n):Array.isArray(n)?e[r]=n.map(i=>zf(i)):typeof n=="object"&&n!==null?e[r]=zf(n):e[r]=n}return e}class cre{constructor(e){var r=this;this.dbName=e,this._lazyDb=void 0,this.loadConfig=async function(n){return(await r.getDb()).get("configs",n).then(s=>zf(s))},this.saveConfig=async function(n,i){await(await r.getDb()).put("configs",i,n)},this.loadV2Node=async function(n){return(await r.getDb()).get("v2Nodes",n).then(s=>zf(s))},this.saveV2Node=async function(n,i){await(await r.getDb()).put("v2Nodes",i,n)},this.loadCounterfactualWallet=async function(n){return(await r.getDb()).get("counterfactualWallets",n)},this.saveCounterfactualWallet=async function(n,i,s){await(await r.getDb()).put("counterfactualWallets",{imageHash:i,context:s},n)},this.loadPayloadOfSubdigest=async function(n){return(await r.getDb()).get("payloads",n).then(s=>zf(s))},this.savePayloadOfSubdigest=async function(n,i){await(await r.getDb()).put("payloads",i,n)},this.loadSubdigestsOfSigner=async function(n){return(await(await r.getDb()).getAllKeysFromIndex("signatures","signer",IDBKeyRange.only(n))).map(o=>o.split("-")[0])},this.loadSignatureOfSubdigest=async function(n,i){const o=await(await r.getDb()).get("signatures",[i,n].join("-"));return o==null?void 0:o.signature},this.saveSignatureOfSubdigest=async function(n,i,s){await(await r.getDb()).put("signatures",{signature:s,signer:n},[i,n].join("-"))},this.loadMigrationsSubdigest=async function(n,i,s){return(await(await r.getDb()).getAllFromIndex("migrations","jump",IDBKeyRange.only([n,i,s]))).map(c=>({subdigest:c.subdigest,toImageHash:c.toImageHash}))},this.saveMigrationsSubdigest=async function(n,i,s,o,a){await(await r.getDb()).put("migrations",{wallet:n,fromVersion:i,toVersion:s,subdigest:o,toImageHash:a},o)}}async getDb(){if(this._lazyDb)return this._lazyDb;const e=this.dbName;return this._lazyDb=await tre(e,1,{upgrade(r,n,i,s){console.log(`upgrading ${e} from ${n} to ${i} - ${s}`),n===0&&(r.createObjectStore("configs"),r.createObjectStore("v2Nodes"),r.createObjectStore("counterfactualWallets"),r.createObjectStore("payloads"),r.createObjectStore("signatures").createIndex("signer","signer",{unique:!1}),r.createObjectStore("migrations").createIndex("jump",["wallet","fromVersion","toVersion"]))}}),this._lazyDb}}function DN(t){return t.left!==void 0&&t.right!==void 0}function LN(t){return t.weight!==void 0&&t.threshold!==void 0&&t.tree!==void 0}function p6(t){return t.version===2&&t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&typeof t.tree=="string"}var lre=Object.freeze({__proto__:null,isPlainNode:DN,isPlainNested:LN,isPlainV2Config:p6,MemoryTrackerStore:NN,recreateBigNumbers:zf,IndexedDBStore:cre});class cC{constructor(e,r=new NN,n=!1){var i=this;this.provider=e,this.store=r,this.useEIP5719=n,this.cachedEIP5719=void 0,this.loadTopology=async function(s){const o=await i.store.loadV2Node(s);if(!o)return{nodeHash:s};if(DN(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return LN(o)?{weight:te.from(o.weight),threshold:te.from(o.threshold),tree:await i.loadTopology(o.tree)}:o},this.saveTopology=async function(s){if(Ze.config.isNodeLeaf(s))return;const o=Ze.config.hashNode(s);if(Ze.config.isNode(s)){const a=i.saveTopology(s.left),c=i.saveTopology(s.right),l=i.store.saveV2Node(o,{left:Ze.config.hashNode(s.left),right:Ze.config.hashNode(s.right)});await Promise.all([a,c,l]);return}if(Ze.config.isNestedLeaf(s)){const a=i.saveTopology(s.tree),c=i.store.saveV2Node(o,{weight:te.from(s.weight).toString(),threshold:te.from(s.threshold).toString(),tree:Ze.config.hashNode(s.tree)});await Promise.all([a,c]);return}if(Ze.config.isSignerLeaf(s))return i.store.saveV2Node(o,{address:s.address,weight:s.weight});if(Ze.config.isSubdigestLeaf(s))return i.store.saveV2Node(o,{subdigest:s.subdigest});throw new Error(`Unknown topology type: ${s}`)},this.saveWalletConfig=async function(s){const{config:o}=s;if(qo.config.ConfigCoder.isWalletConfig(o)){const a=qo.config.ConfigCoder.imageHashOf(o);return i.store.saveConfig(a,o)}if(Ze.config.ConfigCoder.isWalletConfig(o)){const a=Ze.config.ConfigCoder.imageHashOf(o);if(Ze.config.isComplete(o.tree))return i.store.saveConfig(a,o)}},this.configOfImageHashCache={},this.configOfImageHash=async function(s){const{imageHash:o}=s;if(i.configOfImageHashCache[s.imageHash])return i.configOfImageHashCache[s.imageHash];const a=await i.store.loadConfig(o);if(a){if(a.version===1||a.version===2&&!p6(a))return i.configOfImageHashCache[s.imageHash]=a,a;if(p6(a)){const c={version:2,threshold:te.from(a.threshold),checkpoint:te.from(a.checkpoint),tree:await i.loadTopology(a.tree)};return i.configOfImageHashCache[s.imageHash]=c,c}throw new Error(`Unknown config type: ${a}`)}},this.saveCounterfactualWallet=async function(s){const{config:o,context:a}=s,c=nn.genericCoderFor(o.version).config.imageHashOf(o);await Promise.all([i.saveWalletConfig({config:o}),...a.map(l=>{const u=we.context.addressOf(l,c);return i.store.saveCounterfactualWallet(u,c,l)})])},this.imageHashOfCounterfactualWallet=async function(s){const{wallet:o}=s,a=await i.store.loadCounterfactualWallet(o);if(a)return{imageHash:a.imageHash,context:a.context}},this.savePayload=async function(s){const{payload:o}=s,a=we.signature.subdigestOf(o);await i.store.savePayloadOfSubdigest(a,o)},this.payloadOfSubdigestCache={},this.payloadOfSubdigest=async function(s){if(i.payloadOfSubdigestCache[s.subdigest])return i.payloadOfSubdigestCache[s.subdigest];const{subdigest:o}=s,a=await i.store.loadPayloadOfSubdigest(o);return a&&(i.payloadOfSubdigestCache[o]=a),a},this.savePresignedConfiguration=async function(s){const o=Ze.signature.SignatureCoder.decode(s.signature),a=nn.genericCoderFor(s.nextConfig.version).config.imageHashOf(s.nextConfig),c=Ze.chained.messageSetImageHash(a),l=Oe(c),u={message:c,address:s.wallet,chainId:0,digest:l},f=i.savePayload({payload:u}),d=i.saveWalletConfig({config:s.nextConfig}),h=await Ze.signature.SignatureCoder.recover(o,u,i.provider),p=Ze.signature.signaturesOf(h.config.tree);await Promise.all([f,d,i.saveWalletConfig({config:h.config}),...p.map(m=>i.store.saveSignatureOfSubdigest(m.address,h.subdigest,m.signature))])},this.loadPresignedConfiguration=async function(s){const{wallet:o,fromImageHash:a,longestPath:c}=s,l=await i.configOfImageHash({imageHash:a});if(!l||!Ze.config.ConfigCoder.isWalletConfig(l))return[];const u=Ze.config.signersOf(l.tree).map(E=>E.address),f=await Promise.all(u.map(E=>i.store.loadSubdigestsOfSigner(E))),d=[...new Set(f.flat())],p=(await Promise.all([...new Set(d)].map(async function(E){return Mc({},await i.payloadOfSubdigest({subdigest:E}),{subdigest:E})}))).filter(E=>(E==null?void 0:E.message)&&(E==null?void 0:E.address)&&E.address===o).map(E=>({payload:E,nextImageHash:Ze.chained.decodeMessageSetImageHash(E.message)})).filter(E=>E==null?void 0:E.nextImageHash);let m;const y=(await Promise.all(p.map(async function({nextImageHash:E,payload:S}){const P=await i.configOfImageHash({imageHash:E});if(!P||!Ze.config.isWalletConfig(P))return;const M=te.from(P.checkpoint);return{nextConfig:P,nextCheckpoint:M,nextImageHash:E,payload:S}}))).filter(E=>E!==void 0).filter(E=>E.nextCheckpoint.gt(l.checkpoint)).sort((E,S)=>E.nextCheckpoint.gt(S.nextCheckpoint)?c?1:-1:c?-1:1);for(const E of y){const{nextConfig:S,nextCheckpoint:P,nextImageHash:M,payload:L}=E;if(m){const K=m.checkpoint;if(c){if(P.gte(K))continue}else if(P.lte(K))continue}const j=new Map((await Promise.all(u.map(async function(K){const Q=await i.store.loadSignatureOfSubdigest(K,L.subdigest);if(!Q)return[K,void 0];const Y=le(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(K,L.subdigest,Q):Q),F=we.signer.tryRecoverSigner(L.subdigest,Y)!==K;return[K,{isDynamic:F,signature:Y}]}))).filter(K=>!!K[1]));if(j.size===0)continue;const H=Ze.signature.SignatureCoder.encodeSigners(l,j,[],0);H.weight.lt(l.threshold)||(m={nextImageHash:M,checkpoint:te.from(S.checkpoint),signature:H.encoded})}if(!m)return[];const b=await i.loadPresignedConfiguration({wallet:o,fromImageHash:m.nextImageHash,longestPath:c});return[{wallet:o,nextImageHash:m.nextImageHash,signature:m.signature},...b]},this.saveWitnesses=async function(s){const o={digest:s.digest,address:s.wallet,chainId:s.chainId},a=we.signature.subdigestOf(o);await Promise.all([i.savePayload({payload:o}),...s.signatures.filter(c=>we.signer.canRecover(c)).map(c=>{const l=we.signer.recoverSigner(a,c);return i.store.saveSignatureOfSubdigest(l,a,c)})])},this.walletsOfSigner=async function(s){const o=await i.store.loadSubdigestsOfSigner(s.signer),a=await Promise.all(o.map(l=>i.payloadOfSubdigest({subdigest:l}))).then(l=>l.filter(u=>u!==void 0)),c=[];for(const l of a){const u=l.address;if(c.find(h=>h.wallet===u))continue;const f=we.signature.subdigestOf(l),d=await i.store.loadSignatureOfSubdigest(s.signer,f);d&&c.push({wallet:u,proof:{digest:l.digest,chainId:te.from(l.chainId),signature:le(d)}})}return c},this.cachedEIP5719=new qte(e)}async saveMigration(e,r,n){const i=r.fromVersion;if(i!==1)throw new Error("Migration not supported");if(!Ze.config.isWalletConfig(r.toConfig))throw new Error("Invalid to config");const{newImageHash:s,address:o}=xN.v1v2.decodeTransaction(r.tx,n);if(o!==e)throw new Error("Invalid migration transaction - address");if(Ze.config.ConfigCoder.imageHashOf(r.toConfig)!=s)throw new Error("Invalid migration transaction - config");const a=we.transaction.packMetaTransactionsData(r.tx.nonce,r.tx.transactions),c=Oe(a),l={chainId:r.tx.chainId,message:a,address:e,digest:c},u=we.signature.subdigestOf(l),f=this.savePayload({payload:l}),d=this.saveWalletConfig({config:r.toConfig}),h=qo.signature.SignatureCoder.decode(r.tx.signature),p=await qo.signature.SignatureCoder.recover(h,l,this.provider),m=qo.signature.SignatureCoder.signaturesOf(p.config);await Promise.all([f,d,this.saveWalletConfig({config:p.config}),this.store.saveMigrationsSubdigest(e,i,i+1,u,s),...m.map(v=>this.store.saveSignatureOfSubdigest(v.address,p.subdigest,v.signature))])}async getMigration(e,r,n,i){var s=this;const[o,a]=await Promise.all([this.configOfImageHash({imageHash:r}),this.store.loadMigrationsSubdigest(e,n,n+1)]),c=nn.coderFor(n);return!o||!c.config.isWalletConfig(o)?void 0:(await Promise.all(a.map(async function(u){const{subdigest:f,toImageHash:d}=u,h=await s.payloadOfSubdigest({subdigest:f});if(!h||!h.message||!te.from(i).eq(h.chainId))return;const p=c.config.signersOf(o).map(E=>E.address),m=new Map((await Promise.all(p.map(async function(E){const S=await s.store.loadSignatureOfSubdigest(E,f);if(!S)return[E,void 0];const P=le(s.useEIP5719?await s.cachedEIP5719.runByEIP5719(E,f,S):S),M=we.signer.tryRecoverSigner(f,P)!==E;return[E,{isDynamic:M,signature:P}]}))).filter(E=>!!E[1])),v=c.signature.encodeSigners(o,m,[],i);if(!v||v.weightu.filter(f=>f!==void 0)))[0]}updateProvider(e){this.provider=e}}var ure=Object.freeze({__proto__:null,LocalConfigTracker:cC});let Dx=function(t){return t.EIP712="EIP712",t.EthSign="EthSign",t.EIP1271="EIP1271",t}({});class fre{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Sessions/",this.ping=n=>this.fetch(this.url("Ping"),ms({},n)).then(i=>vs(i).then(s=>({}))),this.config=(n,i)=>this.fetch(this.url("Config"),ms(n,i)).then(s=>vs(s).then(o=>({version:o.version,config:o.config}))),this.wallets=(n,i)=>this.fetch(this.url("Wallets"),ms(n,i)).then(s=>vs(s).then(o=>({wallets:o.wallets}))),this.deployHash=(n,i)=>this.fetch(this.url("DeployHash"),ms(n,i)).then(s=>vs(s).then(o=>({deployHash:o.deployHash,context:o.context}))),this.configUpdates=(n,i)=>this.fetch(this.url("ConfigUpdates"),ms(n,i)).then(s=>vs(s).then(o=>({updates:o.updates}))),this.migrations=(n,i)=>this.fetch(this.url("Migrations"),ms(n,i)).then(s=>vs(s).then(o=>({migrations:o.migrations}))),this.saveConfig=(n,i)=>this.fetch(this.url("SaveConfig"),ms(n,i)).then(s=>vs(s).then(o=>({}))),this.saveWallet=(n,i)=>this.fetch(this.url("SaveWallet"),ms(n,i)).then(s=>vs(s).then(o=>({}))),this.saveSignature=(n,i)=>this.fetch(this.url("SaveSignature"),ms(n,i)).then(s=>vs(s).then(o=>({}))),this.saveSignerSignatures=(n,i)=>this.fetch(this.url("SaveSignerSignatures"),ms(n,i)).then(s=>vs(s).then(o=>({}))),this.saveMigration=(n,i)=>this.fetch(this.url("SaveMigration"),ms(n,i)).then(s=>vs(s).then(o=>({}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const ms=(t={},e={})=>({method:"POST",headers:Mc({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),vs=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});class dre{constructor(e,r=!0){this.onlyRecoverable=r,this.sessions=void 0,this.sessions=new fre(e,fetch)}async loadPresignedConfiguration(e){try{const{updates:r}=await this.sessions.configUpdates({wallet:e.wallet,fromImageHash:e.fromImageHash,allUpdates:e.longestPath});return r.map(({toImageHash:n,signature:i})=>({wallet:e.wallet,nextImageHash:n,signature:i}))}catch(r){if(Lx(r))return[];throw r}}async savePresignedConfiguration(e){const r=e.nextConfig,n=nn.genericCoderFor(r.version).config.imageHashOf(r),i=Ze.signature.setImageHashStruct(n),s=Oe(i);await this.sessions.saveSignature({wallet:e.wallet,digest:s,chainID:"0",signature:e.signature,toConfig:tm(r)})}async saveWitnesses(e){let r=e.signatures;this.onlyRecoverable&&(r=r.filter(n=>we.signer.canRecover(n))),await this.sessions.saveSignerSignatures({wallet:e.wallet,digest:e.digest,chainID:xf(e.chainId),signatures:r})}async configOfImageHash(e){try{const{version:r,config:n}=await this.sessions.config(e);return hre(r,n)}catch(r){if(Lx(r))return;throw r}}async saveWalletConfig(e){const r=tm(e.config);await this.sessions.saveConfig({version:e.config.version,config:r})}async imageHashOfCounterfactualWallet(e){try{const{deployHash:r,context:n}=await this.sessions.deployHash(e);return{imageHash:r,context:n}}catch(r){if(Lx(r))return;throw r}}async saveCounterfactualWallet(e){const r=tm(e.config);await this.sessions.saveWallet({version:e.config.version,deployConfig:r})}async walletsOfSigner(e){const{wallets:r}=await this.sessions.wallets(e);return Object.entries(r).map(([n,{digest:i,chainID:s,type:o,signature:a}])=>{switch(o){case Dx.EIP712:a+=le(we.signer.SigType.EIP712).slice(2);break;case Dx.EthSign:a+=le(we.signer.SigType.ETH_SIGN).slice(2);break;case Dx.EIP1271:a+=le(we.signer.SigType.WALLET_BYTES32).slice(2);break}return{wallet:n,proof:{digest:i,signature:a,chainId:te.from(s)}}})}async getMigration(e,r,n,i){var s=this;const o=xf(i),{migrations:a}=await this.sessions.migrations({wallet:e,fromVersion:n,fromImageHash:r,chainID:o}),c=async function(f){const d=a[f];if(d){const h=Object.keys(d).map(Number).sort((p,m)=>m-p);for(const p of h)for(const[m,v]of Object.entries(d[p]))try{const y=await s.configOfImageHash({imageHash:m});if(y)return{fromVersion:n,toVersion:p,toConfig:y,tx:{entrypoint:v.executor,transactions:v.transactions,nonce:v.nonce,signature:v.signature,chainId:f,intent:{id:we.transaction.subdigestOfTransactions(e,f,v.nonce,v.transactions),wallet:e}}}}catch(y){console.error(y)}}},l=await c(o);if(l)return l;for(const u in a)if(u!==o){const f=await c(u);if(f)return f}}async saveMigration(e,r,n){await this.sessions.saveMigration({wallet:e,fromVersion:r.fromVersion,toVersion:r.toVersion,toConfig:tm(r.toConfig),executor:r.tx.entrypoint,transactions:r.tx.transactions.map(pre),nonce:xf(r.tx.nonce),signature:r.tx.signature,chainID:xf(r.tx.chainId)})}}function tm(t){switch(t.version){case 1:if(qo.config.ConfigCoder.isWalletConfig(t))return{threshold:Dl(t.threshold),signers:t.signers.map(({weight:e,address:r})=>({weight:Dl(e),address:r}))};throw new Error(`not a v${t.version} config: ${t}`);case 2:if(Ze.config.ConfigCoder.isWalletConfig(t))return{threshold:Dl(t.threshold),checkpoint:Dl(t.checkpoint),tree:rv(t.tree)};throw new Error(`not a v${t.version} config: ${t}`);default:throw new Error(`unknown version ${t.version}`)}}function rv(t){return Ze.config.isNode(t)?{left:rv(t.left),right:rv(t.right)}:Ze.config.isSignerLeaf(t)?{weight:Dl(t.weight),address:t.address}:Ze.config.isNestedLeaf(t)?{weight:Dl(t.weight),threshold:Dl(t.threshold),tree:rv(t.tree)}:Ze.config.isNodeLeaf(t)?{node:t.nodeHash}:Mc({},t)}function hre(t,e){switch(t){case 1:return Mc({},e,{version:t});case 2:return Mc({},e,{version:t,tree:nv(e.tree)});default:throw new Error(`unknown version ${t}`)}}function nv(t){switch(typeof t){case"object":const e=Mc({},t);return e.left!==void 0&&(e.left=nv(e.left)),e.right!==void 0&&(e.right=nv(e.right)),e.tree!==void 0&&(e.tree=nv(e.tree)),e.node!==void 0&&(e.nodeHash=e.node,delete e.node),e;default:throw new Error(`v2 config tree ${t} is not an object`)}}function pre(t){return{to:t.to,value:t.value!==void 0?xf(t.value):void 0,data:t.data!==void 0?le(t.data):void 0,gasLimit:t.gasLimit!==void 0?xf(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function Dl(t){return te.from(t).toNumber()}function xf(t){return te.from(t).toString()}function Lx(t){return typeof t=="object"&&t.status===404}var mre=Object.freeze({__proto__:null,RemoteConfigTracker:dre});function m6(t,e,r){return new Promise(n=>{let i=0;t.forEach(s=>s.then(o=>{r(o)?n(o):(i++,i===t.length&&n(e))}).catch(()=>{i++,i===t.length&&n(e)}))})}async function Uh(t,e){return Promise.all(t.map(r=>r.catch(()=>e)))}class vre{constructor(e){this.trackers=e}async configOfImageHash(e){const r=this.trackers.map(async function(a,c){return{res:await a.configOfImageHash(e),i:c}}),n=await m6(r,void 0,a=>(a==null?void 0:a.res)===void 0?!1:nn.genericCoderFor(a.res.version).config.isComplete(a.res));if(n!=null&&n.res)return this.saveWalletConfig({config:n.res,skipTracker:n.i}),n.res;const i=new cC(void 0),s=await Uh(r,void 0);for(const a of s)a!=null&&a.res&&await i.saveWalletConfig({config:a.res});const o=await i.configOfImageHash(e);return o&&this.saveWalletConfig({config:o}),o}async saveWalletConfig(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveWalletConfig(e)}))}async imageHashOfCounterfactualWallet(e){const r=await m6(this.trackers.map(n=>n.imageHashOfCounterfactualWallet(e)),void 0,n=>!!n);return r&&this.configOfImageHash({imageHash:r.imageHash}).then(n=>{n&&this.saveCounterfactualWallet({config:n,context:[r.context]})}),r}async saveCounterfactualWallet(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveCounterfactualWallet(e)}))}async walletsOfSigner(e){const r=await Uh(this.trackers.map(o=>o.walletsOfSigner(e)),[]).then(o=>o.flat()),n={};for(const o of r)n[o.wallet]=o.proof;const i=Object.keys(n).map(o=>({wallet:o,proof:n[o]})),s=new Map;return i.forEach(({wallet:o,proof:{digest:a,chainId:c,signature:l}})=>{const u=`${o}-${a}-${c}`;let f=s.get(u);f||(f={wallet:o,digest:a,chainId:c,signatures:[]},s.set(u,f)),f.signatures.push(l)}),s.forEach(o=>this.saveWitnesses(o)),i}async saveWitnesses(e){await Promise.all(this.trackers.map(r=>r.saveWitnesses(e)))}async loadPresignedConfiguration(e){var r=this;const n=await Uh(this.trackers.map(c=>c.loadPresignedConfiguration(e)),[]),s=(await Uh(n.map(async function(c){const l=c[c.length-1],u=await r.configOfImageHash({imageHash:l.nextImageHash});if(u)return{checkpoint:nn.genericCoderFor(u.version).config.checkpointOf(u),result:c}}),void 0)).reduce((c,l)=>l&&(!c||l.checkpoint.gt(c.checkpoint))?l:c);if(!s)return[];const o=new Map,a=c=>(o.has(c)||o.set(c,this.configOfImageHash({imageHash:c})),o.get(c));return s.result.forEach(async function(c){const l=await a(c.nextImageHash);l&&r.savePresignedConfiguration({wallet:e.wallet,nextConfig:l,signature:c.signature})}),s.result}async savePresignedConfiguration(e){await Promise.all(this.trackers.map(r=>r.savePresignedConfiguration(e)))}async getMigration(e,r,n,i){return(await Promise.all(this.trackers.map(o=>o.getMigration(e,r,n,i)))).find(o=>!!o)}async saveMigration(e,r,n){await Promise.all(this.trackers.map(i=>i.saveMigration(e,r,n)))}}class yre{constructor(e,r,n){this.tracker=e,this.cache=r,this.contexts=n}async loadPresignedConfiguration(e){var r=this;const n=[this.tracker.loadPresignedConfiguration(e),this.cache.loadPresignedConfiguration(e)];let i;const[s,o]=await Promise.all(n);if(s.length>0&&o.length>0&&s[s.length-1].nextImageHash===o[o.length-1].nextImageHash)i=e.longestPath===!0?s.length>o.length?s:o:s.lengthf&&(!u||f.checkpoint.gt(u.checkpoint))?f:u))==null?void 0:c.result)!=null?a:[]}return i||[]}async savePresignedConfiguration(e){await Promise.all([this.tracker.savePresignedConfiguration(e),this.cache.savePresignedConfiguration(e)])}async configOfImageHash(e){if(e.noCache!==!0){const n=await this.cache.configOfImageHash(e);if(n)return n}const r=await this.tracker.configOfImageHash(e);return r&&await this.cache.saveWalletConfig({config:r}),r}async saveWalletConfig(e){await Promise.all([this.tracker.saveWalletConfig(e),this.cache.saveWalletConfig(e)])}async imageHashOfCounterfactualWallet(e){if(e.noCache!==!0){const n=await this.cache.imageHashOfCounterfactualWallet(e);if(n)return n}const r=await this.tracker.imageHashOfCounterfactualWallet(e);if(r){const n=await this.configOfImageHash({imageHash:r.imageHash});n&&await this.cache.saveCounterfactualWallet({config:n,context:[r.context]})}return r}async saveCounterfactualWallet(e){await Promise.all([this.tracker.saveCounterfactualWallet(e),this.cache.saveCounterfactualWallet(e)])}async walletsOfSigner(e){if(e.noCache)return this.tracker.walletsOfSigner(e);const r=await Promise.all([this.tracker.walletsOfSigner(e),this.cache.walletsOfSigner(e)]),n=new Map;for(const i of r)for(const s of i)n.set(s.wallet,s);return Array.from(n.values())}async saveWitnesses(e){await Promise.all([this.tracker.saveWitnesses(e),this.cache.saveWitnesses(e)])}async getMigration(e,r,n,i){const s=await this.cache.getMigration(e,r,n,i);if(s)return s;const o=await this.tracker.getMigration(e,r,n,i);return o&&await this.cache.saveMigration(e,o,this.contexts),o}async saveMigration(e,r,n){await Promise.all([this.tracker.saveMigration(e,r,n),this.cache.saveMigration(e,r,n)])}}class rk{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${Oe(kt(JSON.stringify(i,gre)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}}function gre(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function bre(t){return t instanceof jN}class jN{constructor(e,r=50,n=!1){this.tracker=e,this.window=r,this.verbose=n,this.cache=new rk}invalidateCache(){this.cache=new rk}configOfImageHash(e){return this.cache.do("configOfImageHash",this.window,r=>this.tracker.configOfImageHash(r),e)}getMigration(e,r,n,i){return this.cache.do("getMigration",this.window,(...s)=>this.tracker.getMigration(...s),e,r,n,i)}saveMigration(e,r,n){return this.cache.do("saveMigration",void 0,(...i)=>this.tracker.saveMigration(...i),e,r,n)}loadPresignedConfiguration(e){return this.cache.do("loadPresignedConfiguration",this.window,r=>this.tracker.loadPresignedConfiguration(r),e)}savePresignedConfiguration(e){return this.cache.do("savePresignedConfiguration",void 0,r=>this.tracker.savePresignedConfiguration(r),e)}saveWitnesses(e){return this.cache.do("saveWitnesses",void 0,r=>this.tracker.saveWitnesses(r),e)}saveWalletConfig(e){return this.cache.do("saveWalletConfig",void 0,r=>this.tracker.saveWalletConfig(r),e)}imageHashOfCounterfactualWallet(e){return this.cache.do("imageHashOfCounterfactualWallet",void 0,r=>this.tracker.imageHashOfCounterfactualWallet(r),e)}saveCounterfactualWallet(e){return this.cache.do("saveCounterfactualWallet",void 0,r=>this.tracker.saveCounterfactualWallet(r),e)}walletsOfSigner(e){return this.cache.do("walletsOfSigner",this.window,r=>this.tracker.walletsOfSigner(r),e)}updateProvider(e){this.tracker instanceof cC&&this.tracker.updateProvider(e)}}var lC=Object.freeze({__proto__:null,debug:are,local:ure,remote:mre,stores:lre,raceUntil:m6,allSafe:Uh,MultipleTracker:vre,CachedTracker:yre,isDedupedTracker:bre,DedupedTracker:jN});const xre=Object.freeze(Object.defineProperty({__proto__:null,tracker:sre,trackers:lC},Symbol.toStringTag,{value:"Module"})),BN=60*60*24*7,wre=60;class nk{constructor(e,r,n={},i){this.account=e,this.settings=r,this.status=n,this._initialAuthRequest=void 0,this.proofStrings=new Map,this.onAuthCallbacks=[],this.apiClient=void 0,this.metadataClient=void 0,this.indexerClients=new Map,this.projectAccessKey=void 0,this.projectAccessKey=i}now(){return Math.floor(Date.now()/1e3)}get expiration(){var e;return Math.max((e=this.settings.metadata.expiration)!=null?e:BN,120)}onAuth(e){return this.onAuthCallbacks.push(e),()=>this.onAuthCallbacks=this.onAuthCallbacks.filter(r=>r!==e)}async dump(){return this.status.jwt?{jwt:{token:await this.status.jwt.token,expiration:this.status.jwt.expiration},metadata:this.status.metadata}:{metadata:this.settings.metadata}}auth(e=5){var r=this;return this._initialAuthRequest?this._initialAuthRequest:(this._initialAuthRequest=async function(){const n=r.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");let i;for(let s=1;;s++)try{i=(await r.getJWT(!0)).token;break}catch(o){if(s===e)throw console.error(`couldn't authenticate after ${e} attempts`,o),o}return new Xh(n,void 0,i)}(),this._initialAuthRequest)}async getJWT(e){var r=this;const n=this.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");if(this.status.jwt){const l=this.status.jwt,u=await l.token;if(this.now(){throw this.status.jwt=void 0,l}),expiration:o};return this.status.jwt=a,a.token.then(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"fulfilled",value:l})}catch{}})}).catch(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"rejected",reason:l})}catch{}})}),{token:await a.token,expiration:o}}getProofStringKey(){return`${this.account.address} - ${this.settings.metadata.name}`}async isProofStringValid(e){try{const r=new Q0,n=te.from(this.settings.sequenceApiChainId),i=Rs(this.account.networks,n);if(!i)throw Error("No network found");return r.chainId=n.toNumber(),r.provider=new ay(Y0(i.rpcUrl,this.projectAccessKey),{name:"",chainId:n.toNumber()}),await r.decodeProof(e),!0}catch{return!1}}async getAPIClient(e=!0){if(!this.apiClient){const r=this.settings.sequenceApiUrl;if(!r)throw Error("No sequence api url");const n=(await this.getJWT(e)).token;this.apiClient=new Xh(r,void 0,n)}return this.apiClient}async getMetadataClient(e=!0){if(!this.metadataClient){const r=(await this.getJWT(e)).token;this.metadataClient=new oC(this.settings.sequenceMetadataUrl,void 0,r)}return this.metadataClient}async getIndexerClient(e,r=!0){const n=Rs(this.account.networks,e);if(!n)throw Error(`No network for chain ${e}`);if(!this.indexerClients.has(n.chainId))if(n.indexer)this.indexerClients.set(n.chainId,n.indexer);else if(n.indexerUrl){const i=(await this.getJWT(r)).token;this.indexerClients.set(n.chainId,new sC(n.indexerUrl,void 0,i))}else throw Error(`No indexer url for chain ${e}`);return this.indexerClients.get(n.chainId)}getProofString(e){if(this.proofStrings.has(e)){const c=this.proofStrings.get(e);if(this.now()(r.signature=c,n.encodeProof(r,!0))).catch(c=>{throw this.proofStrings.delete(e),c}),expiration:o};return this.proofStrings.set(e,a),a}}const FN=async(t,e,r)=>{const n=Be(await t.getAddress());if(!n||n===""||n==="0x")throw UN;const i=new rb;if(i.address=n,!r||!r.app||r.app==="")throw new uC("authorization options requires app to be set");i.claims.app=r.app,i.claims.ogn=r.origin,i.claims.n=r.nonce,i.setExpiryIn(r.expiry?Math.max(r.expiry,200):BN);const s=i.messageTypedData(),o=PM(e);i.signature=await(t instanceof Qo?t.signTypedData(s.domain,s.types,s.message,o,"eip6492"):t.signTypedData(s.domain,s.types,s.message,o));const c=await new Q0().encodeProof(i,!0);return{typedData:s,proofString:c}};class uC extends Error{constructor(e){super(e),this.name="AuthError"}}const UN=new uC("auth error: account address is empty");function Il(){return Il=Object.assign?Object.assign.bind():function(t){for(var e=1;eK.wallet));let j;if(L){if(f==null||f(L),j=new Qo({address:L,tracker:E,networks:b,contexts:y,orchestrator:m,projectAccessKey:v}),l&&l.length>0){let K=await j.status(P);if(K.original.version!==K.version||j.version!==K.version){const{migratedAllChains:F,failedChains:x}=await j.isMigratedAllChains();if(x.some(k=>v6.includes(k)))throw Error(`Failed to fetch account status on ${x.join(", ")}`);if(!F){if(p&&!await p(j))throw Error("Migration cancelled, cannot open session");const{failedChains:k}=await j.signAllMigrations(h||(N=>N));if(k.some(N=>v6.includes(N)))throw Error(`Failed to sign migrations on ${k.join(", ")}`);lC.isDedupedTracker(E)&&E.invalidateCache();let R;if([R,K]=await Promise.all([j.isMigratedAllChains().then(N=>N.migratedAllChains),j.status(P)]),!R)throw Error("Failed to migrate account")}}K.onChain.version!==K.version&&await j.doBootstrap(P,void 0,K);const Q=K.config,Y=j.coders.config.editConfig(Q,{add:l,threshold:c});if(j.coders.config.imageHashOf(Q)!==j.coders.config.imageHashOf(Y)){const F=j.coders.config.editConfig(Y,{checkpoint:j.coders.config.checkpointOf(Q).add(1)});await j.updateConfig(F)}}}else{if(!l||l.length===0)throw Error("Cannot create new account without signers");if(!c)throw Error("Cannot create new account without threshold");if(j=await Qo.new({config:{threshold:c,checkpoint:0,signers:l},tracker:E,contexts:y,orchestrator:m,networks:b,projectAccessKey:v}),f==null||f(j.address),await j.publishWitness(),!(await E.walletsOfSigner({signer:a,noCache:!0})).some(Q=>Q.wallet===j.address))throw Error("Account not found on tracker")}let H;return S&&(H=new nk(j,S),H.auth(),H.onAuth(K=>{K.status==="fulfilled"&&j.setJwt(K.value)})),new d0(b,y,j,H)}static async load(e){const{dump:r,settings:n,editConfigOnMigration:i,onMigration:s,orchestrator:o}=e,{contexts:a,networks:c,tracker:l,services:u}=Il({},iv,n);let f;if(zN(r)){var d,h,p;const S=r.config.address||we.context.addressOf(a[1],qo.config.ConfigCoder.imageHashOf(Il({},r.config,{version:1}))),P=((d=(h=r.jwt)==null?void 0:h.expiration)!=null?d:0)M.migratedAllChains)){if(s&&!await s(f))throw Error("Migration cancelled, cannot open session");if(console.log("Migrating account..."),await f.signAllMigrations(i),!await f.isMigratedAllChains().then(M=>M.migratedAllChains))throw Error("Failed to migrate account")}}else if(qN(r)){var m,v,y;const S=((m=(v=r.jwt)==null?void 0:v.expiration)!=null?m:0)async(n,i,s)=>{const o=s.messageDigest();return{isValid:await t(i).isValidSignature(s.address,o,s.signature)}},Cre=Object.freeze(Object.defineProperty({__proto__:null,AuthError:uC,CRITICAL_CHAINS:v6,ErrAccountIsRequired:UN,Session:d0,SessionSettingsDefault:iv,ValidateSequenceWalletProof:Ere,isSessionDumpV1:zN,isSessionDumpV2:qN,signAuthorization:FN},Symbol.toStringTag,{value:"Module"}));function gy(){return gy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),On({},n)).then(i=>Rn(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),On({},n)).then(i=>Rn(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),On({},n)).then(i=>Rn(i).then(s=>({status:s.status}))),this.getSignerConfig=(n,i)=>this.fetch(this.url("GetSignerConfig"),On(n,i)).then(s=>Rn(s).then(o=>({signerConfig:o.signerConfig}))),this.sign=(n,i)=>this.fetch(this.url("Sign"),On(n,i)).then(s=>Rn(s).then(o=>({sig:o.sig}))),this.signWith=(n,i)=>this.fetch(this.url("SignWith"),On(n,i)).then(s=>Rn(s).then(o=>({sig:o.sig}))),this.authMethods=(n,i)=>this.fetch(this.url("AuthMethods"),On(n,i)).then(s=>Rn(s).then(o=>({methods:o.methods,active:o.active}))),this.setPIN=(n,i)=>this.fetch(this.url("SetPIN"),On(n,i)).then(s=>Rn(s).then(o=>({}))),this.resetPIN=(n,i)=>this.fetch(this.url("ResetPIN"),On(n,i)).then(s=>Rn(s).then(o=>({}))),this.createTOTP=(n,i)=>this.fetch(this.url("CreateTOTP"),On(n,i)).then(s=>Rn(s).then(o=>({uri:o.uri}))),this.commitTOTP=(n,i)=>this.fetch(this.url("CommitTOTP"),On(n,i)).then(s=>Rn(s).then(o=>({codes:o.codes}))),this.resetTOTP=(n,i)=>this.fetch(this.url("ResetTOTP"),On(n,i)).then(s=>Rn(s).then(o=>({}))),this.reset2FA=(n,i)=>this.fetch(this.url("Reset2FA"),On(n,i)).then(s=>Rn(s).then(o=>({}))),this.recoveryCodes=(n,i)=>this.fetch(this.url("RecoveryCodes"),On(n,i)).then(s=>Rn(s).then(o=>({codes:o.codes}))),this.resetRecoveryCodes=(n,i)=>this.fetch(this.url("ResetRecoveryCodes"),On(n,i)).then(s=>Rn(s).then(o=>({codes:o.codes}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const On=(t={},e={})=>({method:"POST",headers:gy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Rn=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),kre=typeof Bn=="object"?Bn.fetch:window.fetch;class Are{constructor(e,r,n=!1){this.address=e,this.url=r,this.appendSuffix=n,this.guard=void 0,this.guard=new Sre(r,kre)}async getAddress(){return this.address}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}async sign(e,r){var n;if(!we.isWalletSignRequestMetadata(r))throw new Error("expected sequence signature request metadata");const i=r.guardTotpCode,s=nn.genericCoderFor(r.config.version),{encoded:o}=s.signature.encodeSigners(r.config,(n=r.parts)!=null?n:new Map,[],r.chainId);return(await this.guard.signWith({signer:this.address,request:{msg:le(e),auxData:this.packMsgAndSig(r.address,r.digest,o,r.chainId),chainId:te.from(r.chainId).toNumber()},token:i?{id:by.TOTP,token:i}:void 0})).sig}notifyStatusChange(e,r,n){}async getAuthMethods(e){let r;if("jwt"in e)r=await this.guard.authMethods({},{Authorization:`BEARER ${e.jwt}`});else{const n=await y6(e);r=await this.guard.authMethods({proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}return gy({},r,{methods:r.methods.map(_re)})}async setPin(e,r){const n=await xh(r);e===void 0?await this.guard.resetPIN({timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`}):await this.guard.setPIN({pin:e,timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`})}resetPin(e){return this.setPin(void 0,e)}async createTotp(e){const r=await xh(e),{uri:n}=await this.guard.createTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return new URL(n)}async commitTotp(e,r){const{codes:n}=await this.guard.commitTOTP({token:e},{Authorization:`BEARER ${r}`});return n}async resetTotp(e){const r=await xh(e);await this.guard.resetTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`})}async reset2fa(e,r){if("jwt"in r)await this.guard.reset2FA({code:e},{Authorization:`BEARER ${r.jwt}`});else{const n=await y6(r);await this.guard.reset2FA({code:e,proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}}async getRecoveryCodes(e){const r=await xh(e),{codes:n}=await this.guard.recoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}async resetRecoveryCodes(e){const r=await xh(e),{codes:n}=await this.guard.resetRecoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}packMsgAndSig(e,r,n,i){return _n.encode(["address","uint256","bytes","bytes"],[e,i,r,n])}suffix(){return this.appendSuffix?[3]:[]}}let by=function(t){return t.PIN="PIN",t.TOTP="TOTP",t}({});function _re(t){switch(t){case by.PIN:case by.TOTP:return t;default:throw new Error(`unknown auth method '${t}'`)}}function WN(t){return"signerAddress"in t&&typeof t.signerAddress=="string"}async function y6(t){if(WN(t))return t;{const e=f6.isSapientSigner(t.signer)?t.signer:new f6.SignerWrapper(t.signer),r=await e.getAddress(),n=new Date,i=HN(t.walletAddress,n),s=G1(i);return{walletAddress:t.walletAddress,timestamp:n,signerAddress:r,signature:le(await e.sign(s,{}))}}}async function xh(t){if("wallet"in t){var e;const r=new Date,n=VN(r),i=await t.wallet.signTypedData(n.domain,n.types,n.message,(e=n.domain.chainId)!=null?e:1,"eip6492");return{jwt:t.jwt,timestamp:r,signature:i}}else return t}function HN(t,e){return{domain:GN,types:{AuthMethods:[{name:"wallet",type:"address"},{name:"timestamp",type:"string"}]},message:{wallet:Be(t),timestamp:KN(e)}}}function VN(t){return{domain:GN,types:{AuthUpdate:[{name:"timestamp",type:"string"}]},message:{timestamp:KN(t)}}}const GN={name:"Sequence Guard",version:"1",chainId:1};function KN(t){return t.toUTCString().replace("GMT","UTC")}const Pre=Object.freeze(Object.defineProperty({__proto__:null,AuthMethod:by,GuardSigner:Are,getAuthUpdateProofTypedData:VN,getOwnershipProofTypedData:HN,isSignedOwnershipProof:WN,signOwnershipProof:y6},Symbol.toStringTag,{value:"Module"}));function xy(){return xy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(n,i,s)=>{if(this.batchableJsonRpcMethods.find(o=>o===i.method)){this.queue.push({request:i,callback:s,next:n}),this.options.verbose&&console.log("Scheduling call",i.method),this.scheduleExecution();return}return this.options.verbose&&console.log("Forwarded call",i.method),n(i,s)},this.run=async function(){r.options.verbose&&console.log("Processing multicall");const n=Math.min(r.options.batchSize,r.queue.length);if(n===0){r.options.verbose&&console.log("Skip multicall, empty queue");return}if(n===1){r.forward(r.queue[0]),r.queue=[],r.options.verbose&&console.log("Skip multicall, single item");return}r.options.verbose&&console.log("Resolving",n);var a=r.queue.slice(0,n);r.queue=n===r.queue.length?[]:r.queue.slice(n),r.options.verbose&&console.log("Updated queue",r.queue.length),r.queue.length!==0&&(r.options.verbose&&console.log("Scheduling next batch"),r.scheduleExecution());const i=a[0].next;let s;var[a,c]=ik(a,h=>{try{if(h.next!==i)return!1;switch(h.request.method){case Br.ethCall:if(h.request.params[0].from||h.request.params[0].gasPrice||h.request.params[0].value)return!1;case Br.ethGetBalance:case Br.ethGetCode:const p=Tre(h.request.params[1]);if(s===void 0&&(s=p),!Ore(p,s))return!1}return!0}catch{return!1}});if(c.length!==0&&(r.options.verbose&&console.log("Forwarding incompatible calls",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls are incompatible");return}let o=a.map(h=>{try{switch(h.request.method){case Br.ethCall:return{delegateCall:!1,revertOnError:!1,target:h.request.params[0].to,data:h.request.params[0].data,gasLimit:h.request.params[0].gas?h.request.params[0].gas:0,value:0};case Br.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callCode"),[h.request.params[0]])};case Br.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callBalanceOf"),[h.request.params[0]])};default:return null}}catch{return null}});var[a,c]=ik(a,(h,p)=>o[p]!==void 0);if(o=o.filter(h=>h),c.length!==0&&(r.options.verbose&&console.log("Forwarding calls on error",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls had encoding errors");return}let l;try{r.options.verbose&&console.log("Encoding multicall"),l=r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("multiCall"),[o])}catch(h){r.options.verbose&&console.warn("Error encoding multicall, forwarding one by one",h),r.forward(a);return}const u=jE(),f=await Ire(LE(i)({id:u,jsonrpc:ad,method:Br.ethCall,params:[{to:r.options.contract,value:0,data:l},te.isBigNumber(s)?s.toNumber():s]}),h=>({jsonrpc:ad,id:u,result:void 0,error:h}));if(f.error)return r.options.verbose&&console.warn("Error calling multicall, forwarding one by one",f.error),r.forward(a);let d;try{d=r.multicallInterface.decodeFunctionResult(r.multicallInterface.getFunction("multiCall"),f.result)}catch(h){r.options.verbose&&console.warn("Error decoding multicall result, forwarding one by one",h),r.forward(a);return}r.options.verbose&&console.log("Got response for",a.length),a.forEach((h,p)=>{if(!d[0][p])r.options.verbose&&console.warn(`Multicall error for ${h.request.method} not found`),r.forward(h);else switch(h.request.method){case Br.ethCall:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:d[1][p]});break;case Br.ethGetCode:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:_n.decode(["bytes"],d[1][p])[0]});break;case Br.ethGetBalance:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:_n.decode(["uint256"],d[1][p])[0]});break}})},this.options=e?xy({},Xi.DefaultOptions,e):Xi.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach(r=>r.next(r.request,r.callback)):e.next(e.request,e.callback)}static isMulticall(e){return e&&e.handle!==void 0&&e.conf!==void 0&&Xi.isMulticallOptions(e.options)}static isMulticallOptions(e){return e!==void 0&&e.batchSize!==void 0&&e.timeWindow!==void 0&&e.contract!==void 0}}Xi.DefaultOptions=xy({},Rre);const QN=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];class $re extends tb{constructor(e,r){var n;super(e.getNetwork()),n=this,this.provider=e,this.multicall=void 0,this.getResolver=async function(i){const s=n.provider;if(s.getResolver){const o=await s.getResolver(await i);return o?new G5(n,o.address,o.name):null}return s.getResolver(await i)},this.next=async function(i,s){try{switch(i.method){case Br.ethCall:n.callback(i,s,await n.provider.call(i.params[0],i.params[1]));break;case Br.ethGetCode:n.callback(i,s,await n.provider.getCode(i.params[0],i.params[1]));break;case Br.ethGetBalance:n.callback(i,s,await n.provider.getBalance(i.params[0],i.params[1]));break}}catch(o){n.callback(i,s,void 0,o)}},this.listenerCount=e.listenerCount.bind(e),this.multicall=Xi.isMulticall(r)?r:new Xi(r),QN.forEach(i=>{e[i]!==void 0&&(this[i]=(...s)=>e[i](...s))})}callback(e,r,n,i){r(i,{jsonrpc:ad,id:e.id,result:n,error:i})}async call(e,r){return this.rpcCall(Br.ethCall,e,r)}async getCode(e,r){return this.rpcCall(Br.ethGetCode,e,r)}async getBalance(e,r){return this.rpcCall(Br.ethGetBalance,e,r)}async rpcCall(e,...r){const n=jE();return(await LE(this.multicall.handle)(this.next,{jsonrpc:ad,id:n,method:e,params:r})).result}}class Mre{constructor(e,r){if(this.provider=e,this.multicall=void 0,this.multicall=Xi.isMulticall(r)?r:new Xi(r),e.send){const n=async function(s,o){e.send(s,o)};this.send=(i,s)=>{this.multicall.handle(n,i,s)}}if(e.sendAsync){const n=async function(s,o){e.sendAsync(s,o)};this.sendAsync=(i,s)=>{this.multicall.handle(n,i,s)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}}const Nre=t=>e=>{const r=Xi.isMulticall(t)?t:new Xi(t);return(n,i)=>r.handle(e,n,i)};var Dre=Object.freeze({__proto__:null,ProxyMethods:QN,MulticallProvider:$re,MulticallExternalProvider:Mre,multicallMiddleware:Nre});const Lre=Object.freeze(Object.defineProperty({__proto__:null,Multicall:Xi,providers:Dre},Symbol.toStringTag,{value:"Module"}));var YN={exports:{}};(function(t,e){(function(r){var n=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(O){return Object.prototype.toString.call(O)==="[object Array]"},s=10,o=typeof rn=="object"&&typeof rn.nextTick=="function",a=typeof Symbol=="function",c=typeof Reflect=="object",l=typeof setImmediate=="function",u=l?setImmediate:setTimeout,f=a?c&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(A){var O=Object.getOwnPropertyNames(A);return O.push.apply(O,Object.getOwnPropertySymbols(A)),O}:Object.keys;function d(){this._events={},this._conf&&h.call(this,this._conf)}function h(A){A&&(this._conf=A,A.delimiter&&(this.delimiter=A.delimiter),A.maxListeners!==r&&(this._maxListeners=A.maxListeners),A.wildcard&&(this.wildcard=A.wildcard),A.newListener&&(this._newListener=A.newListener),A.removeListener&&(this._removeListener=A.removeListener),A.verboseMemoryLeak&&(this.verboseMemoryLeak=A.verboseMemoryLeak),A.ignoreErrors&&(this.ignoreErrors=A.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function p(A,O){var B="(node) warning: possible EventEmitter memory leak detected. "+A+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(B+=" Event name: "+O+"."),typeof rn<"u"&&rn.emitWarning){var I=new Error(B);I.name="MaxListenersExceededWarning",I.emitter=this,I.count=A,rn.emitWarning(I)}else console.error(B),console.trace&&console.trace()}var m=function(A,O,B){var I=arguments.length;switch(I){case 0:return[];case 1:return[A];case 2:return[A,O];case 3:return[A,O,B];default:for(var C=new Array(I);I--;)C[I]=arguments[I];return C}};function v(A,O){for(var B={},I,C=A.length,D=O?O.length:0,z=0;z0;)A=D[W],z.call(_,A,B[A]);this._listeners={},this._listenersCount=0,G()}}});function b(A,O,B,I){var C=Object.assign({},O);if(!A)return C;if(typeof A!="object")throw TypeError("options must be an object");var D=Object.keys(A),z=D.length,_,W,G;function J(se){throw Error('Invalid "'+_+'" option value'+(se?". Reason: "+se:""))}for(var ee=0;ee0;)if(_===A[W])return D;z(O)}}var P=S(["function"]),M=S(["object","function"]);function L(A,O,B){var I,C,D=0,z,_=new A(function(W,G,J){B=b(B,{timeout:0,overload:!1},{timeout:function(oe,be){return oe*=1,(typeof oe!="number"||oe<0||!Number.isFinite(oe))&&be("timeout must be a positive number"),oe}}),I=!B.overload&&typeof A.prototype.cancel=="function"&&typeof J=="function";function ee(){C&&(C=null),D&&(clearTimeout(D),D=0)}var se=function(oe){ee(),W(oe)},ie=function(oe){ee(),G(oe)};I?O(se,ie,J):(C=[function(oe){ie(oe||Error("canceled"))}],O(se,ie,function(oe){if(z)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof oe!="function")throw TypeError("onCancel callback must be a function");C.push(oe)}),z=!0),B.timeout>0&&(D=setTimeout(function(){var oe=Error("timeout");oe.code="ETIMEDOUT",D=0,_.cancel(oe),G(oe)},B.timeout))});return I||(_.cancel=function(W){if(C){for(var G=C.length,J=1;J0;)ie=Ee[_],ie!=="_listeners"&&(Ue=H(A,O,B[ie],I+1,C),Ue&&(se?se.push.apply(se,Ue):se=Ue));return se}else if($e==="**"){for(ve=I+1===C||I+2===C&&ge==="*",ve&&B._listeners&&(se=H(A,O,B,C,C)),Ee=f(B),_=Ee.length;_-- >0;)ie=Ee[_],ie!=="_listeners"&&(ie==="*"||ie==="**"?(B[ie]._listeners&&!ve&&(Ue=H(A,O,B[ie],C,C),Ue&&(se?se.push.apply(se,Ue):se=Ue)),Ue=H(A,O,B[ie],I,C)):ie===ge?Ue=H(A,O,B[ie],I+2,C):Ue=H(A,O,B[ie],I,C),Ue&&(se?se.push.apply(se,Ue):se=Ue));return se}else B[$e]&&(se=H(A,O,B[$e],I+1,C));if(oe=B["*"],oe&&H(A,O,oe,I+1,C),be=B["**"],be)if(I0;)ie=Ee[_],ie!=="_listeners"&&(ie===ge?H(A,O,be[ie],I+2,C):ie===$e?H(A,O,be[ie],I+1,C):(he={},he[ie]=be[ie],H(A,O,{"**":he},I+1,C)));else be._listeners?H(A,O,be,C,C):be["*"]&&be["*"]._listeners&&H(A,O,be["*"],C,C);return se}function K(A,O,B){var I=0,C=0,D,z=this.delimiter,_=z.length,W;if(typeof A=="string")if((D=A.indexOf(z))!==-1){W=new Array(5);do W[I++]=A.slice(C,D),C=D+_;while((D=A.indexOf(z,C))!==-1);W[I++]=A.slice(C)}else W=[A],I=1;else W=A,I=A.length;if(I>1){for(D=0;D+10&&G._listeners.length>this._maxListeners&&(G._listeners.warned=!0,p.call(this,G._listeners.length,J))):G._listeners=O,!0;return!0}function Q(A,O,B,I){for(var C=f(A),D=C.length,z,_,W,G=A._listeners,J;D-- >0;)_=C[D],z=A[_],_==="_listeners"?W=B:W=B?B.concat(_):[_],J=I||typeof _=="symbol",G&&O.push(J?W:W.join(this.delimiter)),typeof z=="object"&&Q.call(this,z,O,W,J);return O}function Y(A){for(var O=f(A),B=O.length,I,C,D;B-- >0;)C=O[B],I=A[C],I&&(D=!0,C!=="_listeners"&&!Y(I)&&delete A[C]);return D}function F(A,O,B){this.emitter=A,this.event=O,this.listener=B}F.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function x(A,O,B){if(B===!0)C=!0;else if(B===!1)I=!0;else{if(!B||typeof B!="object")throw TypeError("options should be an object or true");var I=B.async,C=B.promisify,D=B.nextTick,z=B.objectify}if(I||D||C){var _=O,W=O._origin||O;if(D&&!o)throw Error("process.nextTick is not supported");C===r&&(C=O.constructor.name==="AsyncFunction"),O=function(){var G=arguments,J=this,ee=this.event;return C?D?Promise.resolve():new Promise(function(se){u(se)}).then(function(){return J.event=ee,_.apply(J,G)}):(D?rn.nextTick:u)(function(){J.event=ee,_.apply(J,G)})},O._async=!0,O._origin=W}return[O,z?new F(this,A,O):this]}function k(A){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,h.call(this,A)}k.EventEmitter2=k,k.prototype.listenTo=function(A,O,B){if(typeof A!="object")throw TypeError("target musts be an object");var I=this;B=b(B,{on:r,off:r,reducers:r},{on:P,off:P,reducers:M});function C(D){if(typeof D!="object")throw TypeError("events must be an object");var z=B.reducers,_=j.call(I,A),W;_===-1?W=new y(I,A,B):W=I._observers[_];for(var G=f(D),J=G.length,ee,se=typeof z=="function",ie=0;ie0;)C=B[I],(!A||C._target===A)&&(C.unsubscribe(O),D=!0);return D},k.prototype.delimiter=".",k.prototype.setMaxListeners=function(A){A!==r&&(this._maxListeners=A,this._conf||(this._conf={}),this._conf.maxListeners=A)},k.prototype.getMaxListeners=function(){return this._maxListeners},k.prototype.event="",k.prototype.once=function(A,O,B){return this._once(A,O,!1,B)},k.prototype.prependOnceListener=function(A,O,B){return this._once(A,O,!0,B)},k.prototype._once=function(A,O,B,I){return this._many(A,1,O,B,I)},k.prototype.many=function(A,O,B,I){return this._many(A,O,B,!1,I)},k.prototype.prependMany=function(A,O,B,I){return this._many(A,O,B,!0,I)},k.prototype._many=function(A,O,B,I,C){var D=this;if(typeof B!="function")throw new Error("many only accepts instances of Function");function z(){return--O===0&&D.off(A,z),B.apply(this,arguments)}return z._origin=B,this._on(A,z,I,C)},k.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var A=arguments[0],O,B=this.wildcard,I,C,D,z,_;if(A==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(B&&(O=A,A!=="newListener"&&A!=="removeListener"&&typeof A=="object")){if(C=A.length,a){for(D=0;D3)for(I=new Array(W-1),z=1;z3)for(C=new Array(G-1),_=1;_0&&this._events[A].length>this._maxListeners&&(this._events[A].warned=!0,p.call(this,this._events[A].length,A))):this._events[A]=O,C)},k.prototype.off=function(A,O){if(typeof O!="function")throw new Error("removeListener only takes instances of Function");var B,I=[];if(this.wildcard){var C=typeof A=="string"?A.split(this.delimiter):A.slice();if(I=H.call(this,null,C,this.listenerTree,0),!I)return this}else{if(!this._events[A])return this;B=this._events[A],I.push({_listeners:B})}for(var D=0;D0){for(I=this._all,O=0,B=I.length;O0;)I=O[B[D]],typeof I=="function"?C.push(I):C.push.apply(C,I);return C}else{if(this.wildcard){if(z=this.listenerTree,!z)return[];var _=[],W=typeof A=="string"?A.split(this.delimiter):A.slice();return H.call(this,_,W,z,0),_}return O?(I=O[A],I?typeof I=="function"?[I]:I:[]):[]}},k.prototype.eventNames=function(A){var O=this._events;return this.wildcard?Q.call(this,this.listenerTree,[],null,A):O?f(O):[]},k.prototype.listenerCount=function(A){return this.listeners(A).length},k.prototype.hasListeners=function(A){if(this.wildcard){var O=[],B=typeof A=="string"?A.split(this.delimiter):A.slice();return H.call(this,O,B,this.listenerTree,0),O.length>0}var I=this._events,C=this._all;return!!(C&&C.length||I&&(A===r?f(I).length:I[A]))},k.prototype.listenersAny=function(){return this._all?this._all:[]},k.prototype.waitFor=function(A,O){var B=this,I=typeof O;return I==="number"?O={timeout:O}:I==="function"&&(O={filter:O}),O=b(O,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:P,Promise:E}),L(O.Promise,function(C,D,z){function _(){var W=O.filter;if(!(W&&!W.apply(B,arguments)))if(B.off(A,_),O.handleError){var G=arguments[0];G?D(G):C(m.apply(null,arguments).slice(1))}else C(m.apply(null,arguments))}z(function(){B.off(A,_)}),B._on(A,_,!1)},{timeout:O.timeout,overload:O.overload})};function R(A,O,B){B=b(B,{Promise,timeout:0,overload:!1},{Promise:E});var I=B.Promise;return L(I,function(C,D,z){var _;if(typeof A.addEventListener=="function"){_=function(){C(m.apply(null,arguments))},z(function(){A.removeEventListener(O,_)}),A.addEventListener(O,_,{once:!0});return}var W=function(){G&&A.removeListener("error",G),C(m.apply(null,arguments))},G;O!=="error"&&(G=function(J){A.removeListener(O,W),D(J)},A.once("error",G)),z(function(){G&&A.removeListener("error",G),A.removeListener(O,W)}),A.once(O,W)},{timeout:B.timeout,overload:B.overload})}var N=k.prototype;Object.defineProperties(k,{defaultMaxListeners:{get:function(){return N._maxListeners},set:function(A){if(typeof A!="number"||A<0||Number.isNaN(A))throw TypeError("n must be a non-negative number");N._maxListeners=A},enumerable:!0},once:{value:R,writable:!0,configurable:!0}}),Object.defineProperties(N,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof r=="function"&&r.amd?r(function(){return k}):t.exports=k})()})(YN);var fb=YN.exports;function jre(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function Bre(t,...e){if(!jre(t))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function sk(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Fre(t,e){Bre(t);const r=e.outputLen;if(t.lengthnew DataView(t.buffer,t.byteOffset,t.byteLength),Ws=(t,e)=>t<<32-e|t>>>e,Ure=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ure)throw new Error("Non little-endian hardware is not supported");const zre=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function qre(t){if(!JN(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rt().update(XN(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Gre(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}class Kre extends Hre{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=jx(this.buffer)}update(e){sk(this);const{view:r,buffer:n,blockLen:i}=this;e=XN(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&r,Yre=(t,e,r)=>t&e^t&r^e&r,Jre=new Uint32Array([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]),Wa=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ha=new Uint32Array(64);class Xre extends Kre{constructor(){super(64,32,8,!1),this.A=Wa[0]|0,this.B=Wa[1]|0,this.C=Wa[2]|0,this.D=Wa[3]|0,this.E=Wa[4]|0,this.F=Wa[5]|0,this.G=Wa[6]|0,this.H=Wa[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)Ha[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){const d=Ha[f-15],h=Ha[f-2],p=Ws(d,7)^Ws(d,18)^d>>>3,m=Ws(h,17)^Ws(h,19)^h>>>10;Ha[f]=m+Ha[f-7]+p+Ha[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let f=0;f<64;f++){const d=Ws(a,6)^Ws(a,11)^Ws(a,25),h=u+d+Qre(a,c,l)+Jre[f]+Ha[f]|0,m=(Ws(n,2)^Ws(n,13)^Ws(n,22))+Yre(n,i,s)|0;u=l,l=c,c=a,a=o+h|0,o=s,s=i,i=n,n=h+m|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,l,u)}roundClean(){Ha.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Zre=Vre(()=>new Xre);var ene=class{constructor(t,e){ct(this,"hostname");ct(this,"fetch");ct(this,"path","/rpc/Databeat/");ct(this,"ping",(t,e)=>this.fetch(this.url("Ping"),wh({},t,e)).then(r=>Eh(r).then(n=>({status:n.status})),r=>{throw tf.new({cause:`fetch(): ${r.message||""}`})}));ct(this,"version",(t,e)=>this.fetch(this.url("Version"),wh({},t,e)).then(r=>Eh(r).then(n=>({version:n.version})),r=>{throw tf.new({cause:`fetch(): ${r.message||""}`})}));ct(this,"runtimeStatus",(t,e)=>this.fetch(this.url("RuntimeStatus"),wh({},t,e)).then(r=>Eh(r).then(n=>({status:n.status})),r=>{throw tf.new({cause:`fetch(): ${r.message||""}`})}));ct(this,"tick",(t,e,r)=>this.fetch(this.url("Tick"),wh(t,e,r)).then(n=>Eh(n).then(i=>({ok:i.ok})),n=>{throw tf.new({cause:`fetch(): ${n.message||""}`})}));ct(this,"rawEvents",(t,e,r)=>this.fetch(this.url("RawEvents"),wh(t,e,r)).then(n=>Eh(n).then(i=>({ok:i.ok})),n=>{throw tf.new({cause:`fetch(): ${n.message||""}`})}));this.hostname=t,this.fetch=(r,n)=>e(r,n)}url(t){return this.hostname+this.path+t}},wh=(t={},e={},r=null)=>({method:"POST",headers:{...e,"Content-Type":"application/json"},body:JSON.stringify(t||{}),signal:r}),Eh=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),sD.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(yne[n]||Hr).new(r)}return r}),Hr=class ZN extends Error{constructor(r,n,i,s,o){super(i);ct(this,"name");ct(this,"code");ct(this,"message");ct(this,"status");ct(this,"cause");ct(this,"msg");this.name=r||"WebrpcError",this.code=typeof n=="number"?n:0,this.message=i||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof s=="number"?s:0,this.cause=o,Object.setPrototypeOf(this,ZN.prototype)}static new(r){return new this(r.error,r.code,r.message||r.msg,r.status,r.cause)}},tne=class eD extends Hr{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,eD.prototype)}},tf=class tD extends Hr{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,tD.prototype)}},rne=class rD extends Hr{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,rD.prototype)}},nne=class nD extends Hr{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,nD.prototype)}},ine=class iD extends Hr{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,iD.prototype)}},sD=class oD extends Hr{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,oD.prototype)}},sne=class aD extends Hr{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,aD.prototype)}},one=class cD extends Hr{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,cD.prototype)}},ane=class lD extends Hr{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,lD.prototype)}},cne=class uD extends Hr{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,uD.prototype)}},lne=class fD extends Hr{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,fD.prototype)}},une=class dD extends Hr{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,dD.prototype)}},fne=class hD extends Hr{constructor(e="PermissionDenied",r=2e3,n="Permission denied",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,hD.prototype)}},dne=class pD extends Hr{constructor(e="SessionExpired",r=2001,n="Session expired",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,pD.prototype)}},hne=class mD extends Hr{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,mD.prototype)}},pne=class vD extends Hr{constructor(e="InvalidAppKey",r=4e3,n="Invalid app key",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,vD.prototype)}},mne=class yD extends Hr{constructor(e="QueryFailed",r=4001,n="DB query failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,yD.prototype)}},vne=class gD extends Hr{constructor(e="InvalidProjectId",r=4002,n="Invalid project id",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,gD.prototype)}},yne={0:tne,[-1]:tf,[-2]:rne,[-3]:nne,[-4]:ine,[-5]:sD,[-6]:sne,[-7]:one,[-8]:ane,[-9]:cne,[-10]:lne,1e3:une,2e3:fne,2001:dne,3e3:hne,4e3:pne,4001:mne,4002:vne},gne=class extends ene{constructor(e,r){const n=typeof Bn=="object"?Bn.fetch.bind(Bn):window.fetch.bind(window);super(e.endsWith("/")?e.slice(0,-1):e,n);ct(this,"_globalFetch");ct(this,"_fetch",(e,r)=>{var n;if(this.auth){let i={};((n=this.auth.jwt)==null?void 0:n.length)>0&&(i.Authorization=`BEARER ${this.auth.jwt}`),this.auth.headers&&(i={...i,...this.auth.headers}),r.headers={...r.headers,...i}}return this._globalFetch(e,r)});this.auth=r,this._globalFetch=n,this.fetch=this._fetch}},ok=150,yl={defaultEnabled:!0,noop:!1,privacy:{userIdHash:!0,userAgentSalt:!1},userIdentTracking:!1,strictMode:!1,flushInterval:500,initProps:()=>({})},bne=class{constructor(t,e,r){ct(this,"rpc");ct(this,"auth");ct(this,"options");ct(this,"enabled");ct(this,"ident");ct(this,"userId");ct(this,"sessionId");ct(this,"allowUserTracking");ct(this,"projectId");ct(this,"queue");ct(this,"flushTimeout");ct(this,"defaultProps");ct(this,"previousPageKey");ct(this,"ts");ct(this,"flush",async()=>{if(this.flushTimeout!==null&&(clearTimeout(this.flushTimeout),this.flushTimeout=null),!this.enabled||this.options.noop||this.options.strictMode&&!this.allowUserTracking||this.queue.length===0)return;const t=this.dedupedQueue();this.queue=[];try{await this.rpc.tick({events:t})}catch(e){console.warn(`databeat flush failed: ${e}`)}});ct(this,"dedupedQueue",()=>{const t=new Map;for(let e=0;eok&&(this.queue=this.queue.splice(this.queue.length-ok)),this.enabled&&(e&&e.flush?await this.flush():this.flushTimeout===null&&(this.flushTimeout=setTimeout(()=>{this.flush()},this.options.flushInterval)))}trackView(t={}){const e={...this.defaultProps,...t},r=ck(),n=`${r}:${JSON.stringify(e)}:${this.userId}:${this.sessionId}`;this.previousPageKey!==n&&(this.previousPageKey=n,this.track({event:"VIEW",source:r,props:e}))}isEnabled(){return this.enabled}isAnon(){return this.ident===0}getIdent(){return this.ident}getUserId(){return this.userId}getSessionId(){return this.sessionId}getStorageTS(){if(this.ts)return this.ts;const t=g6();if(!(t==null||t.id===null))return this.ts=t.ts,this.ts}enable(){if(!bD(this.auth)){this.enabled=!1;return}Yo()&&(this.enabled=!0,this.ts=ju({on:this.enabled,id:this.userId,it:this.ident,ut:this.allowUserTracking}),this.identify())}disable(){Yo()&&(this.enabled=!1,this.ts=ju({on:this.enabled,id:this.userId,it:this.ident,ut:this.allowUserTracking}))}},Yo=()=>typeof window=="object"&&typeof window.localStorage=="object"&&typeof window.localStorage.getItem=="function"&&typeof window.localStorage.setItem=="function",ak=(t,e)=>{if(!bD(e))return!1;if(!Yo())return!0;const r=g6();return r===null?t??!0:r.on},bD=t=>{var e;return!!(((e=t==null?void 0:t.jwt)==null?void 0:e.length)>0||t!=null&&t.headers&&Object.keys(t.headers).length>0)},ck=()=>{try{return window.location.pathname}catch{return""}},xne=()=>{if(!Yo())return{};const t=new URL(window.location.href).searchParams,e={};return e.origin=window.location.origin,t.get("ref")&&t.get("ref")!==""&&(e.ref=t.get("ref")||""),t.get("source")&&t.get("source")!==""&&(e.source=t.get("source")||""),t.get("utm_source")&&t.get("utm_source")!==""&&(e.utmSource=t.get("utm_source")||""),t.get("utm_campaign")&&t.get("utm_campaign")!==""&&(e.utmCampaign=t.get("utm_campaign")||""),t.get("utm_medium")&&t.get("utm_medium")!==""&&(e.utmMedium=t.get("utm_medium")||""),t.get("utm_content")&&t.get("utm_content")!==""&&(e.utmContent=t.get("utm_content")||""),t.get("utm_term")&&t.get("utm_term")!==""&&(e.utmTerm=t.get("utm_term")||""),document.referrer&&document.referrer!==""&&(e.referrer=document.referrer),t.get("gclid")&&t.get("gclid")!==""&&(e.gclid=t.get("gclid")||""),e},wy="_dbeat",g6=()=>{try{return JSON.parse(window.localStorage.getItem(wy))}catch{return null}},ju=t=>{try{return t.ts||(t.ts=Math.floor(Date.now()/1e3)),window.localStorage.setItem(wy,JSON.stringify(t)),t.ts}catch{return}},wne=(t,e,r)=>{if(!t||t===null||t==="")return{userId:`${Math.floor(Math.random()*1e14)}`,ident:0};if(r.userIdentTracking&&e)return{userId:t,ident:2};if(r.privacy.userIdHash===!0||!r.userIdentTracking||!e)return Yo()&&r.privacy.userAgentSalt===!0&&(t=t+":"+navigator.userAgent),r.privacy.extraSalt&&r.privacy.extraSalt.length>0&&(t=t+":"+r.privacy.extraSalt),{userId:qre(Zre(t)).substring(0,50),ident:1};throw new Error("invalid configuration")},Ene=()=>{if(Yo()&&typeof window.sessionStorage=="object"&&typeof window.sessionStorage.getItem=="function"&&typeof window.sessionStorage.setItem=="function"){const e=window.sessionStorage.getItem(wy);if(e&&e.length>0)return e;{const r=lk(16);return window.sessionStorage.setItem(wy,r),r}}else return lk(16)},lk=t=>{let e="";for(let r=0;r++Cne;class Z1{constructor(){var e=this;this.pendingMessageRequests=[],this.responseCallbacks=new Map,this.state=void 0,this.confirmationOnly=!1,this.events=new fb.EventEmitter2,this.openPayload=void 0,this.connectPayload=void 0,this.accountsChangedPayload=void 0,this.networksPayload=void 0,this.walletContextPayload=void 0,this._sessionId=void 0,this._init=void 0,this._registered=void 0,this.sendAsync=async function(r,n,i){e.state===Bi.CLOSED&&(e.confirmationOnly=!0),e.openWallet(void 0,{type:"jsonRpcRequest",method:r.method},i);try{e.isOpened()||await e.waitUntilOpened();const s=await e.sendMessageRequest({idx:CD(),type:tt.MESSAGE,data:r,chainId:i});n(void 0,s.data)}catch(s){n(s)}},this.sendMessageRequest=async function(r){return new Promise((n,i)=>{(!r.idx||r.idx<=0)&&r.type!=="init"&&i(new Error("message idx not set"));const s=(a,c)=>{if(a)i(a);else if(c)n(c);else throw new Error("no valid response to return")},o=r.idx;e.responseCallbacks.get(o)?i(new Error("duplicate message idx, should never happen")):e.responseCallbacks.set(o,s),e.isOpened()?e.sendMessage(r):(Se.debug("pushing to pending requests",r),e.pendingMessageRequests.push(r))})},this.waitUntilOpened=async function(r=fC){let n=!1;return Promise.race([new Promise((i,s)=>{const o=setTimeout(()=>{clearTimeout(o),n||(e.state=Bi.CLOSED,e.events.emit("close",{code:1005,message:"opening wallet timed out"})),s(new Error("opening wallet timed out"))},r)}),new Promise(i=>{if(e.isOpened()){var s;n=!0,i((s=e.openPayload)==null?void 0:s.session);return}e.events.once("open",o=>{e.openPayload=o,n=!0,i(o.session)})})])},this.waitUntilConnected=async function(){await e.waitUntilOpened();const r=new Promise(i=>{if(e.connectPayload){i(e.connectPayload);return}e.events.once("connect",s=>{e.connectPayload=s,i(s)})}),n=new Promise((i,s)=>{e.events.once("close",o=>{s(o?new Error(`wallet closed due to ${JSON.stringify(o)}`):new Error("user closed the wallet"))})});return Promise.race([r,n])},this.state=Bi.CLOSED,this._registered=!1,this._init=tr.NIL}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}openWallet(e,r,n){throw new Error("abstract method")}closeWallet(){throw new Error("abstract method")}isOpened(){return this.registered&&this.state===Bi.OPENED}isConnected(){var e;const r=(e=this.openPayload)==null?void 0:e.session;return this.registered&&r!==void 0&&!!r.accountAddress&&r.accountAddress.length===42&&!!r.networks&&r.networks.length>0}handleMessage(e){var r=this;if(e.type===tt.INIT){Se.debug("MessageProvider, received INIT message",e);const{nonce:c}=e.data;if(!c||c.length==0){Se.error("invalid init nonce");return}this._init=tr.OK,this.sendMessage({idx:-1,type:tt.INIT,data:{sessionId:this._sessionId,nonce:c}})}if(this._init!==tr.OK)return;Se.debug("RECEIVED MESSAGE FROM WALLET",e.idx,e);const n=e.idx,i=this.responseCallbacks.get(n);if(n&&this.responseCallbacks.delete(n),e.type===tt.OPEN&&!this.isOpened()){var s,o;if(this._sessionId&&this._sessionId!==((s=e.data)==null?void 0:s.sessionId)){Se.debug("open event received from wallet, but does not match sessionId",this._sessionId);return}if((o=e.data)!=null&&o.error){var a;const c=new Error(`opening wallet failed: received ${(a=e.data)==null?void 0:a.error}`);throw Se.error(c),this.close(),c}this.state=Bi.OPENED,this.openPayload=e.data,this.events.emit("open",this.openPayload),this.pendingMessageRequests.length!==0&&this.pendingMessageRequests.splice(0,this.pendingMessageRequests.length).forEach(async function(l){r.sendMessage(l)});return}if(e.type===tt.MESSAGE){if(this.confirmationOnly&&setTimeout(()=>{this.responseCallbacks.size===0&&this.closeWallet()},500),!i)throw new Error("impossible state");if(i){this.events.emit("message",e),i(e.data.error,e);return}}if(e.type===tt.ACCOUNTS_CHANGED){this.accountsChangedPayload={accounts:[]},e.data&&e.data.length>0?(this.accountsChangedPayload={accounts:[Be(e.data[0])],origin:e.origin},this.events.emit("accountsChanged",this.accountsChangedPayload.accounts,this.accountsChangedPayload.origin)):this.events.emit("accountsChanged",[],e.origin);return}if(e.type===tt.CHAIN_CHANGED){this.events.emit("chainChanged",e.data,e.origin);return}if(e.type===tt.NETWORKS){this.networksPayload=e.data,this.events.emit("networks",this.networksPayload);return}if(e.type===tt.WALLET_CONTEXT){this.walletContextPayload=e.data,this.events.emit("walletContext",this.walletContextPayload);return}e.type===tt.CLOSE&&this.state!==Bi.CLOSED&&this.close(e.data),e.type===tt.CONNECT&&(this.connectPayload=e.data,this.events.emit("connect",this.connectPayload)),e.type===tt.DISCONNECT&&this.isConnected()&&(this.events.emit("disconnect",e.data,e.origin),this.close())}sendMessage(e){throw new Error("abstract method")}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}emit(e,...r){return this.events.emit(e,...r)}close(e){this.state!==Bi.CLOSED&&(this.state=Bi.CLOSED,this.confirmationOnly=!1,this._sessionId=void 0,Se.info("closing wallet and flushing!"),this.pendingMessageRequests.length=0,this.responseCallbacks.forEach(r=>{r(Zn({},new Error("wallet closed"),{code:4001}))}),this.responseCallbacks.clear(),this.connectPayload=void 0,this.openPayload=void 0,this.accountsChangedPayload=void 0,this.networksPayload=void 0,this.walletContextPayload=void 0,this.events.emit("close",e))}}function Sne(t){return kne.some(e=>e.predicate(t))}const kne=[{name:"Decentraland Exception",predicate:_ne},{name:"0x v3 Exception",predicate:Pne}],Ane=/^Decentraland Login\nEphemeral address: 0x[a-fA-F0-9]{40}\nExpiration: (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/;function _ne(t){try{const e=os(t);return Ane.test(e)}catch{return!1}}function Pne(t){const e=new xr(Ine);try{return e.decodeFunctionData("OrderWithHash",t),!0}catch{return!1}}const Ine=[{inputs:[{components:[{internalType:"address",name:"makerAddress",type:"address"},{internalType:"address",name:"takerAddress",type:"address"},{internalType:"address",name:"feeRecipientAddress",type:"address"},{internalType:"address",name:"senderAddress",type:"address"},{internalType:"uint256",name:"makerAssetAmount",type:"uint256"},{internalType:"uint256",name:"takerAssetAmount",type:"uint256"},{internalType:"uint256",name:"makerFee",type:"uint256"},{internalType:"uint256",name:"takerFee",type:"uint256"},{internalType:"uint256",name:"expirationTimeSeconds",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes",name:"makerAssetData",type:"bytes"},{internalType:"bytes",name:"takerAssetData",type:"bytes"},{internalType:"bytes",name:"makerFeeAssetData",type:"bytes"},{internalType:"bytes",name:"takerFeeAssetData",type:"bytes"}],internalType:"struct IEIP1271Data.Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderWithHash",outputs:[],stateMutability:"pure",type:"function"}],sv=kt(`Ethereum Signed Message: +`),dC=t=>Ms(t)?fe(t):kt(t),db=t=>{const e=dC(t);return Sne(e)?e:Et([sv,kt(String(e.length)),e])},Tne=t=>{if(JSON.stringify(t.slice(0,sv.length))!==JSON.stringify(sv))return t;const e=t.slice(sv.length),r=String(e.length).length;let n,i;try{i=Number(os(e.slice(0,r)))}catch{i=Number(le(e.slice(0,r)))}return i>e.length||!Number.isInteger(i)?n=r-1:n=r,e.slice(n)},ld=async(t,e,r,n)=>new we.reader.OnChainReader(n).isValidSignature(t,e,r),SD=async(t,e,r,n)=>{const i=db(e),s=DE(i);return ld(t,s,r,n)},kD=(t,e,r,n)=>ld(t,G1(e),r,n),Ey=()=>window.location.protocol==="chrome-extension:"||window.location.protocol==="moz-extension:",AD=()=>!!navigator.userAgent.match(/UnitySequence/i),_D=t=>t.onChain.deployed&&t.fullyMigrated;class PD{constructor(){this.callbacks=[],this.store={}}getItem(e){return this.store[e]||null}setItem(e,r){this.store[e]=r,this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){delete this.store[e]}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}class e1{static isAvailable(){return typeof window=="object"&&typeof window.localStorage=="object"}constructor(){if(this.callbacks=[],!e1.isAvailable())throw new Error("LocalStorage is not available");window.addEventListener("storage",e=>{const{key:r}=e;this.callbacks.filter(i=>i.key===r).forEach(i=>i.cb(this.getItem(r)))})}getItem(e){return window.localStorage.getItem(e)}setItem(e,r){window.localStorage.setItem(e,r),this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){window.localStorage.removeItem(e),this.callbacks.filter(r=>r.key===e).forEach(r=>r.cb(null))}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}function Cy(){return e1.isAvailable()?new e1:new PD}async function ID(t){return Array.isArray(t)?Promise.all(t.map(e=>_t(e))):_t(t)}const uk="@sequence.transportSession";class ep{constructor(e){var r=this;this.walletRequestHandler=void 0,this._sessionId=void 0,this._registered=void 0,this._init=void 0,this._initNonce=void 0,this._initCallback=void 0,this.appOrigin=void 0,this.sendAsync=async function(n,i,s){throw new Error("abstract method")},this.handleMessage=async function(n){const i=n;if(r._init!==tr.OK){if(i.type===tt.INIT)if(r.isValidInitAck(n))r._initCallback&&r._initCallback();else{r._initCallback&&r._initCallback("invalid init");return}return}switch(i.type){case tt.OPEN:{if(r._init!==tr.OK)return;const s={sessionId:i.data.sessionId,intent:i.data.intent,networkId:i.data.networkId};await r.open(s);return}case tt.CLOSE:return r._init!==tr.OK,void 0;case tt.MESSAGE:{const s=await r.walletRequestHandler.sendMessageRequest(i);r.sendMessage(s),s.data.error;return}default:Se.error(`unexpected payload type ${i.type}`)}},this.sendMessageRequest=async function(n){return r.walletRequestHandler.sendMessageRequest(n)},this.open=async function({sessionId:n,intent:i,networkId:s}){n&&(r._sessionId=yM(n),r.saveTransportSession({sessionId:n,intent:i,networkId:s})),r.walletRequestHandler.setOpenIntent(i),await r.init();let o;try{if(s){const a=FE(s);if(a)o=a.chainId;else throw new Error(`unknown network ${s}`)}else o=r.walletRequestHandler.defaultChainId()}catch(a){console.error(a)}if(i&&i.type==="connect"&&i.options){const a=i.options,c=a;if(r.appOrigin&&c!=null&&c.origin){if(!Ey()&&c.origin!==r.appOrigin)throw new Error("origin is invalid")}else!r.appOrigin&&c!=null&&c.origin?a.origin=bM(c.origin):r.appOrigin&&(a.origin=r.appOrigin);a.app&&(a.app=gM(a.app)),a.networkId?s=a.networkId:s&&(a.networkId=s),r.walletRequestHandler.setConnectOptions(a)}else r.walletRequestHandler.setConnectOptions(void 0);if(await r.walletRequestHandler.getAccount(),await r.walletRequestHandler.isSignedIn())if(i&&i.type==="connect"){(!o||o<=0)&&console.log("Failed to set default network on open"),r.notifyOpen({sessionId:r._sessionId});try{const a=await r.walletRequestHandler.promptConnect(i.options);a.connected&&r.walletRequestHandler.notifyConnect(a)}catch(a){Se.warn("promptConnect not connected:",a)}finally{(!i.options||i.options.keepWalletOpened!==!0)&&r.notifyClose()}}else{if(!o||o<=0)return r.notifyOpen({sessionId:r._sessionId,error:`failed to open wallet on network ${s}`}),!1;r.notifyOpen({sessionId:r._sessionId,chainId:`${o}`,session:await r.walletRequestHandler.walletSession(o)})}else return r.notifyOpen({sessionId:r._sessionId}),!0;return!0},this.saveTransportSession=n=>{Cy().setItem(uk,JSON.stringify(n))},this.getCachedTransportSession=async function(){const n=Cy().getItem(uk);try{return n?JSON.parse(n):null}catch{return console.error(`unable to parse transport session: ${n}`),null}},this.walletRequestHandler=e,this._init=tr.NIL,this.walletRequestHandler.on("connect",n=>{this.registered&&this.notifyConnect(n)}),this.walletRequestHandler.on("disconnect",(n,i)=>{this.registered&&this.notifyDisconnect(n,i)}),this.walletRequestHandler.on("accountsChanged",(n,i)=>{this.registered&&this.notifyAccountsChanged(n,i)}),this.walletRequestHandler.on("networks",n=>{this.registered&&(this.notifyNetworks(n),!n||n.length===0?this.notifyChainChanged("0x0"):this.notifyChainChanged(Ji(n.find(i=>i.isDefaultChain).chainId)))}),this.walletRequestHandler.on("chainChanged",(n,i)=>{this.notifyChainChanged(n,i)}),this.walletRequestHandler.on("walletContext",n=>{!this.registered||!n||this.notifyWalletContext(n)}),this.walletRequestHandler.on("close",n=>{this.registered&&this.notifyClose(n)})}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}sendMessage(e){throw new Error("abstract method")}notifyOpen(e){const{chainId:r,sessionId:n,session:i,error:s}=e;this.sendMessage({idx:-1,type:tt.OPEN,data:{chainId:r,sessionId:n,session:i,error:s}})}notifyClose(e){this.sendMessage({idx:-1,type:tt.CLOSE,data:e?{error:e}:null})}notifyConnect(e){this.sendMessage({idx:-1,type:tt.CONNECT,data:e})}notifyDisconnect(e,r){this.sendMessage({idx:-1,type:tt.DISCONNECT,data:e?{error:e}:null,origin:r})}notifyAccountsChanged(e,r){this.sendMessage({idx:-1,type:tt.ACCOUNTS_CHANGED,data:e,origin:r})}notifyChainChanged(e,r){this.sendMessage({idx:-1,type:tt.CHAIN_CHANGED,data:e,origin:r})}notifyNetworks(e){this.sendMessage({idx:-1,type:tt.NETWORKS,data:e})}notifyWalletContext(e){this.sendMessage({idx:-1,type:tt.WALLET_CONTEXT,data:e})}isValidInitAck(e){if(this._init===tr.OK)return Se.warn("isValidInitAck, already in init'd state, so inquiry is invalid."),!1;if(e.type!==tt.INIT)return Se.warn("isValidInitAck, invalid message type, expecting init"),!1;const{sessionId:r,nonce:n}=e.data;return!r||r.length===0||!n||n.length===0?(Se.error("invalid init ack"),!1):r!==this._sessionId||n!==this._initNonce?(Se.error("invalid init ack match"),!1):!0}init(){return new Promise((e,r)=>{if(this._init===tr.OK){e();return}if(this._init!==tr.NIL||this._initCallback){r("transport init is in progress");return}const n=setTimeout(()=>{Se.warn("transport init timed out"),this._initCallback&&this._initCallback("transport init timed out")},fC/2);this._initCallback=i=>{this._initCallback=void 0,clearTimeout(n),i?r(i):(this._init=tr.OK,e())},this._initNonce=`${performance.now()}`,this.sendMessage({idx:-1,type:tt.INIT,data:{nonce:this._initNonce}}),this._init=tr.SENT_NONCE})}}class One{constructor(){this.app=void 0,this.wallet=void 0;const e=new b6,r=new b6;e.conn=r,r.conn=e,this.app=e,this.wallet=r}}class b6{constructor(){this.conn=void 0,this.events=new fb.EventEmitter2,this.handleMessage=e=>{throw new Error("ProxyMessageChannelPort is not registered")},this.sendMessage=e=>{this.conn.handleMessage(e),e.type==="open"&&this.events.emit("open",e),e.type==="close"&&this.events.emit("close",e),e.type==="connect"&&this.events.emit("connect",e),e.type==="disconnect"&&this.events.emit("disconnect",e)}}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}}class TD extends Z1{constructor(e){if(super(),this.port=void 0,this.register=()=>{this.port.handleMessage=r=>{this.handleMessage(r)},this.on("open",(...r)=>{this.port.events.emit("open",...r)}),this.on("close",(...r)=>{this.port.events.emit("close",...r)}),this.on("connect",(...r)=>{this.port.events.emit("connect",...r)}),this.on("disconnect",(...r)=>{this.port.events.emit("disconnect",...r)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),this.events.removeAllListeners(),this.port.handleMessage=void 0},this.openWallet=(r,n,i)=>{if(this.state===Bi.CLOSED){this.state=Bi.OPENING;const s=`${performance.now()}`;this._sessionId=s,this.sendMessage({idx:-1,type:tt.OPEN,data:{path:r,intent:n,networkId:i,sessionId:s}})}},this.state=Bi.CLOSED,this.port=e,!e)throw new Error("port argument cannot be empty");this._init=tr.OK}closeWallet(){this.sendMessage({idx:-1,type:tt.CLOSE,data:null}),this.close()}sendMessage(e){if(!e.idx)throw new Error("message idx is empty");this.port.sendMessage(e)}}class Rne extends ep{constructor(e,r){super(e),this.port=void 0,this.port=r,this._init=tr.OK}register(){this.port.handleMessage=e=>{this.handleMessage(e)},this._registered=!0}async restoreSession(){const e=await this.getCachedTransportSession();e&&this.open(e)}unregister(){this.port.handleMessage=void 0,this._registered=!1}sendMessage(e){this.port.sendMessage(e)}}function OD(t){var e;if((e=window.ue)!=null&&e.sequencewallettransport&&!window.logsOverriddenForUnreal){var r;const n=(r=window.ue)==null?void 0:r.sequencewallettransport;console.log=(...i)=>{n.logfromjs(`${t}: ${Bx(i)}`)},console.warn=(...i)=>{n.warnfromjs(`${t}: ${Bx(i)}`)},console.error=(...i)=>{n.errorfromjs(`${t}: ${Bx(i)}`)},window.logsOverriddenForUnreal=!0}}function Bx(t){return t.map(e=>typeof e=="object"?e instanceof Error?e.message:JSON.stringify(e):String(e)).join(" ")}let Bu;class RD extends Z1{constructor(e){super(),this.walletURL=void 0,this.register=()=>{var r;OD("dapp"),Bu&&(Bu.unregister(),Bu=this),(r=window.ue)!=null&&r.sequencewallettransport&&(window.ue.sequencewallettransport.onmessagefromwallet=this.onUnrealCallback),Bu=this,this._registered=!0,console.log("registering transport!")},this.unregister=()=>{var r;this._registered=!1,this.closeWallet(),Bu===this&&(Bu=void 0),((r=window.ue)==null||(r=r.sequencewallettransport)==null?void 0:r.onmessagefromwallet)===this.onUnrealCallback&&delete window.ue.sequencewallettransport.onmessagefromwallet,this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.isOpened()){console.log("wallet already open!");return}console.log("opening wallet!");const s=new URL(this.walletURL.href),o=new X1;r&&(s.pathname=r.toLowerCase()),this._init=tr.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&o.set("intent",ME(n)),i&&o.set("net",`${i}`),s.search=o.toString(),console.log("opening wallet to",s.href),window.open(s.href)},this.onUnrealCallback=r=>{if(!r)throw new Error("ProviderMessage object is empty");this.handleMessage(r)},this.walletURL=new URL(e)}closeWallet(){this.close()}sendMessage(e){var r;const n=typeof e!="string"?JSON.stringify(e):e;console.log("Sending message to wallet:",n),(r=window.ue)==null||(r=r.sequencewallettransport)==null||r.sendmessagetowallet(n)}}class $ne extends ep{constructor(e){super(e),this.onMessageFromUnreal=r=>{Se.debug("RECEIVED MESSAGE",r),this.handleMessage(r)},this.getUnrealTransportSession=r=>{const n=new X1(r);return{sessionId:n.get("sid"),networkId:n.get("net"),intent:NE(n.get("intent"))}},this._init=tr.NIL}async register(e){var r;if(((r=window.ue)==null?void 0:r.sequencewallettransport)===void 0)return;OD("wallet");const{search:n}=new URL(e||window.location.href);let i=this.getUnrealTransportSession(n);if(!!i.sessionId||(i=await this.getCachedTransportSession()),!i){Se.error("unreal session is undefined");return}window.ue.sequencewallettransport.onmessagefromsequencejs=this.onMessageFromUnreal,this._registered=!0,this.open(i).then(o=>{if(!o){var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}`;Se.error(c),this.notifyClose({message:c}),window.close()}}).catch(o=>{var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}, due to: ${o}`;Se.error(c),this.notifyClose({message:c}),window.close()})}unregister(){var e;((e=window.ue)==null||(e=e.sequencewallettransport)==null?void 0:e.onmessagefromsequencejs)===this.onMessageFromUnreal&&delete window.ue.sequencewallettransport.onmessagefromsequencejs,this._registered=!1}sendMessage(e){var r;if(e.type!==tt.INIT&&this._init!==tr.OK){Se.error("impossible state, should not be calling postMessage until inited");return}const n=JSON.stringify(e);(r=window.ue)==null||(r=r.sequencewallettransport)==null||r.sendmessagetosequencejs(n)}}const hC="sequence-extension-message-handler";class Mne extends ep{constructor(e,r){super(e),this.runtime=r,this.port=void 0,this._init=tr.OK}register(){this._registered=!0,this.port=this.runtime.connect({name:hC})}sendMessage(e){Se.info("[ExtensionMessageHandler send]",e),this.port.postMessage(e)}}class $D extends Z1{constructor(e){super(),this.register=()=>{this._registered=!0},e.onConnect.addListener(r=>{r.name===hC&&(this._init=tr.OK,r.onMessage.addListener(n=>{this.handleMessage(n)}))})}sendMessage(e){}unregister(){}openWallet(e,r,n){}closeWallet(){}}class Nne extends fb.EventEmitter2{constructor(e){var r;super(),r=this,this.stream=e,this.responseCallbacks=new Map,this._messageIdx=0,this.nextMessageIdx=()=>++this._messageIdx,this.handleMessage=n=>{if(!n.type||!n.data)return;Se.info("[received message]",n);const i=n.idx,s=this.responseCallbacks.get(i);switch(i&&this.responseCallbacks.delete(i),n.type){case tt.MESSAGE:if(s)this.emit(tt.MESSAGE,n),s(n.data.error,n);else throw new Error("impossible state");break;case tt.DISCONNECT:case tt.ACCOUNTS_CHANGED:case tt.CHAIN_CHANGED:this.emit(n.type,n.data);break;default:console.error("unknown message type",n);break}},this.sendMessageRequest=async function(n){return new Promise((i,s)=>{(!n.idx||n.idx<=0)&&s(new Error("message idx not set"));const o=(c,l)=>{if(c)s(c);else if(l)i(l);else throw new Error("no valid response to return")},{idx:a}=n;r.responseCallbacks.get(a)?s(new Error("duplicate message idx, should never happen")):r.responseCallbacks.set(a,o),r.sendMessage(n)})},this.stream.on("data",this.handleMessage)}sendMessage(e){this.stream.writable||console.error("window post message stream is not writable"),this.stream.write(e)}}let Fu;class MD extends Z1{constructor(e){super(),this.walletURL=void 0,this.walletWindow=void 0,this.register=()=>{Fu&&(Fu.unregister(),Fu=this),window.addEventListener("message",this.onWindowEvent),Fu=this,this.on("open",()=>{const r=this.walletWindow,n=setInterval(()=>{r&&r.closed&&(clearInterval(n),this.close())},500)}),this.on("close",()=>{this.walletWindow&&(this.walletWindow.close(),this.walletWindow=null)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),Fu===this&&(Fu=void 0),window.removeEventListener("message",this.onWindowEvent),this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.walletWindow&&this.isOpened()){this.walletWindow.focus();return}const s=new URL(this.walletURL.href),o=new X1;r&&r!==""&&(s.pathname=r.toLowerCase()),this._init=tr.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&(n.type==="connect"&&(n.options||(n.options={app:window.location.origin}),!Ey()&&!AD()&&n.options&&(n.options.origin=window.location.origin)),o.set("intent",ME(n))),i&&o.set("net",`${i}`);let a,c;Ey()?(a=[450,750],c=[Math.abs(window.screen.width/2-a[0]/2),Math.abs(window.screen.height/2-a[1]/2)]):(a=[450,750],c=[Math.abs(window.screenX+window.innerWidth/2-a[0]/2),Math.abs(window.screenY+window.innerHeight/2-a[1]/2)]);const l=`toolbar=0,location=0,menubar=0,scrollbars=yes,status=yes,width=${a[0]},height=${a[1]},left=${c[0]},top=${c[1]}`;s.search=o.toString(),this.walletWindow=window.open(s.href,"sequence.app",l)},this.onWindowEvent=r=>{if(r.origin!==this.walletURL.origin)return;let n;try{n=JSON.parse(r.data)}catch{return}if(!n)throw new Error("ProviderMessage object is empty");this.handleMessage(n)},this.walletURL=new URL(e)}closeWallet(){var e;this.close(),(e=this.walletWindow)==null||e.close()}sendMessage(e){if(!this.walletWindow){Se.warn("WindowMessageProvider: sendMessage failed as walletWindow is unavailable");return}const r=typeof e!="string"?JSON.stringify(e):e;this.walletWindow.postMessage(r,this.walletURL.origin)}}class Dne extends ep{constructor(e){var r;super(e),r=this,this.parentWindow=void 0,this._isPopup=!1,this.onWindowEvent=async function(n){if(!n.origin||n.origin===""||r.appOrigin&&n.origin!==r.appOrigin)return;let i;try{i=JSON.parse(n.data)}catch{return}if(Se.debug("RECEIVED MESSAGE",i),r._init!==tr.OK&&r.isValidInitAck(i)&&(r.appOrigin=n.origin),r._init===tr.OK&&(!r.appOrigin||r.appOrigin.length<8)){Se.error("impossible state, init.OK and appOrigin required");return}r.handleMessage(i)},this.getWindowTransportSession=n=>{const i=new X1(n);return{sessionId:i.get("sid"),networkId:i.get("net"),intent:NE(i.get("intent"))}},this._init=tr.NIL}async register(e){const r=parent.window.opener!==null;if(this._isPopup=r,r!==!0)return;const{pathname:n,search:i}=new URL(e||window.location.href);let s=this.getWindowTransportSession(i);if(!!s.sessionId||(s=await this.getCachedTransportSession()),!s){Se.error("window session is undefined");return}this.parentWindow=parent.window.opener,window.addEventListener("message",this.onWindowEvent,!1),this._registered=!0,this.open(s).then(a=>{if(!a){var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}`;Se.error(l),this.notifyClose({message:l}),window.close()}}).catch(a=>{var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}, due to: ${a}`;Se.error(l),this.notifyClose({message:l}),window.close()})}unregister(){window.removeEventListener("message",this.onWindowEvent),this._registered=!1}sendMessage(e){const r=JSON.stringify(e);e.type===tt.INIT?this.postMessage(r,!0):this.postMessage(r)}get isPopup(){return this._isPopup}postMessage(e,r=!1){if(r!==!0&&this._init!==tr.OK){Se.error("impossible state, should not be calling postMessage until inited");return}r?this.parentWindow.postMessage(e,"*"):this.appOrigin&&this.appOrigin.length>4?this.parentWindow.postMessage(e,this.appOrigin):Se.error("unable to postMessage as parentOrigin is invalid")}}function ND(t){return t&&typeof t=="object"&&(t.windowTransport&&typeof t.windowTransport=="object"||t.proxyTransport&&typeof t.proxyTransport=="object"||t.extensionTransport&&typeof t.extensionTransport=="object"||t.unrealTransport&&typeof t.unrealTransport=="object")&&(t.windowTransport&&t.windowTransport.enabled||t.proxyTransport&&t.proxyTransport.enabled||t.extensionTransport&&t.extensionTransport.enabled||t.unrealTransport&&t.unrealTransport.enabled)}class hb{constructor(...e){var r=this;this.messageProviders=void 0,this.provider=void 0,this.register=()=>{if(this.messageProviders.length===1){this.provider=this.messageProviders[0],this.provider.register();return}this.messageProviders.forEach(n=>{n.register(),n.once("open",()=>{this.provider||(this.provider=n,this.messageProviders.forEach(i=>{this.provider!==i&&i.unregister()}))})})},this.unregister=()=>{this.messageProviders.forEach(n=>n.unregister()),this.provider=void 0},this.openWallet=(n,i,s)=>{if(this.provider){this.provider.openWallet(n,i,s);return}this.messageProviders.forEach(o=>o.openWallet(n,i,s))},this.sendAsync=async function(n,i,s){if(r.provider){r.provider.sendAsync(n,i,s);return}throw new Error("impossible state, wallet must be opened first")},this.sendMessageRequest=async function(n){if(r.provider)return r.provider.sendMessageRequest(n);throw new Error("impossible state, wallet must be opened first")},this.waitUntilOpened=async function(){return r.provider?r.provider.waitUntilOpened():Promise.race(r.messageProviders.map(n=>n.waitUntilOpened()))},this.waitUntilConnected=async function(){if(r.provider)return r.provider.waitUntilConnected();throw new Error("impossible state, wallet must be opened first")},this.messageProviders=e,this.provider=void 0}static new(e){var r,n,i,s;const o=new hb;if((r=e.windowTransport)!=null&&r.enabled&&typeof window=="object"&&e.walletAppURL){const a=new MD(e.walletAppURL);o.add(a)}if((n=e.proxyTransport)!=null&&n.enabled){const a=new TD(e.proxyTransport.appPort);o.add(a)}if((i=e.extensionTransport)!=null&&i.enabled){const a=new $D(e.extensionTransport.runtime);o.add(a)}if((s=e.unrealTransport)!=null&&s.enabled&&e.windowTransport&&e.walletAppURL){const a=new RD(e.walletAppURL);o.add(a)}return o.register(),o}add(...e){this.messageProviders.push(...e)}closeWallet(){this.provider&&this.provider.closeWallet()}isOpened(){return this.provider?this.provider.isOpened():!1}isConnected(){return this.provider?this.provider.isConnected():!1}on(e,r){if(this.provider){this.provider.on(e,r);return}this.messageProviders.forEach(n=>{n.on(e,r)})}once(e,r){if(this.provider){this.provider.once(e,r);return}this.messageProviders.forEach(n=>{n.once(e,r)})}emit(e,...r){if(this.provider)return this.provider.emit(e,...r);for(let n=0;nBne(t,i))}function Bne(t,e){if(e.to.toLowerCase()===t.toLowerCase()&&e.data){const r=fe(e.data);if(r.length>=4&&!Fne(r))throw new Error("self calls are forbidden")}if(e.delegateCall)throw new Error("delegate calls are forbidden")}function Fne(t){const e=new xr(Yr.mainModule.abi);try{return e.decodeFunctionData("createContract",t),!0}catch{return!1}}const Une=1e4;class zne{constructor(e,r,n){var i=this;this.account=void 0,this.signerReadyCallbacks=[],this.prompter=void 0,this.networks=void 0,this._openIntent=void 0,this._connectOptions=void 0,this.events=new fb.EventEmitter2,this.onConnectOptionsChange=void 0,this.promptConnect=async function(s){if(!s&&!i._connectOptions)throw new Error("prompter connect options are empty");if(!i.prompter)return i.connect(s);const o=await i.prompter.promptConnect(s||i._connectOptions).catch(c=>({connected:!1})),a=o;return a.connected&&!a.session&&(a.session=await i.walletSession(s==null?void 0:s.networkId)),o},this.sendAsync=async function(s,o,a){const c={jsonrpc:"2.0",id:s.id,result:null};await i.getAccount();try{var l;if((!i.account||i.account===null)&&!qne.includes(s.method))throw ED;const f=i.account;if(!f)throw new Error("WalletRequestHandler: wallet account is not configured");const d=(l=i.account)==null?void 0:l.providerFor(a??i.defaultChainId());if(!d)throw new Error(`WalletRequestHandler: wallet provider is not configured for chainId ${a}`);const h=d instanceof ua?d:void 0;switch(s.method){case"net_version":{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send("net_version",[]);c.result=p;break}case"eth_chainId":{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send("eth_chainId",[]);c.result=p;break}case"eth_accounts":{const p=f.address;c.result=[p];break}case"eth_getBalance":{const[p,m]=s.params,v=await d.getBalance(p,m);c.result=v.toHexString();break}case"sequence_sign":case"personal_sign":case"eth_sign":{let p;switch(s.method){case"sequence_sign":case"personal_sign":{const[b,E]=s.params;p=b;break}case"eth_sign":{const[b,E]=s.params;p=E;break}}let m="";const v=db(p),y=s.method==="sequence_sign";if(i.prompter===null?m=await f.signMessage(v,a??i.defaultChainId(),y?"eip6492":"ignore"):m=await i.prompter.promptSignMessage({chainId:a,message:v,eip6492:y},i.connectOptions),m&&m.length>0)c.result=m;else throw new Error("declined by user");break}case"sequence_signTypedData_v4":case"eth_signTypedData":case"eth_signTypedData_v4":{const[p,m]=s.params;let v;if(typeof m=="string")try{v=JSON.parse(m)}catch(E){console.warn("walletRequestHandler: error parsing typedData",E)}else v=m;if(!v||!v.domain||!v.types||!v.message)throw new Error("invalid typedData object");let y="";const b=s.method==="sequence_signTypedData_v4";if(i.prompter===null?y=await f.signTypedData(v.domain,v.types,v.message,a??i.defaultChainId(),b?"eip6492":"ignore"):y=await i.prompter.promptSignMessage({chainId:a,typedData:v,eip6492:b},i.connectOptions),y&&y.length>0)c.result=y;else throw new Error("declined by user");break}case"eth_sendTransaction":{const p=jne(s.params[0]).map(v=>("gas"in v&&v.gasLimit===void 0&&(v.gasLimit=v.gas,delete v.gas),v));fk(f.address,p);let m="";if(i.prompter===null){var u;const v=await f.sendTransaction(p,a??i.defaultChainId());m=(u=v==null?void 0:v.hash)!=null?u:""}else m=await i.prompter.promptSendTransaction(p,a,i.connectOptions);if(m)c.result=m;else throw new Error("declined by user");break}case"eth_signTransaction":{const[p]=s.params;if(Be(p.from)!==f.address)throw new Error("sender address does not match wallet");fk(f.address,p),i.prompter===null?c.result=await f.signTransactions(p,a??i.defaultChainId()):c.result=await i.prompter.promptSignTransaction(p,a,i.connectOptions);break}case"eth_sendRawTransaction":{if(we.transaction.isSignedTransactionBundle(s.params[0])){const p=te.from(s.params[0].chainId).toNumber(),m=await f.relayer(p).relay(s.params[0]);c.result=m.hash}else{const p=await d.sendTransaction(s.params[0]);c.result=p.hash}break}case"eth_getTransactionCount":{const p=Be(s.params[0]),m=s.params[1],v=await d.getTransactionCount(p,m);c.result=te.from(v).toHexString();break}case"eth_blockNumber":{c.result=await d.getBlockNumber();break}case"eth_getBlockByNumber":{c.result=await d.getBlock(s.params[0]);break}case"eth_getBlockByHash":{c.result=await d.getBlock(s.params[0]);break}case"eth_getTransactionByHash":{c.result=await d.getTransaction(s.params[0]);break}case"eth_call":{const[p,m]=s.params;c.result=await d.call(p,m);break}case"eth_getCode":{const[p,m]=s.params;c.result=await d.getCode(p,m);break}case"eth_estimateGas":{const[p]=s.params;c.result=await d.estimateGas(p);break}case"eth_gasPrice":{const p=await d.getGasPrice();c.result=p.toHexString();break}case"wallet_switchEthereumChain":{const[p]=s.params;if(!p.chainId||p.chainId.length===0)throw new Error("invalid chainId");const m=te.from(p.chainId);i.setDefaultChainId(m.toNumber()),c.result=null;break}case"sequence_getWalletContext":{c.result=f.contexts;break}case"sequence_getWalletConfig":{const[p]=s.params;p?c.result=[(await f.status(p)).onChain.config]:c.result=await Promise.all(f.networks.map(async function(m){return(await f.status(m.chainId)).onChain.config}));break}case"sequence_getWalletState":{const[p]=s.params;p?c.result=[dk(p,await f.status(p))]:c.result=await Promise.all(f.networks.map(async function(m){const v=await f.status(m.chainId);return dk(m.chainId,v)}));break}case"sequence_getNetworks":{c.result=await i.getNetworks(!0);break}case"sequence_isSequence":{c.result=!0;break}case"sequence_updateConfig":throw new Error("sequence_updateConfig method is not allowed from a dapp");case"sequence_publishConfig":throw new Error("sequence_publishConfig method is not allowed from a dapp");case"sequence_gasRefundOptions":break;case"sequence_getNonce":break;case"sequence_relay":break;case"sequence_setDefaultNetwork":{const[p]=s.params;if(!p)throw new Error("invalid request, method argument defaultChainId cannot be empty");i.setDefaultChainId(p),c.result=await i.getNetworks(!0);break}default:{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send(s.method,s.params);c.result=p}}}catch(f){Se.error(f),c.result=null,c.error=Zn({},new Error(f),{code:4001})}o(void 0,c)},this.isSignedIn=async function(){return await i.signerReady(),!!i.account},this.getAccount=async function(){if(await i.signerReady(),i.account===void 0)throw new Error("signerReady failed resolve");return i.account},this.account=e,this.prompter=r,this.networks=n}defaultChainId(){var e,r;return(e=(r=this.prompter)==null?void 0:r.getDefaultChainId())!=null?e:this.networks[0].chainId}async signIn(e,r={}){this.setAccount(e);const{connect:n,defaultNetworkId:i}=r;if(n){const a=this._connectOptions;let c;if(this.prompter!==null){var s;c=await((s=this.prompter)==null?void 0:s.promptSignInConnect(a))}else c=await this.connect(a);this.notifyConnect(c),(!a||a.keepWalletOpened!==!0)&&this.notifyClose()}if(i&&this.defaultChainId()!==i){var o;await((o=this.prompter)==null?void 0:o.promptChangeNetwork(i))}}signOut(){this.account&&this.notifyDisconnect(),this.setAccount(null)}signerReset(){this.account=void 0}signerReady(e=Une){return new Promise((r,n)=>{this.account!==void 0?r():(setTimeout(()=>{this.account===void 0&&(this.signerReadyCallbacks=[],n("signerReady timed out"))},e),this.signerReadyCallbacks.push(r))})}async connect(e){var r,n;if(!this.account)return{connected:!1,chainId:"0x0",error:"unable to connect without signed in account"};const i=(r=(n=e==null?void 0:e.networkId)!=null?n:this.defaultChainId())!=null?r:ue.MAINNET,s=FE(i).chainId,o={connected:!0,chainId:Ji(s)};if(e&&e.authorize){const a={app:e.app,origin:e.origin,expiry:e.expiry,nonce:e.authorizeNonce};try{o.proof=await FN(this.account,s,a)}catch(c){return Se.warn(`connect, signAuthorization failed for options: ${JSON.stringify(e)}, due to: ${c.message}`),{connected:!1,chainId:"0x0",error:`signAuthorization failed: ${c.message}`}}}return o.session=this.walletSession(s),o}sendMessageRequest(e){return new Promise(r=>{this.sendAsync(e.data,(n,i)=>{const s=Zn({},e,{data:i});r(s)},e.chainId)})}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}async getAddress(){var e,r;return(e=(r=this.account)==null?void 0:r.address)!=null?e:""}get openIntent(){return this._openIntent}setOpenIntent(e){this._openIntent=e}get connectOptions(){return this._connectOptions}setConnectOptions(e){var r;this._connectOptions=e,(r=this.onConnectOptionsChange)==null||r.call(this,e)}async setDefaultChainId(e){var r;return await((r=this.prompter)==null?void 0:r.promptChangeNetwork(e)),this.defaultChainId()}async getNetworks(e){return this.account?e?this.account.networks.map(r=>{const n=Zn({},r);return n.provider=void 0,n.relayer=void 0,n}):this.account.networks:(Se.warn("signer not set: getNetworks is returning an empty list"),[])}walletSession(e){if(!this.account)return;const r={walletContext:this.account.contexts,accountAddress:this.account.address,networks:this.account.networks.map(i=>Zn({},i,{provider:void 0,relayer:void 0}))};if(e){const i=Rs(r.networks,e);if(i){var n;(n=r.networks)==null||n.forEach(s=>delete s.isDefaultChain),i.isDefaultChain=!0}}return r}notifyConnect(e,r){var n;if(console.log("emit connect",e),this.events.emit("connect",e),(n=e.session)!=null&&n.accountAddress){var i;this.events.emit("accountsChanged",[(i=e.session)==null?void 0:i.accountAddress],r)}}notifyDisconnect(e){this.events.emit("accountsChanged",[],e),this.events.emit("disconnect",void 0,e)}notifyChainChanged(e,r){this.events.emit("chainChanged",Ji(e),r)}async notifyNetworks(e){const r=e||await this.getNetworks(!0);if(this.events.emit("networks",r),r.length>0){const n=r.find(i=>i.chainId===this.defaultChainId());n&&this.events.emit("chainChanged",Ji(n.chainId))}else this.events.emit("chainChanged","0x0")}async notifyWalletContext(){if(!this.account){Se.warn("signer not set: skipping to notify wallet context");return}const e=this.account.contexts;this.events.emit("walletContext",e)}notifyClose(e){this.events.emit("close",e)}setAccount(e){if(this.account=e,e!==void 0){for(let r=0;rc.canOnchainValidate||c.original.version===2&&n,o=await r.status(i);if(s(o))return!0;if(await e.promptConfirmWalletDeploy(i,this.connectOptions)){const c=await r.status(i);return s(c)?!0:(Se.error("WalletRequestHandler: result for promptConfirmWalletDeploy is not correct"),!1)}return!1}}function dk(t,e){return{context:e.original.context,config:e.onChain.config,address:we.context.addressOf(e.original.context,e.original.imageHash),chainId:t,deployed:e.onChain.deployed,imageHash:e.imageHash,lastImageHash:e.onChain.imageHash,published:!0,status:e}}const qne=["net_version","eth_chainId","eth_getBalance","eth_getTransactionCount","eth_blockNumber","eth_getBlockByNumber","eth_getBlockByHash","eth_getTransactionByHash","eth_getCode","eth_estimateGas","eth_gasPrice","sequence_getWalletContext","sequence_getNetworks","sequence_setDefaultNetwork"];class Dd{get utils(){return this.provider.utils}constructor(e,r){this.client=e,this.provider=r,this.singleNetworkSigners={},this._isSigner=!0,this._isSequenceSigner=!0}async getAddress(){return this.client.getAddress()}connect(e){if(!Ld.is(e))throw new Error("SequenceSigner can only be connected to a SequenceProvider");return new Dd(this.client,e)}getSigner(e){if(!e)return this;const r=this.provider.toChainId(e);return this.singleNetworkSigners[r]||(this.singleNetworkSigners[r]=new pC(this.client,this.provider,r)),this.singleNetworkSigners[r]}useChainId(e){return this.provider.toChainId(e)||this.client.getChainId()}async signMessage(e,r){const{eip6492:n=!0}=r||{},i=this.useChainId(r==null?void 0:r.chainId);return this.client.signMessage(e,{eip6492:n,chainId:i})}async signTypedData(e,r,n,i){const{eip6492:s=!0}=i||{},o=this.useChainId(i==null?void 0:i.chainId);return this.client.signTypedData({domain:e,types:r,message:n},{eip6492:s,chainId:o})}getProvider(e){return this.provider.getProvider(e)}async sendTransaction(e,r){const n=this.useChainId(r==null?void 0:r.chainId),i=await ID(e),s=await this.client.sendTransaction(i,{chainId:n}),o=this.getProvider(n);try{return await Ko(async function(){const a=await o.getTransaction(s);return a?o._wrapTransaction(a,s):void 0},{onceBlock:o})}catch(a){throw a.transactionHash=s,a}}async getWalletConfig(e){const r=this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}getNetworks(){return this.client.getNetworks()}async getBalance(e,r){return this.getProvider(r==null?void 0:r.chainId).getBalance(this.getAddress(),e)}async estimateGas(e,r){return this.getProvider(r==null?void 0:r.chainId).estimateGas(e)}async call(e,r,n){return this.getProvider(n==null?void 0:n.chainId).call(e,r)}getChainId(){return Promise.resolve(this.client.getChainId())}async getGasPrice(e){return this.getProvider(e==null?void 0:e.chainId).getGasPrice()}async getFeeData(e){return this.getProvider(e==null?void 0:e.chainId).getFeeData()}async resolveName(e){const r=await this.provider.resolveName(e);if(r===null)throw new Error(`ENS name not found: ${e}`);return r}_checkProvider(e){}populateTransaction(e){throw new Error("SequenceSigner does not support populateTransaction")}checkTransaction(e){throw new Error("SequenceSigner does not support checkTransaction")}getTransactionCount(e){throw new Error("SequenceSigner does not support getTransactionCount")}signTransaction(e){throw new Error("SequenceWallet does not support signTransaction, use sendTransaction instead.")}static is(e){return e&&typeof e=="object"&&e._isSequenceSigner===!0}}class pC extends Dd{constructor(e,r,n){super(e,r.getProvider(n)),this.chainId=n,this._isSingleNetworkSequenceSigner=!0}_useChainId(e){const r=this.provider.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This signer only supports the network ${this.chainId}, but ${r} was requested.`);return r||this.provider.toChainId(this.chainId)}useChainId(e){return this._useChainId(e)}getChainId(){return Promise.resolve(this.provider.toChainId(this.chainId))}getProvider(e){return super.getProvider(this._useChainId(e))}getSigner(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceSigner===!0}}class Wne{constructor(e){if(this.signer=e,pC.is(e))throw new Error("WalletUtils does not support SingleNetworkSequenceSigner")}signMessage(e,r,n){return this.signer.signMessage(e,{chainId:r,eip6492:n})}signTypedData(e,r,n,i,s){return this.signer.signTypedData(e,r,n,{chainId:i,eip6492:s})}async isValidSignature(e,r,n,i){return ld(e,r,n,this.signer.getProvider(i))}async isValidMessageSignature(e,r,n,i){const s=this.signer.getProvider(i),o=db(r),a=DE(o);return ld(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,G1(r),n,i)}}class Ld extends tb{constructor(e,r,n=od){super(e.getChainId()),this.client=e,this.providerFor=r,this.networks=n,this.singleNetworkProviders={},this._isSequenceProvider=!0,this.utils=void 0,this.signer=void 0,e.onConnect(i=>{this.emit("connect",i)}),e.onDisconnect(i=>{this.emit("disconnect",i)}),e.onDefaultChainIdChanged(i=>{this.emit("chainChanged",i)}),e.onAccountsChanged(i=>{this.emit("accountsChanged",i)}),this.signer=new Dd(this.client,this),this.utils=new Wne(this.signer)}getSigner(e){return this.signer.getSigner(e)}connect(e){return this.client.connect(e)}disconnect(){return this.client.disconnect()}isConnected(){return this.client.isConnected()}getSession(){return this.client.getSession()}listAccounts(){return[this.client.getAddress()]}getAddress(){return this.client.getAddress()}getNetworks(){return this.client.getNetworks()}getChainId(){return this.client.getChainId()}setDefaultChainId(e){return this.client.setDefaultChainId(this.toChainId(e))}isOpened(){return this.client.isOpened()}closeWallet(){return this.client.closeWallet()}getWalletContext(){return this.client.getWalletContext()}async getWalletConfig(e){const r=await this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}authorize(e){return this.client.connect(Zn({},e,{authorize:!0}))}async openWallet(e,r){return await this.client.openWallet(e,r),!0}toChainId(e){if(e===void 0)return;const r=Rs(this.networks,e);if(!r)throw new Error(`Unsupported network ${e}`);return r.chainId}async useChainId(e){return this.toChainId(e)||this.client.getChainId()}getProvider(e){if(!e)return this;const r=this.toChainId(e);return this.singleNetworkProviders[r]||(this.singleNetworkProviders[r]=new LD(this.client,this.providerFor,r)),this.singleNetworkProviders[r]}async _getSubprovider(e){const r=await this.useChainId(e),n=this.providerFor(r);if(!n)throw new Error(`Unsupported network ${r}`);return n}async perform(e,r){var n;if(e==="eth_chainId")return Ji(await this.useChainId());if(e==="eth_accounts")return[this.client.getAddress()];if(e==="wallet_switchEthereumChain"){const o=r[0],a=DD(o);return this.setDefaultChainId(a)}if(e==="eth_sendTransaction"||e==="eth_sign"||e==="eth_signTypedData"||e==="eth_signTypedData_v4"||e==="personal_sign"||e==="sequence_sign"||e==="sequence_signTypedData_v4")return this.client.send({method:e,params:r},this.getChainId());const i=await this._getSubprovider(),s=(n=i.prepareRequest(e,r))!=null?n:[e,r];return i.send(s[0],s[1])}send(e,r){return this.perform(e,r)}request(e){return this.perform(e.method,e.params)}async detectNetwork(){const e=this.client.getChainId(),r=Rs(this.networks,e);if(!r)throw new Error(`Unknown network ${e}`);return r}async waitForTransaction(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).waitForTransaction(e,r,n)}async getBlockNumber(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getBlockNumber()}async getGasPrice(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getGasPrice()}async getBalance(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBalance(e,r)}async getTransactionCount(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getTransactionCount(e,r)}async getCode(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getCode(e,r)}async getStorageAt(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).getStorageAt(e,r,n)}async call(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).call(e,r)}async estimateGas(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).estimateGas(e)}async getBlock(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getBlock(e)}async getTransaction(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getTransaction(e)}async getLogs(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getLogs(e)}async supportsENS(){return(await this.getNetworks()).some(r=>r.chainId===1)}async getResolver(e){return await this.supportsENS()?(await this._getSubprovider(1)).getResolver(e):null}async resolveName(e){return iE(await e)?e:await this.supportsENS()?(await this._getSubprovider(1)).resolveName(e):null}async lookupAddress(e){return await this.supportsENS()?(await this._getSubprovider(1)).lookupAddress(e):null}async getAvatar(e){return await this.supportsENS()?(await this._getSubprovider(1)).getAvatar(e):null}}Ld.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function DD(t){return typeof t=="object"?DD(t.chainId):te.from(t).toNumber()}class LD extends Ld{constructor(e,r,n){super(e,r),this.chainId=n,this._isSingleNetworkSequenceProvider=!0}_useChainId(e){const r=this.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This provider only supports the network ${this.chainId}, but ${r} was requested.`);return r||super.toChainId(this.chainId)}useChainId(e){return Promise.resolve(this._useChainId(e))}getChainId(){return super.toChainId(this.chainId)}async getNetwork(){const e=await this.client.getNetworks(),r=Rs(e,this.chainId);if(!r)throw new Error(`Unsupported network ${this.chainId}`);return r}getProvider(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}getSigner(e){return super.getSigner(this._useChainId(e))}setDefaultChainId(e){throw new Error(`This provider only supports the network ${this.chainId}; use the parent provider to switch networks.`)}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceProvider===!0}}class Hne extends bne{}const Vne=(t,e)=>{e||(e="https://nodes.sequence.app");const r=!t,n={};return t&&(n.headers={"X-Access-Key":t}),new Hne(e,n,{noop:r,defaultEnabled:!0,privacy:{userIdHash:!0,userAgentSalt:!1},initProps:()=>Yo()?{origin:window.location.origin}:{}})};var Gne={name:"@0xsequence/provider",version:"1.9.17",description:"provider sub-package for Sequence",repository:"https://github.com/0xsequence/sequence.js/tree/master/packages/provider",source:"src/index.ts",main:"dist/0xsequence-provider.cjs.js",module:"dist/0xsequence-provider.esm.js",author:"Horizon Blockchain Games",license:"Apache-2.0",scripts:{test:"pnpm test:concurrently 'pnpm test:run'","test:run":"pnpm test:file tests/**/*.spec.ts","test:file":"NODE_OPTIONS='--import tsx' mocha --timeout 30000",typecheck:"tsc --noEmit","test:concurrently":"concurrently -k --success first 'pnpm start:hardhat1' 'pnpm start:hardhat2'","start:hardhat1":"pnpm start:hardhat1:verbose > /dev/null 2>&1","start:hardhat2":"pnpm start:hardhat2:verbose > /dev/null 2>&1","start:hardhat1:verbose":"hardhat node --config hardhat1.config.js --hostname 0.0.0.0 --port 9595","start:hardhat2:verbose":"hardhat node --config hardhat2.config.js --hostname 0.0.0.0 --port 8595"},dependencies:{"@0xsequence/abi":"workspace:*","@0xsequence/account":"workspace:*","@0xsequence/auth":"workspace:*","@0xsequence/core":"workspace:*","@0xsequence/migration":"workspace:*","@0xsequence/network":"workspace:*","@0xsequence/relayer":"workspace:*","@0xsequence/utils":"workspace:*","@0xsequence/wallet":"workspace:*","@databeat/tracker":"^0.9.1",eventemitter2:"^6.4.5","webextension-polyfill":"^0.10.0"},peerDependencies:{ethers:">=5.5 < 6"},devDependencies:{"@types/webextension-polyfill":"^0.10.0",ethers:"^5.7.2",hardhat:"^2.20.1"},files:["src","dist"]};class Wl{constructor(e){this.store=e}connectedSession(){const e=this.getSession();if(e&&e.accountAddress&&e.walletContext&&e.networks)return{accountAddress:e.accountAddress,walletContext:e.walletContext,networks:e.networks};throw new Error("Sequence session not connected")}hasSession(){var e;return((e=this.getSession())==null?void 0:e.accountAddress)!==void 0}setSession(e){return this.store.setItem(Wl.SESSION_LOCALSTORE_KEY,JSON.stringify(e))}getSession(){const e=this.store.getItem(Wl.SESSION_LOCALSTORE_KEY);if(e)return JSON.parse(e)}async clearSession(){return this.store.removeItem(Wl.SESSION_LOCALSTORE_KEY)}}Wl.SESSION_LOCALSTORE_KEY="@sequence.session";class Hl{constructor(e,r=1){this.store=e,this.startingChainId=r,this.callbacks=[],e.onItemChange(Hl.SESSION_CHAIN_ID_KEY,n=>{if(n){const i=parseInt(n);this.callbacks.forEach(s=>s(i))}})}onDefaultChainIdChanged(e){return this.callbacks.push(e),()=>{this.callbacks=this.callbacks.filter(r=>r!==e)}}setDefaultChainId(e){e!==this.getDefaultChainId()&&this.store.setItem(Hl.SESSION_CHAIN_ID_KEY,e.toString())}getDefaultChainId(){const e=this.store.getItem(Hl.SESSION_CHAIN_ID_KEY);return!e||e.length===0?this.startingChainId:parseInt(e)}}Hl.SESSION_CHAIN_ID_KEY="@sequence.session.defaultChainId";class mC{constructor(e,r,n){var i,s;if(this.session=void 0,this.defaultChainId=void 0,this.callbacks={},this.transport=void 0,this.defaultEIP6492=void 0,this.projectAccessKey=void 0,this.analytics=void 0,ND(e))this.transport=hb.new(e);else if(xD(e))this.transport=e;else throw new Error("Invalid transport");const o=n==null?void 0:n.defaultChainId;if(this.defaultEIP6492=(i=n==null?void 0:n.defaultEIP6492)!=null?i:!1,this.session=new Wl(r),this.defaultChainId=new Hl(r,o),this.transport.on("accountsChanged",l=>{var u;l.length>1&&console.warn("SequenceClient: wallet-webapp returned more than one account"),(u=this.callbacks.accountsChanged)==null||u.forEach(f=>f(l))}),this.transport.on("connect",l=>{var u;const f=Ji(this.getChainId());(u=this.callbacks.connect)==null||u.forEach(d=>d(Zn({},l,{chainId:f})))}),this.transport.on("disconnect",(l,u)=>{var f;(f=this.callbacks.disconnect)==null||f.forEach(d=>d(l,u))}),this.transport.on("networks",l=>{var u;(u=this.callbacks.networks)==null||u.forEach(f=>f(l))}),this.transport.on("walletContext",l=>{var u;(u=this.callbacks.walletContext)==null||u.forEach(f=>f(l))}),this.transport.on("open",l=>{var u;(u=this.callbacks.open)==null||u.forEach(f=>f(l))}),this.transport.on("close",()=>{var l;(l=this.callbacks.close)==null||l.forEach(u=>u())}),this.transport.on("chainChanged",(l,u)=>{var f;(f=this.callbacks.chainChanged)==null||f.forEach(d=>d(l,u))}),this.defaultChainId.onDefaultChainIdChanged(l=>{var u;const f=Ji(l);(u=this.callbacks.chainChanged)==null||u.forEach(d=>d(f))}),n!=null&&n.projectAccessKey&&(this.projectAccessKey=n.projectAccessKey),this.projectAccessKey&&n!=null&&n.analytics&&(this.analytics=Vne(this.projectAccessKey)),(s=this.session.getSession())!=null&&s.accountAddress){var a,c;(a=this.analytics)==null||a.identify((c=this.session.getSession())==null||(c=c.accountAddress)==null?void 0:c.toLowerCase())}}registerCallback(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),()=>{this.callbacks[e]=this.callbacks[e].filter(n=>n!==r)}}onOpen(e){return this.registerCallback("open",e)}onClose(e){return this.registerCallback("close",e)}onConnect(e){return this.registerCallback("connect",e)}onDisconnect(e){return this.registerCallback("disconnect",e)}onNetworks(e){return this.registerCallback("networks",e)}onAccountsChanged(e){return this.registerCallback("accountsChanged",e)}onWalletContext(e){return this.registerCallback("walletContext",e)}onChainChanged(e){return this.registerCallback("chainChanged",e)}onDefaultChainIdChanged(e){return this.registerCallback("chainChanged",e)}getChainId(){return this.defaultChainId.getDefaultChainId()}setDefaultChainId(e){return this.defaultChainId.setDefaultChainId(e)}async openWallet(e,r){return this.transport.openWallet(e,r,this.getChainId()),await this.transport.waitUntilOpened(),this.isOpened()}closeWallet(){return this.transport.closeWallet()}isOpened(){return this.transport.isOpened()}isConnected(){return this.session.hasSession()}getSession(){return this.session.getSession()}getAddress(){return this.session.connectedSession().accountAddress}async connect(e){if((e==null?void 0:e.authorizeVersion)===void 0&&(e.authorizeVersion=2),(e==null?void 0:e.refresh)===!0&&this.disconnect(),e.projectAccessKey=this.projectAccessKey,e&&e.authorize){if(!e.app)throw new Error("connecting with 'authorize' option also requires 'app' to be set");e.authorizeVersion===void 0&&(e.authorizeVersion=2)}await this.openWallet(void 0,{type:"connect",options:Zn({},e,{networkId:this.getChainId(),clientVersion:Gne.version})});const r=await this.transport.waitUntilConnected().catch(s=>s instanceof Error?{connected:!1,error:s.message}:{connected:!1,error:JSON.stringify(s)});if(r.chainId&&(r.chainId=te.from(r.chainId).toString()),r.connected){var n;if(!r.session)throw new Error("impossible state, connect response is missing session");if(this.session.setSession(r.session),(n=r.session)!=null&&n.accountAddress){var i;(i=this.analytics)==null||i.identify(r.session.accountAddress.toLowerCase())}}return r}disconnect(){var e;return this.isOpened()&&this.closeWallet(),(e=this.analytics)==null||e.reset(),this.session.clearSession()}send(e,r){return e.method=this.mapSignMethod(e.method),new Promise((n,i)=>{this.transport.sendAsync(e,(s,o)=>{s?i(s):o===void 0?i(new Error(`Got undefined response for request: ${e}`)):typeof o=="object"&&o.error?i(o.error):typeof o=="object"&&o.result?n(o.result):i(new Error(`Got invalid response for request: ${e}`))},r||this.getChainId())})}async getNetworks(e){const r=this.session.connectedSession();return e&&(r.networks=await this.send({method:"sequence_getNetworks"}),this.session.setSession(r)),r.networks}signMethod(e){return(e==null?void 0:e.eip6492)===void 0?"personal_sign":e.eip6492?"sequence_sign":"legacy_sign"}signTypedDataMethod(e){return(e==null?void 0:e.eip6492)===void 0?"eth_signTypedData_v4":e.eip6492?"sequence_signTypedData_v4":"legacy_signTypedData_v4"}mapSignMethod(e){return e==="personal_sign"?this.defaultEIP6492?"sequence_sign":"personal_sign":e==="eth_signTypedData_v4"?this.defaultEIP6492?"sequence_signTypedData_v4":"eth_signTypedData_v4":e==="legacy_sign"?"personal_sign":e==="legacy_signTypedData_v4"?"eth_signTypedData_v4":e}async signMessage(e,r){var n;const i=this.signMethod(r);return(n=this.analytics)==null||n.track({event:"SIGN_MESSAGE_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),e=le(dC(e)),this.send({method:i,params:[e,this.getAddress()]},r==null?void 0:r.chainId)}async signTypedData(e,r){var n;const i=this.signTypedDataMethod(r),s=Sr.getPayload(e.domain,e.types,e.message);return(n=this.analytics)==null||n.track({event:"SIGN_TYPED_DATA_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),this.send({method:i,params:[this.getAddress(),s]},(r==null?void 0:r.chainId)||e.domain.chainId&&te.from(e.domain.chainId).toNumber()||this.getChainId())}async sendTransaction(e,r){var n;const i=Array.isArray(e)?e:[e],s=Lne(i);return(n=this.analytics)==null||n.track({event:"SEND_TRANSACTION_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),this.send({method:"eth_sendTransaction",params:[s]},r==null?void 0:r.chainId)}async getWalletContext(){return this.send({method:"sequence_getWalletContext"})}async getOnchainWalletConfig(e){const r=await this.send({method:"sequence_getWalletConfig",params:[(e==null?void 0:e.chainId)||this.getChainId()]},e==null?void 0:e.chainId);return Array.isArray(r)?r[0]:r}}const x6={transports:{walletAppURL:"https://sequence.app",windowTransport:{enabled:!0},proxyTransport:{enabled:!1}},defaultNetwork:1,analytics:!0};let co;const jD=(t,e)=>{var r,n,i;if(!t||typeof t!="string")throw new Error("Please pass a projectAccessKey in initWallet.");if(co)return co;const s=Zn({},x6,e,{transports:Zn({},x6.transports,e==null?void 0:e.transports)}),o={},a=(r=(n=s.networks)==null?void 0:n.filter(h=>{h.rpcUrl!==void 0&&h.chainId!==void 0&&od.find(p=>p.chainId===h.chainId)}))!=null?r:[],c=od.map(h=>{var p;const m=(p=s.networks)==null?void 0:p.find(v=>v.chainId===h.chainId);return m?Zn({},h,m):h}).concat(a).map(h=>(h.rpcUrl.includes(t)||(h.rpcUrl=h.rpcUrl+`/${t}`),h)),l=h=>{if(!o[h]){var p;const m=(p=c.find(b=>b.chainId===h))==null?void 0:p.rpcUrl;if(!m)throw new Error(`no rpcUrl found for chainId: ${h}`);const v=new ua(m),y=new UE([MM,$M,new zE],new uy(v));o[h]=new W$(y,h)}return o[h]},u=s.defaultNetwork?(i=Rs(c,s.defaultNetwork))==null?void 0:i.chainId:void 0;if(!u&&s.defaultNetwork)throw new Error(`defaultNetwork not found for chainId: ${s.defaultNetwork}`);const f=s.localStorage||Cy(),d=new mC(s.transports,f,{defaultChainId:u,defaultEIP6492:s.defaultEIP6492,projectAccessKey:t,analytics:s.analytics});return co=new Ld(d,l),co},BD=()=>{co&&(co.client.closeWallet(),co.client.transport.unregister(),co=void 0)},FD=()=>{if(!co)throw new Error("Wallet has not been initialized, call sequence.initWallet(config) first.");return co},Kne=Object.freeze(Object.defineProperty({__proto__:null,BaseInjectedTransport:Nne,BaseProviderTransport:Z1,BaseWalletTransport:ep,CHANNEL_ID:hC,DefaultChainIdTracker:Hl,DefaultProviderConfig:x6,ErrSignedInRequired:ED,EventType:tt,ExtensionMessageHandler:Mne,ExtensionMessageProvider:$D,InitState:tr,LocalStorage:e1,MemoryItemStore:PD,MuxMessageProvider:hb,OpenState:Bi,PROVIDER_OPEN_TIMEOUT:fC,ProviderError:wD,ProxyMessageChannel:One,ProxyMessageChannelPort:b6,ProxyMessageHandler:Rne,ProxyMessageProvider:TD,SequenceClient:mC,SequenceClientSession:Wl,SequenceProvider:Ld,SequenceSigner:Dd,SingleNetworkSequenceProvider:LD,SingleNetworkSequenceSigner:pC,UnrealMessageHandler:$ne,UnrealMessageProvider:RD,WalletRequestHandler:zne,WindowMessageHandler:Dne,WindowMessageProvider:MD,WindowSessionParams:X1,getWallet:FD,initWallet:jD,isBrowserExtension:Ey,isMuxTransportTemplate:ND,isProviderTransport:xD,isUnityPlugin:AD,isValidMessageSignature:SD,isValidSignature:ld,isValidTypedDataSignature:kD,isWalletUpToDate:_D,messageToBytes:dC,nextMessageIdx:CD,prefixEIP191Message:db,resolveArrayProperties:ID,trimEIP191Prefix:Tne,unregisterWallet:BD,useBestStore:Cy},Symbol.toStringTag,{value:"Module"}));function Pn(t,e){return e.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(t)}var Qne=Pn({__proto__:null},[cG]),Yne=Pn({__proto__:null},[hG]),Jne=Pn({__proto__:null},[Cre]),Xne=Pn({__proto__:null},[Pre]),Zne=Pn({__proto__:null},[Ote]),eie=Pn({__proto__:null},[Fte]),tie=Pn({__proto__:null},[Lre]),rie=Pn({__proto__:null},[nee]),nie=Pn({__proto__:null},[Kne]),iie=Pn({__proto__:null},[hte]);const sie=we.transaction;var oie=Object.freeze({__proto__:null,transactions:sie}),aie=Pn({__proto__:null,isValidSignature:ld,isValidMessageSignature:SD,isValidTypedDataSignature:kD,isWalletUpToDate:_D},[zZ]),cie=Pn({__proto__:null},[Vee]),lie=Pn({__proto__:null},[pte]),uie=Pn({__proto__:null},[xre]),fie=Pn({__proto__:null},[Xee]),die=Pn({__proto__:null},[wte]),lu=Object.freeze({__proto__:null,abi:Qne,api:Yne,auth:Jne,guard:Xne,indexer:Zne,metadata:eie,multicall:tie,network:rie,provider:nie,relayer:iie,transactions:oie,utils:aie,core:cie,signhub:lie,sessions:uie,migration:fie,account:die,initWallet:jD,getWallet:FD,unregisterWallet:BD,SequenceProvider:Ld,SequenceClient:mC,SequenceSigner:Dd});const UD="%[a-f0-9]{2}",hk=new RegExp("("+UD+")|([^%]+?)","gi"),pk=new RegExp("("+UD+")+","gi");function w6(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;const r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],w6(r),w6(n))}function hie(t){try{return decodeURIComponent(t)}catch{let e=t.match(hk)||[];for(let r=1;rt==null,gie=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),E6=Symbol("encodeFragmentIdentifier");function bie(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const i=r.length;return n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Rr(e,t),"[",i,"]"].join("")]:[...r,[Rr(e,t),"[",Rr(i,t),"]=",Rr(n,t)].join("")]};case"bracket":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Rr(e,t),"[]"].join("")]:[...r,[Rr(e,t),"[]=",Rr(n,t)].join("")];case"colon-list-separator":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Rr(e,t),":list="].join("")]:[...r,[Rr(e,t),":list=",Rr(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e=t.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(n,i)=>i===void 0||t.skipNull&&i===null||t.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[Rr(r,t),e,Rr(i,t)].join("")]:[[n,Rr(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,Rr(e,t)]:[...r,[Rr(e,t),"=",Rr(n,t)].join("")]}}function xie(t){let e;switch(t.arrayFormat){case"index":return(r,n,i)=>{if(e=/\[(\d*)]$/.exec(r),r=r.replace(/\[\d*]$/,""),!e){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][e[1]]=n};case"bracket":return(r,n,i)=>{if(e=/(\[])$/.exec(r),r=r.replace(/\[]$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"colon-list-separator":return(r,n,i)=>{if(e=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"comma":case"separator":return(r,n,i)=>{const s=typeof n=="string"&&n.includes(t.arrayFormatSeparator),o=typeof n=="string"&&!s&&zo(n,t).includes(t.arrayFormatSeparator);n=o?zo(n,t):n;const a=s||o?n.split(t.arrayFormatSeparator).map(c=>zo(c,t)):n===null?n:zo(n,t);i[r]=a};case"bracket-separator":return(r,n,i)=>{const s=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!s){i[r]=n&&zo(n,t);return}const o=n===null?[]:n.split(t.arrayFormatSeparator).map(a=>zo(a,t));if(i[r]===void 0){i[r]=o;return}i[r]=[...i[r],...o]};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[...[i[r]].flat(),n]}}}function qD(t){if(typeof t!="string"||t.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Rr(t,e){return e.encode?e.strict?gie(t):encodeURIComponent(t):t}function zo(t,e){return e.decode?mie(t):t}function WD(t){return Array.isArray(t)?t.sort():typeof t=="object"?WD(Object.keys(t)).sort((e,r)=>Number(e)-Number(r)).map(e=>t[e]):t}function HD(t){const e=t.indexOf("#");return e!==-1&&(t=t.slice(0,e)),t}function wie(t){let e="";const r=t.indexOf("#");return r!==-1&&(e=t.slice(r)),e}function mk(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&typeof t=="string"&&t.trim()!==""?t=Number(t):e.parseBooleans&&t!==null&&(t.toLowerCase()==="true"||t.toLowerCase()==="false")&&(t=t.toLowerCase()==="true"),t}function vC(t){t=HD(t);const e=t.indexOf("?");return e===-1?"":t.slice(e+1)}function yC(t,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e},qD(e.arrayFormatSeparator);const r=xie(e),n=Object.create(null);if(typeof t!="string"||(t=t.trim().replace(/^[?#&]/,""),!t))return n;for(const i of t.split("&")){if(i==="")continue;const s=e.decode?i.replace(/\+/g," "):i;let[o,a]=zD(s,"=");o===void 0&&(o=s),a=a===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:zo(a,e),r(zo(o,e),a,n)}for(const[i,s]of Object.entries(n))if(typeof s=="object"&&s!==null)for(const[o,a]of Object.entries(s))s[o]=mk(a,e);else n[i]=mk(s,e);return e.sort===!1?n:(e.sort===!0?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((i,s)=>{const o=n[s];return i[s]=o&&typeof o=="object"&&!Array.isArray(o)?WD(o):o,i},Object.create(null))}function VD(t,e){if(!t)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},qD(e.arrayFormatSeparator);const r=o=>e.skipNull&&yie(t[o])||e.skipEmptyString&&t[o]==="",n=bie(e),i={};for(const[o,a]of Object.entries(t))r(o)||(i[o]=a);const s=Object.keys(i);return e.sort!==!1&&s.sort(e.sort),s.map(o=>{const a=t[o];return a===void 0?"":a===null?Rr(o,e):Array.isArray(a)?a.length===0&&e.arrayFormat==="bracket-separator"?Rr(o,e)+"[]":a.reduce(n(o),[]).join("&"):Rr(o,e)+"="+Rr(a,e)}).filter(o=>o.length>0).join("&")}function GD(t,e){var i;e={decode:!0,...e};let[r,n]=zD(t,"#");return r===void 0&&(r=t),{url:((i=r==null?void 0:r.split("?"))==null?void 0:i[0])??"",query:yC(vC(t),e),...e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:zo(n,e)}:{}}}function KD(t,e){e={encode:!0,strict:!0,[E6]:!0,...e};const r=HD(t.url).split("?")[0]||"",n=vC(t.url),i={...yC(n,{sort:!1}),...t.query};let s=VD(i,e);s&&(s=`?${s}`);let o=wie(t.url);if(t.fragmentIdentifier){const a=new URL(r);a.hash=t.fragmentIdentifier,o=e[E6]?a.hash:`#${t.fragmentIdentifier}`}return`${r}${s}${o}`}function QD(t,e,r){r={parseFragmentIdentifier:!0,[E6]:!1,...r};const{url:n,query:i,fragmentIdentifier:s}=GD(t,r);return KD({url:n,query:vie(i,e),fragmentIdentifier:s},r)}function Eie(t,e,r){const n=Array.isArray(e)?i=>!e.includes(i):(i,s)=>!e(i,s);return QD(t,n,r)}const YD=Object.freeze(Object.defineProperty({__proto__:null,exclude:Eie,extract:vC,parse:yC,parseUrl:GD,pick:QD,stringify:VD,stringifyUrl:KD},Symbol.toStringTag,{value:"Module"})),gC=w.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),pb=w.createContext({});function Cie(){return w.useContext(pb).visualElement}const tp=w.createContext(null),mb=typeof document<"u",Sy=mb?w.useLayoutEffect:w.useEffect,JD=w.createContext({strict:!1});function Sie(t,e,r,n){const i=Cie(),s=w.useContext(JD),o=w.useContext(tp),a=w.useContext(gC).reducedMotion,c=w.useRef();n=n||s.renderer,!c.current&&n&&(c.current=n(t,{visualState:e,parent:i,props:r,presenceId:o?o.id:void 0,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;return Sy(()=>{l&&l.render()}),(window.HandoffAppearAnimations?Sy:w.useEffect)(()=>{l&&l.animationState&&l.animationState.animateChanges()}),l}function wf(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function kie(t,e,r){return w.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):wf(r)&&(r.current=n))},[e])}function t1(t){return typeof t=="string"||Array.isArray(t)}function vb(t){return typeof t=="object"&&typeof t.start=="function"}const Aie=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function yb(t){return vb(t.animate)||Aie.some(e=>t1(t[e]))}function XD(t){return!!(yb(t)||t.variants)}function _ie(t,e){if(yb(t)){const{initial:r,animate:n}=t;return{initial:r===!1||t1(r)?r:void 0,animate:t1(n)?n:void 0}}return t.inherit!==!1?e:{}}function Pie(t){const{initial:e,animate:r}=_ie(t,w.useContext(pb));return w.useMemo(()=>({initial:e,animate:r}),[vk(e),vk(r)])}function vk(t){return Array.isArray(t)?t.join(" "):t}const $o=t=>({isEnabled:e=>t.some(r=>!!e[r])}),r1={measureLayout:$o(["layout","layoutId","drag"]),animation:$o(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:$o(["exit"]),drag:$o(["drag","dragControls"]),focus:$o(["whileFocus"]),hover:$o(["whileHover","onHoverStart","onHoverEnd"]),tap:$o(["whileTap","onTap","onTapStart","onTapCancel"]),pan:$o(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:$o(["whileInView","onViewportEnter","onViewportLeave"])};function Iie(t){for(const e in t)e==="projectionNodeConstructor"?r1.projectionNodeConstructor=t[e]:r1[e].Component=t[e]}function gb(t){const e=w.useRef(null);return e.current===null&&(e.current=t()),e.current}const h0={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let Tie=1;function Oie(){return gb(()=>{if(h0.hasEverUpdated)return Tie++})}const bC=w.createContext({});class Rie extends g.Component{getSnapshotBeforeUpdate(){const{visualElement:e,props:r}=this.props;return e&&e.setProps(r),null}componentDidUpdate(){}render(){return this.props.children}}const ZD=w.createContext({}),$ie=Symbol.for("motionComponentSymbol");function Mie({preloadedFeatures:t,createVisualElement:e,projectionNodeConstructor:r,useRender:n,useVisualState:i,Component:s}){t&&Iie(t);function o(c,l){const u={...w.useContext(gC),...c,layoutId:Nie(c)},{isStatic:f}=u;let d=null;const h=Pie(c),p=f?void 0:Oie(),m=i(c,f);if(!f&&mb){h.visualElement=Sie(s,m,u,e);const v=w.useContext(JD).strict,y=w.useContext(ZD);h.visualElement&&(d=h.visualElement.loadFeatures(u,v,t,p,r||r1.projectionNodeConstructor,y))}return w.createElement(Rie,{visualElement:h.visualElement,props:u},d,w.createElement(pb.Provider,{value:h},n(s,c,p,kie(m,h.visualElement,l),m,f,h.visualElement)))}const a=w.forwardRef(o);return a[$ie]=s,a}function Nie({layoutId:t}){const e=w.useContext(bC).id;return e&&t!==void 0?e+"-"+t:t}function Die(t){function e(n,i={}){return Mie(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const Lie=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function xC(t){return typeof t!="string"||t.includes("-")?!1:!!(Lie.indexOf(t)>-1||/[A-Z]/.test(t))}const ky={};function jie(t){Object.assign(ky,t)}const Ay=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],jd=new Set(Ay);function eL(t,{layout:e,layoutId:r}){return jd.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!ky[t]||t==="opacity")}const li=t=>!!(t!=null&&t.getVelocity),Bie={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Fie=(t,e)=>Ay.indexOf(t)-Ay.indexOf(e);function Uie({transform:t,transformKeys:e},{enableHardwareAcceleration:r=!0,allowTransformNone:n=!0},i,s){let o="";e.sort(Fie);for(const a of e)o+=`${Bie[a]||a}(${t[a]}) `;return r&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,i?"":o):n&&i&&(o="none"),o}function tL(t){return t.startsWith("--")}const zie=(t,e)=>e&&typeof t=="number"?e.transform(t):t,ud=(t,e,r)=>Math.min(Math.max(r,t),e),wu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},p0={...wu,transform:t=>ud(0,1,t)},rm={...wu,default:1},m0=t=>Math.round(t*1e5)/1e5,n1=/(-)?([\d]*\.?[\d])+/g,C6=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,qie=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function rp(t){return typeof t=="string"}const np=t=>({test:e=>rp(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Va=np("deg"),vo=np("%"),Pe=np("px"),Wie=np("vh"),Hie=np("vw"),yk={...vo,parse:t=>vo.parse(t)/100,transform:t=>vo.transform(t*100)},gk={...wu,transform:Math.round},rL={borderWidth:Pe,borderTopWidth:Pe,borderRightWidth:Pe,borderBottomWidth:Pe,borderLeftWidth:Pe,borderRadius:Pe,radius:Pe,borderTopLeftRadius:Pe,borderTopRightRadius:Pe,borderBottomRightRadius:Pe,borderBottomLeftRadius:Pe,width:Pe,maxWidth:Pe,height:Pe,maxHeight:Pe,size:Pe,top:Pe,right:Pe,bottom:Pe,left:Pe,padding:Pe,paddingTop:Pe,paddingRight:Pe,paddingBottom:Pe,paddingLeft:Pe,margin:Pe,marginTop:Pe,marginRight:Pe,marginBottom:Pe,marginLeft:Pe,rotate:Va,rotateX:Va,rotateY:Va,rotateZ:Va,scale:rm,scaleX:rm,scaleY:rm,scaleZ:rm,skew:Va,skewX:Va,skewY:Va,distance:Pe,translateX:Pe,translateY:Pe,translateZ:Pe,x:Pe,y:Pe,z:Pe,perspective:Pe,transformPerspective:Pe,opacity:p0,originX:yk,originY:yk,originZ:Pe,zIndex:gk,fillOpacity:p0,strokeOpacity:p0,numOctaves:gk};function wC(t,e,r,n){const{style:i,vars:s,transform:o,transformKeys:a,transformOrigin:c}=t;a.length=0;let l=!1,u=!1,f=!0;for(const d in e){const h=e[d];if(tL(d)){s[d]=h;continue}const p=rL[d],m=zie(h,p);if(jd.has(d)){if(l=!0,o[d]=m,a.push(d),!f)continue;h!==(p.default||0)&&(f=!1)}else d.startsWith("origin")?(u=!0,c[d]=m):i[d]=m}if(e.transform||(l||n?i.transform=Uie(t,r,f,n):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:h="50%",originZ:p=0}=c;i.transformOrigin=`${d} ${h} ${p}`}}const EC=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function nL(t,e,r){for(const n in e)!li(e[n])&&!eL(n,r)&&(t[n]=e[n])}function Vie({transformTemplate:t},e,r){return w.useMemo(()=>{const n=EC();return wC(n,e,{enableHardwareAcceleration:!r},t),Object.assign({},n.vars,n.style)},[e])}function Gie(t,e,r){const n=t.style||{},i={};return nL(i,n,t),Object.assign(i,Vie(t,e,r)),t.transformValues?t.transformValues(i):i}function Kie(t,e,r){const n={},i=Gie(t,e,r);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),n.style=i,n}const Qie=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","viewport"]);function _y(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||Qie.has(t)}let iL=t=>!_y(t);function Yie(t){t&&(iL=e=>e.startsWith("on")?!_y(e):t(e))}try{Yie(require("@emotion/is-prop-valid").default)}catch{}function Jie(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(iL(i)||r===!0&&_y(i)||!e&&!_y(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function bk(t,e,r){return typeof t=="string"?t:Pe.transform(e+r*t)}function Xie(t,e,r){const n=bk(e,t.x,t.width),i=bk(r,t.y,t.height);return`${n} ${i}`}const Zie={offset:"stroke-dashoffset",array:"stroke-dasharray"},ese={offset:"strokeDashoffset",array:"strokeDasharray"};function tse(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?Zie:ese;t[s.offset]=Pe.transform(-n);const o=Pe.transform(e),a=Pe.transform(r);t[s.array]=`${o} ${a}`}function CC(t,{attrX:e,attrY:r,originX:n,originY:i,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...c},l,u,f){if(wC(t,c,l,f),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:p}=t;d.transform&&(p&&(h.transform=d.transform),delete d.transform),p&&(n!==void 0||i!==void 0||h.transform)&&(h.transformOrigin=Xie(p,n!==void 0?n:.5,i!==void 0?i:.5)),e!==void 0&&(d.x=e),r!==void 0&&(d.y=r),s!==void 0&&tse(d,s,o,a,!1)}const sL=()=>({...EC(),attrs:{}}),SC=t=>typeof t=="string"&&t.toLowerCase()==="svg";function rse(t,e,r,n){const i=w.useMemo(()=>{const s=sL();return CC(s,e,{enableHardwareAcceleration:!1},SC(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};nL(s,t.style,t),i.style={...s,...i.style}}return i}function nse(t=!1){return(r,n,i,s,{latestValues:o},a)=>{const l=(xC(r)?rse:Kie)(n,o,a,r),f={...Jie(n,typeof r=="string",t),...l,ref:s},{children:d}=n,h=w.useMemo(()=>li(d)?d.get():d,[d]);return i&&(f["data-projection-id"]=i),w.createElement(r,{...f,children:h})}}const kC=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function oL(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const aL=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function cL(t,e,r,n){oL(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(aL.has(i)?i:kC(i),e.attrs[i])}function AC(t,e){const{style:r}=t,n={};for(const i in r)(li(r[i])||e.style&&li(e.style[i])||eL(i,t))&&(n[i]=r[i]);return n}function lL(t,e){const r=AC(t,e);for(const n in t)if(li(t[n])||li(e[n])){const i=n==="x"||n==="y"?"attr"+n.toUpperCase():n;r[i]=t[n]}return r}function _C(t,e,r,n={},i={}){return typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),e}const Py=t=>Array.isArray(t),ise=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),sse=t=>Py(t)?t[t.length-1]||0:t;function ov(t){const e=li(t)?t.get():t;return ise(e)?e.toValue():e}function ose({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:r},n,i,s){const o={latestValues:ase(n,i,s,t),renderState:e()};return r&&(o.mount=a=>r(n,a,o)),o}const uL=t=>(e,r)=>{const n=w.useContext(pb),i=w.useContext(tp),s=()=>ose(t,e,n,i);return r?s():gb(s)};function ase(t,e,r,n){const i={},s=n(t,{});for(const d in s)i[d]=ov(s[d]);let{initial:o,animate:a}=t;const c=yb(t),l=XD(t);e&&l&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=r?r.initial===!1:!1;u=u||o===!1;const f=u?a:o;return f&&typeof f!="boolean"&&!vb(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=_C(t,h);if(!p)return;const{transitionEnd:m,transition:v,...y}=p;for(const b in y){let E=y[b];if(Array.isArray(E)){const S=u?E.length-1:0;E=E[S]}E!==null&&(i[b]=E)}for(const b in m)i[b]=m[b]}),i}const cse={useVisualState:uL({scrapeMotionValuesFromProps:lL,createRenderState:sL,onMount:(t,e,{renderState:r,latestValues:n})=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}CC(r,n,{enableHardwareAcceleration:!1},SC(e.tagName),t.transformTemplate),cL(e,r)}})},lse={useVisualState:uL({scrapeMotionValuesFromProps:AC,createRenderState:EC})};function use(t,{forwardMotionProps:e=!1},r,n,i){return{...xC(t)?cse:lse,preloadedFeatures:r,useRender:nse(e),createVisualElement:n,projectionNodeConstructor:i,Component:t}}var Rt;(function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"})(Rt||(Rt={}));function bb(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function S6(t,e,r,n){w.useEffect(()=>{const i=t.current;if(r&&i)return bb(i,e,r,n)},[t,e,r,n])}function fse({whileFocus:t,visualElement:e}){const{animationState:r}=e,n=w.useCallback(()=>{r&&r.setActive(Rt.Focus,!0)},[r]),i=w.useCallback(()=>{r&&r.setActive(Rt.Focus,!1)},[r]);S6(e,"focus",t?n:void 0),S6(e,"blur",t?i:void 0)}const fL=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function PC(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const dL=t=>e=>fL(e)&&t(e,PC(e));function qf(t,e,r,n){return bb(t,e,dL(r),n)}function Iy(t,e,r,n){return S6(t,e,r&&dL(r),n)}function hL(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const xk=hL("dragHorizontal"),wk=hL("dragVertical");function pL(t){let e=!1;if(t==="y")e=wk();else if(t==="x")e=xk();else{const r=xk(),n=wk();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function mL(){const t=pL(!0);return t?(t(),!1):!0}function Ek(t,e,r,n){return(i,s)=>{i.type==="touch"||mL()||(r&&t.animationState&&t.animationState.setActive(Rt.Hover,e),n&&n(i,s))}}function dse({onHoverStart:t,onHoverEnd:e,whileHover:r,visualElement:n}){Iy(n,"pointerenter",w.useMemo(()=>t||r?Ek(n,!0,!!r,t):void 0,[t,!!r,n]),{passive:!t}),Iy(n,"pointerleave",w.useMemo(()=>e||r?Ek(n,!1,!!r,e):void 0,[t,!!r,n]),{passive:!e})}const vL=(t,e)=>e?t===e?!0:vL(t,e.parentElement):!1;function IC(t){return w.useEffect(()=>()=>t(),[])}const hse=(t,e)=>r=>e(t(r)),xb=(...t)=>t.reduce(hse);function pse({onTap:t,onTapStart:e,onTapCancel:r,whileTap:n,visualElement:i,...s}){const o=t||e||r||n,a=w.useRef(!1),c=w.useRef(null),l={passive:!(e||t||r||s.onPointerDown)};function u(){c.current&&c.current(),c.current=null}function f(){return u(),a.current=!1,i.getProps().whileTap&&i.animationState&&i.animationState.setActive(Rt.Tap,!1),!mL()}function d(m,v){var y,b,E,S;f()&&(vL(i.current,m.target)?(S=(E=i.getProps()).onTap)===null||S===void 0||S.call(E,m,v):(b=(y=i.getProps()).onTapCancel)===null||b===void 0||b.call(y,m,v))}function h(m,v){var y,b;f()&&((b=(y=i.getProps()).onTapCancel)===null||b===void 0||b.call(y,m,v))}const p=w.useCallback((m,v)=>{var y;if(u(),a.current)return;a.current=!0,c.current=xb(qf(window,"pointerup",d,l),qf(window,"pointercancel",h,l));const b=i.getProps();b.whileTap&&i.animationState&&i.animationState.setActive(Rt.Tap,!0),(y=b.onTapStart)===null||y===void 0||y.call(b,m,v)},[!!e,i]);Iy(i,"pointerdown",o?p:void 0,l),IC(u)}const k6=new WeakMap,Fx=new WeakMap,mse=t=>{const e=k6.get(t.target);e&&e(t)},vse=t=>{t.forEach(mse)};function yse({root:t,...e}){const r=t||document;Fx.has(r)||Fx.set(r,{});const n=Fx.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(vse,{root:t,...e})),n[i]}function gse(t,e,r){const n=yse(e);return k6.set(t,r),n.observe(t),()=>{k6.delete(t),n.unobserve(t)}}function bse({visualElement:t,whileInView:e,onViewportEnter:r,onViewportLeave:n,viewport:i={}}){const s=w.useRef({hasEnteredView:!1,isInView:!1});let o=!!(e||r||n);i.once&&s.current.hasEnteredView&&(o=!1),(typeof IntersectionObserver>"u"?Ese:wse)(o,s.current,t,i)}const xse={some:0,all:1};function wse(t,e,r,{root:n,margin:i,amount:s="some",once:o}){w.useEffect(()=>{if(!t||!r.current)return;const a={root:n==null?void 0:n.current,rootMargin:i,threshold:typeof s=="number"?s:xse[s]},c=l=>{const{isIntersecting:u}=l;if(e.isInView===u||(e.isInView=u,o&&!u&&e.hasEnteredView))return;u&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(Rt.InView,u);const f=r.getProps(),d=u?f.onViewportEnter:f.onViewportLeave;d&&d(l)};return gse(r.current,a,c)},[t,n,i,s])}function Ese(t,e,r,{fallback:n=!0}){w.useEffect(()=>{!t||!n||requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:i}=r.getProps();i&&i(null),r.animationState&&r.animationState.setActive(Rt.InView,!0)})},[t])}const uc=t=>e=>(t(e),null),Cse={inView:uc(bse),tap:uc(pse),focus:uc(fse),hover:uc(dse)};function yL(){const t=w.useContext(tp);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=w.useId();return w.useEffect(()=>n(i),[]),!e&&r?[!1,()=>r&&r(i)]:[!0]}function gL(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n/^\-?\d*\.?\d+$/.test(t),kse=t=>/^0[^.\s]+$/.test(t),ea={delta:0,timestamp:0},bL=1/60*1e3,Ase=typeof performance<"u"?()=>performance.now():()=>Date.now(),xL=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Ase()),bL);function _se(t){let e=[],r=[],n=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const f=u&&i,d=f?e:r;return l&&o.add(c),d.indexOf(c)===-1&&(d.push(c),f&&i&&(n=e.length)),c},cancel:c=>{const l=r.indexOf(c);l!==-1&&r.splice(l,1),o.delete(c)},process:c=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let l=0;l(t[e]=_se(()=>i1=!0),t),{}),Sn=ip.reduce((t,e)=>{const r=wb[e];return t[e]=(n,i=!1,s=!1)=>(i1||Tse(),r.schedule(n,i,s)),t},{}),Nc=ip.reduce((t,e)=>(t[e]=wb[e].cancel,t),{}),Ux=ip.reduce((t,e)=>(t[e]=()=>wb[e].process(ea),t),{}),Ise=t=>wb[t].process(ea),wL=t=>{i1=!1,ea.delta=A6?bL:Math.max(Math.min(t-ea.timestamp,Pse),1),ea.timestamp=t,_6=!0,ip.forEach(Ise),_6=!1,i1&&(A6=!1,xL(wL))},Tse=()=>{i1=!0,A6=!0,_6||xL(wL)};function TC(t,e){t.indexOf(e)===-1&&t.push(e)}function OC(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class RC{constructor(){this.subscriptions=[]}add(e){return TC(this.subscriptions,e),()=>OC(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class Rse{constructor(e,r={}){this.version="8.5.5",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(n,i=!0)=>{this.prev=this.current,this.current=n;const{delta:s,timestamp:o}=ea;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,Sn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Sn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=Ose(this.current),this.owner=r.owner}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new RC);const n=this.events[e].add(r);return e==="change"?()=>{n(),Sn.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$C(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r)||null,this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function fd(t,e){return new Rse(t,e)}const MC=(t,e)=>r=>!!(rp(r)&&qie.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),EL=(t,e,r)=>n=>{if(!rp(n))return n;const[i,s,o,a]=n.match(n1);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},$se=t=>ud(0,255,t),zx={...wu,transform:t=>Math.round($se(t))},Ll={test:MC("rgb","red"),parse:EL("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+zx.transform(t)+", "+zx.transform(e)+", "+zx.transform(r)+", "+m0(p0.transform(n))+")"};function Mse(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const P6={test:MC("#"),parse:Mse,transform:Ll.transform},Ef={test:MC("hsl","hue"),parse:EL("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+vo.transform(m0(e))+", "+vo.transform(m0(r))+", "+m0(p0.transform(n))+")"},$n={test:t=>Ll.test(t)||P6.test(t)||Ef.test(t),parse:t=>Ll.test(t)?Ll.parse(t):Ef.test(t)?Ef.parse(t):P6.parse(t),transform:t=>rp(t)?t:t.hasOwnProperty("red")?Ll.transform(t):Ef.transform(t)},CL="${c}",SL="${n}";function Nse(t){var e,r;return isNaN(t)&&rp(t)&&(((e=t.match(n1))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(C6))===null||r===void 0?void 0:r.length)||0)>0}function Ty(t){typeof t=="number"&&(t=`${t}`);const e=[];let r=0,n=0;const i=t.match(C6);i&&(r=i.length,t=t.replace(C6,CL),e.push(...i.map($n.parse)));const s=t.match(n1);return s&&(n=s.length,t=t.replace(n1,SL),e.push(...s.map(wu.parse))),{values:e,numColors:r,numNumbers:n,tokenised:t}}function kL(t){return Ty(t).values}function AL(t){const{values:e,numColors:r,tokenised:n}=Ty(t),i=e.length;return s=>{let o=n;for(let a=0;atypeof t=="number"?0:t;function Lse(t){const e=kL(t);return AL(t)(e.map(Dse))}const Dc={test:Nse,parse:kL,createTransformer:AL,getAnimatableNone:Lse},jse=new Set(["brightness","contrast","saturate","opacity"]);function Bse(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(n1)||[];if(!n)return t;const i=r.replace(n,"");let s=jse.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const Fse=/([a-z-]*)\(.*?\)/g,I6={...Dc,getAnimatableNone:t=>{const e=t.match(Fse);return e?e.map(Bse).join(" "):t}},Use={...rL,color:$n,backgroundColor:$n,outlineColor:$n,fill:$n,stroke:$n,borderColor:$n,borderTopColor:$n,borderRightColor:$n,borderBottomColor:$n,borderLeftColor:$n,filter:I6,WebkitFilter:I6},NC=t=>Use[t];function DC(t,e){var r;let n=NC(t);return n!==I6&&(n=Dc),(r=n.getAnimatableNone)===null||r===void 0?void 0:r.call(n,e)}const _L=t=>e=>e.test(t),zse={test:t=>t==="auto",parse:t=>t},PL=[wu,Pe,vo,Va,Hie,Wie,zse],Ch=t=>PL.find(_L(t)),qse=[...PL,$n,Dc],Wse=t=>qse.find(_L(t));function Hse(t){const e={};return t.values.forEach((r,n)=>e[n]=r.get()),e}function Vse(t){const e={};return t.values.forEach((r,n)=>e[n]=r.getVelocity()),e}function Eb(t,e,r){const n=t.getProps();return _C(n,e,r!==void 0?r:n.custom,Hse(t),Vse(t))}function Gse(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,fd(r))}function Kse(t,e){const r=Eb(t,e);let{transitionEnd:n={},transition:i={},...s}=r?t.makeTargetAnimatable(r,!1):{};s={...s,...n};for(const o in s){const a=sse(s[o]);Gse(t,o,a)}}function Qse(t,e,r){var n,i;const s=Object.keys(e).filter(a=>!t.hasValue(a)),o=s.length;if(o)for(let a=0;at*1e3,eoe={current:!1},LC=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,jC=t=>e=>1-t(1-e),BC=t=>t*t,toe=jC(BC),FC=LC(BC),gr=(t,e,r)=>-r*t+r*e+t;function qx(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function roe({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,c=2*r-a;i=qx(c,a,t+1/3),s=qx(c,a,t),o=qx(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}const Wx=(t,e,r)=>{const n=t*t;return Math.sqrt(Math.max(0,r*(e*e-n)+n))},noe=[P6,Ll,Ef],ioe=t=>noe.find(e=>e.test(t));function Ck(t){const e=ioe(t);let r=e.parse(t);return e===Ef&&(r=roe(r)),r}const IL=(t,e)=>{const r=Ck(t),n=Ck(e),i={...r};return s=>(i.red=Wx(r.red,n.red,s),i.green=Wx(r.green,n.green,s),i.blue=Wx(r.blue,n.blue,s),i.alpha=gr(r.alpha,n.alpha,s),Ll.transform(i))};function TL(t,e){return typeof t=="number"?r=>gr(t,e,r):$n.test(t)?IL(t,e):RL(t,e)}const OL=(t,e)=>{const r=[...t],n=r.length,i=t.map((s,o)=>TL(s,e[o]));return s=>{for(let o=0;o{const r={...t,...e},n={};for(const i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=TL(t[i],e[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}},RL=(t,e)=>{const r=Dc.createTransformer(e),n=Ty(t),i=Ty(e);return n.numColors===i.numColors&&n.numNumbers>=i.numNumbers?xb(OL(n.values,i.values),r):o=>`${o>0?e:t}`},$y=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},Sk=(t,e)=>r=>gr(t,e,r);function ooe(t){return typeof t=="number"?Sk:typeof t=="string"?$n.test(t)?IL:RL:Array.isArray(t)?OL:typeof t=="object"?soe:Sk}function aoe(t,e,r){const n=[],i=r||ooe(t[0]),s=t.length-1;for(let o=0;ot[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=aoe(e,n,i),a=o.length,c=l=>{let u=0;if(a>1)for(;uc(ud(t[0],t[s-1],l)):c}const UC=t=>t,ML=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,coe=1e-7,loe=12;function uoe(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=ML(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>coe&&++auoe(s,0,1,t,r);return s=>s===0||s===1?s:ML(i(s),e,n)}const DL=t=>1-Math.sin(Math.acos(t)),zC=jC(DL),foe=LC(zC),LL=NL(.33,1.53,.69,.99),qC=jC(LL),doe=LC(qC),hoe=t=>(t*=2)<1?.5*qC(t):.5*(2-Math.pow(2,-10*(t-1))),poe={linear:UC,easeIn:BC,easeInOut:FC,easeOut:toe,circIn:DL,circInOut:foe,circOut:zC,backIn:qC,backInOut:doe,backOut:LL,anticipate:hoe},kk=t=>{if(Array.isArray(t)){Ry(t.length===4);const[e,r,n,i]=t;return NL(e,r,n,i)}else if(typeof t=="string")return poe[t];return t},moe=t=>Array.isArray(t)&&typeof t[0]!="number";function voe(t,e){return t.map(()=>e||FC).splice(0,t.length-1)}function yoe(t){const e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function goe(t,e){return t.map(r=>r*e)}function T6({keyframes:t,ease:e=FC,times:r,duration:n=300}){t=[...t];const i=moe(e)?e.map(kk):kk(e),s={done:!1,value:t[0]},o=goe(r&&r.length===t.length?r:yoe(t),n);function a(){return $L(o,t,{ease:Array.isArray(i)?i:voe(t,i)})}let c=a();return{next:l=>(s.value=c(l),s.done=l>=n,s),flipTarget:()=>{t.reverse(),c=a()}}}const Hx=.001,boe=.01,xoe=10,woe=.05,Eoe=1;function Coe({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s,o=1-e;o=ud(woe,Eoe,o),t=ud(boe,xoe,t/1e3),o<1?(i=l=>{const u=l*o,f=u*t,d=u-r,h=O6(l,o),p=Math.exp(-f);return Hx-d/h*p},s=l=>{const f=l*o*t,d=f*r+r,h=Math.pow(o,2)*Math.pow(l,2)*t,p=Math.exp(-f),m=O6(Math.pow(l,2),o);return(-i(l)+Hx>0?-1:1)*((d-h)*p)/m}):(i=l=>{const u=Math.exp(-l*t),f=(l-r)*t+1;return-Hx+u*f},s=l=>{const u=Math.exp(-l*t),f=(r-l)*(t*t);return u*f});const a=5/t,c=koe(i,s,a);if(t=t*1e3,isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*n;return{stiffness:l,damping:o*2*Math.sqrt(n*l),duration:t}}}const Soe=12;function koe(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function Poe(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Ak(t,_oe)&&Ak(t,Aoe)){const r=Coe(t);e={...e,...r,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}const Ioe=5;function jL({keyframes:t,restDelta:e,restSpeed:r,...n}){let i=t[0],s=t[t.length-1];const o={done:!1,value:i},{stiffness:a,damping:c,mass:l,velocity:u,duration:f,isResolvedFromDuration:d}=Poe(n);let h=Toe,p=u?-(u/1e3):0;const m=c/(2*Math.sqrt(a*l));function v(){const y=s-i,b=Math.sqrt(a/l)/1e3,E=Math.abs(y)<5;if(r||(r=E?.01:2),e||(e=E?.005:.5),m<1){const S=O6(b,m);h=P=>{const M=Math.exp(-m*b*P);return s-M*((p+m*b*y)/S*Math.sin(S*P)+y*Math.cos(S*P))}}else if(m===1)h=S=>s-Math.exp(-b*S)*(y+(p+b*y)*S);else{const S=b*Math.sqrt(m*m-1);h=P=>{const M=Math.exp(-m*b*P),L=Math.min(S*P,300);return s-M*((p+m*b*y)*Math.sinh(L)+S*y*Math.cosh(L))/S}}}return v(),{next:y=>{const b=h(y);if(d)o.done=y>=f;else{let E=p;if(y!==0)if(m<1){const M=Math.max(0,y-Ioe);E=$C(b-h(M),y-M)}else E=0;const S=Math.abs(E)<=r,P=Math.abs(s-b)<=e;o.done=S&&P}return o.value=o.done?s:b,o},flipTarget:()=>{p=-p,[i,s]=[s,i],v()}}}jL.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const Toe=t=>0;function Ooe({keyframes:t=[0],velocity:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){const o=t[0],a={done:!1,value:o};let c=r*e;const l=o+c,u=s===void 0?l:s(l);return u!==l&&(c=u-o),{next:f=>{const d=-c*Math.exp(-f/n);return a.done=!(d>i||d<-i),a.value=a.done?u:u+d,a},flipTarget:()=>{}}}const Roe={decay:Ooe,keyframes:T6,tween:T6,spring:jL};function BL(t,e,r=0){return t-e-r}function $oe(t,e=0,r=0,n=!0){return n?BL(e+-t,e,r):e-(t-e)+r}function Moe(t,e,r,n){return n?t>=e+r:t<=-r}const Noe=t=>{const e=({delta:r})=>t(r);return{start:()=>Sn.update(e,!0),stop:()=>Nc.update(e)}};function My({duration:t,driver:e=Noe,elapsed:r=0,repeat:n=0,repeatType:i="loop",repeatDelay:s=0,keyframes:o,autoplay:a=!0,onPlay:c,onStop:l,onComplete:u,onRepeat:f,onUpdate:d,type:h="keyframes",...p}){var m,v;const y=r;let b,E=0,S=t,P=!1,M=!0,L;const j=Roe[o.length>2?"keyframes":h]||T6,H=o[0],K=o[o.length-1];let Q={done:!1,value:H};!((v=(m=j).needsInterpolation)===null||v===void 0)&&v.call(m,H,K)&&(L=$L([0,100],[H,K],{clamp:!1}),o=[0,100]);const Y=j({...p,duration:t,keyframes:o});function F(){E++,i==="reverse"?(M=E%2===0,r=$oe(r,S,s,M)):(r=BL(r,S,s),i==="mirror"&&Y.flipTarget()),P=!1,f&&f()}function x(){b&&b.stop(),u&&u()}function k(N){M||(N=-N),r+=N,P||(Q=Y.next(Math.max(0,r)),L&&(Q.value=L(Q.value)),P=M?Q.done:r<=0),d&&d(Q.value),P&&(E===0&&(S=S!==void 0?S:r),E{l&&l(),b&&b.stop()},set currentTime(N){r=y,k(N)},sample:N=>{r=y;const A=t&&typeof t=="number"?Math.max(t*.5,50):50;let O=0;for(k(0);O<=N;){const B=N-O;k(Math.min(B,A)),O+=A}return Q}}}function Doe(t){return!t||Array.isArray(t)||typeof t=="string"&&FL[t]}const zh=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,FL={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zh([0,.65,.55,1]),circOut:zh([.55,0,1,.45]),backIn:zh([.31,.01,.66,-.59]),backOut:zh([.33,1.53,.69,.99])};function Loe(t){if(t)return Array.isArray(t)?zh(t):FL[t]}function joe(t,e,r,{delay:n=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:c}={}){return t.animate({[e]:r,offset:c},{delay:n,duration:i,easing:Loe(a),fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const _k={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},Vx={},UL={};for(const t in _k)UL[t]=()=>(Vx[t]===void 0&&(Vx[t]=_k[t]()),Vx[t]);function Boe(t,{repeat:e,repeatType:r="loop"}){const n=e&&r!=="loop"&&e%2===1?0:t.length-1;return t[n]}const Foe=new Set(["opacity"]),nm=10;function Uoe(t,e,{onUpdate:r,onComplete:n,...i}){if(!(UL.waapi()&&Foe.has(e)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0))return!1;let{keyframes:o,duration:a=300,elapsed:c=0,ease:l}=i;if(i.type==="spring"||!Doe(i.ease)){if(i.repeat===1/0)return;const f=My({...i,elapsed:0});let d={done:!1,value:o[0]};const h=[];let p=0;for(;!d.done&&p<2e4;)d=f.sample(p),h.push(d.value),p+=nm;o=h,a=p-nm,l="linear"}const u=joe(t.owner.current,e,o,{...i,delay:-c,duration:a,ease:l});return u.onfinish=()=>{t.set(Boe(o,i)),Sn.update(()=>u.cancel()),n&&n()},{get currentTime(){return u.currentTime||0},set currentTime(f){u.currentTime=f},stop:()=>{const{currentTime:f}=u;if(f){const d=My({...i,autoplay:!1});t.setWithVelocity(d.sample(f-nm).value,d.sample(f).value,nm)}Sn.update(()=>u.cancel())}}}function zL(t,e){const r=performance.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(Nc.read(n),t(s-e))};return Sn.read(n,!0),()=>Nc.read(n)}function zoe({keyframes:t,elapsed:e,onUpdate:r,onComplete:n}){const i=()=>{r&&r(t[t.length-1]),n&&n()};return e?{stop:zL(i,-e)}:i()}function qoe({keyframes:t,velocity:e=0,min:r,max:n,power:i=.8,timeConstant:s=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:f,onComplete:d,onStop:h}){const p=t[0];let m;function v(S){return r!==void 0&&Sn}function y(S){return r===void 0?n:n===void 0||Math.abs(r-S){var M;f==null||f(P),(M=S.onUpdate)===null||M===void 0||M.call(S,P)},onComplete:d,onStop:h})}function E(S){b({type:"spring",stiffness:o,damping:a,restDelta:c,...S})}if(v(p))E({velocity:e,keyframes:[p,y(p)]});else{let S=i*e+p;typeof l<"u"&&(S=l(S));const P=y(S),M=P===r?-1:1;let L,j;const H=K=>{L=j,j=K,e=$C(K-L,ea.delta),(M===1&&K>P||M===-1&&Km==null?void 0:m.stop()}}const gl=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),im=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Gx=()=>({type:"keyframes",ease:"linear",duration:.3}),Woe={type:"keyframes",duration:.8},Pk={x:gl,y:gl,z:gl,rotate:gl,rotateX:gl,rotateY:gl,rotateZ:gl,scaleX:im,scaleY:im,scale:im,opacity:Gx,backgroundColor:Gx,color:Gx,default:im},Hoe=(t,{keyframes:e})=>e.length>2?Woe:(Pk[t]||Pk.default)(e[1]),R6=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Dc.test(e)&&!e.startsWith("url("));function Voe({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}function Ik(t){return t===0||typeof t=="string"&&parseFloat(t)===0&&t.indexOf(" ")===-1}function Tk(t){return typeof t=="number"?0:DC("",t)}function qL(t,e){return t[e]||t.default||t}function Goe(t,e,r,n){const i=R6(e,r);let s=n.from!==void 0?n.from:t.get();return s==="none"&&i&&typeof r=="string"?s=DC(e,r):Ik(s)&&typeof r=="string"?s=Tk(r):!Array.isArray(r)&&Ik(r)&&typeof s=="string"&&(r=Tk(s)),Array.isArray(r)?(r[0]===null&&(r[0]=s),r):[s,r]}const WC=(t,e,r,n={})=>i=>{const s=qL(n,t)||{},o=s.delay||n.delay||0;let{elapsed:a=0}=n;a=a-av(o);const c=Goe(e,t,r,s),l=c[0],u=c[c.length-1],f=R6(t,l),d=R6(t,u);let h={keyframes:c,velocity:e.getVelocity(),...s,elapsed:a,onUpdate:v=>{e.set(v),s.onUpdate&&s.onUpdate(v)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(!f||!d||eoe.current||s.type===!1)return zoe(h);if(s.type==="inertia")return qoe(h);Voe(s)||(h={...h,...Hoe(t,h)}),h.duration&&(h.duration=av(h.duration)),h.repeatDelay&&(h.repeatDelay=av(h.repeatDelay));const p=e.owner,m=p&&p.current;if(p&&m instanceof HTMLElement&&!(p!=null&&p.getProps().onUpdate)){const v=Uoe(e,t,h);if(v)return v}return My(h)};function Koe(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>$6(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=$6(t,e,r);else{const i=typeof e=="function"?Eb(t,e,r.custom):e;n=WL(t,i,r)}return n.then(()=>t.notify("AnimationComplete",e))}function $6(t,e,r={}){var n;const i=Eb(t,e,r.custom);let{transition:s=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>WL(t,i,r):()=>Promise.resolve(),a=!((n=t.variantChildren)===null||n===void 0)&&n.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:d}=s;return Qoe(t,e,u+l,f,d,r)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,u]=c==="beforeChildren"?[o,a]:[a,o];return l().then(u)}else return Promise.all([o(),a(r.delay)])}function WL(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");n&&(o=n);const u=[],f=i&&((s=t.animationState)===null||s===void 0?void 0:s.getState()[i]);for(const d in c){const h=t.getValue(d),p=c[d];if(!h||p===void 0||f&&Joe(f,d))continue;const m={delay:r,elapsed:0,...o};if(window.HandoffAppearAnimations&&!h.hasAnimated){const y=t.getProps()[Zse];y&&(m.elapsed=window.HandoffAppearAnimations(y,d,h,Sn))}let v=h.start(WC(d,h,p,t.shouldReduceMotion&&jd.has(d)?{type:!1}:m));Oy(l)&&(l.add(d),v=v.then(()=>l.remove(d))),u.push(v)}return Promise.all(u).then(()=>{a&&Kse(t,a)})}function Qoe(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,c=i===1?(l=0)=>l*n:(l=0)=>a-l*n;return Array.from(t.variantChildren).sort(Yoe).forEach((l,u)=>{l.notify("AnimationStart",e),o.push($6(l,e,{...s,delay:r+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function Yoe(t,e){return t.sortNodePosition(e)}function Joe({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}const HC=[Rt.Animate,Rt.InView,Rt.Focus,Rt.Hover,Rt.Tap,Rt.Drag,Rt.Exit],Xoe=[...HC].reverse(),Zoe=HC.length;function eae(t){return e=>Promise.all(e.map(({animation:r,options:n})=>Koe(t,r,n)))}function tae(t){let e=eae(t);const r=nae();let n=!0;const i=(c,l)=>{const u=Eb(t,l);if(u){const{transition:f,transitionEnd:d,...h}=u;c={...c,...h,...d}}return c};function s(c){e=c(t)}function o(c,l){const u=t.getProps(),f=t.getVariantContext(!0)||{},d=[],h=new Set;let p={},m=1/0;for(let y=0;ym&&P;const K=Array.isArray(S)?S:[S];let Q=K.reduce(i,{});M===!1&&(Q={});const{prevResolvedValues:Y={}}=E,F={...Y,...Q},x=k=>{H=!0,h.delete(k),E.needsAnimating[k]=!0};for(const k in F){const R=Q[k],N=Y[k];p.hasOwnProperty(k)||(R!==N?Py(R)&&Py(N)?!gL(R,N)||j?x(k):E.protectedKeys[k]=!0:R!==void 0?x(k):h.add(k):R!==void 0&&h.has(k)?x(k):E.protectedKeys[k]=!0)}E.prevProp=S,E.prevResolvedValues=Q,E.isActive&&(p={...p,...Q}),n&&t.blockInitialAnimation&&(H=!1),H&&!L&&d.push(...K.map(k=>({animation:k,options:{type:b,...c}})))}if(h.size){const y={};h.forEach(b=>{const E=t.getBaseTarget(b);E!==void 0&&(y[b]=E)}),d.push({animation:y})}let v=!!d.length;return n&&u.initial===!1&&!t.manuallyAnimateOnMount&&(v=!1),n=!1,v?e(d):Promise.resolve()}function a(c,l,u){var f;if(r[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(c,l)}),r[c].isActive=l;const d=o(u,c);for(const h in r)r[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r}}function rae(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!gL(e,t):!1}function bl(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nae(){return{[Rt.Animate]:bl(!0),[Rt.InView]:bl(),[Rt.Hover]:bl(),[Rt.Tap]:bl(),[Rt.Drag]:bl(),[Rt.Focus]:bl(),[Rt.Exit]:bl()}}const iae={animation:uc(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=tae(t)),vb(e)&&w.useEffect(()=>e.subscribe(t),[e])}),exit:uc(t=>{const{custom:e,visualElement:r}=t,[n,i]=yL(),s=w.useContext(tp);w.useEffect(()=>{r.isPresent=n;const o=r.animationState&&r.animationState.setActive(Rt.Exit,!n,{custom:s&&s.custom||e});o&&!n&&o.then(i)},[n])})},Ok=(t,e)=>Math.abs(t-e);function sae(t,e){const r=Ok(t.x,e.x),n=Ok(t.y,e.y);return Math.sqrt(r**2+n**2)}class HL{constructor(e,r,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const l=Qx(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,f=sae(l.offset,{x:0,y:0})>=3;if(!u&&!f)return;const{point:d}=l,{timestamp:h}=ea;this.history.push({...d,timestamp:h});const{onStart:p,onMove:m}=this.handlers;u||(p&&p(this.lastMoveEvent,l),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,l)},this.handlePointerMove=(l,u)=>{this.lastMoveEvent=l,this.lastMoveEventInfo=Kx(u,this.transformPagePoint),Sn.update(this.updatePoint,!0)},this.handlePointerUp=(l,u)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,h=Qx(l.type==="pointercancel"?this.lastMoveEventInfo:Kx(u,this.transformPagePoint),this.history);this.startEvent&&f&&f(l,h),d&&d(l,h)},!fL(e))return;this.handlers=r,this.transformPagePoint=n;const i=PC(e),s=Kx(i,this.transformPagePoint),{point:o}=s,{timestamp:a}=ea;this.history=[{...o,timestamp:a}];const{onSessionStart:c}=r;c&&c(e,Qx(s,this.history)),this.removeListeners=xb(qf(window,"pointermove",this.handlePointerMove),qf(window,"pointerup",this.handlePointerUp),qf(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Nc.update(this.updatePoint)}}function Kx(t,e){return e?{point:e(t.point)}:t}function Rk(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Qx({point:t},e){return{point:t,delta:Rk(t,VL(e)),offset:Rk(t,oae(e)),velocity:aae(e,.1)}}function oae(t){return t[0]}function VL(t){return t[t.length-1]}function aae(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=VL(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>av(e)));)r--;if(!n)return{x:0,y:0};const s=(i.timestamp-n.timestamp)/1e3;if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ki(t){return t.max-t.min}function M6(t,e=0,r=.01){return Math.abs(t-e)<=r}function $k(t,e,r,n=.5){t.origin=n,t.originPoint=gr(e.min,e.max,t.origin),t.scale=ki(r)/ki(e),(M6(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=gr(r.min,r.max,t.origin)-t.originPoint,(M6(t.translate)||isNaN(t.translate))&&(t.translate=0)}function v0(t,e,r,n){$k(t.x,e.x,r.x,n==null?void 0:n.originX),$k(t.y,e.y,r.y,n==null?void 0:n.originY)}function Mk(t,e,r){t.min=r.min+e.min,t.max=t.min+ki(e)}function cae(t,e,r){Mk(t.x,e.x,r.x),Mk(t.y,e.y,r.y)}function Nk(t,e,r){t.min=e.min-r.min,t.max=t.min+ki(e)}function y0(t,e,r){Nk(t.x,e.x,r.x),Nk(t.y,e.y,r.y)}function lae(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?gr(r,t,n.max):Math.min(t,r)),t}function Dk(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function uae(t,{top:e,left:r,bottom:n,right:i}){return{x:Dk(t.x,r,i),y:Dk(t.y,e,n)}}function Lk(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=$y(e.min,e.max-n,t.min):n>i&&(r=$y(t.min,t.max-i,e.min)),ud(0,1,r)}function hae(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const N6=.35;function pae(t=N6){return t===!1?t=0:t===!0&&(t=N6),{x:jk(t,"left","right"),y:jk(t,"top","bottom")}}function jk(t,e,r){return{min:Bk(t,e),max:Bk(t,r)}}function Bk(t,e){return typeof t=="number"?t:t[e]||0}const Fk=()=>({translate:0,scale:1,origin:0,originPoint:0}),g0=()=>({x:Fk(),y:Fk()}),Uk=()=>({min:0,max:0}),jr=()=>({x:Uk(),y:Uk()});function Qs(t){return[t("x"),t("y")]}function GL({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function mae({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function vae(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function Yx(t){return t===void 0||t===1}function D6({scale:t,scaleX:e,scaleY:r}){return!Yx(t)||!Yx(e)||!Yx(r)}function El(t){return D6(t)||KL(t)||t.z||t.rotate||t.rotateX||t.rotateY}function KL(t){return zk(t.x)||zk(t.y)}function zk(t){return t&&t!=="0%"}function Ny(t,e,r){const n=t-r,i=e*n;return r+i}function qk(t,e,r,n,i){return i!==void 0&&(t=Ny(t,i,n)),Ny(t,r,n)+e}function L6(t,e=0,r=1,n,i){t.min=qk(t.min,e,r,n,i),t.max=qk(t.max,e,r,n,i)}function QL(t,{x:e,y:r}){L6(t.x,e.translate,e.scale,e.originPoint),L6(t.y,r.translate,r.scale,r.originPoint)}function yae(t,e,r,n=!1){var i,s;const o=r.length;if(!o)return;e.x=e.y=1;let a,c;for(let l=0;l1.0000000000001||t<.999999999999?t:1}function tc(t,e){t.min=t.min+e,t.max=t.max+e}function Hk(t,e,[r,n,i]){const s=e[i]!==void 0?e[i]:.5,o=gr(t.min,t.max,s);L6(t,e[r],e[n],o,e.scale)}const gae=["x","scaleX","originX"],bae=["y","scaleY","originY"];function Cf(t,e){Hk(t.x,e,gae),Hk(t.y,e,bae)}function YL(t,e){return GL(vae(t.getBoundingClientRect(),e))}function xae(t,e,r){const n=YL(t,r),{scroll:i}=e;return i&&(tc(n.x,i.offset.x),tc(n.y,i.offset.y)),n}const wae=new WeakMap;class Eae{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=jr(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){if(this.visualElement.isPresent===!1)return;const n=a=>{this.stopAnimation(),r&&this.snapToCursor(PC(a,"page").point)},i=(a,c)=>{var l;const{drag:u,dragPropagation:f,onDragStart:d}=this.getProps();u&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=pL(u),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Qs(h=>{var p,m;let v=this.getAxisMotionValue(h).get()||0;if(vo.test(v)){const y=(m=(p=this.visualElement.projection)===null||p===void 0?void 0:p.layout)===null||m===void 0?void 0:m.layoutBox[h];y&&(v=ki(y)*(parseFloat(v)/100))}this.originPoint[h]=v}),d==null||d(a,c),(l=this.visualElement.animationState)===null||l===void 0||l.setActive(Rt.Drag,!0))},s=(a,c)=>{const{dragPropagation:l,dragDirectionLock:u,onDirectionLock:f,onDrag:d}=this.getProps();if(!l&&!this.openGlobalLock)return;const{offset:h}=c;if(u&&this.currentDirection===null){this.currentDirection=Cae(h),this.currentDirection!==null&&(f==null||f(this.currentDirection));return}this.updateAxis("x",c.point,h),this.updateAxis("y",c.point,h),this.visualElement.render(),d==null||d(a,c)},o=(a,c)=>this.stop(a,c);this.panSession=new HL(e,{onSessionStart:n,onStart:i,onMove:s,onSessionEnd:o},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s==null||s(e,r)}cancel(){var e,r;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)===null||e===void 0||e.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(r=this.visualElement.animationState)===null||r===void 0||r.setActive(Rt.Drag,!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!sm(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=lae(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:r}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;e&&wf(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=uae(n.layoutBox,e):this.constraints=!1,this.elastic=pae(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Qs(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=hae(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!wf(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=xae(n,i.root,this.visualElement.getTransformPagePoint());let o=fae(i.layout.layoutBox,s);if(r){const a=r(mae(o));this.hasMutatedConstraints=!!a,a&&(o=GL(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Qs(u=>{if(!sm(u,r,this.currentDirection))return;let f=(c==null?void 0:c[u])||{};o&&(f={min:0,max:0});const d=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:n?e[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,p)});return Promise.all(l).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(WC(e,n,0,r))}stopAnimation(){Qs(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){var r;const n="_drag"+e.toUpperCase(),i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,((r=this.visualElement.getProps().initial)===null||r===void 0?void 0:r[e])||0)}snapToCursor(e){Qs(r=>{const{drag:n}=this.getProps();if(!sm(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-gr(o,a,.5))}})}scalePositionWithinConstraints(){var e;if(!this.visualElement.current)return;const{drag:r,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!wf(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Qs(a=>{const c=this.getAxisMotionValue(a);if(c){const l=c.get();s[a]=dae({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",(e=i.root)===null||e===void 0||e.updateScroll(),i.updateLayout(),this.resolveConstraints(),Qs(a=>{if(!sm(a,r,null))return;const c=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];c.set(gr(l,u,s[a]))})}addListeners(){var e;if(!this.visualElement.current)return;wae.set(this.visualElement,this);const r=this.visualElement.current,n=qf(r,"pointerdown",l=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();wf(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&((e=s.root)===null||e===void 0||e.updateScroll(),s.updateLayout()),i();const a=bb(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Qs(f=>{const d=this.getAxisMotionValue(f);d&&(this.originPoint[f]+=l[f].translate,d.set(d.get()+l[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),c==null||c()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=N6,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function sm(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Cae(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}function Sae(t){const{dragControls:e,visualElement:r}=t,n=gb(()=>new Eae(r));w.useEffect(()=>e&&e.subscribe(n),[n,e]),w.useEffect(()=>n.addListeners(),[n])}function kae({onPan:t,onPanStart:e,onPanEnd:r,onPanSessionStart:n,visualElement:i}){const s=t||e||r||n,o=w.useRef(null),{transformPagePoint:a}=w.useContext(gC),c={onSessionStart:n,onStart:e,onMove:t,onEnd:(u,f)=>{o.current=null,r&&r(u,f)}};w.useEffect(()=>{o.current!==null&&o.current.updateHandlers(c)});function l(u){o.current=new HL(u,c,{transformPagePoint:a})}Iy(i,"pointerdown",s&&l),IC(()=>o.current&&o.current.end())}const Aae={pan:uc(kae),drag:uc(Sae)};function j6(t){return typeof t=="string"&&t.startsWith("var(--")}const JL=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function _ae(t){const e=JL.exec(t);if(!e)return[,];const[,r,n]=e;return[r,n]}function B6(t,e,r=1){const[n,i]=_ae(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);return s?s.trim():j6(i)?B6(i,e,r+1):i}function Pae(t,{...e},r){const n=t.current;if(!(n instanceof Element))return{target:e,transitionEnd:r};r&&(r={...r}),t.values.forEach(i=>{const s=i.get();if(!j6(s))return;const o=B6(s,n);o&&i.set(o)});for(const i in e){const s=e[i];if(!j6(s))continue;const o=B6(s,n);o&&(e[i]=o,r&&r[i]===void 0&&(r[i]=s))}return{target:e,transitionEnd:r}}const Iae=new Set(["width","height","top","left","right","bottom","x","y"]),XL=t=>Iae.has(t),Tae=t=>Object.keys(t).some(XL),Vk=t=>t===wu||t===Pe;var Gk;(function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"})(Gk||(Gk={}));const Kk=(t,e)=>parseFloat(t.split(", ")[e]),Qk=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/);if(i)return Kk(i[1],e);{const s=n.match(/^matrix\((.+)\)$/);return s?Kk(s[1],t):0}},Oae=new Set(["x","y","z"]),Rae=Ay.filter(t=>!Oae.has(t));function $ae(t){const e=[];return Rae.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e.length&&t.render(),e}const Yk={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Qk(4,13),y:Qk(5,14)},Mae=(t,e,r)=>{const n=e.measureViewportBox(),i=e.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",t.display||"block"),r.forEach(l=>{a[l]=Yk[l](n,s)}),e.render();const c=e.measureViewportBox();return r.forEach(l=>{const u=e.getValue(l);u&&u.jump(a[l]),t[l]=Yk[l](c,s)}),t},Nae=(t,e,r={},n={})=>{e={...e},n={...n};const i=Object.keys(e).filter(XL);let s=[],o=!1;const a=[];if(i.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=r[c],f=Ch(u);const d=e[c];let h;if(Py(d)){const p=d.length,m=d[0]===null?1:0;u=d[m],f=Ch(u);for(let v=m;v=0?window.pageYOffset:null,l=Mae(e,t,a);return s.length&&s.forEach(([u,f])=>{t.getValue(u).set(f)}),t.render(),mb&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:n}}else return{target:e,transitionEnd:n}};function Dae(t,e,r,n){return Tae(e)?Nae(t,e,r,n):{target:e,transitionEnd:n}}const Lae=(t,e,r,n)=>{const i=Pae(t,e,n);return e=i.target,n=i.transitionEnd,Dae(t,e,r,n)},F6={current:null},ZL={current:!1};function jae(){if(ZL.current=!0,!!mb)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>F6.current=t.matches;t.addListener(e),e()}else F6.current=!1}function Bae(t,e,r){const{willChange:n}=e;for(const i in e){const s=e[i],o=r[i];if(li(s))t.addValue(i,s),Oy(n)&&n.add(i);else if(li(o))t.addValue(i,fd(s,{owner:t})),Oy(n)&&n.remove(i);else if(o!==s)if(t.hasValue(i)){const a=t.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=t.getStaticValue(i);t.addValue(i,fd(a!==void 0?a:s,{owner:t}))}}for(const i in r)e[i]===void 0&&t.removeValue(i);return e}const ej=Object.keys(r1),Fae=ej.length,Jk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Uae{constructor({parent:e,props:r,reducedMotionConfig:n,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Sn.render(this.render,!1,!0);const{latestValues:o,renderState:a}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=r.initial?{...o}:{},this.renderState=a,this.parent=e,this.props=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=yb(r),this.isVariantNode=XD(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...l}=this.scrapeMotionValuesFromProps(r,{});for(const u in l){const f=l[u];o[u]!==void 0&&li(f)&&(f.set(o[u],!1),Oy(c)&&c.add(u))}}scrapeMotionValuesFromProps(e,r){return{}}mount(e){var r;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(r=this.parent)===null||r===void 0?void 0:r.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),ZL.current||jae(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:F6.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var e,r,n;(e=this.projection)===null||e===void 0||e.unmount(),Nc.update(this.notifyUpdate),Nc.render(this.render),this.valueSubscriptions.forEach(i=>i()),(r=this.removeFromVariantTree)===null||r===void 0||r.call(this),(n=this.parent)===null||n===void 0||n.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(e,r){const n=jd.has(e),i=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Sn.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...r},n,i,s,o,a){const c=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:h,layoutRoot:p})}return c}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):jr()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}makeTargetAnimatable(e,r=!0){return this.makeTargetAnimatableFromInstance(e,this.props,r)}setProps(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const r=this.props;this.props=e;for(let n=0;nn.variantChildren.delete(e)}addValue(e,r){r!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,r)),this.values.set(e,r),this.latestValues[e]=r.get()}removeValue(e){var r;this.values.delete(e),(r=this.valueSubscriptions.get(e))===null||r===void 0||r(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=fd(r,{owner:this}),this.addValue(e,n)),n}readValue(e){return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props,i=typeof n=="string"||typeof n=="object"?(r=_C(this.props,n))===null||r===void 0?void 0:r[e]:void 0;if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!li(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new RC),this.events[e].add(r)}notify(e,...r){var n;(n=this.events[e])===null||n===void 0||n.notify(...r)}}const tj=["initial",...HC],zae=tj.length;class rj extends Uae{sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){var n;return(n=e.style)===null||n===void 0?void 0:n[r]}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:r,...n},{transformValues:i},s){let o=Jse(n,e||{},this);if(i&&(r&&(r=i(r)),n&&(n=i(n)),o&&(o=i(o))),s){Qse(this,n,o);const a=Lae(this,n,o,r);r=a.transitionEnd,n=a.target}return{transition:e,transitionEnd:r,...n}}}function qae(t){return window.getComputedStyle(t)}class Wae extends rj{readValueFromInstance(e,r){if(jd.has(r)){const n=NC(r);return n&&n.default||0}else{const n=qae(e),i=(tL(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return YL(e,r)}build(e,r,n,i){wC(e,r,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,r){return AC(e,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;li(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}renderInstance(e,r,n,i){oL(e,r,n,i)}}class Hae extends rj{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){var n;return jd.has(r)?((n=NC(r))===null||n===void 0?void 0:n.default)||0:(r=aL.has(r)?r:kC(r),e.getAttribute(r))}measureInstanceViewportBox(){return jr()}scrapeMotionValuesFromProps(e,r){return lL(e,r)}build(e,r,n,i){CC(e,r,n,this.isSVGTag,i.transformTemplate)}renderInstance(e,r,n,i){cL(e,r,n,i)}mount(e){this.isSVGTag=SC(e.tagName),super.mount(e)}}const Vae=(t,e)=>xC(t)?new Hae(e,{enableHardwareAcceleration:!1}):new Wae(e,{enableHardwareAcceleration:!0});function Xk(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Sh={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Pe.test(t))t=parseFloat(t);else return t;const r=Xk(t,e.target.x),n=Xk(t,e.target.y);return`${r}% ${n}%`}},Zk="_$css",Gae={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=t.includes("var("),s=[];i&&(t=t.replace(JL,h=>(s.push(h),Zk)));const o=Dc.parse(t);if(o.length>5)return n;const a=Dc.createTransformer(t),c=typeof o[0]!="number"?1:0,l=r.x.scale*e.x,u=r.y.scale*e.y;o[0+c]/=l,o[1+c]/=u;const f=gr(l,u,.5);typeof o[2+c]=="number"&&(o[2+c]/=f),typeof o[3+c]=="number"&&(o[3+c]/=f);let d=a(o);if(i){let h=0;d=d.replace(Zk,()=>{const p=s[h];return h++,p})}return d}};class Kae extends g.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;jie(Yae),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),h0.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||Sn.postRender(()=>{var a;!((a=o.getStack())===null||a===void 0)&&a.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r!=null&&r.group&&r.group.remove(i),n!=null&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e==null||e()}render(){return null}}function Qae(t){const[e,r]=yL(),n=w.useContext(bC);return g.createElement(Kae,{...t,layoutGroup:n,switchLayoutGroup:w.useContext(ZD),isPresent:e,safeToRemove:r})}const Yae={borderRadius:{...Sh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Sh,borderTopRightRadius:Sh,borderBottomLeftRadius:Sh,borderBottomRightRadius:Sh,boxShadow:Gae},Jae={measureLayout:Qae};function Xae(t,e,r={}){const n=li(t)?t:fd(t);return n.start(WC("",n,e,r)),{stop:()=>n.stop(),isAnimating:()=>n.isAnimating()}}const nj=["TopLeft","TopRight","BottomLeft","BottomRight"],Zae=nj.length,eA=t=>typeof t=="string"?parseFloat(t):t,tA=t=>typeof t=="number"||Pe.test(t);function ece(t,e,r,n,i,s){i?(t.opacity=gr(0,r.opacity!==void 0?r.opacity:1,tce(n)),t.opacityExit=gr(e.opacity!==void 0?e.opacity:1,0,rce(n))):s&&(t.opacity=gr(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r($y(t,e,n))}function nA(t,e){t.min=e.min,t.max=e.max}function ys(t,e){nA(t.x,e.x),nA(t.y,e.y)}function iA(t,e,r,n,i){return t-=e,t=Ny(t,1/r,n),i!==void 0&&(t=Ny(t,1/i,n)),t}function nce(t,e=0,r=1,n=.5,i,s=t,o=t){if(vo.test(e)&&(e=parseFloat(e),e=gr(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=gr(s.min,s.max,n);t===s&&(a-=e),t.min=iA(t.min,e,r,a,i),t.max=iA(t.max,e,r,a,i)}function sA(t,e,[r,n,i],s,o){nce(t,e[r],e[n],e[i],e.scale,s,o)}const ice=["x","scaleX","originX"],sce=["y","scaleY","originY"];function oA(t,e,r,n){sA(t.x,e,ice,r==null?void 0:r.x,n==null?void 0:n.x),sA(t.y,e,sce,r==null?void 0:r.y,n==null?void 0:n.y)}function aA(t){return t.translate===0&&t.scale===1}function sj(t){return aA(t.x)&&aA(t.y)}function oj(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function cA(t){return ki(t.x)/ki(t.y)}class oce{constructor(){this.members=[]}add(e){TC(this.members,e),e.scheduleRender()}remove(e){if(OC(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){var n;const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,r&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),!((n=e.root)===null||n===void 0)&&n.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var r,n,i,s,o;(n=(r=e.options).onExitComplete)===null||n===void 0||n.call(r),(o=(i=e.resumingFrom)===null||i===void 0?void 0:(s=i.options).onExitComplete)===null||o===void 0||o.call(s)})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function lA(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y;if((i||s)&&(n=`translate3d(${i}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{rotate:c,rotateX:l,rotateY:u}=r;c&&(n+=`rotate(${c}deg) `),l&&(n+=`rotateX(${l}deg) `),u&&(n+=`rotateY(${u}deg) `)}const o=t.x.scale*e.x,a=t.y.scale*e.y;return(o!==1||a!==1)&&(n+=`scale(${o}, ${a})`),n||"none"}const ace=(t,e)=>t.depth-e.depth;class cce{constructor(){this.children=[],this.isDirty=!1}add(e){TC(this.children,e),this.isDirty=!0}remove(e){OC(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ace),this.isDirty=!1,this.children.forEach(e)}}const uA=["","X","Y","Z"],fA=1e3;let lce=0;function aj({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o,a={},c=e==null?void 0:e()){this.id=lce++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(dce),this.nodes.forEach(mce),this.nodes.forEach(vce)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=o,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0,o&&this.root.registerPotentialNode(o,this);for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=zL(h,250),h0.hasAnimatedSinceResize&&(h0.hasAnimatedSinceResize=!1,this.nodes.forEach(hA))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&f&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:m})=>{var v,y,b,E,S;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const P=(y=(v=this.options.transition)!==null&&v!==void 0?v:f.getDefaultTransition())!==null&&y!==void 0?y:wce,{onLayoutAnimationStart:M,onLayoutAnimationComplete:L}=f.getProps(),j=!this.targetLayout||!oj(this.targetLayout,m)||p,H=!h&&p;if(this.options.layoutRoot||!((b=this.resumeFrom)===null||b===void 0)&&b.instance||H||h&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,H);const K={...qL(P,"layout"),onPlay:M,onComplete:L};(f.shouldReduceMotion||this.options.layoutRoot)&&(K.delay=0,K.type=!1),this.startAnimation(K)}else!h&&this.animationProgress===0&&hA(this),this.isLead()&&((S=(E=this.options).onExitComplete)===null||S===void 0||S.call(E));this.targetLayout=m})}unmount(){var o,a;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(o=this.getStack())===null||o===void 0||o.remove(this),(a=this.parent)===null||a===void 0||a.children.delete(this),this.instance=void 0,Nc.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var o;return this.isAnimationBlocked||((o=this.parent)===null||o===void 0?void 0:o.isTreeAnimationBlocked())||!1}startUpdate(){var o;this.isUpdateBlocked()||(this.isUpdating=!0,(o=this.nodes)===null||o===void 0||o.forEach(yce),this.animationId++)}getTransformTemplate(){var o;return(o=this.options.visualElement)===null||o===void 0?void 0:o.getProps().transformTemplate}willUpdate(o=!0){var a,c,l;if(this.root.isUpdateBlocked()){(c=(a=this.options).onExitComplete)===null||c===void 0||c.call(a);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var o;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{var E;const S=b/1e3;pA(h.x,o.x,S),pA(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((E=this.relativeParent)===null||E===void 0)&&E.layout)&&(y0(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),bce(this.relativeTarget,this.relativeTargetOrigin,p,S)),m&&(this.animationValues=d,ece(d,f,this.latestValues,S,y,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)===null||a===void 0||a.stop(),this.resumingFrom&&((c=this.resumingFrom.currentAnimation)===null||c===void 0||c.stop()),this.pendingAnimation&&(Nc.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Sn.update(()=>{h0.hasAnimatedSinceResize=!0,this.currentAnimation=Xae(0,fA,{...o,onUpdate:l=>{var u;this.mixTargetDelta(l),(u=o.onUpdate)===null||u===void 0||u.call(o,l)},onComplete:()=>{var l;(l=o.onComplete)===null||l===void 0||l.call(o),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var o;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(o=this.getStack())===null||o===void 0||o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var o;this.currentAnimation&&((o=this.mixTargetDelta)===null||o===void 0||o.call(this,fA),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&cj(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||jr();const f=ki(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const d=ki(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+d}ys(a,c),Cf(a,u),v0(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){var c,l,u;this.sharedNodes.has(o)||this.sharedNodes.set(o,new oce),this.sharedNodes.get(o).add(a),a.promote({transition:(c=a.options.initialPromotionConfig)===null||c===void 0?void 0:c.transition,preserveFollowOpacity:(u=(l=a.options.initialPromotionConfig)===null||l===void 0?void 0:l.shouldPreserveFollowOpacity)===null||u===void 0?void 0:u.call(l,a)})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.rotate||c.rotateX||c.rotateY||c.rotateZ)&&(a=!0),!a)return;const l={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(dA),this.root.sharedNodes.clear()}}}function uce(t){t.updateLayout()}function fce(t){var e,r,n;const i=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=t.layout,{animationType:a}=t.options,c=i.source!==t.layout.source;a==="size"?Qs(h=>{const p=c?i.measuredBox[h]:i.layoutBox[h],m=ki(p);p.min=s[h].min,p.max=p.min+m}):cj(a,i.layoutBox,s)&&Qs(h=>{const p=c?i.measuredBox[h]:i.layoutBox[h],m=ki(s[h]);p.max=p.min+m});const l=g0();v0(l,s,i.layoutBox);const u=g0();c?v0(u,t.applyTransform(o,!0),i.measuredBox):v0(u,s,i.layoutBox);const f=!sj(l);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:m}=h;if(p&&m){const v=jr();y0(v,i.layoutBox,p.layoutBox);const y=jr();y0(y,s,m.layoutBox),oj(v,y)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=v,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:i,delta:u,layoutDelta:l,hasLayoutChanged:f,hasRelativeTargetChanged:d})}else t.isLead()&&((n=(r=t.options).onExitComplete)===null||n===void 0||n.call(r));t.options.transition=void 0}function dce(t){t.isProjectionDirty||(t.isProjectionDirty=!!(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=!!(t.parent&&t.parent.isTransformDirty))}function hce(t){t.clearSnapshot()}function dA(t){t.clearMeasurements()}function pce(t){const{visualElement:e}=t.options;e!=null&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function hA(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function mce(t){t.resolveTargetDelta()}function vce(t){t.calcProjection()}function yce(t){t.resetRotation()}function gce(t){t.removeLeadSnapshot()}function pA(t,e,r){t.translate=gr(e.translate,0,r),t.scale=gr(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function mA(t,e,r,n){t.min=gr(e.min,r.min,n),t.max=gr(e.max,r.max,n)}function bce(t,e,r,n){mA(t.x,e.x,r.x,n),mA(t.y,e.y,r.y,n)}function xce(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const wce={duration:.45,ease:[.4,0,.1,1]};function Ece(t,e){let r=t.root;for(let s=t.path.length-1;s>=0;s--)if(t.path[s].instance){r=t.path[s];break}const i=(r&&r!==t.root?r.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function vA(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Cce(t){vA(t.x),vA(t.y)}function cj(t,e,r){return t==="position"||t==="preserve-aspect"&&!M6(cA(e),cA(r),.2)}const Sce=aj({attachResizeListener:(t,e)=>bb(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Jx={current:void 0},kce=aj({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Jx.current){const t=new Sce(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Jx.current=t}return Jx.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Ace={...iae,...Cse,...Aae,...Jae},Cc=Die((t,e)=>use(t,e,Ace,Vae,kce));function lj(){const t=w.useRef(!1);return Sy(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function _ce(){const t=lj(),[e,r]=w.useState(0),n=w.useCallback(()=>{t.current&&r(e+1)},[e]);return[w.useCallback(()=>Sn.postRender(n),[n]),e]}class Pce extends w.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Ice({children:t,isPresent:e}){const r=w.useId(),n=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0});return w.useInsertionEffect(()=>{const{width:s,height:o,top:a,left:c}=i.current;if(e||!n.current||!s||!o)return;n.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${s}px !important; @@ -71,12 +71,12 @@ Error generating stack: `+s.message+` top: ${a}px !important; left: ${c}px !important; } - `),()=>{document.head.removeChild(l)}},[e]),x.createElement(Jce,{isPresent:e,childRef:n,sizeRef:i},x.cloneElement(t,{ref:n}))}const fw=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=Tb(Zce),c=x.useId(),l=x.useMemo(()=>({id:c,initial:e,isPresent:r,custom:i,onExitComplete:u=>{a.set(u,!0);for(const f of a.values())if(!f)return;n&&n()},register:u=>(a.set(u,!1),()=>a.delete(u))}),s?void 0:[r]);return x.useMemo(()=>{a.forEach((u,f)=>a.set(f,!1))},[r]),x.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(t=x.createElement(Xce,{isPresent:r},t)),x.createElement(hp.Provider,{value:l},t)};function Zce(){return new Map}const ff=t=>t.key||"";function ele(t,e){t.forEach(r=>{const n=ff(r);e.set(n,r)})}function tle(t){const e=[];return x.Children.forEach(t,r=>{x.isValidElement(r)&&e.push(r)}),e}const wd=({children:t,custom:e,initial:r=!0,onExitComplete:n,exitBeforeEnter:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{i&&(o="wait");let[a]=Yce();const c=x.useContext($C).forceRender;c&&(a=c);const l=Pj(),u=tle(t);let f=u;const d=new Set,h=x.useRef(f),p=x.useRef(new Map).current,m=x.useRef(!0);if(Dy(()=>{m.current=!1,ele(u,p),h.current=f}),qC(()=>{m.current=!0,p.clear(),d.clear()}),m.current)return x.createElement(x.Fragment,null,f.map(E=>x.createElement(fw,{key:ff(E),isPresent:!0,initial:r?void 0:!1,presenceAffectsLayout:s,mode:o},E)));f=[...f];const v=h.current.map(ff),y=u.map(ff),b=v.length;for(let E=0;E{if(y.indexOf(E)!==-1)return;const S=p.get(E);if(!S)return;const P=v.indexOf(E),M=()=>{p.delete(E),d.delete(E);const L=h.current.findIndex(j=>j.key===E);if(h.current.splice(L,1),!d.size){if(h.current=u,l.current===!1)return;a(),n&&n()}};f.splice(P,0,x.createElement(fw,{key:ff(S),isPresent:!1,onExitComplete:M,custom:e,presenceAffectsLayout:s,mode:o},S))}),f=f.map(E=>{const S=E.key;return d.has(S)?E:x.createElement(fw,{key:ff(E),isPresent:!0,presenceAffectsLayout:s,mode:o},E)}),x.createElement(x.Fragment,null,d.size?f:f.map(E=>x.cloneElement(E)))};var t3=function(t,e){return t3=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},t3(t,e)};function Ij(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t3(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Qi=function(){return Qi=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Oj(t,e){return function(r,n){e(r,n,t)}}function rle(t,e,r,n,i,s){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,d=!1,h=r.length-1;h>=0;h--){var p={};for(var m in n)p[m]=m==="access"?{}:n[m];for(var m in n.access)p.access[m]=n.access[m];p.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(y||null))};var v=(0,r[h])(a==="accessor"?{get:u.get,set:u.set}:u[c],p);if(a==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(f=o(v.get))&&(u.get=f),(f=o(v.set))&&(u.set=f),(f=o(v.init))&&i.unshift(f)}else(f=o(v))&&(a==="field"?i.unshift(f):u[c]=f)}l&&Object.defineProperty(l,n.name,u),d=!0}function nle(t,e,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function o4(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Dj(){for(var t=[],e=0;e1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(p){f(s[0][3],p)}}function c(d){d.value instanceof Ed?Promise.resolve(d.value.v).then(l,u):f(s[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Bj(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Ed(t[i](o)),done:!1}:s?s(o):o}:s}}function Fj(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ky=="function"?Ky(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Uj(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var ole=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function zj(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Db(e,t,r);return ole(e,t),e}function qj(t){return t&&t.__esModule?t:{default:t}}function Wj(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)}function Hj(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function Vj(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Gj(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var ale=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function Kj(t){function e(n){t.error=t.hasError?new ale(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}const cle={__extends:Ij,__assign:Qi,__rest:Nb,__decorate:Tj,__param:Oj,__metadata:Rj,__awaiter:$j,__generator:Mj,__createBinding:Db,__exportStar:Nj,__values:Ky,__read:o4,__spread:Dj,__spreadArrays:Lj,__spreadArray:a4,__await:Ed,__asyncGenerator:jj,__asyncDelegator:Bj,__asyncValues:Fj,__makeTemplateObject:Uj,__importStar:zj,__importDefault:qj,__classPrivateFieldGet:Wj,__classPrivateFieldSet:Hj,__classPrivateFieldIn:Vj,__addDisposableResource:Gj,__disposeResources:Kj},o_e=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Gj,get __assign(){return Qi},__asyncDelegator:Bj,__asyncGenerator:jj,__asyncValues:Fj,__await:Ed,__awaiter:$j,__classPrivateFieldGet:Wj,__classPrivateFieldIn:Vj,__classPrivateFieldSet:Hj,__createBinding:Db,__decorate:Tj,__disposeResources:Kj,__esDecorate:rle,__exportStar:Nj,__extends:Ij,__generator:Mj,__importDefault:qj,__importStar:zj,__makeTemplateObject:Uj,__metadata:Rj,__param:Oj,__propKey:ile,__read:o4,__rest:Nb,__runInitializers:nle,__setFunctionName:sle,__spread:Dj,__spreadArray:a4,__spreadArrays:Lj,__values:Ky,default:cle},Symbol.toStringTag,{value:"Module"})),Qj={black:"#000000",white:"#ffffff",inherit:"inherit",transparent:"transparent",positive:"#1FC266",negative:"#C2501F",info:"#0076CC",warning:"#F4B03E",gradientBackdrop:`linear-gradient( + `),()=>{document.head.removeChild(l)}},[e]),w.createElement(Pce,{isPresent:e,childRef:n,sizeRef:i},w.cloneElement(t,{ref:n}))}const Xx=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=gb(Tce),c=w.useId(),l=w.useMemo(()=>({id:c,initial:e,isPresent:r,custom:i,onExitComplete:u=>{a.set(u,!0);for(const f of a.values())if(!f)return;n&&n()},register:u=>(a.set(u,!1),()=>a.delete(u))}),s?void 0:[r]);return w.useMemo(()=>{a.forEach((u,f)=>a.set(f,!1))},[r]),w.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(t=w.createElement(Ice,{isPresent:r},t)),w.createElement(tp.Provider,{value:l},t)};function Tce(){return new Map}const rf=t=>t.key||"";function Oce(t,e){t.forEach(r=>{const n=rf(r);e.set(n,r)})}function Rce(t){const e=[];return w.Children.forEach(t,r=>{w.isValidElement(r)&&e.push(r)}),e}const dd=({children:t,custom:e,initial:r=!0,onExitComplete:n,exitBeforeEnter:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{i&&(o="wait");let[a]=_ce();const c=w.useContext(bC).forceRender;c&&(a=c);const l=lj(),u=Rce(t);let f=u;const d=new Set,h=w.useRef(f),p=w.useRef(new Map).current,m=w.useRef(!0);if(Sy(()=>{m.current=!1,Oce(u,p),h.current=f}),IC(()=>{m.current=!0,p.clear(),d.clear()}),m.current)return w.createElement(w.Fragment,null,f.map(E=>w.createElement(Xx,{key:rf(E),isPresent:!0,initial:r?void 0:!1,presenceAffectsLayout:s,mode:o},E)));f=[...f];const v=h.current.map(rf),y=u.map(rf),b=v.length;for(let E=0;E{if(y.indexOf(E)!==-1)return;const S=p.get(E);if(!S)return;const P=v.indexOf(E),M=()=>{p.delete(E),d.delete(E);const L=h.current.findIndex(j=>j.key===E);if(h.current.splice(L,1),!d.size){if(h.current=u,l.current===!1)return;a(),n&&n()}};f.splice(P,0,w.createElement(Xx,{key:rf(S),isPresent:!1,onExitComplete:M,custom:e,presenceAffectsLayout:s,mode:o},S))}),f=f.map(E=>{const S=E.key;return d.has(S)?E:w.createElement(Xx,{key:rf(E),isPresent:!0,presenceAffectsLayout:s,mode:o},E)}),w.createElement(w.Fragment,null,d.size?f:f.map(E=>w.cloneElement(E)))};var U6=function(t,e){return U6=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},U6(t,e)};function uj(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");U6(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Gi=function(){return Gi=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function dj(t,e){return function(r,n){e(r,n,t)}}function $ce(t,e,r,n,i,s){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,d=!1,h=r.length-1;h>=0;h--){var p={};for(var m in n)p[m]=m==="access"?{}:n[m];for(var m in n.access)p.access[m]=n.access[m];p.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(y||null))};var v=(0,r[h])(a==="accessor"?{get:u.get,set:u.set}:u[c],p);if(a==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(f=o(v.get))&&(u.get=f),(f=o(v.set))&&(u.set=f),(f=o(v.init))&&i.unshift(f)}else(f=o(v))&&(a==="field"?i.unshift(f):u[c]=f)}l&&Object.defineProperty(l,n.name,u),d=!0}function Mce(t,e,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function VC(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function yj(){for(var t=[],e=0;e1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(p){f(s[0][3],p)}}function c(d){d.value instanceof hd?Promise.resolve(d.value.v).then(l,u):f(s[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function xj(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:hd(t[i](o)),done:!1}:s?s(o):o}:s}}function wj(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Dy=="function"?Dy(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Ej(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Lce=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function Cj(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Sb(e,t,r);return Lce(e,t),e}function Sj(t){return t&&t.__esModule?t:{default:t}}function kj(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)}function Aj(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function _j(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Pj(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var jce=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function Ij(t){function e(n){t.error=t.hasError?new jce(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}const Bce={__extends:uj,__assign:Gi,__rest:Cb,__decorate:fj,__param:dj,__metadata:hj,__awaiter:pj,__generator:mj,__createBinding:Sb,__exportStar:vj,__values:Dy,__read:VC,__spread:yj,__spreadArrays:gj,__spreadArray:GC,__await:hd,__asyncGenerator:bj,__asyncDelegator:xj,__asyncValues:wj,__makeTemplateObject:Ej,__importStar:Cj,__importDefault:Sj,__classPrivateFieldGet:kj,__classPrivateFieldSet:Aj,__classPrivateFieldIn:_j,__addDisposableResource:Pj,__disposeResources:Ij},EAe=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Pj,get __assign(){return Gi},__asyncDelegator:xj,__asyncGenerator:bj,__asyncValues:wj,__await:hd,__awaiter:pj,__classPrivateFieldGet:kj,__classPrivateFieldIn:_j,__classPrivateFieldSet:Aj,__createBinding:Sb,__decorate:fj,__disposeResources:Ij,__esDecorate:$ce,__exportStar:vj,__extends:uj,__generator:mj,__importDefault:Sj,__importStar:Cj,__makeTemplateObject:Ej,__metadata:hj,__param:dj,__propKey:Nce,__read:VC,__rest:Cb,__runInitializers:Mce,__setFunctionName:Dce,__spread:yj,__spreadArray:GC,__spreadArrays:gj,__values:Dy,default:Bce},Symbol.toStringTag,{value:"Module"})),Tj={black:"#000000",white:"#ffffff",inherit:"inherit",transparent:"transparent",positive:"#1FC266",negative:"#C2501F",info:"#0076CC",warning:"#F4B03E",gradientBackdrop:`linear-gradient( 243.18deg, rgba(86, 52, 189, 0.85) 0%, rgba(49, 41, 223, 0.85) 63.54%, rgba(7, 98, 149, 0.85) 100% - )`,gradientPrimary:"linear-gradient(89.69deg, #4411E1 0.27%, #7537F9 99.73%)",gradientSecondary:"linear-gradient(32.51deg, #951990 -15.23%, #3A35B1 48.55%, #20A8B0 100%)",arbitrumDark:"#212D44",arbitrumLight:"#93D4FF",avalanceDark:"#810C0C",avalanceLight:"#FF8080",bscDark:"#584508",bscLight:"#FCCF43",ethereumDark:"#132362",ethereumLight:"#AABBFF",gnosisDark:"#084246",gnosisLight:"#8CF6FD",polygonDark:"#350881",polygonLight:"#C7A6FF"},lle={...Qj,text100:"rgba(255, 255, 255, 1)",text80:"rgba(255, 255, 255, 0.8)",text50:"rgba(255, 255, 255, 0.5)",textInverse100:"rgba(0, 0, 0, 1)",backgroundPrimary:"rgba(0, 0, 0, 1)",backgroundSecondary:"rgba(255, 255, 255, 0.1)",backgroundContrast:"rgba(0, 0, 0, 0.5)",backgroundMuted:"rgba(255, 255, 255, 0.05)",backgroundControl:"rgba(255, 255, 255, 0.25)",backgroundInverse:"rgba(255, 255, 255, 1)",backgroundBackdrop:"rgba(34, 34, 34, 0.9)",backgroundOverlay:"rgba(0, 0, 0, 0.7)",backgroundRaised:"rgba(54, 54, 54, 0.7)",buttonGlass:"rgba(255, 255, 255, 0.15)",buttonEmphasis:"rgba(0, 0, 0, 0.5)",buttonInverse:"rgba(255, 255, 255, 0.8)",borderNormal:"rgba(255, 255, 255, 0.25)",borderFocus:"rgba(255, 255, 255, 0.5)"},ule={...Qj,text100:"rgba(0, 0, 0, 1)",text80:"rgba(0, 0, 0, 0.8)",text50:"rgba(0, 0, 0, 0.5)",textInverse100:"rgba(255, 255, 255, 1)",backgroundPrimary:"rgba(244, 244, 244, 1)",backgroundSecondary:"rgba(0, 0, 0, 0.1)",backgroundContrast:"rgba(244, 244, 244, 0.5)",backgroundMuted:"rgba(0, 0, 0, 0.05)",backgroundControl:"rgba(0, 0, 0, 0.25)",backgroundInverse:"rgba(0, 0, 0, 1)",backgroundBackdrop:"rgba(221, 221, 221, 0.9)",backgroundOverlay:"rgba(244, 244, 244, 0.7)",backgroundRaised:"rgba(192, 192, 192, 0.7)",buttonGlass:"rgba(0, 0, 0, 0.15)",buttonEmphasis:"rgba(255, 255, 255, 0.5)",buttonInverse:"rgba(0, 0, 0, 0.8)",borderNormal:"rgba(0, 0, 0, 0.25)",borderFocus:"rgba(0, 0, 0, 0.5)"},fle={dark:lle,light:ule},dle={inherit:{fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit"},xlarge:{fontFamily:"body",fontSize:"xlarge",lineHeight:"9",letterSpacing:"none",fontWeight:"bold"},large:{fontFamily:"body",fontSize:"large",lineHeight:"7",letterSpacing:"normal",fontWeight:"semibold"},medium:{fontFamily:"body",fontSize:"medium",lineHeight:"6",letterSpacing:"normal",fontWeight:"bold"},normal:{fontFamily:"body",fontSize:"normal",lineHeight:"5",letterSpacing:"wide",fontWeight:"normal"},small:{fontFamily:"body",fontSize:"small",lineHeight:"4",letterSpacing:"wide",fontWeight:"medium"},xsmall:{fontFamily:"body",fontSize:"xsmall",lineHeight:"4",letterSpacing:"wide",fontWeight:"bold"},code:{fontFamily:"mono",fontSize:"normal",lineHeight:"5",letterSpacing:"none",fontWeight:"normal"}},$A={sm:0,md:480,lg:769,xl:1281};var MA={colors:{black:"var(--seq-colors-black)",white:"var(--seq-colors-white)",inherit:"var(--seq-colors-inherit)",transparent:"var(--seq-colors-transparent)",positive:"var(--seq-colors-positive)",negative:"var(--seq-colors-negative)",info:"var(--seq-colors-info)",warning:"var(--seq-colors-warning)",gradientBackdrop:"var(--seq-colors-gradient-backdrop)",gradientPrimary:"var(--seq-colors-gradient-primary)",gradientSecondary:"var(--seq-colors-gradient-secondary)",arbitrumDark:"var(--seq-colors-arbitrum-dark)",arbitrumLight:"var(--seq-colors-arbitrum-light)",avalanceDark:"var(--seq-colors-avalance-dark)",avalanceLight:"var(--seq-colors-avalance-light)",bscDark:"var(--seq-colors-bsc-dark)",bscLight:"var(--seq-colors-bsc-light)",ethereumDark:"var(--seq-colors-ethereum-dark)",ethereumLight:"var(--seq-colors-ethereum-light)",gnosisDark:"var(--seq-colors-gnosis-dark)",gnosisLight:"var(--seq-colors-gnosis-light)",polygonDark:"var(--seq-colors-polygon-dark)",polygonLight:"var(--seq-colors-polygon-light)",text100:"var(--seq-colors-text100)",text80:"var(--seq-colors-text80)",text50:"var(--seq-colors-text50)",textInverse100:"var(--seq-colors-text-inverse100)",backgroundPrimary:"var(--seq-colors-background-primary)",backgroundSecondary:"var(--seq-colors-background-secondary)",backgroundContrast:"var(--seq-colors-background-contrast)",backgroundMuted:"var(--seq-colors-background-muted)",backgroundControl:"var(--seq-colors-background-control)",backgroundInverse:"var(--seq-colors-background-inverse)",backgroundBackdrop:"var(--seq-colors-background-backdrop)",backgroundOverlay:"var(--seq-colors-background-overlay)",backgroundRaised:"var(--seq-colors-background-raised)",buttonGlass:"var(--seq-colors-button-glass)",buttonEmphasis:"var(--seq-colors-button-emphasis)",buttonInverse:"var(--seq-colors-button-inverse)",borderNormal:"var(--seq-colors-border-normal)",borderFocus:"var(--seq-colors-border-focus)"}},Te={blur:{blur:"var(--seq-blur-blur)",none:"var(--seq-blur-none)"},borderWidths:{none:"var(--seq-border-widths-none)",thin:"var(--seq-border-widths-thin)",thick:"var(--seq-border-widths-thick)"},fonts:{inherit:"var(--seq-fonts-inherit)",body:"var(--seq-fonts-body)",mono:"var(--seq-fonts-mono)"},fontSizes:{inherit:"var(--seq-font-sizes-inherit)",xsmall:"var(--seq-font-sizes-xsmall)",small:"var(--seq-font-sizes-small)",normal:"var(--seq-font-sizes-normal)",medium:"var(--seq-font-sizes-medium)",large:"var(--seq-font-sizes-large)",xlarge:"var(--seq-font-sizes-xlarge)"},fontWeights:{inherit:"var(--seq-font-weights-inherit)",normal:"var(--seq-font-weights-normal)",medium:"var(--seq-font-weights-medium)",semibold:"var(--seq-font-weights-semibold)",bold:"var(--seq-font-weights-bold)"},letterSpacings:{inherit:"var(--seq-letter-spacings-inherit)",none:"var(--seq-letter-spacings-none)",normal:"var(--seq-letter-spacings-normal)",wide:"var(--seq-letter-spacings-wide)"},lineHeights:{4:"var(--seq-line-heights-4)",5:"var(--seq-line-heights-5)",6:"var(--seq-line-heights-6)",7:"var(--seq-line-heights-7)",9:"var(--seq-line-heights-9)",inherit:"var(--seq-line-heights-inherit)"},opacity:{0:"var(--seq-opacity-0)",50:"var(--seq-opacity-50)",80:"var(--seq-opacity-80)",100:"var(--seq-opacity-100)"},radii:{none:"var(--seq-radii-none)",xs:"var(--seq-radii-xs)",sm:"var(--seq-radii-sm)",md:"var(--seq-radii-md)",lg:"var(--seq-radii-lg)",circle:"var(--seq-radii-circle)"},space:{0:"var(--seq-space-0)",1:"var(--seq-space-1)",2:"var(--seq-space-2)",3:"var(--seq-space-3)",4:"var(--seq-space-4)",5:"var(--seq-space-5)",6:"var(--seq-space-6)",7:"var(--seq-space-7)",8:"var(--seq-space-8)",9:"var(--seq-space-9)",10:"var(--seq-space-10)",12:"var(--seq-space-12)",14:"var(--seq-space-14)",16:"var(--seq-space-16)","0.25":"var(--seq-space-0_25)","0.5":"var(--seq-space-0_5)","1.5":"var(--seq-space-1_5)"},colors:{black:"var(--seq-colors-black)",white:"var(--seq-colors-white)",inherit:"var(--seq-colors-inherit)",transparent:"var(--seq-colors-transparent)",positive:"var(--seq-colors-positive)",negative:"var(--seq-colors-negative)",info:"var(--seq-colors-info)",warning:"var(--seq-colors-warning)",gradientBackdrop:"var(--seq-colors-gradient-backdrop)",gradientPrimary:"var(--seq-colors-gradient-primary)",gradientSecondary:"var(--seq-colors-gradient-secondary)",arbitrumDark:"var(--seq-colors-arbitrum-dark)",arbitrumLight:"var(--seq-colors-arbitrum-light)",avalanceDark:"var(--seq-colors-avalance-dark)",avalanceLight:"var(--seq-colors-avalance-light)",bscDark:"var(--seq-colors-bsc-dark)",bscLight:"var(--seq-colors-bsc-light)",ethereumDark:"var(--seq-colors-ethereum-dark)",ethereumLight:"var(--seq-colors-ethereum-light)",gnosisDark:"var(--seq-colors-gnosis-dark)",gnosisLight:"var(--seq-colors-gnosis-light)",polygonDark:"var(--seq-colors-polygon-dark)",polygonLight:"var(--seq-colors-polygon-light)",text100:"var(--seq-colors-text100)",text80:"var(--seq-colors-text80)",text50:"var(--seq-colors-text50)",textInverse100:"var(--seq-colors-text-inverse100)",backgroundPrimary:"var(--seq-colors-background-primary)",backgroundSecondary:"var(--seq-colors-background-secondary)",backgroundContrast:"var(--seq-colors-background-contrast)",backgroundMuted:"var(--seq-colors-background-muted)",backgroundControl:"var(--seq-colors-background-control)",backgroundInverse:"var(--seq-colors-background-inverse)",backgroundBackdrop:"var(--seq-colors-background-backdrop)",backgroundOverlay:"var(--seq-colors-background-overlay)",backgroundRaised:"var(--seq-colors-background-raised)",buttonGlass:"var(--seq-colors-button-glass)",buttonEmphasis:"var(--seq-colors-button-emphasis)",buttonInverse:"var(--seq-colors-button-inverse)",borderNormal:"var(--seq-colors-border-normal)",borderFocus:"var(--seq-colors-border-focus)"}};function hle(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ple(t){var e=hle(t,"string");return typeof e=="symbol"?e:String(e)}function mle(t,e,r){return e=ple(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function NA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function dw(t){for(var e=1;efunction(){for(var e=arguments.length,r=new Array(e),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),a=c=>{var l=[],u={},f=dw({},c),d=!1;for(var h of o){var p=c[h];if(p!=null){var m=i[h];d=!0;for(var v of m.mappings)u[v]=p,f[v]==null&&delete f[v]}}var y=d?dw(dw({},u),f):c,b=function(){var M=y[E],L=i[E];try{if(L.mappings)return"continue";if(typeof M=="string"||typeof M=="number")l.push(L.values[M].defaultClass);else if(Array.isArray(M))for(var j=0;jt,gle=function(){return vle(yle)(...arguments)},Yj=gle({conditions:{defaultCondition:"sm",conditionNames:["sm","md","lg","xl"],responsiveArray:void 0},styles:{borderWidth:{mappings:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"]},borderRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderLeftRadius:{mappings:["borderBottomLeftRadius","borderTopLeftRadius"]},borderRightRadius:{mappings:["borderBottomRightRadius","borderTopRightRadius"]},borderTopRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius"]},borderBottomRadius:{mappings:["borderBottomLeftRadius","borderBottomRightRadius"]},margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},overflow:{mappings:["overflowX","overflowY"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},placeItems:{mappings:["justifyContent","alignItems"]},inset:{mappings:["top","bottom","left","right"]},width:{values:{0:{conditions:{sm:"fyvr10",md:"fyvr11",lg:"fyvr12",xl:"fyvr13"},defaultClass:"fyvr10"},1:{conditions:{sm:"fyvr14",md:"fyvr15",lg:"fyvr16",xl:"fyvr17"},defaultClass:"fyvr14"},2:{conditions:{sm:"fyvr18",md:"fyvr19",lg:"fyvr1a",xl:"fyvr1b"},defaultClass:"fyvr18"},3:{conditions:{sm:"fyvr1c",md:"fyvr1d",lg:"fyvr1e",xl:"fyvr1f"},defaultClass:"fyvr1c"},4:{conditions:{sm:"fyvr1g",md:"fyvr1h",lg:"fyvr1i",xl:"fyvr1j"},defaultClass:"fyvr1g"},5:{conditions:{sm:"fyvr1k",md:"fyvr1l",lg:"fyvr1m",xl:"fyvr1n"},defaultClass:"fyvr1k"},6:{conditions:{sm:"fyvr1o",md:"fyvr1p",lg:"fyvr1q",xl:"fyvr1r"},defaultClass:"fyvr1o"},7:{conditions:{sm:"fyvr1s",md:"fyvr1t",lg:"fyvr1u",xl:"fyvr1v"},defaultClass:"fyvr1s"},8:{conditions:{sm:"fyvr1w",md:"fyvr1x",lg:"fyvr1y",xl:"fyvr1z"},defaultClass:"fyvr1w"},9:{conditions:{sm:"fyvr110",md:"fyvr111",lg:"fyvr112",xl:"fyvr113"},defaultClass:"fyvr110"},10:{conditions:{sm:"fyvr114",md:"fyvr115",lg:"fyvr116",xl:"fyvr117"},defaultClass:"fyvr114"},12:{conditions:{sm:"fyvr118",md:"fyvr119",lg:"fyvr11a",xl:"fyvr11b"},defaultClass:"fyvr118"},14:{conditions:{sm:"fyvr11c",md:"fyvr11d",lg:"fyvr11e",xl:"fyvr11f"},defaultClass:"fyvr11c"},16:{conditions:{sm:"fyvr11g",md:"fyvr11h",lg:"fyvr11i",xl:"fyvr11j"},defaultClass:"fyvr11g"},"0.25":{conditions:{sm:"fyvr11k",md:"fyvr11l",lg:"fyvr11m",xl:"fyvr11n"},defaultClass:"fyvr11k"},"0.5":{conditions:{sm:"fyvr11o",md:"fyvr11p",lg:"fyvr11q",xl:"fyvr11r"},defaultClass:"fyvr11o"},"1.5":{conditions:{sm:"fyvr11s",md:"fyvr11t",lg:"fyvr11u",xl:"fyvr11v"},defaultClass:"fyvr11s"},none:{conditions:{sm:"fyvr11w",md:"fyvr11x",lg:"fyvr11y",xl:"fyvr11z"},defaultClass:"fyvr11w"},px:{conditions:{sm:"fyvr120",md:"fyvr121",lg:"fyvr122",xl:"fyvr123"},defaultClass:"fyvr120"},auto:{conditions:{sm:"fyvr124",md:"fyvr125",lg:"fyvr126",xl:"fyvr127"},defaultClass:"fyvr124"},full:{conditions:{sm:"fyvr128",md:"fyvr129",lg:"fyvr12a",xl:"fyvr12b"},defaultClass:"fyvr128"},"1/2":{conditions:{sm:"fyvr12c",md:"fyvr12d",lg:"fyvr12e",xl:"fyvr12f"},defaultClass:"fyvr12c"},"1/3":{conditions:{sm:"fyvr12g",md:"fyvr12h",lg:"fyvr12i",xl:"fyvr12j"},defaultClass:"fyvr12g"},"2/3":{conditions:{sm:"fyvr12k",md:"fyvr12l",lg:"fyvr12m",xl:"fyvr12n"},defaultClass:"fyvr12k"},"1/4":{conditions:{sm:"fyvr12o",md:"fyvr12p",lg:"fyvr12q",xl:"fyvr12r"},defaultClass:"fyvr12o"},"3/4":{conditions:{sm:"fyvr12s",md:"fyvr12t",lg:"fyvr12u",xl:"fyvr12v"},defaultClass:"fyvr12s"},fit:{conditions:{sm:"fyvr12w",md:"fyvr12x",lg:"fyvr12y",xl:"fyvr12z"},defaultClass:"fyvr12w"},max:{conditions:{sm:"fyvr130",md:"fyvr131",lg:"fyvr132",xl:"fyvr133"},defaultClass:"fyvr130"},min:{conditions:{sm:"fyvr134",md:"fyvr135",lg:"fyvr136",xl:"fyvr137"},defaultClass:"fyvr134"},vw:{conditions:{sm:"fyvr138",md:"fyvr139",lg:"fyvr13a",xl:"fyvr13b"},defaultClass:"fyvr138"},vh:{conditions:{sm:"fyvr13c",md:"fyvr13d",lg:"fyvr13e",xl:"fyvr13f"},defaultClass:"fyvr13c"}}},height:{values:{0:{conditions:{sm:"fyvr13g",md:"fyvr13h",lg:"fyvr13i",xl:"fyvr13j"},defaultClass:"fyvr13g"},1:{conditions:{sm:"fyvr13k",md:"fyvr13l",lg:"fyvr13m",xl:"fyvr13n"},defaultClass:"fyvr13k"},2:{conditions:{sm:"fyvr13o",md:"fyvr13p",lg:"fyvr13q",xl:"fyvr13r"},defaultClass:"fyvr13o"},3:{conditions:{sm:"fyvr13s",md:"fyvr13t",lg:"fyvr13u",xl:"fyvr13v"},defaultClass:"fyvr13s"},4:{conditions:{sm:"fyvr13w",md:"fyvr13x",lg:"fyvr13y",xl:"fyvr13z"},defaultClass:"fyvr13w"},5:{conditions:{sm:"fyvr140",md:"fyvr141",lg:"fyvr142",xl:"fyvr143"},defaultClass:"fyvr140"},6:{conditions:{sm:"fyvr144",md:"fyvr145",lg:"fyvr146",xl:"fyvr147"},defaultClass:"fyvr144"},7:{conditions:{sm:"fyvr148",md:"fyvr149",lg:"fyvr14a",xl:"fyvr14b"},defaultClass:"fyvr148"},8:{conditions:{sm:"fyvr14c",md:"fyvr14d",lg:"fyvr14e",xl:"fyvr14f"},defaultClass:"fyvr14c"},9:{conditions:{sm:"fyvr14g",md:"fyvr14h",lg:"fyvr14i",xl:"fyvr14j"},defaultClass:"fyvr14g"},10:{conditions:{sm:"fyvr14k",md:"fyvr14l",lg:"fyvr14m",xl:"fyvr14n"},defaultClass:"fyvr14k"},12:{conditions:{sm:"fyvr14o",md:"fyvr14p",lg:"fyvr14q",xl:"fyvr14r"},defaultClass:"fyvr14o"},14:{conditions:{sm:"fyvr14s",md:"fyvr14t",lg:"fyvr14u",xl:"fyvr14v"},defaultClass:"fyvr14s"},16:{conditions:{sm:"fyvr14w",md:"fyvr14x",lg:"fyvr14y",xl:"fyvr14z"},defaultClass:"fyvr14w"},"0.25":{conditions:{sm:"fyvr150",md:"fyvr151",lg:"fyvr152",xl:"fyvr153"},defaultClass:"fyvr150"},"0.5":{conditions:{sm:"fyvr154",md:"fyvr155",lg:"fyvr156",xl:"fyvr157"},defaultClass:"fyvr154"},"1.5":{conditions:{sm:"fyvr158",md:"fyvr159",lg:"fyvr15a",xl:"fyvr15b"},defaultClass:"fyvr158"},none:{conditions:{sm:"fyvr15c",md:"fyvr15d",lg:"fyvr15e",xl:"fyvr15f"},defaultClass:"fyvr15c"},px:{conditions:{sm:"fyvr15g",md:"fyvr15h",lg:"fyvr15i",xl:"fyvr15j"},defaultClass:"fyvr15g"},auto:{conditions:{sm:"fyvr15k",md:"fyvr15l",lg:"fyvr15m",xl:"fyvr15n"},defaultClass:"fyvr15k"},full:{conditions:{sm:"fyvr15o",md:"fyvr15p",lg:"fyvr15q",xl:"fyvr15r"},defaultClass:"fyvr15o"},"1/2":{conditions:{sm:"fyvr15s",md:"fyvr15t",lg:"fyvr15u",xl:"fyvr15v"},defaultClass:"fyvr15s"},"1/3":{conditions:{sm:"fyvr15w",md:"fyvr15x",lg:"fyvr15y",xl:"fyvr15z"},defaultClass:"fyvr15w"},"2/3":{conditions:{sm:"fyvr160",md:"fyvr161",lg:"fyvr162",xl:"fyvr163"},defaultClass:"fyvr160"},"1/4":{conditions:{sm:"fyvr164",md:"fyvr165",lg:"fyvr166",xl:"fyvr167"},defaultClass:"fyvr164"},"3/4":{conditions:{sm:"fyvr168",md:"fyvr169",lg:"fyvr16a",xl:"fyvr16b"},defaultClass:"fyvr168"},fit:{conditions:{sm:"fyvr16c",md:"fyvr16d",lg:"fyvr16e",xl:"fyvr16f"},defaultClass:"fyvr16c"},max:{conditions:{sm:"fyvr16g",md:"fyvr16h",lg:"fyvr16i",xl:"fyvr16j"},defaultClass:"fyvr16g"},min:{conditions:{sm:"fyvr16k",md:"fyvr16l",lg:"fyvr16m",xl:"fyvr16n"},defaultClass:"fyvr16k"},vw:{conditions:{sm:"fyvr16o",md:"fyvr16p",lg:"fyvr16q",xl:"fyvr16r"},defaultClass:"fyvr16o"},vh:{conditions:{sm:"fyvr16s",md:"fyvr16t",lg:"fyvr16u",xl:"fyvr16v"},defaultClass:"fyvr16s"}}},maxWidth:{values:{0:{conditions:{sm:"fyvr16w",md:"fyvr16x",lg:"fyvr16y",xl:"fyvr16z"},defaultClass:"fyvr16w"},1:{conditions:{sm:"fyvr170",md:"fyvr171",lg:"fyvr172",xl:"fyvr173"},defaultClass:"fyvr170"},2:{conditions:{sm:"fyvr174",md:"fyvr175",lg:"fyvr176",xl:"fyvr177"},defaultClass:"fyvr174"},3:{conditions:{sm:"fyvr178",md:"fyvr179",lg:"fyvr17a",xl:"fyvr17b"},defaultClass:"fyvr178"},4:{conditions:{sm:"fyvr17c",md:"fyvr17d",lg:"fyvr17e",xl:"fyvr17f"},defaultClass:"fyvr17c"},5:{conditions:{sm:"fyvr17g",md:"fyvr17h",lg:"fyvr17i",xl:"fyvr17j"},defaultClass:"fyvr17g"},6:{conditions:{sm:"fyvr17k",md:"fyvr17l",lg:"fyvr17m",xl:"fyvr17n"},defaultClass:"fyvr17k"},7:{conditions:{sm:"fyvr17o",md:"fyvr17p",lg:"fyvr17q",xl:"fyvr17r"},defaultClass:"fyvr17o"},8:{conditions:{sm:"fyvr17s",md:"fyvr17t",lg:"fyvr17u",xl:"fyvr17v"},defaultClass:"fyvr17s"},9:{conditions:{sm:"fyvr17w",md:"fyvr17x",lg:"fyvr17y",xl:"fyvr17z"},defaultClass:"fyvr17w"},10:{conditions:{sm:"fyvr180",md:"fyvr181",lg:"fyvr182",xl:"fyvr183"},defaultClass:"fyvr180"},12:{conditions:{sm:"fyvr184",md:"fyvr185",lg:"fyvr186",xl:"fyvr187"},defaultClass:"fyvr184"},14:{conditions:{sm:"fyvr188",md:"fyvr189",lg:"fyvr18a",xl:"fyvr18b"},defaultClass:"fyvr188"},16:{conditions:{sm:"fyvr18c",md:"fyvr18d",lg:"fyvr18e",xl:"fyvr18f"},defaultClass:"fyvr18c"},"0.25":{conditions:{sm:"fyvr18g",md:"fyvr18h",lg:"fyvr18i",xl:"fyvr18j"},defaultClass:"fyvr18g"},"0.5":{conditions:{sm:"fyvr18k",md:"fyvr18l",lg:"fyvr18m",xl:"fyvr18n"},defaultClass:"fyvr18k"},"1.5":{conditions:{sm:"fyvr18o",md:"fyvr18p",lg:"fyvr18q",xl:"fyvr18r"},defaultClass:"fyvr18o"},none:{conditions:{sm:"fyvr18s",md:"fyvr18t",lg:"fyvr18u",xl:"fyvr18v"},defaultClass:"fyvr18s"},px:{conditions:{sm:"fyvr18w",md:"fyvr18x",lg:"fyvr18y",xl:"fyvr18z"},defaultClass:"fyvr18w"},auto:{conditions:{sm:"fyvr190",md:"fyvr191",lg:"fyvr192",xl:"fyvr193"},defaultClass:"fyvr190"},full:{conditions:{sm:"fyvr194",md:"fyvr195",lg:"fyvr196",xl:"fyvr197"},defaultClass:"fyvr194"},"1/2":{conditions:{sm:"fyvr198",md:"fyvr199",lg:"fyvr19a",xl:"fyvr19b"},defaultClass:"fyvr198"},"1/3":{conditions:{sm:"fyvr19c",md:"fyvr19d",lg:"fyvr19e",xl:"fyvr19f"},defaultClass:"fyvr19c"},"2/3":{conditions:{sm:"fyvr19g",md:"fyvr19h",lg:"fyvr19i",xl:"fyvr19j"},defaultClass:"fyvr19g"},"1/4":{conditions:{sm:"fyvr19k",md:"fyvr19l",lg:"fyvr19m",xl:"fyvr19n"},defaultClass:"fyvr19k"},"3/4":{conditions:{sm:"fyvr19o",md:"fyvr19p",lg:"fyvr19q",xl:"fyvr19r"},defaultClass:"fyvr19o"},fit:{conditions:{sm:"fyvr19s",md:"fyvr19t",lg:"fyvr19u",xl:"fyvr19v"},defaultClass:"fyvr19s"},max:{conditions:{sm:"fyvr19w",md:"fyvr19x",lg:"fyvr19y",xl:"fyvr19z"},defaultClass:"fyvr19w"},min:{conditions:{sm:"fyvr1a0",md:"fyvr1a1",lg:"fyvr1a2",xl:"fyvr1a3"},defaultClass:"fyvr1a0"},vw:{conditions:{sm:"fyvr1a4",md:"fyvr1a5",lg:"fyvr1a6",xl:"fyvr1a7"},defaultClass:"fyvr1a4"},vh:{conditions:{sm:"fyvr1a8",md:"fyvr1a9",lg:"fyvr1aa",xl:"fyvr1ab"},defaultClass:"fyvr1a8"}}},maxHeight:{values:{0:{conditions:{sm:"fyvr1ac",md:"fyvr1ad",lg:"fyvr1ae",xl:"fyvr1af"},defaultClass:"fyvr1ac"},1:{conditions:{sm:"fyvr1ag",md:"fyvr1ah",lg:"fyvr1ai",xl:"fyvr1aj"},defaultClass:"fyvr1ag"},2:{conditions:{sm:"fyvr1ak",md:"fyvr1al",lg:"fyvr1am",xl:"fyvr1an"},defaultClass:"fyvr1ak"},3:{conditions:{sm:"fyvr1ao",md:"fyvr1ap",lg:"fyvr1aq",xl:"fyvr1ar"},defaultClass:"fyvr1ao"},4:{conditions:{sm:"fyvr1as",md:"fyvr1at",lg:"fyvr1au",xl:"fyvr1av"},defaultClass:"fyvr1as"},5:{conditions:{sm:"fyvr1aw",md:"fyvr1ax",lg:"fyvr1ay",xl:"fyvr1az"},defaultClass:"fyvr1aw"},6:{conditions:{sm:"fyvr1b0",md:"fyvr1b1",lg:"fyvr1b2",xl:"fyvr1b3"},defaultClass:"fyvr1b0"},7:{conditions:{sm:"fyvr1b4",md:"fyvr1b5",lg:"fyvr1b6",xl:"fyvr1b7"},defaultClass:"fyvr1b4"},8:{conditions:{sm:"fyvr1b8",md:"fyvr1b9",lg:"fyvr1ba",xl:"fyvr1bb"},defaultClass:"fyvr1b8"},9:{conditions:{sm:"fyvr1bc",md:"fyvr1bd",lg:"fyvr1be",xl:"fyvr1bf"},defaultClass:"fyvr1bc"},10:{conditions:{sm:"fyvr1bg",md:"fyvr1bh",lg:"fyvr1bi",xl:"fyvr1bj"},defaultClass:"fyvr1bg"},12:{conditions:{sm:"fyvr1bk",md:"fyvr1bl",lg:"fyvr1bm",xl:"fyvr1bn"},defaultClass:"fyvr1bk"},14:{conditions:{sm:"fyvr1bo",md:"fyvr1bp",lg:"fyvr1bq",xl:"fyvr1br"},defaultClass:"fyvr1bo"},16:{conditions:{sm:"fyvr1bs",md:"fyvr1bt",lg:"fyvr1bu",xl:"fyvr1bv"},defaultClass:"fyvr1bs"},"0.25":{conditions:{sm:"fyvr1bw",md:"fyvr1bx",lg:"fyvr1by",xl:"fyvr1bz"},defaultClass:"fyvr1bw"},"0.5":{conditions:{sm:"fyvr1c0",md:"fyvr1c1",lg:"fyvr1c2",xl:"fyvr1c3"},defaultClass:"fyvr1c0"},"1.5":{conditions:{sm:"fyvr1c4",md:"fyvr1c5",lg:"fyvr1c6",xl:"fyvr1c7"},defaultClass:"fyvr1c4"},none:{conditions:{sm:"fyvr1c8",md:"fyvr1c9",lg:"fyvr1ca",xl:"fyvr1cb"},defaultClass:"fyvr1c8"},px:{conditions:{sm:"fyvr1cc",md:"fyvr1cd",lg:"fyvr1ce",xl:"fyvr1cf"},defaultClass:"fyvr1cc"},auto:{conditions:{sm:"fyvr1cg",md:"fyvr1ch",lg:"fyvr1ci",xl:"fyvr1cj"},defaultClass:"fyvr1cg"},full:{conditions:{sm:"fyvr1ck",md:"fyvr1cl",lg:"fyvr1cm",xl:"fyvr1cn"},defaultClass:"fyvr1ck"},"1/2":{conditions:{sm:"fyvr1co",md:"fyvr1cp",lg:"fyvr1cq",xl:"fyvr1cr"},defaultClass:"fyvr1co"},"1/3":{conditions:{sm:"fyvr1cs",md:"fyvr1ct",lg:"fyvr1cu",xl:"fyvr1cv"},defaultClass:"fyvr1cs"},"2/3":{conditions:{sm:"fyvr1cw",md:"fyvr1cx",lg:"fyvr1cy",xl:"fyvr1cz"},defaultClass:"fyvr1cw"},"1/4":{conditions:{sm:"fyvr1d0",md:"fyvr1d1",lg:"fyvr1d2",xl:"fyvr1d3"},defaultClass:"fyvr1d0"},"3/4":{conditions:{sm:"fyvr1d4",md:"fyvr1d5",lg:"fyvr1d6",xl:"fyvr1d7"},defaultClass:"fyvr1d4"},fit:{conditions:{sm:"fyvr1d8",md:"fyvr1d9",lg:"fyvr1da",xl:"fyvr1db"},defaultClass:"fyvr1d8"},max:{conditions:{sm:"fyvr1dc",md:"fyvr1dd",lg:"fyvr1de",xl:"fyvr1df"},defaultClass:"fyvr1dc"},min:{conditions:{sm:"fyvr1dg",md:"fyvr1dh",lg:"fyvr1di",xl:"fyvr1dj"},defaultClass:"fyvr1dg"},vw:{conditions:{sm:"fyvr1dk",md:"fyvr1dl",lg:"fyvr1dm",xl:"fyvr1dn"},defaultClass:"fyvr1dk"},vh:{conditions:{sm:"fyvr1do",md:"fyvr1dp",lg:"fyvr1dq",xl:"fyvr1dr"},defaultClass:"fyvr1do"}}},minWidth:{values:{0:{conditions:{sm:"fyvr1ds",md:"fyvr1dt",lg:"fyvr1du",xl:"fyvr1dv"},defaultClass:"fyvr1ds"},1:{conditions:{sm:"fyvr1dw",md:"fyvr1dx",lg:"fyvr1dy",xl:"fyvr1dz"},defaultClass:"fyvr1dw"},2:{conditions:{sm:"fyvr1e0",md:"fyvr1e1",lg:"fyvr1e2",xl:"fyvr1e3"},defaultClass:"fyvr1e0"},3:{conditions:{sm:"fyvr1e4",md:"fyvr1e5",lg:"fyvr1e6",xl:"fyvr1e7"},defaultClass:"fyvr1e4"},4:{conditions:{sm:"fyvr1e8",md:"fyvr1e9",lg:"fyvr1ea",xl:"fyvr1eb"},defaultClass:"fyvr1e8"},5:{conditions:{sm:"fyvr1ec",md:"fyvr1ed",lg:"fyvr1ee",xl:"fyvr1ef"},defaultClass:"fyvr1ec"},6:{conditions:{sm:"fyvr1eg",md:"fyvr1eh",lg:"fyvr1ei",xl:"fyvr1ej"},defaultClass:"fyvr1eg"},7:{conditions:{sm:"fyvr1ek",md:"fyvr1el",lg:"fyvr1em",xl:"fyvr1en"},defaultClass:"fyvr1ek"},8:{conditions:{sm:"fyvr1eo",md:"fyvr1ep",lg:"fyvr1eq",xl:"fyvr1er"},defaultClass:"fyvr1eo"},9:{conditions:{sm:"fyvr1es",md:"fyvr1et",lg:"fyvr1eu",xl:"fyvr1ev"},defaultClass:"fyvr1es"},10:{conditions:{sm:"fyvr1ew",md:"fyvr1ex",lg:"fyvr1ey",xl:"fyvr1ez"},defaultClass:"fyvr1ew"},12:{conditions:{sm:"fyvr1f0",md:"fyvr1f1",lg:"fyvr1f2",xl:"fyvr1f3"},defaultClass:"fyvr1f0"},14:{conditions:{sm:"fyvr1f4",md:"fyvr1f5",lg:"fyvr1f6",xl:"fyvr1f7"},defaultClass:"fyvr1f4"},16:{conditions:{sm:"fyvr1f8",md:"fyvr1f9",lg:"fyvr1fa",xl:"fyvr1fb"},defaultClass:"fyvr1f8"},"0.25":{conditions:{sm:"fyvr1fc",md:"fyvr1fd",lg:"fyvr1fe",xl:"fyvr1ff"},defaultClass:"fyvr1fc"},"0.5":{conditions:{sm:"fyvr1fg",md:"fyvr1fh",lg:"fyvr1fi",xl:"fyvr1fj"},defaultClass:"fyvr1fg"},"1.5":{conditions:{sm:"fyvr1fk",md:"fyvr1fl",lg:"fyvr1fm",xl:"fyvr1fn"},defaultClass:"fyvr1fk"},none:{conditions:{sm:"fyvr1fo",md:"fyvr1fp",lg:"fyvr1fq",xl:"fyvr1fr"},defaultClass:"fyvr1fo"},px:{conditions:{sm:"fyvr1fs",md:"fyvr1ft",lg:"fyvr1fu",xl:"fyvr1fv"},defaultClass:"fyvr1fs"},auto:{conditions:{sm:"fyvr1fw",md:"fyvr1fx",lg:"fyvr1fy",xl:"fyvr1fz"},defaultClass:"fyvr1fw"},full:{conditions:{sm:"fyvr1g0",md:"fyvr1g1",lg:"fyvr1g2",xl:"fyvr1g3"},defaultClass:"fyvr1g0"},"1/2":{conditions:{sm:"fyvr1g4",md:"fyvr1g5",lg:"fyvr1g6",xl:"fyvr1g7"},defaultClass:"fyvr1g4"},"1/3":{conditions:{sm:"fyvr1g8",md:"fyvr1g9",lg:"fyvr1ga",xl:"fyvr1gb"},defaultClass:"fyvr1g8"},"2/3":{conditions:{sm:"fyvr1gc",md:"fyvr1gd",lg:"fyvr1ge",xl:"fyvr1gf"},defaultClass:"fyvr1gc"},"1/4":{conditions:{sm:"fyvr1gg",md:"fyvr1gh",lg:"fyvr1gi",xl:"fyvr1gj"},defaultClass:"fyvr1gg"},"3/4":{conditions:{sm:"fyvr1gk",md:"fyvr1gl",lg:"fyvr1gm",xl:"fyvr1gn"},defaultClass:"fyvr1gk"},fit:{conditions:{sm:"fyvr1go",md:"fyvr1gp",lg:"fyvr1gq",xl:"fyvr1gr"},defaultClass:"fyvr1go"},max:{conditions:{sm:"fyvr1gs",md:"fyvr1gt",lg:"fyvr1gu",xl:"fyvr1gv"},defaultClass:"fyvr1gs"},min:{conditions:{sm:"fyvr1gw",md:"fyvr1gx",lg:"fyvr1gy",xl:"fyvr1gz"},defaultClass:"fyvr1gw"},vw:{conditions:{sm:"fyvr1h0",md:"fyvr1h1",lg:"fyvr1h2",xl:"fyvr1h3"},defaultClass:"fyvr1h0"},vh:{conditions:{sm:"fyvr1h4",md:"fyvr1h5",lg:"fyvr1h6",xl:"fyvr1h7"},defaultClass:"fyvr1h4"}}},minHeight:{values:{0:{conditions:{sm:"fyvr1h8",md:"fyvr1h9",lg:"fyvr1ha",xl:"fyvr1hb"},defaultClass:"fyvr1h8"},1:{conditions:{sm:"fyvr1hc",md:"fyvr1hd",lg:"fyvr1he",xl:"fyvr1hf"},defaultClass:"fyvr1hc"},2:{conditions:{sm:"fyvr1hg",md:"fyvr1hh",lg:"fyvr1hi",xl:"fyvr1hj"},defaultClass:"fyvr1hg"},3:{conditions:{sm:"fyvr1hk",md:"fyvr1hl",lg:"fyvr1hm",xl:"fyvr1hn"},defaultClass:"fyvr1hk"},4:{conditions:{sm:"fyvr1ho",md:"fyvr1hp",lg:"fyvr1hq",xl:"fyvr1hr"},defaultClass:"fyvr1ho"},5:{conditions:{sm:"fyvr1hs",md:"fyvr1ht",lg:"fyvr1hu",xl:"fyvr1hv"},defaultClass:"fyvr1hs"},6:{conditions:{sm:"fyvr1hw",md:"fyvr1hx",lg:"fyvr1hy",xl:"fyvr1hz"},defaultClass:"fyvr1hw"},7:{conditions:{sm:"fyvr1i0",md:"fyvr1i1",lg:"fyvr1i2",xl:"fyvr1i3"},defaultClass:"fyvr1i0"},8:{conditions:{sm:"fyvr1i4",md:"fyvr1i5",lg:"fyvr1i6",xl:"fyvr1i7"},defaultClass:"fyvr1i4"},9:{conditions:{sm:"fyvr1i8",md:"fyvr1i9",lg:"fyvr1ia",xl:"fyvr1ib"},defaultClass:"fyvr1i8"},10:{conditions:{sm:"fyvr1ic",md:"fyvr1id",lg:"fyvr1ie",xl:"fyvr1if"},defaultClass:"fyvr1ic"},12:{conditions:{sm:"fyvr1ig",md:"fyvr1ih",lg:"fyvr1ii",xl:"fyvr1ij"},defaultClass:"fyvr1ig"},14:{conditions:{sm:"fyvr1ik",md:"fyvr1il",lg:"fyvr1im",xl:"fyvr1in"},defaultClass:"fyvr1ik"},16:{conditions:{sm:"fyvr1io",md:"fyvr1ip",lg:"fyvr1iq",xl:"fyvr1ir"},defaultClass:"fyvr1io"},"0.25":{conditions:{sm:"fyvr1is",md:"fyvr1it",lg:"fyvr1iu",xl:"fyvr1iv"},defaultClass:"fyvr1is"},"0.5":{conditions:{sm:"fyvr1iw",md:"fyvr1ix",lg:"fyvr1iy",xl:"fyvr1iz"},defaultClass:"fyvr1iw"},"1.5":{conditions:{sm:"fyvr1j0",md:"fyvr1j1",lg:"fyvr1j2",xl:"fyvr1j3"},defaultClass:"fyvr1j0"},none:{conditions:{sm:"fyvr1j4",md:"fyvr1j5",lg:"fyvr1j6",xl:"fyvr1j7"},defaultClass:"fyvr1j4"},px:{conditions:{sm:"fyvr1j8",md:"fyvr1j9",lg:"fyvr1ja",xl:"fyvr1jb"},defaultClass:"fyvr1j8"},auto:{conditions:{sm:"fyvr1jc",md:"fyvr1jd",lg:"fyvr1je",xl:"fyvr1jf"},defaultClass:"fyvr1jc"},full:{conditions:{sm:"fyvr1jg",md:"fyvr1jh",lg:"fyvr1ji",xl:"fyvr1jj"},defaultClass:"fyvr1jg"},"1/2":{conditions:{sm:"fyvr1jk",md:"fyvr1jl",lg:"fyvr1jm",xl:"fyvr1jn"},defaultClass:"fyvr1jk"},"1/3":{conditions:{sm:"fyvr1jo",md:"fyvr1jp",lg:"fyvr1jq",xl:"fyvr1jr"},defaultClass:"fyvr1jo"},"2/3":{conditions:{sm:"fyvr1js",md:"fyvr1jt",lg:"fyvr1ju",xl:"fyvr1jv"},defaultClass:"fyvr1js"},"1/4":{conditions:{sm:"fyvr1jw",md:"fyvr1jx",lg:"fyvr1jy",xl:"fyvr1jz"},defaultClass:"fyvr1jw"},"3/4":{conditions:{sm:"fyvr1k0",md:"fyvr1k1",lg:"fyvr1k2",xl:"fyvr1k3"},defaultClass:"fyvr1k0"},fit:{conditions:{sm:"fyvr1k4",md:"fyvr1k5",lg:"fyvr1k6",xl:"fyvr1k7"},defaultClass:"fyvr1k4"},max:{conditions:{sm:"fyvr1k8",md:"fyvr1k9",lg:"fyvr1ka",xl:"fyvr1kb"},defaultClass:"fyvr1k8"},min:{conditions:{sm:"fyvr1kc",md:"fyvr1kd",lg:"fyvr1ke",xl:"fyvr1kf"},defaultClass:"fyvr1kc"},vw:{conditions:{sm:"fyvr1kg",md:"fyvr1kh",lg:"fyvr1ki",xl:"fyvr1kj"},defaultClass:"fyvr1kg"},vh:{conditions:{sm:"fyvr1kk",md:"fyvr1kl",lg:"fyvr1km",xl:"fyvr1kn"},defaultClass:"fyvr1kk"}}},top:{values:{0:{conditions:{sm:"fyvr1ko",md:"fyvr1kp",lg:"fyvr1kq",xl:"fyvr1kr"},defaultClass:"fyvr1ko"},1:{conditions:{sm:"fyvr1ks",md:"fyvr1kt",lg:"fyvr1ku",xl:"fyvr1kv"},defaultClass:"fyvr1ks"},2:{conditions:{sm:"fyvr1kw",md:"fyvr1kx",lg:"fyvr1ky",xl:"fyvr1kz"},defaultClass:"fyvr1kw"},3:{conditions:{sm:"fyvr1l0",md:"fyvr1l1",lg:"fyvr1l2",xl:"fyvr1l3"},defaultClass:"fyvr1l0"},4:{conditions:{sm:"fyvr1l4",md:"fyvr1l5",lg:"fyvr1l6",xl:"fyvr1l7"},defaultClass:"fyvr1l4"},5:{conditions:{sm:"fyvr1l8",md:"fyvr1l9",lg:"fyvr1la",xl:"fyvr1lb"},defaultClass:"fyvr1l8"},6:{conditions:{sm:"fyvr1lc",md:"fyvr1ld",lg:"fyvr1le",xl:"fyvr1lf"},defaultClass:"fyvr1lc"},7:{conditions:{sm:"fyvr1lg",md:"fyvr1lh",lg:"fyvr1li",xl:"fyvr1lj"},defaultClass:"fyvr1lg"},8:{conditions:{sm:"fyvr1lk",md:"fyvr1ll",lg:"fyvr1lm",xl:"fyvr1ln"},defaultClass:"fyvr1lk"},9:{conditions:{sm:"fyvr1lo",md:"fyvr1lp",lg:"fyvr1lq",xl:"fyvr1lr"},defaultClass:"fyvr1lo"},10:{conditions:{sm:"fyvr1ls",md:"fyvr1lt",lg:"fyvr1lu",xl:"fyvr1lv"},defaultClass:"fyvr1ls"},12:{conditions:{sm:"fyvr1lw",md:"fyvr1lx",lg:"fyvr1ly",xl:"fyvr1lz"},defaultClass:"fyvr1lw"},14:{conditions:{sm:"fyvr1m0",md:"fyvr1m1",lg:"fyvr1m2",xl:"fyvr1m3"},defaultClass:"fyvr1m0"},16:{conditions:{sm:"fyvr1m4",md:"fyvr1m5",lg:"fyvr1m6",xl:"fyvr1m7"},defaultClass:"fyvr1m4"},"0.25":{conditions:{sm:"fyvr1m8",md:"fyvr1m9",lg:"fyvr1ma",xl:"fyvr1mb"},defaultClass:"fyvr1m8"},"0.5":{conditions:{sm:"fyvr1mc",md:"fyvr1md",lg:"fyvr1me",xl:"fyvr1mf"},defaultClass:"fyvr1mc"},"1.5":{conditions:{sm:"fyvr1mg",md:"fyvr1mh",lg:"fyvr1mi",xl:"fyvr1mj"},defaultClass:"fyvr1mg"},auto:{conditions:{sm:"fyvr1mk",md:"fyvr1ml",lg:"fyvr1mm",xl:"fyvr1mn"},defaultClass:"fyvr1mk"}}},bottom:{values:{0:{conditions:{sm:"fyvr1mo",md:"fyvr1mp",lg:"fyvr1mq",xl:"fyvr1mr"},defaultClass:"fyvr1mo"},1:{conditions:{sm:"fyvr1ms",md:"fyvr1mt",lg:"fyvr1mu",xl:"fyvr1mv"},defaultClass:"fyvr1ms"},2:{conditions:{sm:"fyvr1mw",md:"fyvr1mx",lg:"fyvr1my",xl:"fyvr1mz"},defaultClass:"fyvr1mw"},3:{conditions:{sm:"fyvr1n0",md:"fyvr1n1",lg:"fyvr1n2",xl:"fyvr1n3"},defaultClass:"fyvr1n0"},4:{conditions:{sm:"fyvr1n4",md:"fyvr1n5",lg:"fyvr1n6",xl:"fyvr1n7"},defaultClass:"fyvr1n4"},5:{conditions:{sm:"fyvr1n8",md:"fyvr1n9",lg:"fyvr1na",xl:"fyvr1nb"},defaultClass:"fyvr1n8"},6:{conditions:{sm:"fyvr1nc",md:"fyvr1nd",lg:"fyvr1ne",xl:"fyvr1nf"},defaultClass:"fyvr1nc"},7:{conditions:{sm:"fyvr1ng",md:"fyvr1nh",lg:"fyvr1ni",xl:"fyvr1nj"},defaultClass:"fyvr1ng"},8:{conditions:{sm:"fyvr1nk",md:"fyvr1nl",lg:"fyvr1nm",xl:"fyvr1nn"},defaultClass:"fyvr1nk"},9:{conditions:{sm:"fyvr1no",md:"fyvr1np",lg:"fyvr1nq",xl:"fyvr1nr"},defaultClass:"fyvr1no"},10:{conditions:{sm:"fyvr1ns",md:"fyvr1nt",lg:"fyvr1nu",xl:"fyvr1nv"},defaultClass:"fyvr1ns"},12:{conditions:{sm:"fyvr1nw",md:"fyvr1nx",lg:"fyvr1ny",xl:"fyvr1nz"},defaultClass:"fyvr1nw"},14:{conditions:{sm:"fyvr1o0",md:"fyvr1o1",lg:"fyvr1o2",xl:"fyvr1o3"},defaultClass:"fyvr1o0"},16:{conditions:{sm:"fyvr1o4",md:"fyvr1o5",lg:"fyvr1o6",xl:"fyvr1o7"},defaultClass:"fyvr1o4"},"0.25":{conditions:{sm:"fyvr1o8",md:"fyvr1o9",lg:"fyvr1oa",xl:"fyvr1ob"},defaultClass:"fyvr1o8"},"0.5":{conditions:{sm:"fyvr1oc",md:"fyvr1od",lg:"fyvr1oe",xl:"fyvr1of"},defaultClass:"fyvr1oc"},"1.5":{conditions:{sm:"fyvr1og",md:"fyvr1oh",lg:"fyvr1oi",xl:"fyvr1oj"},defaultClass:"fyvr1og"},auto:{conditions:{sm:"fyvr1ok",md:"fyvr1ol",lg:"fyvr1om",xl:"fyvr1on"},defaultClass:"fyvr1ok"}}},left:{values:{0:{conditions:{sm:"fyvr1oo",md:"fyvr1op",lg:"fyvr1oq",xl:"fyvr1or"},defaultClass:"fyvr1oo"},1:{conditions:{sm:"fyvr1os",md:"fyvr1ot",lg:"fyvr1ou",xl:"fyvr1ov"},defaultClass:"fyvr1os"},2:{conditions:{sm:"fyvr1ow",md:"fyvr1ox",lg:"fyvr1oy",xl:"fyvr1oz"},defaultClass:"fyvr1ow"},3:{conditions:{sm:"fyvr1p0",md:"fyvr1p1",lg:"fyvr1p2",xl:"fyvr1p3"},defaultClass:"fyvr1p0"},4:{conditions:{sm:"fyvr1p4",md:"fyvr1p5",lg:"fyvr1p6",xl:"fyvr1p7"},defaultClass:"fyvr1p4"},5:{conditions:{sm:"fyvr1p8",md:"fyvr1p9",lg:"fyvr1pa",xl:"fyvr1pb"},defaultClass:"fyvr1p8"},6:{conditions:{sm:"fyvr1pc",md:"fyvr1pd",lg:"fyvr1pe",xl:"fyvr1pf"},defaultClass:"fyvr1pc"},7:{conditions:{sm:"fyvr1pg",md:"fyvr1ph",lg:"fyvr1pi",xl:"fyvr1pj"},defaultClass:"fyvr1pg"},8:{conditions:{sm:"fyvr1pk",md:"fyvr1pl",lg:"fyvr1pm",xl:"fyvr1pn"},defaultClass:"fyvr1pk"},9:{conditions:{sm:"fyvr1po",md:"fyvr1pp",lg:"fyvr1pq",xl:"fyvr1pr"},defaultClass:"fyvr1po"},10:{conditions:{sm:"fyvr1ps",md:"fyvr1pt",lg:"fyvr1pu",xl:"fyvr1pv"},defaultClass:"fyvr1ps"},12:{conditions:{sm:"fyvr1pw",md:"fyvr1px",lg:"fyvr1py",xl:"fyvr1pz"},defaultClass:"fyvr1pw"},14:{conditions:{sm:"fyvr1q0",md:"fyvr1q1",lg:"fyvr1q2",xl:"fyvr1q3"},defaultClass:"fyvr1q0"},16:{conditions:{sm:"fyvr1q4",md:"fyvr1q5",lg:"fyvr1q6",xl:"fyvr1q7"},defaultClass:"fyvr1q4"},"0.25":{conditions:{sm:"fyvr1q8",md:"fyvr1q9",lg:"fyvr1qa",xl:"fyvr1qb"},defaultClass:"fyvr1q8"},"0.5":{conditions:{sm:"fyvr1qc",md:"fyvr1qd",lg:"fyvr1qe",xl:"fyvr1qf"},defaultClass:"fyvr1qc"},"1.5":{conditions:{sm:"fyvr1qg",md:"fyvr1qh",lg:"fyvr1qi",xl:"fyvr1qj"},defaultClass:"fyvr1qg"},auto:{conditions:{sm:"fyvr1qk",md:"fyvr1ql",lg:"fyvr1qm",xl:"fyvr1qn"},defaultClass:"fyvr1qk"}}},right:{values:{0:{conditions:{sm:"fyvr1qo",md:"fyvr1qp",lg:"fyvr1qq",xl:"fyvr1qr"},defaultClass:"fyvr1qo"},1:{conditions:{sm:"fyvr1qs",md:"fyvr1qt",lg:"fyvr1qu",xl:"fyvr1qv"},defaultClass:"fyvr1qs"},2:{conditions:{sm:"fyvr1qw",md:"fyvr1qx",lg:"fyvr1qy",xl:"fyvr1qz"},defaultClass:"fyvr1qw"},3:{conditions:{sm:"fyvr1r0",md:"fyvr1r1",lg:"fyvr1r2",xl:"fyvr1r3"},defaultClass:"fyvr1r0"},4:{conditions:{sm:"fyvr1r4",md:"fyvr1r5",lg:"fyvr1r6",xl:"fyvr1r7"},defaultClass:"fyvr1r4"},5:{conditions:{sm:"fyvr1r8",md:"fyvr1r9",lg:"fyvr1ra",xl:"fyvr1rb"},defaultClass:"fyvr1r8"},6:{conditions:{sm:"fyvr1rc",md:"fyvr1rd",lg:"fyvr1re",xl:"fyvr1rf"},defaultClass:"fyvr1rc"},7:{conditions:{sm:"fyvr1rg",md:"fyvr1rh",lg:"fyvr1ri",xl:"fyvr1rj"},defaultClass:"fyvr1rg"},8:{conditions:{sm:"fyvr1rk",md:"fyvr1rl",lg:"fyvr1rm",xl:"fyvr1rn"},defaultClass:"fyvr1rk"},9:{conditions:{sm:"fyvr1ro",md:"fyvr1rp",lg:"fyvr1rq",xl:"fyvr1rr"},defaultClass:"fyvr1ro"},10:{conditions:{sm:"fyvr1rs",md:"fyvr1rt",lg:"fyvr1ru",xl:"fyvr1rv"},defaultClass:"fyvr1rs"},12:{conditions:{sm:"fyvr1rw",md:"fyvr1rx",lg:"fyvr1ry",xl:"fyvr1rz"},defaultClass:"fyvr1rw"},14:{conditions:{sm:"fyvr1s0",md:"fyvr1s1",lg:"fyvr1s2",xl:"fyvr1s3"},defaultClass:"fyvr1s0"},16:{conditions:{sm:"fyvr1s4",md:"fyvr1s5",lg:"fyvr1s6",xl:"fyvr1s7"},defaultClass:"fyvr1s4"},"0.25":{conditions:{sm:"fyvr1s8",md:"fyvr1s9",lg:"fyvr1sa",xl:"fyvr1sb"},defaultClass:"fyvr1s8"},"0.5":{conditions:{sm:"fyvr1sc",md:"fyvr1sd",lg:"fyvr1se",xl:"fyvr1sf"},defaultClass:"fyvr1sc"},"1.5":{conditions:{sm:"fyvr1sg",md:"fyvr1sh",lg:"fyvr1si",xl:"fyvr1sj"},defaultClass:"fyvr1sg"},auto:{conditions:{sm:"fyvr1sk",md:"fyvr1sl",lg:"fyvr1sm",xl:"fyvr1sn"},defaultClass:"fyvr1sk"}}},paddingTop:{values:{0:{conditions:{sm:"fyvr1so",md:"fyvr1sp",lg:"fyvr1sq",xl:"fyvr1sr"},defaultClass:"fyvr1so"},1:{conditions:{sm:"fyvr1ss",md:"fyvr1st",lg:"fyvr1su",xl:"fyvr1sv"},defaultClass:"fyvr1ss"},2:{conditions:{sm:"fyvr1sw",md:"fyvr1sx",lg:"fyvr1sy",xl:"fyvr1sz"},defaultClass:"fyvr1sw"},3:{conditions:{sm:"fyvr1t0",md:"fyvr1t1",lg:"fyvr1t2",xl:"fyvr1t3"},defaultClass:"fyvr1t0"},4:{conditions:{sm:"fyvr1t4",md:"fyvr1t5",lg:"fyvr1t6",xl:"fyvr1t7"},defaultClass:"fyvr1t4"},5:{conditions:{sm:"fyvr1t8",md:"fyvr1t9",lg:"fyvr1ta",xl:"fyvr1tb"},defaultClass:"fyvr1t8"},6:{conditions:{sm:"fyvr1tc",md:"fyvr1td",lg:"fyvr1te",xl:"fyvr1tf"},defaultClass:"fyvr1tc"},7:{conditions:{sm:"fyvr1tg",md:"fyvr1th",lg:"fyvr1ti",xl:"fyvr1tj"},defaultClass:"fyvr1tg"},8:{conditions:{sm:"fyvr1tk",md:"fyvr1tl",lg:"fyvr1tm",xl:"fyvr1tn"},defaultClass:"fyvr1tk"},9:{conditions:{sm:"fyvr1to",md:"fyvr1tp",lg:"fyvr1tq",xl:"fyvr1tr"},defaultClass:"fyvr1to"},10:{conditions:{sm:"fyvr1ts",md:"fyvr1tt",lg:"fyvr1tu",xl:"fyvr1tv"},defaultClass:"fyvr1ts"},12:{conditions:{sm:"fyvr1tw",md:"fyvr1tx",lg:"fyvr1ty",xl:"fyvr1tz"},defaultClass:"fyvr1tw"},14:{conditions:{sm:"fyvr1u0",md:"fyvr1u1",lg:"fyvr1u2",xl:"fyvr1u3"},defaultClass:"fyvr1u0"},16:{conditions:{sm:"fyvr1u4",md:"fyvr1u5",lg:"fyvr1u6",xl:"fyvr1u7"},defaultClass:"fyvr1u4"},"0.25":{conditions:{sm:"fyvr1u8",md:"fyvr1u9",lg:"fyvr1ua",xl:"fyvr1ub"},defaultClass:"fyvr1u8"},"0.5":{conditions:{sm:"fyvr1uc",md:"fyvr1ud",lg:"fyvr1ue",xl:"fyvr1uf"},defaultClass:"fyvr1uc"},"1.5":{conditions:{sm:"fyvr1ug",md:"fyvr1uh",lg:"fyvr1ui",xl:"fyvr1uj"},defaultClass:"fyvr1ug"}}},paddingBottom:{values:{0:{conditions:{sm:"fyvr1uk",md:"fyvr1ul",lg:"fyvr1um",xl:"fyvr1un"},defaultClass:"fyvr1uk"},1:{conditions:{sm:"fyvr1uo",md:"fyvr1up",lg:"fyvr1uq",xl:"fyvr1ur"},defaultClass:"fyvr1uo"},2:{conditions:{sm:"fyvr1us",md:"fyvr1ut",lg:"fyvr1uu",xl:"fyvr1uv"},defaultClass:"fyvr1us"},3:{conditions:{sm:"fyvr1uw",md:"fyvr1ux",lg:"fyvr1uy",xl:"fyvr1uz"},defaultClass:"fyvr1uw"},4:{conditions:{sm:"fyvr1v0",md:"fyvr1v1",lg:"fyvr1v2",xl:"fyvr1v3"},defaultClass:"fyvr1v0"},5:{conditions:{sm:"fyvr1v4",md:"fyvr1v5",lg:"fyvr1v6",xl:"fyvr1v7"},defaultClass:"fyvr1v4"},6:{conditions:{sm:"fyvr1v8",md:"fyvr1v9",lg:"fyvr1va",xl:"fyvr1vb"},defaultClass:"fyvr1v8"},7:{conditions:{sm:"fyvr1vc",md:"fyvr1vd",lg:"fyvr1ve",xl:"fyvr1vf"},defaultClass:"fyvr1vc"},8:{conditions:{sm:"fyvr1vg",md:"fyvr1vh",lg:"fyvr1vi",xl:"fyvr1vj"},defaultClass:"fyvr1vg"},9:{conditions:{sm:"fyvr1vk",md:"fyvr1vl",lg:"fyvr1vm",xl:"fyvr1vn"},defaultClass:"fyvr1vk"},10:{conditions:{sm:"fyvr1vo",md:"fyvr1vp",lg:"fyvr1vq",xl:"fyvr1vr"},defaultClass:"fyvr1vo"},12:{conditions:{sm:"fyvr1vs",md:"fyvr1vt",lg:"fyvr1vu",xl:"fyvr1vv"},defaultClass:"fyvr1vs"},14:{conditions:{sm:"fyvr1vw",md:"fyvr1vx",lg:"fyvr1vy",xl:"fyvr1vz"},defaultClass:"fyvr1vw"},16:{conditions:{sm:"fyvr1w0",md:"fyvr1w1",lg:"fyvr1w2",xl:"fyvr1w3"},defaultClass:"fyvr1w0"},"0.25":{conditions:{sm:"fyvr1w4",md:"fyvr1w5",lg:"fyvr1w6",xl:"fyvr1w7"},defaultClass:"fyvr1w4"},"0.5":{conditions:{sm:"fyvr1w8",md:"fyvr1w9",lg:"fyvr1wa",xl:"fyvr1wb"},defaultClass:"fyvr1w8"},"1.5":{conditions:{sm:"fyvr1wc",md:"fyvr1wd",lg:"fyvr1we",xl:"fyvr1wf"},defaultClass:"fyvr1wc"}}},paddingLeft:{values:{0:{conditions:{sm:"fyvr1wg",md:"fyvr1wh",lg:"fyvr1wi",xl:"fyvr1wj"},defaultClass:"fyvr1wg"},1:{conditions:{sm:"fyvr1wk",md:"fyvr1wl",lg:"fyvr1wm",xl:"fyvr1wn"},defaultClass:"fyvr1wk"},2:{conditions:{sm:"fyvr1wo",md:"fyvr1wp",lg:"fyvr1wq",xl:"fyvr1wr"},defaultClass:"fyvr1wo"},3:{conditions:{sm:"fyvr1ws",md:"fyvr1wt",lg:"fyvr1wu",xl:"fyvr1wv"},defaultClass:"fyvr1ws"},4:{conditions:{sm:"fyvr1ww",md:"fyvr1wx",lg:"fyvr1wy",xl:"fyvr1wz"},defaultClass:"fyvr1ww"},5:{conditions:{sm:"fyvr1x0",md:"fyvr1x1",lg:"fyvr1x2",xl:"fyvr1x3"},defaultClass:"fyvr1x0"},6:{conditions:{sm:"fyvr1x4",md:"fyvr1x5",lg:"fyvr1x6",xl:"fyvr1x7"},defaultClass:"fyvr1x4"},7:{conditions:{sm:"fyvr1x8",md:"fyvr1x9",lg:"fyvr1xa",xl:"fyvr1xb"},defaultClass:"fyvr1x8"},8:{conditions:{sm:"fyvr1xc",md:"fyvr1xd",lg:"fyvr1xe",xl:"fyvr1xf"},defaultClass:"fyvr1xc"},9:{conditions:{sm:"fyvr1xg",md:"fyvr1xh",lg:"fyvr1xi",xl:"fyvr1xj"},defaultClass:"fyvr1xg"},10:{conditions:{sm:"fyvr1xk",md:"fyvr1xl",lg:"fyvr1xm",xl:"fyvr1xn"},defaultClass:"fyvr1xk"},12:{conditions:{sm:"fyvr1xo",md:"fyvr1xp",lg:"fyvr1xq",xl:"fyvr1xr"},defaultClass:"fyvr1xo"},14:{conditions:{sm:"fyvr1xs",md:"fyvr1xt",lg:"fyvr1xu",xl:"fyvr1xv"},defaultClass:"fyvr1xs"},16:{conditions:{sm:"fyvr1xw",md:"fyvr1xx",lg:"fyvr1xy",xl:"fyvr1xz"},defaultClass:"fyvr1xw"},"0.25":{conditions:{sm:"fyvr1y0",md:"fyvr1y1",lg:"fyvr1y2",xl:"fyvr1y3"},defaultClass:"fyvr1y0"},"0.5":{conditions:{sm:"fyvr1y4",md:"fyvr1y5",lg:"fyvr1y6",xl:"fyvr1y7"},defaultClass:"fyvr1y4"},"1.5":{conditions:{sm:"fyvr1y8",md:"fyvr1y9",lg:"fyvr1ya",xl:"fyvr1yb"},defaultClass:"fyvr1y8"}}},paddingRight:{values:{0:{conditions:{sm:"fyvr1yc",md:"fyvr1yd",lg:"fyvr1ye",xl:"fyvr1yf"},defaultClass:"fyvr1yc"},1:{conditions:{sm:"fyvr1yg",md:"fyvr1yh",lg:"fyvr1yi",xl:"fyvr1yj"},defaultClass:"fyvr1yg"},2:{conditions:{sm:"fyvr1yk",md:"fyvr1yl",lg:"fyvr1ym",xl:"fyvr1yn"},defaultClass:"fyvr1yk"},3:{conditions:{sm:"fyvr1yo",md:"fyvr1yp",lg:"fyvr1yq",xl:"fyvr1yr"},defaultClass:"fyvr1yo"},4:{conditions:{sm:"fyvr1ys",md:"fyvr1yt",lg:"fyvr1yu",xl:"fyvr1yv"},defaultClass:"fyvr1ys"},5:{conditions:{sm:"fyvr1yw",md:"fyvr1yx",lg:"fyvr1yy",xl:"fyvr1yz"},defaultClass:"fyvr1yw"},6:{conditions:{sm:"fyvr1z0",md:"fyvr1z1",lg:"fyvr1z2",xl:"fyvr1z3"},defaultClass:"fyvr1z0"},7:{conditions:{sm:"fyvr1z4",md:"fyvr1z5",lg:"fyvr1z6",xl:"fyvr1z7"},defaultClass:"fyvr1z4"},8:{conditions:{sm:"fyvr1z8",md:"fyvr1z9",lg:"fyvr1za",xl:"fyvr1zb"},defaultClass:"fyvr1z8"},9:{conditions:{sm:"fyvr1zc",md:"fyvr1zd",lg:"fyvr1ze",xl:"fyvr1zf"},defaultClass:"fyvr1zc"},10:{conditions:{sm:"fyvr1zg",md:"fyvr1zh",lg:"fyvr1zi",xl:"fyvr1zj"},defaultClass:"fyvr1zg"},12:{conditions:{sm:"fyvr1zk",md:"fyvr1zl",lg:"fyvr1zm",xl:"fyvr1zn"},defaultClass:"fyvr1zk"},14:{conditions:{sm:"fyvr1zo",md:"fyvr1zp",lg:"fyvr1zq",xl:"fyvr1zr"},defaultClass:"fyvr1zo"},16:{conditions:{sm:"fyvr1zs",md:"fyvr1zt",lg:"fyvr1zu",xl:"fyvr1zv"},defaultClass:"fyvr1zs"},"0.25":{conditions:{sm:"fyvr1zw",md:"fyvr1zx",lg:"fyvr1zy",xl:"fyvr1zz"},defaultClass:"fyvr1zw"},"0.5":{conditions:{sm:"fyvr1100",md:"fyvr1101",lg:"fyvr1102",xl:"fyvr1103"},defaultClass:"fyvr1100"},"1.5":{conditions:{sm:"fyvr1104",md:"fyvr1105",lg:"fyvr1106",xl:"fyvr1107"},defaultClass:"fyvr1104"}}},marginTop:{values:{0:{conditions:{sm:"fyvr1108",md:"fyvr1109",lg:"fyvr110a",xl:"fyvr110b"},defaultClass:"fyvr1108"},1:{conditions:{sm:"fyvr110c",md:"fyvr110d",lg:"fyvr110e",xl:"fyvr110f"},defaultClass:"fyvr110c"},2:{conditions:{sm:"fyvr110g",md:"fyvr110h",lg:"fyvr110i",xl:"fyvr110j"},defaultClass:"fyvr110g"},3:{conditions:{sm:"fyvr110k",md:"fyvr110l",lg:"fyvr110m",xl:"fyvr110n"},defaultClass:"fyvr110k"},4:{conditions:{sm:"fyvr110o",md:"fyvr110p",lg:"fyvr110q",xl:"fyvr110r"},defaultClass:"fyvr110o"},5:{conditions:{sm:"fyvr110s",md:"fyvr110t",lg:"fyvr110u",xl:"fyvr110v"},defaultClass:"fyvr110s"},6:{conditions:{sm:"fyvr110w",md:"fyvr110x",lg:"fyvr110y",xl:"fyvr110z"},defaultClass:"fyvr110w"},7:{conditions:{sm:"fyvr1110",md:"fyvr1111",lg:"fyvr1112",xl:"fyvr1113"},defaultClass:"fyvr1110"},8:{conditions:{sm:"fyvr1114",md:"fyvr1115",lg:"fyvr1116",xl:"fyvr1117"},defaultClass:"fyvr1114"},9:{conditions:{sm:"fyvr1118",md:"fyvr1119",lg:"fyvr111a",xl:"fyvr111b"},defaultClass:"fyvr1118"},10:{conditions:{sm:"fyvr111c",md:"fyvr111d",lg:"fyvr111e",xl:"fyvr111f"},defaultClass:"fyvr111c"},12:{conditions:{sm:"fyvr111g",md:"fyvr111h",lg:"fyvr111i",xl:"fyvr111j"},defaultClass:"fyvr111g"},14:{conditions:{sm:"fyvr111k",md:"fyvr111l",lg:"fyvr111m",xl:"fyvr111n"},defaultClass:"fyvr111k"},16:{conditions:{sm:"fyvr111o",md:"fyvr111p",lg:"fyvr111q",xl:"fyvr111r"},defaultClass:"fyvr111o"},"0.25":{conditions:{sm:"fyvr111s",md:"fyvr111t",lg:"fyvr111u",xl:"fyvr111v"},defaultClass:"fyvr111s"},"0.5":{conditions:{sm:"fyvr111w",md:"fyvr111x",lg:"fyvr111y",xl:"fyvr111z"},defaultClass:"fyvr111w"},"1.5":{conditions:{sm:"fyvr1120",md:"fyvr1121",lg:"fyvr1122",xl:"fyvr1123"},defaultClass:"fyvr1120"},auto:{conditions:{sm:"fyvr1124",md:"fyvr1125",lg:"fyvr1126",xl:"fyvr1127"},defaultClass:"fyvr1124"}}},marginBottom:{values:{0:{conditions:{sm:"fyvr1128",md:"fyvr1129",lg:"fyvr112a",xl:"fyvr112b"},defaultClass:"fyvr1128"},1:{conditions:{sm:"fyvr112c",md:"fyvr112d",lg:"fyvr112e",xl:"fyvr112f"},defaultClass:"fyvr112c"},2:{conditions:{sm:"fyvr112g",md:"fyvr112h",lg:"fyvr112i",xl:"fyvr112j"},defaultClass:"fyvr112g"},3:{conditions:{sm:"fyvr112k",md:"fyvr112l",lg:"fyvr112m",xl:"fyvr112n"},defaultClass:"fyvr112k"},4:{conditions:{sm:"fyvr112o",md:"fyvr112p",lg:"fyvr112q",xl:"fyvr112r"},defaultClass:"fyvr112o"},5:{conditions:{sm:"fyvr112s",md:"fyvr112t",lg:"fyvr112u",xl:"fyvr112v"},defaultClass:"fyvr112s"},6:{conditions:{sm:"fyvr112w",md:"fyvr112x",lg:"fyvr112y",xl:"fyvr112z"},defaultClass:"fyvr112w"},7:{conditions:{sm:"fyvr1130",md:"fyvr1131",lg:"fyvr1132",xl:"fyvr1133"},defaultClass:"fyvr1130"},8:{conditions:{sm:"fyvr1134",md:"fyvr1135",lg:"fyvr1136",xl:"fyvr1137"},defaultClass:"fyvr1134"},9:{conditions:{sm:"fyvr1138",md:"fyvr1139",lg:"fyvr113a",xl:"fyvr113b"},defaultClass:"fyvr1138"},10:{conditions:{sm:"fyvr113c",md:"fyvr113d",lg:"fyvr113e",xl:"fyvr113f"},defaultClass:"fyvr113c"},12:{conditions:{sm:"fyvr113g",md:"fyvr113h",lg:"fyvr113i",xl:"fyvr113j"},defaultClass:"fyvr113g"},14:{conditions:{sm:"fyvr113k",md:"fyvr113l",lg:"fyvr113m",xl:"fyvr113n"},defaultClass:"fyvr113k"},16:{conditions:{sm:"fyvr113o",md:"fyvr113p",lg:"fyvr113q",xl:"fyvr113r"},defaultClass:"fyvr113o"},"0.25":{conditions:{sm:"fyvr113s",md:"fyvr113t",lg:"fyvr113u",xl:"fyvr113v"},defaultClass:"fyvr113s"},"0.5":{conditions:{sm:"fyvr113w",md:"fyvr113x",lg:"fyvr113y",xl:"fyvr113z"},defaultClass:"fyvr113w"},"1.5":{conditions:{sm:"fyvr1140",md:"fyvr1141",lg:"fyvr1142",xl:"fyvr1143"},defaultClass:"fyvr1140"},auto:{conditions:{sm:"fyvr1144",md:"fyvr1145",lg:"fyvr1146",xl:"fyvr1147"},defaultClass:"fyvr1144"}}},marginLeft:{values:{0:{conditions:{sm:"fyvr1148",md:"fyvr1149",lg:"fyvr114a",xl:"fyvr114b"},defaultClass:"fyvr1148"},1:{conditions:{sm:"fyvr114c",md:"fyvr114d",lg:"fyvr114e",xl:"fyvr114f"},defaultClass:"fyvr114c"},2:{conditions:{sm:"fyvr114g",md:"fyvr114h",lg:"fyvr114i",xl:"fyvr114j"},defaultClass:"fyvr114g"},3:{conditions:{sm:"fyvr114k",md:"fyvr114l",lg:"fyvr114m",xl:"fyvr114n"},defaultClass:"fyvr114k"},4:{conditions:{sm:"fyvr114o",md:"fyvr114p",lg:"fyvr114q",xl:"fyvr114r"},defaultClass:"fyvr114o"},5:{conditions:{sm:"fyvr114s",md:"fyvr114t",lg:"fyvr114u",xl:"fyvr114v"},defaultClass:"fyvr114s"},6:{conditions:{sm:"fyvr114w",md:"fyvr114x",lg:"fyvr114y",xl:"fyvr114z"},defaultClass:"fyvr114w"},7:{conditions:{sm:"fyvr1150",md:"fyvr1151",lg:"fyvr1152",xl:"fyvr1153"},defaultClass:"fyvr1150"},8:{conditions:{sm:"fyvr1154",md:"fyvr1155",lg:"fyvr1156",xl:"fyvr1157"},defaultClass:"fyvr1154"},9:{conditions:{sm:"fyvr1158",md:"fyvr1159",lg:"fyvr115a",xl:"fyvr115b"},defaultClass:"fyvr1158"},10:{conditions:{sm:"fyvr115c",md:"fyvr115d",lg:"fyvr115e",xl:"fyvr115f"},defaultClass:"fyvr115c"},12:{conditions:{sm:"fyvr115g",md:"fyvr115h",lg:"fyvr115i",xl:"fyvr115j"},defaultClass:"fyvr115g"},14:{conditions:{sm:"fyvr115k",md:"fyvr115l",lg:"fyvr115m",xl:"fyvr115n"},defaultClass:"fyvr115k"},16:{conditions:{sm:"fyvr115o",md:"fyvr115p",lg:"fyvr115q",xl:"fyvr115r"},defaultClass:"fyvr115o"},"0.25":{conditions:{sm:"fyvr115s",md:"fyvr115t",lg:"fyvr115u",xl:"fyvr115v"},defaultClass:"fyvr115s"},"0.5":{conditions:{sm:"fyvr115w",md:"fyvr115x",lg:"fyvr115y",xl:"fyvr115z"},defaultClass:"fyvr115w"},"1.5":{conditions:{sm:"fyvr1160",md:"fyvr1161",lg:"fyvr1162",xl:"fyvr1163"},defaultClass:"fyvr1160"},auto:{conditions:{sm:"fyvr1164",md:"fyvr1165",lg:"fyvr1166",xl:"fyvr1167"},defaultClass:"fyvr1164"}}},marginRight:{values:{0:{conditions:{sm:"fyvr1168",md:"fyvr1169",lg:"fyvr116a",xl:"fyvr116b"},defaultClass:"fyvr1168"},1:{conditions:{sm:"fyvr116c",md:"fyvr116d",lg:"fyvr116e",xl:"fyvr116f"},defaultClass:"fyvr116c"},2:{conditions:{sm:"fyvr116g",md:"fyvr116h",lg:"fyvr116i",xl:"fyvr116j"},defaultClass:"fyvr116g"},3:{conditions:{sm:"fyvr116k",md:"fyvr116l",lg:"fyvr116m",xl:"fyvr116n"},defaultClass:"fyvr116k"},4:{conditions:{sm:"fyvr116o",md:"fyvr116p",lg:"fyvr116q",xl:"fyvr116r"},defaultClass:"fyvr116o"},5:{conditions:{sm:"fyvr116s",md:"fyvr116t",lg:"fyvr116u",xl:"fyvr116v"},defaultClass:"fyvr116s"},6:{conditions:{sm:"fyvr116w",md:"fyvr116x",lg:"fyvr116y",xl:"fyvr116z"},defaultClass:"fyvr116w"},7:{conditions:{sm:"fyvr1170",md:"fyvr1171",lg:"fyvr1172",xl:"fyvr1173"},defaultClass:"fyvr1170"},8:{conditions:{sm:"fyvr1174",md:"fyvr1175",lg:"fyvr1176",xl:"fyvr1177"},defaultClass:"fyvr1174"},9:{conditions:{sm:"fyvr1178",md:"fyvr1179",lg:"fyvr117a",xl:"fyvr117b"},defaultClass:"fyvr1178"},10:{conditions:{sm:"fyvr117c",md:"fyvr117d",lg:"fyvr117e",xl:"fyvr117f"},defaultClass:"fyvr117c"},12:{conditions:{sm:"fyvr117g",md:"fyvr117h",lg:"fyvr117i",xl:"fyvr117j"},defaultClass:"fyvr117g"},14:{conditions:{sm:"fyvr117k",md:"fyvr117l",lg:"fyvr117m",xl:"fyvr117n"},defaultClass:"fyvr117k"},16:{conditions:{sm:"fyvr117o",md:"fyvr117p",lg:"fyvr117q",xl:"fyvr117r"},defaultClass:"fyvr117o"},"0.25":{conditions:{sm:"fyvr117s",md:"fyvr117t",lg:"fyvr117u",xl:"fyvr117v"},defaultClass:"fyvr117s"},"0.5":{conditions:{sm:"fyvr117w",md:"fyvr117x",lg:"fyvr117y",xl:"fyvr117z"},defaultClass:"fyvr117w"},"1.5":{conditions:{sm:"fyvr1180",md:"fyvr1181",lg:"fyvr1182",xl:"fyvr1183"},defaultClass:"fyvr1180"},auto:{conditions:{sm:"fyvr1184",md:"fyvr1185",lg:"fyvr1186",xl:"fyvr1187"},defaultClass:"fyvr1184"}}},gap:{values:{0:{conditions:{sm:"fyvr1188",md:"fyvr1189",lg:"fyvr118a",xl:"fyvr118b"},defaultClass:"fyvr1188"},1:{conditions:{sm:"fyvr118c",md:"fyvr118d",lg:"fyvr118e",xl:"fyvr118f"},defaultClass:"fyvr118c"},2:{conditions:{sm:"fyvr118g",md:"fyvr118h",lg:"fyvr118i",xl:"fyvr118j"},defaultClass:"fyvr118g"},3:{conditions:{sm:"fyvr118k",md:"fyvr118l",lg:"fyvr118m",xl:"fyvr118n"},defaultClass:"fyvr118k"},4:{conditions:{sm:"fyvr118o",md:"fyvr118p",lg:"fyvr118q",xl:"fyvr118r"},defaultClass:"fyvr118o"},5:{conditions:{sm:"fyvr118s",md:"fyvr118t",lg:"fyvr118u",xl:"fyvr118v"},defaultClass:"fyvr118s"},6:{conditions:{sm:"fyvr118w",md:"fyvr118x",lg:"fyvr118y",xl:"fyvr118z"},defaultClass:"fyvr118w"},7:{conditions:{sm:"fyvr1190",md:"fyvr1191",lg:"fyvr1192",xl:"fyvr1193"},defaultClass:"fyvr1190"},8:{conditions:{sm:"fyvr1194",md:"fyvr1195",lg:"fyvr1196",xl:"fyvr1197"},defaultClass:"fyvr1194"},9:{conditions:{sm:"fyvr1198",md:"fyvr1199",lg:"fyvr119a",xl:"fyvr119b"},defaultClass:"fyvr1198"},10:{conditions:{sm:"fyvr119c",md:"fyvr119d",lg:"fyvr119e",xl:"fyvr119f"},defaultClass:"fyvr119c"},12:{conditions:{sm:"fyvr119g",md:"fyvr119h",lg:"fyvr119i",xl:"fyvr119j"},defaultClass:"fyvr119g"},14:{conditions:{sm:"fyvr119k",md:"fyvr119l",lg:"fyvr119m",xl:"fyvr119n"},defaultClass:"fyvr119k"},16:{conditions:{sm:"fyvr119o",md:"fyvr119p",lg:"fyvr119q",xl:"fyvr119r"},defaultClass:"fyvr119o"},"0.25":{conditions:{sm:"fyvr119s",md:"fyvr119t",lg:"fyvr119u",xl:"fyvr119v"},defaultClass:"fyvr119s"},"0.5":{conditions:{sm:"fyvr119w",md:"fyvr119x",lg:"fyvr119y",xl:"fyvr119z"},defaultClass:"fyvr119w"},"1.5":{conditions:{sm:"fyvr11a0",md:"fyvr11a1",lg:"fyvr11a2",xl:"fyvr11a3"},defaultClass:"fyvr11a0"}}},borderBottomWidth:{values:{none:{conditions:{sm:"fyvr11a4",md:"fyvr11a5",lg:"fyvr11a6",xl:"fyvr11a7"},defaultClass:"fyvr11a4"},thin:{conditions:{sm:"fyvr11a8",md:"fyvr11a9",lg:"fyvr11aa",xl:"fyvr11ab"},defaultClass:"fyvr11a8"},thick:{conditions:{sm:"fyvr11ac",md:"fyvr11ad",lg:"fyvr11ae",xl:"fyvr11af"},defaultClass:"fyvr11ac"}}},borderLeftWidth:{values:{none:{conditions:{sm:"fyvr11ag",md:"fyvr11ah",lg:"fyvr11ai",xl:"fyvr11aj"},defaultClass:"fyvr11ag"},thin:{conditions:{sm:"fyvr11ak",md:"fyvr11al",lg:"fyvr11am",xl:"fyvr11an"},defaultClass:"fyvr11ak"},thick:{conditions:{sm:"fyvr11ao",md:"fyvr11ap",lg:"fyvr11aq",xl:"fyvr11ar"},defaultClass:"fyvr11ao"}}},borderRightWidth:{values:{none:{conditions:{sm:"fyvr11as",md:"fyvr11at",lg:"fyvr11au",xl:"fyvr11av"},defaultClass:"fyvr11as"},thin:{conditions:{sm:"fyvr11aw",md:"fyvr11ax",lg:"fyvr11ay",xl:"fyvr11az"},defaultClass:"fyvr11aw"},thick:{conditions:{sm:"fyvr11b0",md:"fyvr11b1",lg:"fyvr11b2",xl:"fyvr11b3"},defaultClass:"fyvr11b0"}}},borderTopWidth:{values:{none:{conditions:{sm:"fyvr11b4",md:"fyvr11b5",lg:"fyvr11b6",xl:"fyvr11b7"},defaultClass:"fyvr11b4"},thin:{conditions:{sm:"fyvr11b8",md:"fyvr11b9",lg:"fyvr11ba",xl:"fyvr11bb"},defaultClass:"fyvr11b8"},thick:{conditions:{sm:"fyvr11bc",md:"fyvr11bd",lg:"fyvr11be",xl:"fyvr11bf"},defaultClass:"fyvr11bc"}}},borderBottomLeftRadius:{values:{none:{conditions:{sm:"fyvr11bg",md:"fyvr11bh",lg:"fyvr11bi",xl:"fyvr11bj"},defaultClass:"fyvr11bg"},xs:{conditions:{sm:"fyvr11bk",md:"fyvr11bl",lg:"fyvr11bm",xl:"fyvr11bn"},defaultClass:"fyvr11bk"},sm:{conditions:{sm:"fyvr11bo",md:"fyvr11bp",lg:"fyvr11bq",xl:"fyvr11br"},defaultClass:"fyvr11bo"},md:{conditions:{sm:"fyvr11bs",md:"fyvr11bt",lg:"fyvr11bu",xl:"fyvr11bv"},defaultClass:"fyvr11bs"},lg:{conditions:{sm:"fyvr11bw",md:"fyvr11bx",lg:"fyvr11by",xl:"fyvr11bz"},defaultClass:"fyvr11bw"},circle:{conditions:{sm:"fyvr11c0",md:"fyvr11c1",lg:"fyvr11c2",xl:"fyvr11c3"},defaultClass:"fyvr11c0"}}},borderBottomRightRadius:{values:{none:{conditions:{sm:"fyvr11c4",md:"fyvr11c5",lg:"fyvr11c6",xl:"fyvr11c7"},defaultClass:"fyvr11c4"},xs:{conditions:{sm:"fyvr11c8",md:"fyvr11c9",lg:"fyvr11ca",xl:"fyvr11cb"},defaultClass:"fyvr11c8"},sm:{conditions:{sm:"fyvr11cc",md:"fyvr11cd",lg:"fyvr11ce",xl:"fyvr11cf"},defaultClass:"fyvr11cc"},md:{conditions:{sm:"fyvr11cg",md:"fyvr11ch",lg:"fyvr11ci",xl:"fyvr11cj"},defaultClass:"fyvr11cg"},lg:{conditions:{sm:"fyvr11ck",md:"fyvr11cl",lg:"fyvr11cm",xl:"fyvr11cn"},defaultClass:"fyvr11ck"},circle:{conditions:{sm:"fyvr11co",md:"fyvr11cp",lg:"fyvr11cq",xl:"fyvr11cr"},defaultClass:"fyvr11co"}}},borderTopLeftRadius:{values:{none:{conditions:{sm:"fyvr11cs",md:"fyvr11ct",lg:"fyvr11cu",xl:"fyvr11cv"},defaultClass:"fyvr11cs"},xs:{conditions:{sm:"fyvr11cw",md:"fyvr11cx",lg:"fyvr11cy",xl:"fyvr11cz"},defaultClass:"fyvr11cw"},sm:{conditions:{sm:"fyvr11d0",md:"fyvr11d1",lg:"fyvr11d2",xl:"fyvr11d3"},defaultClass:"fyvr11d0"},md:{conditions:{sm:"fyvr11d4",md:"fyvr11d5",lg:"fyvr11d6",xl:"fyvr11d7"},defaultClass:"fyvr11d4"},lg:{conditions:{sm:"fyvr11d8",md:"fyvr11d9",lg:"fyvr11da",xl:"fyvr11db"},defaultClass:"fyvr11d8"},circle:{conditions:{sm:"fyvr11dc",md:"fyvr11dd",lg:"fyvr11de",xl:"fyvr11df"},defaultClass:"fyvr11dc"}}},borderTopRightRadius:{values:{none:{conditions:{sm:"fyvr11dg",md:"fyvr11dh",lg:"fyvr11di",xl:"fyvr11dj"},defaultClass:"fyvr11dg"},xs:{conditions:{sm:"fyvr11dk",md:"fyvr11dl",lg:"fyvr11dm",xl:"fyvr11dn"},defaultClass:"fyvr11dk"},sm:{conditions:{sm:"fyvr11do",md:"fyvr11dp",lg:"fyvr11dq",xl:"fyvr11dr"},defaultClass:"fyvr11do"},md:{conditions:{sm:"fyvr11ds",md:"fyvr11dt",lg:"fyvr11du",xl:"fyvr11dv"},defaultClass:"fyvr11ds"},lg:{conditions:{sm:"fyvr11dw",md:"fyvr11dx",lg:"fyvr11dy",xl:"fyvr11dz"},defaultClass:"fyvr11dw"},circle:{conditions:{sm:"fyvr11e0",md:"fyvr11e1",lg:"fyvr11e2",xl:"fyvr11e3"},defaultClass:"fyvr11e0"}}},fontSize:{values:{inherit:{conditions:{sm:"fyvr11e4",md:"fyvr11e5",lg:"fyvr11e6",xl:"fyvr11e7"},defaultClass:"fyvr11e4"},xsmall:{conditions:{sm:"fyvr11e8",md:"fyvr11e9",lg:"fyvr11ea",xl:"fyvr11eb"},defaultClass:"fyvr11e8"},small:{conditions:{sm:"fyvr11ec",md:"fyvr11ed",lg:"fyvr11ee",xl:"fyvr11ef"},defaultClass:"fyvr11ec"},normal:{conditions:{sm:"fyvr11eg",md:"fyvr11eh",lg:"fyvr11ei",xl:"fyvr11ej"},defaultClass:"fyvr11eg"},medium:{conditions:{sm:"fyvr11ek",md:"fyvr11el",lg:"fyvr11em",xl:"fyvr11en"},defaultClass:"fyvr11ek"},large:{conditions:{sm:"fyvr11eo",md:"fyvr11ep",lg:"fyvr11eq",xl:"fyvr11er"},defaultClass:"fyvr11eo"},xlarge:{conditions:{sm:"fyvr11es",md:"fyvr11et",lg:"fyvr11eu",xl:"fyvr11ev"},defaultClass:"fyvr11es"}}},fontWeight:{values:{inherit:{conditions:{sm:"fyvr11ew",md:"fyvr11ex",lg:"fyvr11ey",xl:"fyvr11ez"},defaultClass:"fyvr11ew"},normal:{conditions:{sm:"fyvr11f0",md:"fyvr11f1",lg:"fyvr11f2",xl:"fyvr11f3"},defaultClass:"fyvr11f0"},medium:{conditions:{sm:"fyvr11f4",md:"fyvr11f5",lg:"fyvr11f6",xl:"fyvr11f7"},defaultClass:"fyvr11f4"},semibold:{conditions:{sm:"fyvr11f8",md:"fyvr11f9",lg:"fyvr11fa",xl:"fyvr11fb"},defaultClass:"fyvr11f8"},bold:{conditions:{sm:"fyvr11fc",md:"fyvr11fd",lg:"fyvr11fe",xl:"fyvr11ff"},defaultClass:"fyvr11fc"}}},letterSpacing:{values:{inherit:{conditions:{sm:"fyvr11fg",md:"fyvr11fh",lg:"fyvr11fi",xl:"fyvr11fj"},defaultClass:"fyvr11fg"},none:{conditions:{sm:"fyvr11fk",md:"fyvr11fl",lg:"fyvr11fm",xl:"fyvr11fn"},defaultClass:"fyvr11fk"},normal:{conditions:{sm:"fyvr11fo",md:"fyvr11fp",lg:"fyvr11fq",xl:"fyvr11fr"},defaultClass:"fyvr11fo"},wide:{conditions:{sm:"fyvr11fs",md:"fyvr11ft",lg:"fyvr11fu",xl:"fyvr11fv"},defaultClass:"fyvr11fs"}}},lineHeight:{values:{4:{conditions:{sm:"fyvr11fw",md:"fyvr11fx",lg:"fyvr11fy",xl:"fyvr11fz"},defaultClass:"fyvr11fw"},5:{conditions:{sm:"fyvr11g0",md:"fyvr11g1",lg:"fyvr11g2",xl:"fyvr11g3"},defaultClass:"fyvr11g0"},6:{conditions:{sm:"fyvr11g4",md:"fyvr11g5",lg:"fyvr11g6",xl:"fyvr11g7"},defaultClass:"fyvr11g4"},7:{conditions:{sm:"fyvr11g8",md:"fyvr11g9",lg:"fyvr11ga",xl:"fyvr11gb"},defaultClass:"fyvr11g8"},9:{conditions:{sm:"fyvr11gc",md:"fyvr11gd",lg:"fyvr11ge",xl:"fyvr11gf"},defaultClass:"fyvr11gc"},inherit:{conditions:{sm:"fyvr11gg",md:"fyvr11gh",lg:"fyvr11gi",xl:"fyvr11gj"},defaultClass:"fyvr11gg"}}},textAlign:{values:{center:{conditions:{sm:"fyvr11gk",md:"fyvr11gl",lg:"fyvr11gm",xl:"fyvr11gn"},defaultClass:"fyvr11gk"},left:{conditions:{sm:"fyvr11go",md:"fyvr11gp",lg:"fyvr11gq",xl:"fyvr11gr"},defaultClass:"fyvr11go"},right:{conditions:{sm:"fyvr11gs",md:"fyvr11gt",lg:"fyvr11gu",xl:"fyvr11gv"},defaultClass:"fyvr11gs"}}},display:{values:{block:{conditions:{sm:"fyvr11gw",md:"fyvr11gx",lg:"fyvr11gy",xl:"fyvr11gz"},defaultClass:"fyvr11gw"},flex:{conditions:{sm:"fyvr11h0",md:"fyvr11h1",lg:"fyvr11h2",xl:"fyvr11h3"},defaultClass:"fyvr11h0"},grid:{conditions:{sm:"fyvr11h4",md:"fyvr11h5",lg:"fyvr11h6",xl:"fyvr11h7"},defaultClass:"fyvr11h4"},"inline-block":{conditions:{sm:"fyvr11h8",md:"fyvr11h9",lg:"fyvr11ha",xl:"fyvr11hb"},defaultClass:"fyvr11h8"},"inline-flex":{conditions:{sm:"fyvr11hc",md:"fyvr11hd",lg:"fyvr11he",xl:"fyvr11hf"},defaultClass:"fyvr11hc"},none:{conditions:{sm:"fyvr11hg",md:"fyvr11hh",lg:"fyvr11hi",xl:"fyvr11hj"},defaultClass:"fyvr11hg"},contents:{conditions:{sm:"fyvr11hk",md:"fyvr11hl",lg:"fyvr11hm",xl:"fyvr11hn"},defaultClass:"fyvr11hk"}}},position:{values:{absolute:{conditions:{sm:"fyvr11ho",md:"fyvr11hp",lg:"fyvr11hq",xl:"fyvr11hr"},defaultClass:"fyvr11ho"},fixed:{conditions:{sm:"fyvr11hs",md:"fyvr11ht",lg:"fyvr11hu",xl:"fyvr11hv"},defaultClass:"fyvr11hs"},relative:{conditions:{sm:"fyvr11hw",md:"fyvr11hx",lg:"fyvr11hy",xl:"fyvr11hz"},defaultClass:"fyvr11hw"},sticky:{conditions:{sm:"fyvr11i0",md:"fyvr11i1",lg:"fyvr11i2",xl:"fyvr11i3"},defaultClass:"fyvr11i0"}}},flexDirection:{values:{column:{conditions:{sm:"fyvr11i4",md:"fyvr11i5",lg:"fyvr11i6",xl:"fyvr11i7"},defaultClass:"fyvr11i4"},"column-reverse":{conditions:{sm:"fyvr11i8",md:"fyvr11i9",lg:"fyvr11ia",xl:"fyvr11ib"},defaultClass:"fyvr11i8"},row:{conditions:{sm:"fyvr11ic",md:"fyvr11id",lg:"fyvr11ie",xl:"fyvr11if"},defaultClass:"fyvr11ic"},"row-reverse":{conditions:{sm:"fyvr11ig",md:"fyvr11ih",lg:"fyvr11ii",xl:"fyvr11ij"},defaultClass:"fyvr11ig"}}},flexShrink:{values:{0:{conditions:{sm:"fyvr11ik",md:"fyvr11il",lg:"fyvr11im",xl:"fyvr11in"},defaultClass:"fyvr11ik"},1:{conditions:{sm:"fyvr11io",md:"fyvr11ip",lg:"fyvr11iq",xl:"fyvr11ir"},defaultClass:"fyvr11io"}}},flexGrow:{values:{0:{conditions:{sm:"fyvr11is",md:"fyvr11it",lg:"fyvr11iu",xl:"fyvr11iv"},defaultClass:"fyvr11is"},1:{conditions:{sm:"fyvr11iw",md:"fyvr11ix",lg:"fyvr11iy",xl:"fyvr11iz"},defaultClass:"fyvr11iw"}}},flexWrap:{values:{nowrap:{conditions:{sm:"fyvr11j0",md:"fyvr11j1",lg:"fyvr11j2",xl:"fyvr11j3"},defaultClass:"fyvr11j0"},wrap:{conditions:{sm:"fyvr11j4",md:"fyvr11j5",lg:"fyvr11j6",xl:"fyvr11j7"},defaultClass:"fyvr11j4"},"wrap-reverse":{conditions:{sm:"fyvr11j8",md:"fyvr11j9",lg:"fyvr11ja",xl:"fyvr11jb"},defaultClass:"fyvr11j8"}}},justifyContent:{values:{"flex-start":{conditions:{sm:"fyvr11jc",md:"fyvr11jd",lg:"fyvr11je",xl:"fyvr11jf"},defaultClass:"fyvr11jc"},center:{conditions:{sm:"fyvr11jg",md:"fyvr11jh",lg:"fyvr11ji",xl:"fyvr11jj"},defaultClass:"fyvr11jg"},"flex-end":{conditions:{sm:"fyvr11jk",md:"fyvr11jl",lg:"fyvr11jm",xl:"fyvr11jn"},defaultClass:"fyvr11jk"},stretch:{conditions:{sm:"fyvr11jo",md:"fyvr11jp",lg:"fyvr11jq",xl:"fyvr11jr"},defaultClass:"fyvr11jo"},"space-around":{conditions:{sm:"fyvr11js",md:"fyvr11jt",lg:"fyvr11ju",xl:"fyvr11jv"},defaultClass:"fyvr11js"},"space-between":{conditions:{sm:"fyvr11jw",md:"fyvr11jx",lg:"fyvr11jy",xl:"fyvr11jz"},defaultClass:"fyvr11jw"},"space-evenly":{conditions:{sm:"fyvr11k0",md:"fyvr11k1",lg:"fyvr11k2",xl:"fyvr11k3"},defaultClass:"fyvr11k0"}}},justifySelf:{values:{"flex-start":{conditions:{sm:"fyvr11k4",md:"fyvr11k5",lg:"fyvr11k6",xl:"fyvr11k7"},defaultClass:"fyvr11k4"},center:{conditions:{sm:"fyvr11k8",md:"fyvr11k9",lg:"fyvr11ka",xl:"fyvr11kb"},defaultClass:"fyvr11k8"},"flex-end":{conditions:{sm:"fyvr11kc",md:"fyvr11kd",lg:"fyvr11ke",xl:"fyvr11kf"},defaultClass:"fyvr11kc"},stretch:{conditions:{sm:"fyvr11kg",md:"fyvr11kh",lg:"fyvr11ki",xl:"fyvr11kj"},defaultClass:"fyvr11kg"}}},alignItems:{values:{"flex-start":{conditions:{sm:"fyvr11kk",md:"fyvr11kl",lg:"fyvr11km",xl:"fyvr11kn"},defaultClass:"fyvr11kk"},center:{conditions:{sm:"fyvr11ko",md:"fyvr11kp",lg:"fyvr11kq",xl:"fyvr11kr"},defaultClass:"fyvr11ko"},"flex-end":{conditions:{sm:"fyvr11ks",md:"fyvr11kt",lg:"fyvr11ku",xl:"fyvr11kv"},defaultClass:"fyvr11ks"},stretch:{conditions:{sm:"fyvr11kw",md:"fyvr11kx",lg:"fyvr11ky",xl:"fyvr11kz"},defaultClass:"fyvr11kw"},baseline:{conditions:{sm:"fyvr11l0",md:"fyvr11l1",lg:"fyvr11l2",xl:"fyvr11l3"},defaultClass:"fyvr11l0"}}},alignSelf:{values:{"flex-start":{conditions:{sm:"fyvr11l4",md:"fyvr11l5",lg:"fyvr11l6",xl:"fyvr11l7"},defaultClass:"fyvr11l4"},center:{conditions:{sm:"fyvr11l8",md:"fyvr11l9",lg:"fyvr11la",xl:"fyvr11lb"},defaultClass:"fyvr11l8"},"flex-end":{conditions:{sm:"fyvr11lc",md:"fyvr11ld",lg:"fyvr11le",xl:"fyvr11lf"},defaultClass:"fyvr11lc"},stretch:{conditions:{sm:"fyvr11lg",md:"fyvr11lh",lg:"fyvr11li",xl:"fyvr11lj"},defaultClass:"fyvr11lg"},baseline:{conditions:{sm:"fyvr11lk",md:"fyvr11ll",lg:"fyvr11lm",xl:"fyvr11ln"},defaultClass:"fyvr11lk"}}},overflowX:{values:{auto:{conditions:{sm:"fyvr11lo",md:"fyvr11lp",lg:"fyvr11lq",xl:"fyvr11lr"},defaultClass:"fyvr11lo"},hidden:{conditions:{sm:"fyvr11ls",md:"fyvr11lt",lg:"fyvr11lu",xl:"fyvr11lv"},defaultClass:"fyvr11ls"},scroll:{conditions:{sm:"fyvr11lw",md:"fyvr11lx",lg:"fyvr11ly",xl:"fyvr11lz"},defaultClass:"fyvr11lw"},visible:{conditions:{sm:"fyvr11m0",md:"fyvr11m1",lg:"fyvr11m2",xl:"fyvr11m3"},defaultClass:"fyvr11m0"}}},overflowY:{values:{auto:{conditions:{sm:"fyvr11m4",md:"fyvr11m5",lg:"fyvr11m6",xl:"fyvr11m7"},defaultClass:"fyvr11m4"},hidden:{conditions:{sm:"fyvr11m8",md:"fyvr11m9",lg:"fyvr11ma",xl:"fyvr11mb"},defaultClass:"fyvr11m8"},scroll:{conditions:{sm:"fyvr11mc",md:"fyvr11md",lg:"fyvr11me",xl:"fyvr11mf"},defaultClass:"fyvr11mc"},visible:{conditions:{sm:"fyvr11mg",md:"fyvr11mh",lg:"fyvr11mi",xl:"fyvr11mj"},defaultClass:"fyvr11mg"}}},visibility:{values:{hidden:{conditions:{sm:"fyvr11mk",md:"fyvr11ml",lg:"fyvr11mm",xl:"fyvr11mn"},defaultClass:"fyvr11mk"},visible:{conditions:{sm:"fyvr11mo",md:"fyvr11mp",lg:"fyvr11mq",xl:"fyvr11mr"},defaultClass:"fyvr11mo"}}}}},{conditions:void 0,styles:{backdropFilter:{values:{blur:{defaultClass:"fyvr11ms"},none:{defaultClass:"fyvr11mt"}}},fontFamily:{values:{inherit:{defaultClass:"fyvr11mu"},body:{defaultClass:"fyvr11mv"},mono:{defaultClass:"fyvr11mw"}}},textOverflow:{values:{ellipsis:{defaultClass:"fyvr11mx"},clip:{defaultClass:"fyvr11my"}}},textTransform:{values:{capitalize:{defaultClass:"fyvr11mz"},lowercase:{defaultClass:"fyvr11n0"},uppercase:{defaultClass:"fyvr11n1"}}},textDecoration:{values:{none:{defaultClass:"fyvr11n2"},underline:{defaultClass:"fyvr11n3"}}},userSelect:{values:{none:{defaultClass:"fyvr11n4"},text:{defaultClass:"fyvr11n5"},all:{defaultClass:"fyvr11n6"},auto:{defaultClass:"fyvr11n7"}}},whiteSpace:{values:{normal:{defaultClass:"fyvr11n8"},nowrap:{defaultClass:"fyvr11n9"},initial:{defaultClass:"fyvr11na"},inherit:{defaultClass:"fyvr11nb"}}},wordBreak:{values:{"break-word":{defaultClass:"fyvr11nc"}}},wordWrap:{values:{normal:{defaultClass:"fyvr11nd"},"break-word":{defaultClass:"fyvr11ne"},initial:{defaultClass:"fyvr11nf"},inherit:{defaultClass:"fyvr11ng"}}},zIndex:{values:{0:{defaultClass:"fyvr11nh"},1:{defaultClass:"fyvr11ni"},10:{defaultClass:"fyvr11nj"},20:{defaultClass:"fyvr11nk"},30:{defaultClass:"fyvr11nl"},40:{defaultClass:"fyvr11nm"},50:{defaultClass:"fyvr11nn"},"-1":{defaultClass:"fyvr11no"},auto:{defaultClass:"fyvr11np"}}},aspectRatio:{values:{"1/1":{defaultClass:"fyvr11nq"},"16/9":{defaultClass:"fyvr11nr"},"4/3":{defaultClass:"fyvr11ns"},"3/1":{defaultClass:"fyvr11nt"},auto:{defaultClass:"fyvr11nu"}}}}},{conditions:{defaultCondition:"base",conditionNames:["base","active","disabled","focus","hover","checked"],responsiveArray:void 0},styles:{borderColor:{mappings:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]},borderStyle:{mappings:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},focusRing:{mappings:["boxShadow","outline"]},background:{values:{black:{conditions:{base:"fyvr11nv",active:"fyvr11nw",disabled:"fyvr11nx",focus:"fyvr11ny",hover:"fyvr11nz",checked:"fyvr11o0"},defaultClass:"fyvr11nv"},white:{conditions:{base:"fyvr11o1",active:"fyvr11o2",disabled:"fyvr11o3",focus:"fyvr11o4",hover:"fyvr11o5",checked:"fyvr11o6"},defaultClass:"fyvr11o1"},inherit:{conditions:{base:"fyvr11o7",active:"fyvr11o8",disabled:"fyvr11o9",focus:"fyvr11oa",hover:"fyvr11ob",checked:"fyvr11oc"},defaultClass:"fyvr11o7"},transparent:{conditions:{base:"fyvr11od",active:"fyvr11oe",disabled:"fyvr11of",focus:"fyvr11og",hover:"fyvr11oh",checked:"fyvr11oi"},defaultClass:"fyvr11od"},positive:{conditions:{base:"fyvr11oj",active:"fyvr11ok",disabled:"fyvr11ol",focus:"fyvr11om",hover:"fyvr11on",checked:"fyvr11oo"},defaultClass:"fyvr11oj"},negative:{conditions:{base:"fyvr11op",active:"fyvr11oq",disabled:"fyvr11or",focus:"fyvr11os",hover:"fyvr11ot",checked:"fyvr11ou"},defaultClass:"fyvr11op"},info:{conditions:{base:"fyvr11ov",active:"fyvr11ow",disabled:"fyvr11ox",focus:"fyvr11oy",hover:"fyvr11oz",checked:"fyvr11p0"},defaultClass:"fyvr11ov"},warning:{conditions:{base:"fyvr11p1",active:"fyvr11p2",disabled:"fyvr11p3",focus:"fyvr11p4",hover:"fyvr11p5",checked:"fyvr11p6"},defaultClass:"fyvr11p1"},gradientBackdrop:{conditions:{base:"fyvr11p7",active:"fyvr11p8",disabled:"fyvr11p9",focus:"fyvr11pa",hover:"fyvr11pb",checked:"fyvr11pc"},defaultClass:"fyvr11p7"},gradientPrimary:{conditions:{base:"fyvr11pd",active:"fyvr11pe",disabled:"fyvr11pf",focus:"fyvr11pg",hover:"fyvr11ph",checked:"fyvr11pi"},defaultClass:"fyvr11pd"},gradientSecondary:{conditions:{base:"fyvr11pj",active:"fyvr11pk",disabled:"fyvr11pl",focus:"fyvr11pm",hover:"fyvr11pn",checked:"fyvr11po"},defaultClass:"fyvr11pj"},arbitrumDark:{conditions:{base:"fyvr11pp",active:"fyvr11pq",disabled:"fyvr11pr",focus:"fyvr11ps",hover:"fyvr11pt",checked:"fyvr11pu"},defaultClass:"fyvr11pp"},arbitrumLight:{conditions:{base:"fyvr11pv",active:"fyvr11pw",disabled:"fyvr11px",focus:"fyvr11py",hover:"fyvr11pz",checked:"fyvr11q0"},defaultClass:"fyvr11pv"},avalanceDark:{conditions:{base:"fyvr11q1",active:"fyvr11q2",disabled:"fyvr11q3",focus:"fyvr11q4",hover:"fyvr11q5",checked:"fyvr11q6"},defaultClass:"fyvr11q1"},avalanceLight:{conditions:{base:"fyvr11q7",active:"fyvr11q8",disabled:"fyvr11q9",focus:"fyvr11qa",hover:"fyvr11qb",checked:"fyvr11qc"},defaultClass:"fyvr11q7"},bscDark:{conditions:{base:"fyvr11qd",active:"fyvr11qe",disabled:"fyvr11qf",focus:"fyvr11qg",hover:"fyvr11qh",checked:"fyvr11qi"},defaultClass:"fyvr11qd"},bscLight:{conditions:{base:"fyvr11qj",active:"fyvr11qk",disabled:"fyvr11ql",focus:"fyvr11qm",hover:"fyvr11qn",checked:"fyvr11qo"},defaultClass:"fyvr11qj"},ethereumDark:{conditions:{base:"fyvr11qp",active:"fyvr11qq",disabled:"fyvr11qr",focus:"fyvr11qs",hover:"fyvr11qt",checked:"fyvr11qu"},defaultClass:"fyvr11qp"},ethereumLight:{conditions:{base:"fyvr11qv",active:"fyvr11qw",disabled:"fyvr11qx",focus:"fyvr11qy",hover:"fyvr11qz",checked:"fyvr11r0"},defaultClass:"fyvr11qv"},gnosisDark:{conditions:{base:"fyvr11r1",active:"fyvr11r2",disabled:"fyvr11r3",focus:"fyvr11r4",hover:"fyvr11r5",checked:"fyvr11r6"},defaultClass:"fyvr11r1"},gnosisLight:{conditions:{base:"fyvr11r7",active:"fyvr11r8",disabled:"fyvr11r9",focus:"fyvr11ra",hover:"fyvr11rb",checked:"fyvr11rc"},defaultClass:"fyvr11r7"},polygonDark:{conditions:{base:"fyvr11rd",active:"fyvr11re",disabled:"fyvr11rf",focus:"fyvr11rg",hover:"fyvr11rh",checked:"fyvr11ri"},defaultClass:"fyvr11rd"},polygonLight:{conditions:{base:"fyvr11rj",active:"fyvr11rk",disabled:"fyvr11rl",focus:"fyvr11rm",hover:"fyvr11rn",checked:"fyvr11ro"},defaultClass:"fyvr11rj"},text100:{conditions:{base:"fyvr11rp",active:"fyvr11rq",disabled:"fyvr11rr",focus:"fyvr11rs",hover:"fyvr11rt",checked:"fyvr11ru"},defaultClass:"fyvr11rp"},text80:{conditions:{base:"fyvr11rv",active:"fyvr11rw",disabled:"fyvr11rx",focus:"fyvr11ry",hover:"fyvr11rz",checked:"fyvr11s0"},defaultClass:"fyvr11rv"},text50:{conditions:{base:"fyvr11s1",active:"fyvr11s2",disabled:"fyvr11s3",focus:"fyvr11s4",hover:"fyvr11s5",checked:"fyvr11s6"},defaultClass:"fyvr11s1"},textInverse100:{conditions:{base:"fyvr11s7",active:"fyvr11s8",disabled:"fyvr11s9",focus:"fyvr11sa",hover:"fyvr11sb",checked:"fyvr11sc"},defaultClass:"fyvr11s7"},backgroundPrimary:{conditions:{base:"fyvr11sd",active:"fyvr11se",disabled:"fyvr11sf",focus:"fyvr11sg",hover:"fyvr11sh",checked:"fyvr11si"},defaultClass:"fyvr11sd"},backgroundSecondary:{conditions:{base:"fyvr11sj",active:"fyvr11sk",disabled:"fyvr11sl",focus:"fyvr11sm",hover:"fyvr11sn",checked:"fyvr11so"},defaultClass:"fyvr11sj"},backgroundContrast:{conditions:{base:"fyvr11sp",active:"fyvr11sq",disabled:"fyvr11sr",focus:"fyvr11ss",hover:"fyvr11st",checked:"fyvr11su"},defaultClass:"fyvr11sp"},backgroundMuted:{conditions:{base:"fyvr11sv",active:"fyvr11sw",disabled:"fyvr11sx",focus:"fyvr11sy",hover:"fyvr11sz",checked:"fyvr11t0"},defaultClass:"fyvr11sv"},backgroundControl:{conditions:{base:"fyvr11t1",active:"fyvr11t2",disabled:"fyvr11t3",focus:"fyvr11t4",hover:"fyvr11t5",checked:"fyvr11t6"},defaultClass:"fyvr11t1"},backgroundInverse:{conditions:{base:"fyvr11t7",active:"fyvr11t8",disabled:"fyvr11t9",focus:"fyvr11ta",hover:"fyvr11tb",checked:"fyvr11tc"},defaultClass:"fyvr11t7"},backgroundBackdrop:{conditions:{base:"fyvr11td",active:"fyvr11te",disabled:"fyvr11tf",focus:"fyvr11tg",hover:"fyvr11th",checked:"fyvr11ti"},defaultClass:"fyvr11td"},backgroundOverlay:{conditions:{base:"fyvr11tj",active:"fyvr11tk",disabled:"fyvr11tl",focus:"fyvr11tm",hover:"fyvr11tn",checked:"fyvr11to"},defaultClass:"fyvr11tj"},backgroundRaised:{conditions:{base:"fyvr11tp",active:"fyvr11tq",disabled:"fyvr11tr",focus:"fyvr11ts",hover:"fyvr11tt",checked:"fyvr11tu"},defaultClass:"fyvr11tp"},buttonGlass:{conditions:{base:"fyvr11tv",active:"fyvr11tw",disabled:"fyvr11tx",focus:"fyvr11ty",hover:"fyvr11tz",checked:"fyvr11u0"},defaultClass:"fyvr11tv"},buttonEmphasis:{conditions:{base:"fyvr11u1",active:"fyvr11u2",disabled:"fyvr11u3",focus:"fyvr11u4",hover:"fyvr11u5",checked:"fyvr11u6"},defaultClass:"fyvr11u1"},buttonInverse:{conditions:{base:"fyvr11u7",active:"fyvr11u8",disabled:"fyvr11u9",focus:"fyvr11ua",hover:"fyvr11ub",checked:"fyvr11uc"},defaultClass:"fyvr11u7"},borderNormal:{conditions:{base:"fyvr11ud",active:"fyvr11ue",disabled:"fyvr11uf",focus:"fyvr11ug",hover:"fyvr11uh",checked:"fyvr11ui"},defaultClass:"fyvr11ud"},borderFocus:{conditions:{base:"fyvr11uj",active:"fyvr11uk",disabled:"fyvr11ul",focus:"fyvr11um",hover:"fyvr11un",checked:"fyvr11uo"},defaultClass:"fyvr11uj"}}},borderBottomColor:{values:{black:{conditions:{base:"fyvr11up",active:"fyvr11uq",disabled:"fyvr11ur",focus:"fyvr11us",hover:"fyvr11ut",checked:"fyvr11uu"},defaultClass:"fyvr11up"},white:{conditions:{base:"fyvr11uv",active:"fyvr11uw",disabled:"fyvr11ux",focus:"fyvr11uy",hover:"fyvr11uz",checked:"fyvr11v0"},defaultClass:"fyvr11uv"},inherit:{conditions:{base:"fyvr11v1",active:"fyvr11v2",disabled:"fyvr11v3",focus:"fyvr11v4",hover:"fyvr11v5",checked:"fyvr11v6"},defaultClass:"fyvr11v1"},transparent:{conditions:{base:"fyvr11v7",active:"fyvr11v8",disabled:"fyvr11v9",focus:"fyvr11va",hover:"fyvr11vb",checked:"fyvr11vc"},defaultClass:"fyvr11v7"},positive:{conditions:{base:"fyvr11vd",active:"fyvr11ve",disabled:"fyvr11vf",focus:"fyvr11vg",hover:"fyvr11vh",checked:"fyvr11vi"},defaultClass:"fyvr11vd"},negative:{conditions:{base:"fyvr11vj",active:"fyvr11vk",disabled:"fyvr11vl",focus:"fyvr11vm",hover:"fyvr11vn",checked:"fyvr11vo"},defaultClass:"fyvr11vj"},info:{conditions:{base:"fyvr11vp",active:"fyvr11vq",disabled:"fyvr11vr",focus:"fyvr11vs",hover:"fyvr11vt",checked:"fyvr11vu"},defaultClass:"fyvr11vp"},warning:{conditions:{base:"fyvr11vv",active:"fyvr11vw",disabled:"fyvr11vx",focus:"fyvr11vy",hover:"fyvr11vz",checked:"fyvr11w0"},defaultClass:"fyvr11vv"},gradientBackdrop:{conditions:{base:"fyvr11w1",active:"fyvr11w2",disabled:"fyvr11w3",focus:"fyvr11w4",hover:"fyvr11w5",checked:"fyvr11w6"},defaultClass:"fyvr11w1"},gradientPrimary:{conditions:{base:"fyvr11w7",active:"fyvr11w8",disabled:"fyvr11w9",focus:"fyvr11wa",hover:"fyvr11wb",checked:"fyvr11wc"},defaultClass:"fyvr11w7"},gradientSecondary:{conditions:{base:"fyvr11wd",active:"fyvr11we",disabled:"fyvr11wf",focus:"fyvr11wg",hover:"fyvr11wh",checked:"fyvr11wi"},defaultClass:"fyvr11wd"},arbitrumDark:{conditions:{base:"fyvr11wj",active:"fyvr11wk",disabled:"fyvr11wl",focus:"fyvr11wm",hover:"fyvr11wn",checked:"fyvr11wo"},defaultClass:"fyvr11wj"},arbitrumLight:{conditions:{base:"fyvr11wp",active:"fyvr11wq",disabled:"fyvr11wr",focus:"fyvr11ws",hover:"fyvr11wt",checked:"fyvr11wu"},defaultClass:"fyvr11wp"},avalanceDark:{conditions:{base:"fyvr11wv",active:"fyvr11ww",disabled:"fyvr11wx",focus:"fyvr11wy",hover:"fyvr11wz",checked:"fyvr11x0"},defaultClass:"fyvr11wv"},avalanceLight:{conditions:{base:"fyvr11x1",active:"fyvr11x2",disabled:"fyvr11x3",focus:"fyvr11x4",hover:"fyvr11x5",checked:"fyvr11x6"},defaultClass:"fyvr11x1"},bscDark:{conditions:{base:"fyvr11x7",active:"fyvr11x8",disabled:"fyvr11x9",focus:"fyvr11xa",hover:"fyvr11xb",checked:"fyvr11xc"},defaultClass:"fyvr11x7"},bscLight:{conditions:{base:"fyvr11xd",active:"fyvr11xe",disabled:"fyvr11xf",focus:"fyvr11xg",hover:"fyvr11xh",checked:"fyvr11xi"},defaultClass:"fyvr11xd"},ethereumDark:{conditions:{base:"fyvr11xj",active:"fyvr11xk",disabled:"fyvr11xl",focus:"fyvr11xm",hover:"fyvr11xn",checked:"fyvr11xo"},defaultClass:"fyvr11xj"},ethereumLight:{conditions:{base:"fyvr11xp",active:"fyvr11xq",disabled:"fyvr11xr",focus:"fyvr11xs",hover:"fyvr11xt",checked:"fyvr11xu"},defaultClass:"fyvr11xp"},gnosisDark:{conditions:{base:"fyvr11xv",active:"fyvr11xw",disabled:"fyvr11xx",focus:"fyvr11xy",hover:"fyvr11xz",checked:"fyvr11y0"},defaultClass:"fyvr11xv"},gnosisLight:{conditions:{base:"fyvr11y1",active:"fyvr11y2",disabled:"fyvr11y3",focus:"fyvr11y4",hover:"fyvr11y5",checked:"fyvr11y6"},defaultClass:"fyvr11y1"},polygonDark:{conditions:{base:"fyvr11y7",active:"fyvr11y8",disabled:"fyvr11y9",focus:"fyvr11ya",hover:"fyvr11yb",checked:"fyvr11yc"},defaultClass:"fyvr11y7"},polygonLight:{conditions:{base:"fyvr11yd",active:"fyvr11ye",disabled:"fyvr11yf",focus:"fyvr11yg",hover:"fyvr11yh",checked:"fyvr11yi"},defaultClass:"fyvr11yd"},text100:{conditions:{base:"fyvr11yj",active:"fyvr11yk",disabled:"fyvr11yl",focus:"fyvr11ym",hover:"fyvr11yn",checked:"fyvr11yo"},defaultClass:"fyvr11yj"},text80:{conditions:{base:"fyvr11yp",active:"fyvr11yq",disabled:"fyvr11yr",focus:"fyvr11ys",hover:"fyvr11yt",checked:"fyvr11yu"},defaultClass:"fyvr11yp"},text50:{conditions:{base:"fyvr11yv",active:"fyvr11yw",disabled:"fyvr11yx",focus:"fyvr11yy",hover:"fyvr11yz",checked:"fyvr11z0"},defaultClass:"fyvr11yv"},textInverse100:{conditions:{base:"fyvr11z1",active:"fyvr11z2",disabled:"fyvr11z3",focus:"fyvr11z4",hover:"fyvr11z5",checked:"fyvr11z6"},defaultClass:"fyvr11z1"},backgroundPrimary:{conditions:{base:"fyvr11z7",active:"fyvr11z8",disabled:"fyvr11z9",focus:"fyvr11za",hover:"fyvr11zb",checked:"fyvr11zc"},defaultClass:"fyvr11z7"},backgroundSecondary:{conditions:{base:"fyvr11zd",active:"fyvr11ze",disabled:"fyvr11zf",focus:"fyvr11zg",hover:"fyvr11zh",checked:"fyvr11zi"},defaultClass:"fyvr11zd"},backgroundContrast:{conditions:{base:"fyvr11zj",active:"fyvr11zk",disabled:"fyvr11zl",focus:"fyvr11zm",hover:"fyvr11zn",checked:"fyvr11zo"},defaultClass:"fyvr11zj"},backgroundMuted:{conditions:{base:"fyvr11zp",active:"fyvr11zq",disabled:"fyvr11zr",focus:"fyvr11zs",hover:"fyvr11zt",checked:"fyvr11zu"},defaultClass:"fyvr11zp"},backgroundControl:{conditions:{base:"fyvr11zv",active:"fyvr11zw",disabled:"fyvr11zx",focus:"fyvr11zy",hover:"fyvr11zz",checked:"fyvr1200"},defaultClass:"fyvr11zv"},backgroundInverse:{conditions:{base:"fyvr1201",active:"fyvr1202",disabled:"fyvr1203",focus:"fyvr1204",hover:"fyvr1205",checked:"fyvr1206"},defaultClass:"fyvr1201"},backgroundBackdrop:{conditions:{base:"fyvr1207",active:"fyvr1208",disabled:"fyvr1209",focus:"fyvr120a",hover:"fyvr120b",checked:"fyvr120c"},defaultClass:"fyvr1207"},backgroundOverlay:{conditions:{base:"fyvr120d",active:"fyvr120e",disabled:"fyvr120f",focus:"fyvr120g",hover:"fyvr120h",checked:"fyvr120i"},defaultClass:"fyvr120d"},backgroundRaised:{conditions:{base:"fyvr120j",active:"fyvr120k",disabled:"fyvr120l",focus:"fyvr120m",hover:"fyvr120n",checked:"fyvr120o"},defaultClass:"fyvr120j"},buttonGlass:{conditions:{base:"fyvr120p",active:"fyvr120q",disabled:"fyvr120r",focus:"fyvr120s",hover:"fyvr120t",checked:"fyvr120u"},defaultClass:"fyvr120p"},buttonEmphasis:{conditions:{base:"fyvr120v",active:"fyvr120w",disabled:"fyvr120x",focus:"fyvr120y",hover:"fyvr120z",checked:"fyvr1210"},defaultClass:"fyvr120v"},buttonInverse:{conditions:{base:"fyvr1211",active:"fyvr1212",disabled:"fyvr1213",focus:"fyvr1214",hover:"fyvr1215",checked:"fyvr1216"},defaultClass:"fyvr1211"},borderNormal:{conditions:{base:"fyvr1217",active:"fyvr1218",disabled:"fyvr1219",focus:"fyvr121a",hover:"fyvr121b",checked:"fyvr121c"},defaultClass:"fyvr1217"},borderFocus:{conditions:{base:"fyvr121d",active:"fyvr121e",disabled:"fyvr121f",focus:"fyvr121g",hover:"fyvr121h",checked:"fyvr121i"},defaultClass:"fyvr121d"}}},borderBottomStyle:{values:{solid:{conditions:{base:"fyvr121j",active:"fyvr121k",disabled:"fyvr121l",focus:"fyvr121m",hover:"fyvr121n",checked:"fyvr121o"},defaultClass:"fyvr121j"},dashed:{conditions:{base:"fyvr121p",active:"fyvr121q",disabled:"fyvr121r",focus:"fyvr121s",hover:"fyvr121t",checked:"fyvr121u"},defaultClass:"fyvr121p"},dotted:{conditions:{base:"fyvr121v",active:"fyvr121w",disabled:"fyvr121x",focus:"fyvr121y",hover:"fyvr121z",checked:"fyvr1220"},defaultClass:"fyvr121v"}}},borderLeftColor:{values:{black:{conditions:{base:"fyvr1221",active:"fyvr1222",disabled:"fyvr1223",focus:"fyvr1224",hover:"fyvr1225",checked:"fyvr1226"},defaultClass:"fyvr1221"},white:{conditions:{base:"fyvr1227",active:"fyvr1228",disabled:"fyvr1229",focus:"fyvr122a",hover:"fyvr122b",checked:"fyvr122c"},defaultClass:"fyvr1227"},inherit:{conditions:{base:"fyvr122d",active:"fyvr122e",disabled:"fyvr122f",focus:"fyvr122g",hover:"fyvr122h",checked:"fyvr122i"},defaultClass:"fyvr122d"},transparent:{conditions:{base:"fyvr122j",active:"fyvr122k",disabled:"fyvr122l",focus:"fyvr122m",hover:"fyvr122n",checked:"fyvr122o"},defaultClass:"fyvr122j"},positive:{conditions:{base:"fyvr122p",active:"fyvr122q",disabled:"fyvr122r",focus:"fyvr122s",hover:"fyvr122t",checked:"fyvr122u"},defaultClass:"fyvr122p"},negative:{conditions:{base:"fyvr122v",active:"fyvr122w",disabled:"fyvr122x",focus:"fyvr122y",hover:"fyvr122z",checked:"fyvr1230"},defaultClass:"fyvr122v"},info:{conditions:{base:"fyvr1231",active:"fyvr1232",disabled:"fyvr1233",focus:"fyvr1234",hover:"fyvr1235",checked:"fyvr1236"},defaultClass:"fyvr1231"},warning:{conditions:{base:"fyvr1237",active:"fyvr1238",disabled:"fyvr1239",focus:"fyvr123a",hover:"fyvr123b",checked:"fyvr123c"},defaultClass:"fyvr1237"},gradientBackdrop:{conditions:{base:"fyvr123d",active:"fyvr123e",disabled:"fyvr123f",focus:"fyvr123g",hover:"fyvr123h",checked:"fyvr123i"},defaultClass:"fyvr123d"},gradientPrimary:{conditions:{base:"fyvr123j",active:"fyvr123k",disabled:"fyvr123l",focus:"fyvr123m",hover:"fyvr123n",checked:"fyvr123o"},defaultClass:"fyvr123j"},gradientSecondary:{conditions:{base:"fyvr123p",active:"fyvr123q",disabled:"fyvr123r",focus:"fyvr123s",hover:"fyvr123t",checked:"fyvr123u"},defaultClass:"fyvr123p"},arbitrumDark:{conditions:{base:"fyvr123v",active:"fyvr123w",disabled:"fyvr123x",focus:"fyvr123y",hover:"fyvr123z",checked:"fyvr1240"},defaultClass:"fyvr123v"},arbitrumLight:{conditions:{base:"fyvr1241",active:"fyvr1242",disabled:"fyvr1243",focus:"fyvr1244",hover:"fyvr1245",checked:"fyvr1246"},defaultClass:"fyvr1241"},avalanceDark:{conditions:{base:"fyvr1247",active:"fyvr1248",disabled:"fyvr1249",focus:"fyvr124a",hover:"fyvr124b",checked:"fyvr124c"},defaultClass:"fyvr1247"},avalanceLight:{conditions:{base:"fyvr124d",active:"fyvr124e",disabled:"fyvr124f",focus:"fyvr124g",hover:"fyvr124h",checked:"fyvr124i"},defaultClass:"fyvr124d"},bscDark:{conditions:{base:"fyvr124j",active:"fyvr124k",disabled:"fyvr124l",focus:"fyvr124m",hover:"fyvr124n",checked:"fyvr124o"},defaultClass:"fyvr124j"},bscLight:{conditions:{base:"fyvr124p",active:"fyvr124q",disabled:"fyvr124r",focus:"fyvr124s",hover:"fyvr124t",checked:"fyvr124u"},defaultClass:"fyvr124p"},ethereumDark:{conditions:{base:"fyvr124v",active:"fyvr124w",disabled:"fyvr124x",focus:"fyvr124y",hover:"fyvr124z",checked:"fyvr1250"},defaultClass:"fyvr124v"},ethereumLight:{conditions:{base:"fyvr1251",active:"fyvr1252",disabled:"fyvr1253",focus:"fyvr1254",hover:"fyvr1255",checked:"fyvr1256"},defaultClass:"fyvr1251"},gnosisDark:{conditions:{base:"fyvr1257",active:"fyvr1258",disabled:"fyvr1259",focus:"fyvr125a",hover:"fyvr125b",checked:"fyvr125c"},defaultClass:"fyvr1257"},gnosisLight:{conditions:{base:"fyvr125d",active:"fyvr125e",disabled:"fyvr125f",focus:"fyvr125g",hover:"fyvr125h",checked:"fyvr125i"},defaultClass:"fyvr125d"},polygonDark:{conditions:{base:"fyvr125j",active:"fyvr125k",disabled:"fyvr125l",focus:"fyvr125m",hover:"fyvr125n",checked:"fyvr125o"},defaultClass:"fyvr125j"},polygonLight:{conditions:{base:"fyvr125p",active:"fyvr125q",disabled:"fyvr125r",focus:"fyvr125s",hover:"fyvr125t",checked:"fyvr125u"},defaultClass:"fyvr125p"},text100:{conditions:{base:"fyvr125v",active:"fyvr125w",disabled:"fyvr125x",focus:"fyvr125y",hover:"fyvr125z",checked:"fyvr1260"},defaultClass:"fyvr125v"},text80:{conditions:{base:"fyvr1261",active:"fyvr1262",disabled:"fyvr1263",focus:"fyvr1264",hover:"fyvr1265",checked:"fyvr1266"},defaultClass:"fyvr1261"},text50:{conditions:{base:"fyvr1267",active:"fyvr1268",disabled:"fyvr1269",focus:"fyvr126a",hover:"fyvr126b",checked:"fyvr126c"},defaultClass:"fyvr1267"},textInverse100:{conditions:{base:"fyvr126d",active:"fyvr126e",disabled:"fyvr126f",focus:"fyvr126g",hover:"fyvr126h",checked:"fyvr126i"},defaultClass:"fyvr126d"},backgroundPrimary:{conditions:{base:"fyvr126j",active:"fyvr126k",disabled:"fyvr126l",focus:"fyvr126m",hover:"fyvr126n",checked:"fyvr126o"},defaultClass:"fyvr126j"},backgroundSecondary:{conditions:{base:"fyvr126p",active:"fyvr126q",disabled:"fyvr126r",focus:"fyvr126s",hover:"fyvr126t",checked:"fyvr126u"},defaultClass:"fyvr126p"},backgroundContrast:{conditions:{base:"fyvr126v",active:"fyvr126w",disabled:"fyvr126x",focus:"fyvr126y",hover:"fyvr126z",checked:"fyvr1270"},defaultClass:"fyvr126v"},backgroundMuted:{conditions:{base:"fyvr1271",active:"fyvr1272",disabled:"fyvr1273",focus:"fyvr1274",hover:"fyvr1275",checked:"fyvr1276"},defaultClass:"fyvr1271"},backgroundControl:{conditions:{base:"fyvr1277",active:"fyvr1278",disabled:"fyvr1279",focus:"fyvr127a",hover:"fyvr127b",checked:"fyvr127c"},defaultClass:"fyvr1277"},backgroundInverse:{conditions:{base:"fyvr127d",active:"fyvr127e",disabled:"fyvr127f",focus:"fyvr127g",hover:"fyvr127h",checked:"fyvr127i"},defaultClass:"fyvr127d"},backgroundBackdrop:{conditions:{base:"fyvr127j",active:"fyvr127k",disabled:"fyvr127l",focus:"fyvr127m",hover:"fyvr127n",checked:"fyvr127o"},defaultClass:"fyvr127j"},backgroundOverlay:{conditions:{base:"fyvr127p",active:"fyvr127q",disabled:"fyvr127r",focus:"fyvr127s",hover:"fyvr127t",checked:"fyvr127u"},defaultClass:"fyvr127p"},backgroundRaised:{conditions:{base:"fyvr127v",active:"fyvr127w",disabled:"fyvr127x",focus:"fyvr127y",hover:"fyvr127z",checked:"fyvr1280"},defaultClass:"fyvr127v"},buttonGlass:{conditions:{base:"fyvr1281",active:"fyvr1282",disabled:"fyvr1283",focus:"fyvr1284",hover:"fyvr1285",checked:"fyvr1286"},defaultClass:"fyvr1281"},buttonEmphasis:{conditions:{base:"fyvr1287",active:"fyvr1288",disabled:"fyvr1289",focus:"fyvr128a",hover:"fyvr128b",checked:"fyvr128c"},defaultClass:"fyvr1287"},buttonInverse:{conditions:{base:"fyvr128d",active:"fyvr128e",disabled:"fyvr128f",focus:"fyvr128g",hover:"fyvr128h",checked:"fyvr128i"},defaultClass:"fyvr128d"},borderNormal:{conditions:{base:"fyvr128j",active:"fyvr128k",disabled:"fyvr128l",focus:"fyvr128m",hover:"fyvr128n",checked:"fyvr128o"},defaultClass:"fyvr128j"},borderFocus:{conditions:{base:"fyvr128p",active:"fyvr128q",disabled:"fyvr128r",focus:"fyvr128s",hover:"fyvr128t",checked:"fyvr128u"},defaultClass:"fyvr128p"}}},borderLeftStyle:{values:{solid:{conditions:{base:"fyvr128v",active:"fyvr128w",disabled:"fyvr128x",focus:"fyvr128y",hover:"fyvr128z",checked:"fyvr1290"},defaultClass:"fyvr128v"},dashed:{conditions:{base:"fyvr1291",active:"fyvr1292",disabled:"fyvr1293",focus:"fyvr1294",hover:"fyvr1295",checked:"fyvr1296"},defaultClass:"fyvr1291"},dotted:{conditions:{base:"fyvr1297",active:"fyvr1298",disabled:"fyvr1299",focus:"fyvr129a",hover:"fyvr129b",checked:"fyvr129c"},defaultClass:"fyvr1297"}}},borderRightColor:{values:{black:{conditions:{base:"fyvr129d",active:"fyvr129e",disabled:"fyvr129f",focus:"fyvr129g",hover:"fyvr129h",checked:"fyvr129i"},defaultClass:"fyvr129d"},white:{conditions:{base:"fyvr129j",active:"fyvr129k",disabled:"fyvr129l",focus:"fyvr129m",hover:"fyvr129n",checked:"fyvr129o"},defaultClass:"fyvr129j"},inherit:{conditions:{base:"fyvr129p",active:"fyvr129q",disabled:"fyvr129r",focus:"fyvr129s",hover:"fyvr129t",checked:"fyvr129u"},defaultClass:"fyvr129p"},transparent:{conditions:{base:"fyvr129v",active:"fyvr129w",disabled:"fyvr129x",focus:"fyvr129y",hover:"fyvr129z",checked:"fyvr12a0"},defaultClass:"fyvr129v"},positive:{conditions:{base:"fyvr12a1",active:"fyvr12a2",disabled:"fyvr12a3",focus:"fyvr12a4",hover:"fyvr12a5",checked:"fyvr12a6"},defaultClass:"fyvr12a1"},negative:{conditions:{base:"fyvr12a7",active:"fyvr12a8",disabled:"fyvr12a9",focus:"fyvr12aa",hover:"fyvr12ab",checked:"fyvr12ac"},defaultClass:"fyvr12a7"},info:{conditions:{base:"fyvr12ad",active:"fyvr12ae",disabled:"fyvr12af",focus:"fyvr12ag",hover:"fyvr12ah",checked:"fyvr12ai"},defaultClass:"fyvr12ad"},warning:{conditions:{base:"fyvr12aj",active:"fyvr12ak",disabled:"fyvr12al",focus:"fyvr12am",hover:"fyvr12an",checked:"fyvr12ao"},defaultClass:"fyvr12aj"},gradientBackdrop:{conditions:{base:"fyvr12ap",active:"fyvr12aq",disabled:"fyvr12ar",focus:"fyvr12as",hover:"fyvr12at",checked:"fyvr12au"},defaultClass:"fyvr12ap"},gradientPrimary:{conditions:{base:"fyvr12av",active:"fyvr12aw",disabled:"fyvr12ax",focus:"fyvr12ay",hover:"fyvr12az",checked:"fyvr12b0"},defaultClass:"fyvr12av"},gradientSecondary:{conditions:{base:"fyvr12b1",active:"fyvr12b2",disabled:"fyvr12b3",focus:"fyvr12b4",hover:"fyvr12b5",checked:"fyvr12b6"},defaultClass:"fyvr12b1"},arbitrumDark:{conditions:{base:"fyvr12b7",active:"fyvr12b8",disabled:"fyvr12b9",focus:"fyvr12ba",hover:"fyvr12bb",checked:"fyvr12bc"},defaultClass:"fyvr12b7"},arbitrumLight:{conditions:{base:"fyvr12bd",active:"fyvr12be",disabled:"fyvr12bf",focus:"fyvr12bg",hover:"fyvr12bh",checked:"fyvr12bi"},defaultClass:"fyvr12bd"},avalanceDark:{conditions:{base:"fyvr12bj",active:"fyvr12bk",disabled:"fyvr12bl",focus:"fyvr12bm",hover:"fyvr12bn",checked:"fyvr12bo"},defaultClass:"fyvr12bj"},avalanceLight:{conditions:{base:"fyvr12bp",active:"fyvr12bq",disabled:"fyvr12br",focus:"fyvr12bs",hover:"fyvr12bt",checked:"fyvr12bu"},defaultClass:"fyvr12bp"},bscDark:{conditions:{base:"fyvr12bv",active:"fyvr12bw",disabled:"fyvr12bx",focus:"fyvr12by",hover:"fyvr12bz",checked:"fyvr12c0"},defaultClass:"fyvr12bv"},bscLight:{conditions:{base:"fyvr12c1",active:"fyvr12c2",disabled:"fyvr12c3",focus:"fyvr12c4",hover:"fyvr12c5",checked:"fyvr12c6"},defaultClass:"fyvr12c1"},ethereumDark:{conditions:{base:"fyvr12c7",active:"fyvr12c8",disabled:"fyvr12c9",focus:"fyvr12ca",hover:"fyvr12cb",checked:"fyvr12cc"},defaultClass:"fyvr12c7"},ethereumLight:{conditions:{base:"fyvr12cd",active:"fyvr12ce",disabled:"fyvr12cf",focus:"fyvr12cg",hover:"fyvr12ch",checked:"fyvr12ci"},defaultClass:"fyvr12cd"},gnosisDark:{conditions:{base:"fyvr12cj",active:"fyvr12ck",disabled:"fyvr12cl",focus:"fyvr12cm",hover:"fyvr12cn",checked:"fyvr12co"},defaultClass:"fyvr12cj"},gnosisLight:{conditions:{base:"fyvr12cp",active:"fyvr12cq",disabled:"fyvr12cr",focus:"fyvr12cs",hover:"fyvr12ct",checked:"fyvr12cu"},defaultClass:"fyvr12cp"},polygonDark:{conditions:{base:"fyvr12cv",active:"fyvr12cw",disabled:"fyvr12cx",focus:"fyvr12cy",hover:"fyvr12cz",checked:"fyvr12d0"},defaultClass:"fyvr12cv"},polygonLight:{conditions:{base:"fyvr12d1",active:"fyvr12d2",disabled:"fyvr12d3",focus:"fyvr12d4",hover:"fyvr12d5",checked:"fyvr12d6"},defaultClass:"fyvr12d1"},text100:{conditions:{base:"fyvr12d7",active:"fyvr12d8",disabled:"fyvr12d9",focus:"fyvr12da",hover:"fyvr12db",checked:"fyvr12dc"},defaultClass:"fyvr12d7"},text80:{conditions:{base:"fyvr12dd",active:"fyvr12de",disabled:"fyvr12df",focus:"fyvr12dg",hover:"fyvr12dh",checked:"fyvr12di"},defaultClass:"fyvr12dd"},text50:{conditions:{base:"fyvr12dj",active:"fyvr12dk",disabled:"fyvr12dl",focus:"fyvr12dm",hover:"fyvr12dn",checked:"fyvr12do"},defaultClass:"fyvr12dj"},textInverse100:{conditions:{base:"fyvr12dp",active:"fyvr12dq",disabled:"fyvr12dr",focus:"fyvr12ds",hover:"fyvr12dt",checked:"fyvr12du"},defaultClass:"fyvr12dp"},backgroundPrimary:{conditions:{base:"fyvr12dv",active:"fyvr12dw",disabled:"fyvr12dx",focus:"fyvr12dy",hover:"fyvr12dz",checked:"fyvr12e0"},defaultClass:"fyvr12dv"},backgroundSecondary:{conditions:{base:"fyvr12e1",active:"fyvr12e2",disabled:"fyvr12e3",focus:"fyvr12e4",hover:"fyvr12e5",checked:"fyvr12e6"},defaultClass:"fyvr12e1"},backgroundContrast:{conditions:{base:"fyvr12e7",active:"fyvr12e8",disabled:"fyvr12e9",focus:"fyvr12ea",hover:"fyvr12eb",checked:"fyvr12ec"},defaultClass:"fyvr12e7"},backgroundMuted:{conditions:{base:"fyvr12ed",active:"fyvr12ee",disabled:"fyvr12ef",focus:"fyvr12eg",hover:"fyvr12eh",checked:"fyvr12ei"},defaultClass:"fyvr12ed"},backgroundControl:{conditions:{base:"fyvr12ej",active:"fyvr12ek",disabled:"fyvr12el",focus:"fyvr12em",hover:"fyvr12en",checked:"fyvr12eo"},defaultClass:"fyvr12ej"},backgroundInverse:{conditions:{base:"fyvr12ep",active:"fyvr12eq",disabled:"fyvr12er",focus:"fyvr12es",hover:"fyvr12et",checked:"fyvr12eu"},defaultClass:"fyvr12ep"},backgroundBackdrop:{conditions:{base:"fyvr12ev",active:"fyvr12ew",disabled:"fyvr12ex",focus:"fyvr12ey",hover:"fyvr12ez",checked:"fyvr12f0"},defaultClass:"fyvr12ev"},backgroundOverlay:{conditions:{base:"fyvr12f1",active:"fyvr12f2",disabled:"fyvr12f3",focus:"fyvr12f4",hover:"fyvr12f5",checked:"fyvr12f6"},defaultClass:"fyvr12f1"},backgroundRaised:{conditions:{base:"fyvr12f7",active:"fyvr12f8",disabled:"fyvr12f9",focus:"fyvr12fa",hover:"fyvr12fb",checked:"fyvr12fc"},defaultClass:"fyvr12f7"},buttonGlass:{conditions:{base:"fyvr12fd",active:"fyvr12fe",disabled:"fyvr12ff",focus:"fyvr12fg",hover:"fyvr12fh",checked:"fyvr12fi"},defaultClass:"fyvr12fd"},buttonEmphasis:{conditions:{base:"fyvr12fj",active:"fyvr12fk",disabled:"fyvr12fl",focus:"fyvr12fm",hover:"fyvr12fn",checked:"fyvr12fo"},defaultClass:"fyvr12fj"},buttonInverse:{conditions:{base:"fyvr12fp",active:"fyvr12fq",disabled:"fyvr12fr",focus:"fyvr12fs",hover:"fyvr12ft",checked:"fyvr12fu"},defaultClass:"fyvr12fp"},borderNormal:{conditions:{base:"fyvr12fv",active:"fyvr12fw",disabled:"fyvr12fx",focus:"fyvr12fy",hover:"fyvr12fz",checked:"fyvr12g0"},defaultClass:"fyvr12fv"},borderFocus:{conditions:{base:"fyvr12g1",active:"fyvr12g2",disabled:"fyvr12g3",focus:"fyvr12g4",hover:"fyvr12g5",checked:"fyvr12g6"},defaultClass:"fyvr12g1"}}},borderRightStyle:{values:{solid:{conditions:{base:"fyvr12g7",active:"fyvr12g8",disabled:"fyvr12g9",focus:"fyvr12ga",hover:"fyvr12gb",checked:"fyvr12gc"},defaultClass:"fyvr12g7"},dashed:{conditions:{base:"fyvr12gd",active:"fyvr12ge",disabled:"fyvr12gf",focus:"fyvr12gg",hover:"fyvr12gh",checked:"fyvr12gi"},defaultClass:"fyvr12gd"},dotted:{conditions:{base:"fyvr12gj",active:"fyvr12gk",disabled:"fyvr12gl",focus:"fyvr12gm",hover:"fyvr12gn",checked:"fyvr12go"},defaultClass:"fyvr12gj"}}},borderTopColor:{values:{black:{conditions:{base:"fyvr12gp",active:"fyvr12gq",disabled:"fyvr12gr",focus:"fyvr12gs",hover:"fyvr12gt",checked:"fyvr12gu"},defaultClass:"fyvr12gp"},white:{conditions:{base:"fyvr12gv",active:"fyvr12gw",disabled:"fyvr12gx",focus:"fyvr12gy",hover:"fyvr12gz",checked:"fyvr12h0"},defaultClass:"fyvr12gv"},inherit:{conditions:{base:"fyvr12h1",active:"fyvr12h2",disabled:"fyvr12h3",focus:"fyvr12h4",hover:"fyvr12h5",checked:"fyvr12h6"},defaultClass:"fyvr12h1"},transparent:{conditions:{base:"fyvr12h7",active:"fyvr12h8",disabled:"fyvr12h9",focus:"fyvr12ha",hover:"fyvr12hb",checked:"fyvr12hc"},defaultClass:"fyvr12h7"},positive:{conditions:{base:"fyvr12hd",active:"fyvr12he",disabled:"fyvr12hf",focus:"fyvr12hg",hover:"fyvr12hh",checked:"fyvr12hi"},defaultClass:"fyvr12hd"},negative:{conditions:{base:"fyvr12hj",active:"fyvr12hk",disabled:"fyvr12hl",focus:"fyvr12hm",hover:"fyvr12hn",checked:"fyvr12ho"},defaultClass:"fyvr12hj"},info:{conditions:{base:"fyvr12hp",active:"fyvr12hq",disabled:"fyvr12hr",focus:"fyvr12hs",hover:"fyvr12ht",checked:"fyvr12hu"},defaultClass:"fyvr12hp"},warning:{conditions:{base:"fyvr12hv",active:"fyvr12hw",disabled:"fyvr12hx",focus:"fyvr12hy",hover:"fyvr12hz",checked:"fyvr12i0"},defaultClass:"fyvr12hv"},gradientBackdrop:{conditions:{base:"fyvr12i1",active:"fyvr12i2",disabled:"fyvr12i3",focus:"fyvr12i4",hover:"fyvr12i5",checked:"fyvr12i6"},defaultClass:"fyvr12i1"},gradientPrimary:{conditions:{base:"fyvr12i7",active:"fyvr12i8",disabled:"fyvr12i9",focus:"fyvr12ia",hover:"fyvr12ib",checked:"fyvr12ic"},defaultClass:"fyvr12i7"},gradientSecondary:{conditions:{base:"fyvr12id",active:"fyvr12ie",disabled:"fyvr12if",focus:"fyvr12ig",hover:"fyvr12ih",checked:"fyvr12ii"},defaultClass:"fyvr12id"},arbitrumDark:{conditions:{base:"fyvr12ij",active:"fyvr12ik",disabled:"fyvr12il",focus:"fyvr12im",hover:"fyvr12in",checked:"fyvr12io"},defaultClass:"fyvr12ij"},arbitrumLight:{conditions:{base:"fyvr12ip",active:"fyvr12iq",disabled:"fyvr12ir",focus:"fyvr12is",hover:"fyvr12it",checked:"fyvr12iu"},defaultClass:"fyvr12ip"},avalanceDark:{conditions:{base:"fyvr12iv",active:"fyvr12iw",disabled:"fyvr12ix",focus:"fyvr12iy",hover:"fyvr12iz",checked:"fyvr12j0"},defaultClass:"fyvr12iv"},avalanceLight:{conditions:{base:"fyvr12j1",active:"fyvr12j2",disabled:"fyvr12j3",focus:"fyvr12j4",hover:"fyvr12j5",checked:"fyvr12j6"},defaultClass:"fyvr12j1"},bscDark:{conditions:{base:"fyvr12j7",active:"fyvr12j8",disabled:"fyvr12j9",focus:"fyvr12ja",hover:"fyvr12jb",checked:"fyvr12jc"},defaultClass:"fyvr12j7"},bscLight:{conditions:{base:"fyvr12jd",active:"fyvr12je",disabled:"fyvr12jf",focus:"fyvr12jg",hover:"fyvr12jh",checked:"fyvr12ji"},defaultClass:"fyvr12jd"},ethereumDark:{conditions:{base:"fyvr12jj",active:"fyvr12jk",disabled:"fyvr12jl",focus:"fyvr12jm",hover:"fyvr12jn",checked:"fyvr12jo"},defaultClass:"fyvr12jj"},ethereumLight:{conditions:{base:"fyvr12jp",active:"fyvr12jq",disabled:"fyvr12jr",focus:"fyvr12js",hover:"fyvr12jt",checked:"fyvr12ju"},defaultClass:"fyvr12jp"},gnosisDark:{conditions:{base:"fyvr12jv",active:"fyvr12jw",disabled:"fyvr12jx",focus:"fyvr12jy",hover:"fyvr12jz",checked:"fyvr12k0"},defaultClass:"fyvr12jv"},gnosisLight:{conditions:{base:"fyvr12k1",active:"fyvr12k2",disabled:"fyvr12k3",focus:"fyvr12k4",hover:"fyvr12k5",checked:"fyvr12k6"},defaultClass:"fyvr12k1"},polygonDark:{conditions:{base:"fyvr12k7",active:"fyvr12k8",disabled:"fyvr12k9",focus:"fyvr12ka",hover:"fyvr12kb",checked:"fyvr12kc"},defaultClass:"fyvr12k7"},polygonLight:{conditions:{base:"fyvr12kd",active:"fyvr12ke",disabled:"fyvr12kf",focus:"fyvr12kg",hover:"fyvr12kh",checked:"fyvr12ki"},defaultClass:"fyvr12kd"},text100:{conditions:{base:"fyvr12kj",active:"fyvr12kk",disabled:"fyvr12kl",focus:"fyvr12km",hover:"fyvr12kn",checked:"fyvr12ko"},defaultClass:"fyvr12kj"},text80:{conditions:{base:"fyvr12kp",active:"fyvr12kq",disabled:"fyvr12kr",focus:"fyvr12ks",hover:"fyvr12kt",checked:"fyvr12ku"},defaultClass:"fyvr12kp"},text50:{conditions:{base:"fyvr12kv",active:"fyvr12kw",disabled:"fyvr12kx",focus:"fyvr12ky",hover:"fyvr12kz",checked:"fyvr12l0"},defaultClass:"fyvr12kv"},textInverse100:{conditions:{base:"fyvr12l1",active:"fyvr12l2",disabled:"fyvr12l3",focus:"fyvr12l4",hover:"fyvr12l5",checked:"fyvr12l6"},defaultClass:"fyvr12l1"},backgroundPrimary:{conditions:{base:"fyvr12l7",active:"fyvr12l8",disabled:"fyvr12l9",focus:"fyvr12la",hover:"fyvr12lb",checked:"fyvr12lc"},defaultClass:"fyvr12l7"},backgroundSecondary:{conditions:{base:"fyvr12ld",active:"fyvr12le",disabled:"fyvr12lf",focus:"fyvr12lg",hover:"fyvr12lh",checked:"fyvr12li"},defaultClass:"fyvr12ld"},backgroundContrast:{conditions:{base:"fyvr12lj",active:"fyvr12lk",disabled:"fyvr12ll",focus:"fyvr12lm",hover:"fyvr12ln",checked:"fyvr12lo"},defaultClass:"fyvr12lj"},backgroundMuted:{conditions:{base:"fyvr12lp",active:"fyvr12lq",disabled:"fyvr12lr",focus:"fyvr12ls",hover:"fyvr12lt",checked:"fyvr12lu"},defaultClass:"fyvr12lp"},backgroundControl:{conditions:{base:"fyvr12lv",active:"fyvr12lw",disabled:"fyvr12lx",focus:"fyvr12ly",hover:"fyvr12lz",checked:"fyvr12m0"},defaultClass:"fyvr12lv"},backgroundInverse:{conditions:{base:"fyvr12m1",active:"fyvr12m2",disabled:"fyvr12m3",focus:"fyvr12m4",hover:"fyvr12m5",checked:"fyvr12m6"},defaultClass:"fyvr12m1"},backgroundBackdrop:{conditions:{base:"fyvr12m7",active:"fyvr12m8",disabled:"fyvr12m9",focus:"fyvr12ma",hover:"fyvr12mb",checked:"fyvr12mc"},defaultClass:"fyvr12m7"},backgroundOverlay:{conditions:{base:"fyvr12md",active:"fyvr12me",disabled:"fyvr12mf",focus:"fyvr12mg",hover:"fyvr12mh",checked:"fyvr12mi"},defaultClass:"fyvr12md"},backgroundRaised:{conditions:{base:"fyvr12mj",active:"fyvr12mk",disabled:"fyvr12ml",focus:"fyvr12mm",hover:"fyvr12mn",checked:"fyvr12mo"},defaultClass:"fyvr12mj"},buttonGlass:{conditions:{base:"fyvr12mp",active:"fyvr12mq",disabled:"fyvr12mr",focus:"fyvr12ms",hover:"fyvr12mt",checked:"fyvr12mu"},defaultClass:"fyvr12mp"},buttonEmphasis:{conditions:{base:"fyvr12mv",active:"fyvr12mw",disabled:"fyvr12mx",focus:"fyvr12my",hover:"fyvr12mz",checked:"fyvr12n0"},defaultClass:"fyvr12mv"},buttonInverse:{conditions:{base:"fyvr12n1",active:"fyvr12n2",disabled:"fyvr12n3",focus:"fyvr12n4",hover:"fyvr12n5",checked:"fyvr12n6"},defaultClass:"fyvr12n1"},borderNormal:{conditions:{base:"fyvr12n7",active:"fyvr12n8",disabled:"fyvr12n9",focus:"fyvr12na",hover:"fyvr12nb",checked:"fyvr12nc"},defaultClass:"fyvr12n7"},borderFocus:{conditions:{base:"fyvr12nd",active:"fyvr12ne",disabled:"fyvr12nf",focus:"fyvr12ng",hover:"fyvr12nh",checked:"fyvr12ni"},defaultClass:"fyvr12nd"}}},borderTopStyle:{values:{solid:{conditions:{base:"fyvr12nj",active:"fyvr12nk",disabled:"fyvr12nl",focus:"fyvr12nm",hover:"fyvr12nn",checked:"fyvr12no"},defaultClass:"fyvr12nj"},dashed:{conditions:{base:"fyvr12np",active:"fyvr12nq",disabled:"fyvr12nr",focus:"fyvr12ns",hover:"fyvr12nt",checked:"fyvr12nu"},defaultClass:"fyvr12np"},dotted:{conditions:{base:"fyvr12nv",active:"fyvr12nw",disabled:"fyvr12nx",focus:"fyvr12ny",hover:"fyvr12nz",checked:"fyvr12o0"},defaultClass:"fyvr12nv"}}},border:{values:{none:{conditions:{base:"fyvr12o1",active:"fyvr12o2",disabled:"fyvr12o3",focus:"fyvr12o4",hover:"fyvr12o5",checked:"fyvr12o6"},defaultClass:"fyvr12o1"}}},color:{values:{black:{conditions:{base:"fyvr12o7",active:"fyvr12o8",disabled:"fyvr12o9",focus:"fyvr12oa",hover:"fyvr12ob",checked:"fyvr12oc"},defaultClass:"fyvr12o7"},white:{conditions:{base:"fyvr12od",active:"fyvr12oe",disabled:"fyvr12of",focus:"fyvr12og",hover:"fyvr12oh",checked:"fyvr12oi"},defaultClass:"fyvr12od"},inherit:{conditions:{base:"fyvr12oj",active:"fyvr12ok",disabled:"fyvr12ol",focus:"fyvr12om",hover:"fyvr12on",checked:"fyvr12oo"},defaultClass:"fyvr12oj"},transparent:{conditions:{base:"fyvr12op",active:"fyvr12oq",disabled:"fyvr12or",focus:"fyvr12os",hover:"fyvr12ot",checked:"fyvr12ou"},defaultClass:"fyvr12op"},positive:{conditions:{base:"fyvr12ov",active:"fyvr12ow",disabled:"fyvr12ox",focus:"fyvr12oy",hover:"fyvr12oz",checked:"fyvr12p0"},defaultClass:"fyvr12ov"},negative:{conditions:{base:"fyvr12p1",active:"fyvr12p2",disabled:"fyvr12p3",focus:"fyvr12p4",hover:"fyvr12p5",checked:"fyvr12p6"},defaultClass:"fyvr12p1"},info:{conditions:{base:"fyvr12p7",active:"fyvr12p8",disabled:"fyvr12p9",focus:"fyvr12pa",hover:"fyvr12pb",checked:"fyvr12pc"},defaultClass:"fyvr12p7"},warning:{conditions:{base:"fyvr12pd",active:"fyvr12pe",disabled:"fyvr12pf",focus:"fyvr12pg",hover:"fyvr12ph",checked:"fyvr12pi"},defaultClass:"fyvr12pd"},gradientBackdrop:{conditions:{base:"fyvr12pj",active:"fyvr12pk",disabled:"fyvr12pl",focus:"fyvr12pm",hover:"fyvr12pn",checked:"fyvr12po"},defaultClass:"fyvr12pj"},gradientPrimary:{conditions:{base:"fyvr12pp",active:"fyvr12pq",disabled:"fyvr12pr",focus:"fyvr12ps",hover:"fyvr12pt",checked:"fyvr12pu"},defaultClass:"fyvr12pp"},gradientSecondary:{conditions:{base:"fyvr12pv",active:"fyvr12pw",disabled:"fyvr12px",focus:"fyvr12py",hover:"fyvr12pz",checked:"fyvr12q0"},defaultClass:"fyvr12pv"},arbitrumDark:{conditions:{base:"fyvr12q1",active:"fyvr12q2",disabled:"fyvr12q3",focus:"fyvr12q4",hover:"fyvr12q5",checked:"fyvr12q6"},defaultClass:"fyvr12q1"},arbitrumLight:{conditions:{base:"fyvr12q7",active:"fyvr12q8",disabled:"fyvr12q9",focus:"fyvr12qa",hover:"fyvr12qb",checked:"fyvr12qc"},defaultClass:"fyvr12q7"},avalanceDark:{conditions:{base:"fyvr12qd",active:"fyvr12qe",disabled:"fyvr12qf",focus:"fyvr12qg",hover:"fyvr12qh",checked:"fyvr12qi"},defaultClass:"fyvr12qd"},avalanceLight:{conditions:{base:"fyvr12qj",active:"fyvr12qk",disabled:"fyvr12ql",focus:"fyvr12qm",hover:"fyvr12qn",checked:"fyvr12qo"},defaultClass:"fyvr12qj"},bscDark:{conditions:{base:"fyvr12qp",active:"fyvr12qq",disabled:"fyvr12qr",focus:"fyvr12qs",hover:"fyvr12qt",checked:"fyvr12qu"},defaultClass:"fyvr12qp"},bscLight:{conditions:{base:"fyvr12qv",active:"fyvr12qw",disabled:"fyvr12qx",focus:"fyvr12qy",hover:"fyvr12qz",checked:"fyvr12r0"},defaultClass:"fyvr12qv"},ethereumDark:{conditions:{base:"fyvr12r1",active:"fyvr12r2",disabled:"fyvr12r3",focus:"fyvr12r4",hover:"fyvr12r5",checked:"fyvr12r6"},defaultClass:"fyvr12r1"},ethereumLight:{conditions:{base:"fyvr12r7",active:"fyvr12r8",disabled:"fyvr12r9",focus:"fyvr12ra",hover:"fyvr12rb",checked:"fyvr12rc"},defaultClass:"fyvr12r7"},gnosisDark:{conditions:{base:"fyvr12rd",active:"fyvr12re",disabled:"fyvr12rf",focus:"fyvr12rg",hover:"fyvr12rh",checked:"fyvr12ri"},defaultClass:"fyvr12rd"},gnosisLight:{conditions:{base:"fyvr12rj",active:"fyvr12rk",disabled:"fyvr12rl",focus:"fyvr12rm",hover:"fyvr12rn",checked:"fyvr12ro"},defaultClass:"fyvr12rj"},polygonDark:{conditions:{base:"fyvr12rp",active:"fyvr12rq",disabled:"fyvr12rr",focus:"fyvr12rs",hover:"fyvr12rt",checked:"fyvr12ru"},defaultClass:"fyvr12rp"},polygonLight:{conditions:{base:"fyvr12rv",active:"fyvr12rw",disabled:"fyvr12rx",focus:"fyvr12ry",hover:"fyvr12rz",checked:"fyvr12s0"},defaultClass:"fyvr12rv"},text100:{conditions:{base:"fyvr12s1",active:"fyvr12s2",disabled:"fyvr12s3",focus:"fyvr12s4",hover:"fyvr12s5",checked:"fyvr12s6"},defaultClass:"fyvr12s1"},text80:{conditions:{base:"fyvr12s7",active:"fyvr12s8",disabled:"fyvr12s9",focus:"fyvr12sa",hover:"fyvr12sb",checked:"fyvr12sc"},defaultClass:"fyvr12s7"},text50:{conditions:{base:"fyvr12sd",active:"fyvr12se",disabled:"fyvr12sf",focus:"fyvr12sg",hover:"fyvr12sh",checked:"fyvr12si"},defaultClass:"fyvr12sd"},textInverse100:{conditions:{base:"fyvr12sj",active:"fyvr12sk",disabled:"fyvr12sl",focus:"fyvr12sm",hover:"fyvr12sn",checked:"fyvr12so"},defaultClass:"fyvr12sj"},backgroundPrimary:{conditions:{base:"fyvr12sp",active:"fyvr12sq",disabled:"fyvr12sr",focus:"fyvr12ss",hover:"fyvr12st",checked:"fyvr12su"},defaultClass:"fyvr12sp"},backgroundSecondary:{conditions:{base:"fyvr12sv",active:"fyvr12sw",disabled:"fyvr12sx",focus:"fyvr12sy",hover:"fyvr12sz",checked:"fyvr12t0"},defaultClass:"fyvr12sv"},backgroundContrast:{conditions:{base:"fyvr12t1",active:"fyvr12t2",disabled:"fyvr12t3",focus:"fyvr12t4",hover:"fyvr12t5",checked:"fyvr12t6"},defaultClass:"fyvr12t1"},backgroundMuted:{conditions:{base:"fyvr12t7",active:"fyvr12t8",disabled:"fyvr12t9",focus:"fyvr12ta",hover:"fyvr12tb",checked:"fyvr12tc"},defaultClass:"fyvr12t7"},backgroundControl:{conditions:{base:"fyvr12td",active:"fyvr12te",disabled:"fyvr12tf",focus:"fyvr12tg",hover:"fyvr12th",checked:"fyvr12ti"},defaultClass:"fyvr12td"},backgroundInverse:{conditions:{base:"fyvr12tj",active:"fyvr12tk",disabled:"fyvr12tl",focus:"fyvr12tm",hover:"fyvr12tn",checked:"fyvr12to"},defaultClass:"fyvr12tj"},backgroundBackdrop:{conditions:{base:"fyvr12tp",active:"fyvr12tq",disabled:"fyvr12tr",focus:"fyvr12ts",hover:"fyvr12tt",checked:"fyvr12tu"},defaultClass:"fyvr12tp"},backgroundOverlay:{conditions:{base:"fyvr12tv",active:"fyvr12tw",disabled:"fyvr12tx",focus:"fyvr12ty",hover:"fyvr12tz",checked:"fyvr12u0"},defaultClass:"fyvr12tv"},backgroundRaised:{conditions:{base:"fyvr12u1",active:"fyvr12u2",disabled:"fyvr12u3",focus:"fyvr12u4",hover:"fyvr12u5",checked:"fyvr12u6"},defaultClass:"fyvr12u1"},buttonGlass:{conditions:{base:"fyvr12u7",active:"fyvr12u8",disabled:"fyvr12u9",focus:"fyvr12ua",hover:"fyvr12ub",checked:"fyvr12uc"},defaultClass:"fyvr12u7"},buttonEmphasis:{conditions:{base:"fyvr12ud",active:"fyvr12ue",disabled:"fyvr12uf",focus:"fyvr12ug",hover:"fyvr12uh",checked:"fyvr12ui"},defaultClass:"fyvr12ud"},buttonInverse:{conditions:{base:"fyvr12uj",active:"fyvr12uk",disabled:"fyvr12ul",focus:"fyvr12um",hover:"fyvr12un",checked:"fyvr12uo"},defaultClass:"fyvr12uj"},borderNormal:{conditions:{base:"fyvr12up",active:"fyvr12uq",disabled:"fyvr12ur",focus:"fyvr12us",hover:"fyvr12ut",checked:"fyvr12uu"},defaultClass:"fyvr12up"},borderFocus:{conditions:{base:"fyvr12uv",active:"fyvr12uw",disabled:"fyvr12ux",focus:"fyvr12uy",hover:"fyvr12uz",checked:"fyvr12v0"},defaultClass:"fyvr12uv"}}},cursor:{values:{default:{conditions:{base:"fyvr12v1",active:"fyvr12v2",disabled:"fyvr12v3",focus:"fyvr12v4",hover:"fyvr12v5",checked:"fyvr12v6"},defaultClass:"fyvr12v1"},pointer:{conditions:{base:"fyvr12v7",active:"fyvr12v8",disabled:"fyvr12v9",focus:"fyvr12va",hover:"fyvr12vb",checked:"fyvr12vc"},defaultClass:"fyvr12v7"},text:{conditions:{base:"fyvr12vd",active:"fyvr12ve",disabled:"fyvr12vf",focus:"fyvr12vg",hover:"fyvr12vh",checked:"fyvr12vi"},defaultClass:"fyvr12vd"}}},opacity:{values:{0:{conditions:{base:"fyvr12vj",active:"fyvr12vk",disabled:"fyvr12vl",focus:"fyvr12vm",hover:"fyvr12vn",checked:"fyvr12vo"},defaultClass:"fyvr12vj"},50:{conditions:{base:"fyvr12vp",active:"fyvr12vq",disabled:"fyvr12vr",focus:"fyvr12vs",hover:"fyvr12vt",checked:"fyvr12vu"},defaultClass:"fyvr12vp"},80:{conditions:{base:"fyvr12vv",active:"fyvr12vw",disabled:"fyvr12vx",focus:"fyvr12vy",hover:"fyvr12vz",checked:"fyvr12w0"},defaultClass:"fyvr12vv"},100:{conditions:{base:"fyvr12w1",active:"fyvr12w2",disabled:"fyvr12w3",focus:"fyvr12w4",hover:"fyvr12w5",checked:"fyvr12w6"},defaultClass:"fyvr12w1"}}},pointerEvents:{values:{none:{conditions:{base:"fyvr12w7",active:"fyvr12w8",disabled:"fyvr12w9",focus:"fyvr12wa",hover:"fyvr12wb",checked:"fyvr12wc"},defaultClass:"fyvr12w7"},auto:{conditions:{base:"fyvr12wd",active:"fyvr12we",disabled:"fyvr12wf",focus:"fyvr12wg",hover:"fyvr12wh",checked:"fyvr12wi"},defaultClass:"fyvr12wd"}}},outline:{values:{none:{conditions:{base:"fyvr12wj",active:"fyvr12wk",disabled:"fyvr12wl",focus:"fyvr12wm",hover:"fyvr12wn",checked:"fyvr12wo"},defaultClass:"fyvr12wj"}}},boxShadow:{values:{none:{conditions:{base:"fyvr12wp",active:"fyvr12wq",disabled:"fyvr12wr",focus:"fyvr12ws",hover:"fyvr12wt",checked:"fyvr12wu"},defaultClass:"fyvr12wp"}}}}});const ble=["alignItems","alignSelf","flexDirection","gap","justifyContent","justifySelf","placeItems"],r3=t=>(t.display||(t.display=Object.keys(t).some(e=>ble.includes(e))?"flex":void 0),Yj(t));r3.properties=Yj.properties;function Jj(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const{as:r="div",sx:n={},className:i,...s}=t,o={},a={};for(const l in s)r3.properties.has(l)?o[l]=s[l]:a[l]=s[l];const c=r3({...o,...n});return x.createElement(r,{className:di(c,i),...a,ref:e})});var Xj={exports:{}},Nh={};/** + )`,gradientPrimary:"linear-gradient(89.69deg, #4411E1 0.27%, #7537F9 99.73%)",gradientSecondary:"linear-gradient(32.51deg, #951990 -15.23%, #3A35B1 48.55%, #20A8B0 100%)",arbitrumDark:"#212D44",arbitrumLight:"#93D4FF",avalanceDark:"#810C0C",avalanceLight:"#FF8080",bscDark:"#584508",bscLight:"#FCCF43",ethereumDark:"#132362",ethereumLight:"#AABBFF",gnosisDark:"#084246",gnosisLight:"#8CF6FD",polygonDark:"#350881",polygonLight:"#C7A6FF"},Fce={...Tj,text100:"rgba(255, 255, 255, 1)",text80:"rgba(255, 255, 255, 0.8)",text50:"rgba(255, 255, 255, 0.5)",textInverse100:"rgba(0, 0, 0, 1)",backgroundPrimary:"rgba(0, 0, 0, 1)",backgroundSecondary:"rgba(255, 255, 255, 0.1)",backgroundContrast:"rgba(0, 0, 0, 0.5)",backgroundMuted:"rgba(255, 255, 255, 0.05)",backgroundControl:"rgba(255, 255, 255, 0.25)",backgroundInverse:"rgba(255, 255, 255, 1)",backgroundBackdrop:"rgba(34, 34, 34, 0.9)",backgroundOverlay:"rgba(0, 0, 0, 0.7)",backgroundRaised:"rgba(54, 54, 54, 0.7)",buttonGlass:"rgba(255, 255, 255, 0.15)",buttonEmphasis:"rgba(0, 0, 0, 0.5)",buttonInverse:"rgba(255, 255, 255, 0.8)",borderNormal:"rgba(255, 255, 255, 0.25)",borderFocus:"rgba(255, 255, 255, 0.5)"},Uce={...Tj,text100:"rgba(0, 0, 0, 1)",text80:"rgba(0, 0, 0, 0.8)",text50:"rgba(0, 0, 0, 0.5)",textInverse100:"rgba(255, 255, 255, 1)",backgroundPrimary:"rgba(244, 244, 244, 1)",backgroundSecondary:"rgba(0, 0, 0, 0.1)",backgroundContrast:"rgba(244, 244, 244, 0.5)",backgroundMuted:"rgba(0, 0, 0, 0.05)",backgroundControl:"rgba(0, 0, 0, 0.25)",backgroundInverse:"rgba(0, 0, 0, 1)",backgroundBackdrop:"rgba(221, 221, 221, 0.9)",backgroundOverlay:"rgba(244, 244, 244, 0.7)",backgroundRaised:"rgba(192, 192, 192, 0.7)",buttonGlass:"rgba(0, 0, 0, 0.15)",buttonEmphasis:"rgba(255, 255, 255, 0.5)",buttonInverse:"rgba(0, 0, 0, 0.8)",borderNormal:"rgba(0, 0, 0, 0.25)",borderFocus:"rgba(0, 0, 0, 0.5)"},zce={dark:Fce,light:Uce},qce={inherit:{fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit"},xlarge:{fontFamily:"body",fontSize:"xlarge",lineHeight:"9",letterSpacing:"none",fontWeight:"bold"},large:{fontFamily:"body",fontSize:"large",lineHeight:"7",letterSpacing:"normal",fontWeight:"semibold"},medium:{fontFamily:"body",fontSize:"medium",lineHeight:"6",letterSpacing:"normal",fontWeight:"bold"},normal:{fontFamily:"body",fontSize:"normal",lineHeight:"5",letterSpacing:"wide",fontWeight:"normal"},small:{fontFamily:"body",fontSize:"small",lineHeight:"4",letterSpacing:"wide",fontWeight:"medium"},xsmall:{fontFamily:"body",fontSize:"xsmall",lineHeight:"4",letterSpacing:"wide",fontWeight:"bold"},code:{fontFamily:"mono",fontSize:"normal",lineHeight:"5",letterSpacing:"none",fontWeight:"normal"}},yA={sm:0,md:480,lg:769,xl:1281};var gA={colors:{black:"var(--seq-colors-black)",white:"var(--seq-colors-white)",inherit:"var(--seq-colors-inherit)",transparent:"var(--seq-colors-transparent)",positive:"var(--seq-colors-positive)",negative:"var(--seq-colors-negative)",info:"var(--seq-colors-info)",warning:"var(--seq-colors-warning)",gradientBackdrop:"var(--seq-colors-gradient-backdrop)",gradientPrimary:"var(--seq-colors-gradient-primary)",gradientSecondary:"var(--seq-colors-gradient-secondary)",arbitrumDark:"var(--seq-colors-arbitrum-dark)",arbitrumLight:"var(--seq-colors-arbitrum-light)",avalanceDark:"var(--seq-colors-avalance-dark)",avalanceLight:"var(--seq-colors-avalance-light)",bscDark:"var(--seq-colors-bsc-dark)",bscLight:"var(--seq-colors-bsc-light)",ethereumDark:"var(--seq-colors-ethereum-dark)",ethereumLight:"var(--seq-colors-ethereum-light)",gnosisDark:"var(--seq-colors-gnosis-dark)",gnosisLight:"var(--seq-colors-gnosis-light)",polygonDark:"var(--seq-colors-polygon-dark)",polygonLight:"var(--seq-colors-polygon-light)",text100:"var(--seq-colors-text100)",text80:"var(--seq-colors-text80)",text50:"var(--seq-colors-text50)",textInverse100:"var(--seq-colors-text-inverse100)",backgroundPrimary:"var(--seq-colors-background-primary)",backgroundSecondary:"var(--seq-colors-background-secondary)",backgroundContrast:"var(--seq-colors-background-contrast)",backgroundMuted:"var(--seq-colors-background-muted)",backgroundControl:"var(--seq-colors-background-control)",backgroundInverse:"var(--seq-colors-background-inverse)",backgroundBackdrop:"var(--seq-colors-background-backdrop)",backgroundOverlay:"var(--seq-colors-background-overlay)",backgroundRaised:"var(--seq-colors-background-raised)",buttonGlass:"var(--seq-colors-button-glass)",buttonEmphasis:"var(--seq-colors-button-emphasis)",buttonInverse:"var(--seq-colors-button-inverse)",borderNormal:"var(--seq-colors-border-normal)",borderFocus:"var(--seq-colors-border-focus)"}},Te={blur:{blur:"var(--seq-blur-blur)",none:"var(--seq-blur-none)"},borderWidths:{none:"var(--seq-border-widths-none)",thin:"var(--seq-border-widths-thin)",thick:"var(--seq-border-widths-thick)"},fonts:{inherit:"var(--seq-fonts-inherit)",body:"var(--seq-fonts-body)",mono:"var(--seq-fonts-mono)"},fontSizes:{inherit:"var(--seq-font-sizes-inherit)",xsmall:"var(--seq-font-sizes-xsmall)",small:"var(--seq-font-sizes-small)",normal:"var(--seq-font-sizes-normal)",medium:"var(--seq-font-sizes-medium)",large:"var(--seq-font-sizes-large)",xlarge:"var(--seq-font-sizes-xlarge)"},fontWeights:{inherit:"var(--seq-font-weights-inherit)",normal:"var(--seq-font-weights-normal)",medium:"var(--seq-font-weights-medium)",semibold:"var(--seq-font-weights-semibold)",bold:"var(--seq-font-weights-bold)"},letterSpacings:{inherit:"var(--seq-letter-spacings-inherit)",none:"var(--seq-letter-spacings-none)",normal:"var(--seq-letter-spacings-normal)",wide:"var(--seq-letter-spacings-wide)"},lineHeights:{4:"var(--seq-line-heights-4)",5:"var(--seq-line-heights-5)",6:"var(--seq-line-heights-6)",7:"var(--seq-line-heights-7)",9:"var(--seq-line-heights-9)",inherit:"var(--seq-line-heights-inherit)"},opacity:{0:"var(--seq-opacity-0)",50:"var(--seq-opacity-50)",80:"var(--seq-opacity-80)",100:"var(--seq-opacity-100)"},radii:{none:"var(--seq-radii-none)",xs:"var(--seq-radii-xs)",sm:"var(--seq-radii-sm)",md:"var(--seq-radii-md)",lg:"var(--seq-radii-lg)",circle:"var(--seq-radii-circle)"},space:{0:"var(--seq-space-0)",1:"var(--seq-space-1)",2:"var(--seq-space-2)",3:"var(--seq-space-3)",4:"var(--seq-space-4)",5:"var(--seq-space-5)",6:"var(--seq-space-6)",7:"var(--seq-space-7)",8:"var(--seq-space-8)",9:"var(--seq-space-9)",10:"var(--seq-space-10)",12:"var(--seq-space-12)",14:"var(--seq-space-14)",16:"var(--seq-space-16)","0.25":"var(--seq-space-0_25)","0.5":"var(--seq-space-0_5)","1.5":"var(--seq-space-1_5)"},colors:{black:"var(--seq-colors-black)",white:"var(--seq-colors-white)",inherit:"var(--seq-colors-inherit)",transparent:"var(--seq-colors-transparent)",positive:"var(--seq-colors-positive)",negative:"var(--seq-colors-negative)",info:"var(--seq-colors-info)",warning:"var(--seq-colors-warning)",gradientBackdrop:"var(--seq-colors-gradient-backdrop)",gradientPrimary:"var(--seq-colors-gradient-primary)",gradientSecondary:"var(--seq-colors-gradient-secondary)",arbitrumDark:"var(--seq-colors-arbitrum-dark)",arbitrumLight:"var(--seq-colors-arbitrum-light)",avalanceDark:"var(--seq-colors-avalance-dark)",avalanceLight:"var(--seq-colors-avalance-light)",bscDark:"var(--seq-colors-bsc-dark)",bscLight:"var(--seq-colors-bsc-light)",ethereumDark:"var(--seq-colors-ethereum-dark)",ethereumLight:"var(--seq-colors-ethereum-light)",gnosisDark:"var(--seq-colors-gnosis-dark)",gnosisLight:"var(--seq-colors-gnosis-light)",polygonDark:"var(--seq-colors-polygon-dark)",polygonLight:"var(--seq-colors-polygon-light)",text100:"var(--seq-colors-text100)",text80:"var(--seq-colors-text80)",text50:"var(--seq-colors-text50)",textInverse100:"var(--seq-colors-text-inverse100)",backgroundPrimary:"var(--seq-colors-background-primary)",backgroundSecondary:"var(--seq-colors-background-secondary)",backgroundContrast:"var(--seq-colors-background-contrast)",backgroundMuted:"var(--seq-colors-background-muted)",backgroundControl:"var(--seq-colors-background-control)",backgroundInverse:"var(--seq-colors-background-inverse)",backgroundBackdrop:"var(--seq-colors-background-backdrop)",backgroundOverlay:"var(--seq-colors-background-overlay)",backgroundRaised:"var(--seq-colors-background-raised)",buttonGlass:"var(--seq-colors-button-glass)",buttonEmphasis:"var(--seq-colors-button-emphasis)",buttonInverse:"var(--seq-colors-button-inverse)",borderNormal:"var(--seq-colors-border-normal)",borderFocus:"var(--seq-colors-border-focus)"}};function Wce(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hce(t){var e=Wce(t,"string");return typeof e=="symbol"?e:String(e)}function Vce(t,e,r){return e=Hce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Zx(t){for(var e=1;efunction(){for(var e=arguments.length,r=new Array(e),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),a=c=>{var l=[],u={},f=Zx({},c),d=!1;for(var h of o){var p=c[h];if(p!=null){var m=i[h];d=!0;for(var v of m.mappings)u[v]=p,f[v]==null&&delete f[v]}}var y=d?Zx(Zx({},u),f):c,b=function(){var M=y[E],L=i[E];try{if(L.mappings)return"continue";if(typeof M=="string"||typeof M=="number")l.push(L.values[M].defaultClass);else if(Array.isArray(M))for(var j=0;jt,Qce=function(){return Gce(Kce)(...arguments)},Oj=Qce({conditions:{defaultCondition:"sm",conditionNames:["sm","md","lg","xl"],responsiveArray:void 0},styles:{borderWidth:{mappings:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"]},borderRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderLeftRadius:{mappings:["borderBottomLeftRadius","borderTopLeftRadius"]},borderRightRadius:{mappings:["borderBottomRightRadius","borderTopRightRadius"]},borderTopRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius"]},borderBottomRadius:{mappings:["borderBottomLeftRadius","borderBottomRightRadius"]},margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},overflow:{mappings:["overflowX","overflowY"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},placeItems:{mappings:["justifyContent","alignItems"]},inset:{mappings:["top","bottom","left","right"]},width:{values:{0:{conditions:{sm:"fyvr10",md:"fyvr11",lg:"fyvr12",xl:"fyvr13"},defaultClass:"fyvr10"},1:{conditions:{sm:"fyvr14",md:"fyvr15",lg:"fyvr16",xl:"fyvr17"},defaultClass:"fyvr14"},2:{conditions:{sm:"fyvr18",md:"fyvr19",lg:"fyvr1a",xl:"fyvr1b"},defaultClass:"fyvr18"},3:{conditions:{sm:"fyvr1c",md:"fyvr1d",lg:"fyvr1e",xl:"fyvr1f"},defaultClass:"fyvr1c"},4:{conditions:{sm:"fyvr1g",md:"fyvr1h",lg:"fyvr1i",xl:"fyvr1j"},defaultClass:"fyvr1g"},5:{conditions:{sm:"fyvr1k",md:"fyvr1l",lg:"fyvr1m",xl:"fyvr1n"},defaultClass:"fyvr1k"},6:{conditions:{sm:"fyvr1o",md:"fyvr1p",lg:"fyvr1q",xl:"fyvr1r"},defaultClass:"fyvr1o"},7:{conditions:{sm:"fyvr1s",md:"fyvr1t",lg:"fyvr1u",xl:"fyvr1v"},defaultClass:"fyvr1s"},8:{conditions:{sm:"fyvr1w",md:"fyvr1x",lg:"fyvr1y",xl:"fyvr1z"},defaultClass:"fyvr1w"},9:{conditions:{sm:"fyvr110",md:"fyvr111",lg:"fyvr112",xl:"fyvr113"},defaultClass:"fyvr110"},10:{conditions:{sm:"fyvr114",md:"fyvr115",lg:"fyvr116",xl:"fyvr117"},defaultClass:"fyvr114"},12:{conditions:{sm:"fyvr118",md:"fyvr119",lg:"fyvr11a",xl:"fyvr11b"},defaultClass:"fyvr118"},14:{conditions:{sm:"fyvr11c",md:"fyvr11d",lg:"fyvr11e",xl:"fyvr11f"},defaultClass:"fyvr11c"},16:{conditions:{sm:"fyvr11g",md:"fyvr11h",lg:"fyvr11i",xl:"fyvr11j"},defaultClass:"fyvr11g"},"0.25":{conditions:{sm:"fyvr11k",md:"fyvr11l",lg:"fyvr11m",xl:"fyvr11n"},defaultClass:"fyvr11k"},"0.5":{conditions:{sm:"fyvr11o",md:"fyvr11p",lg:"fyvr11q",xl:"fyvr11r"},defaultClass:"fyvr11o"},"1.5":{conditions:{sm:"fyvr11s",md:"fyvr11t",lg:"fyvr11u",xl:"fyvr11v"},defaultClass:"fyvr11s"},none:{conditions:{sm:"fyvr11w",md:"fyvr11x",lg:"fyvr11y",xl:"fyvr11z"},defaultClass:"fyvr11w"},px:{conditions:{sm:"fyvr120",md:"fyvr121",lg:"fyvr122",xl:"fyvr123"},defaultClass:"fyvr120"},auto:{conditions:{sm:"fyvr124",md:"fyvr125",lg:"fyvr126",xl:"fyvr127"},defaultClass:"fyvr124"},full:{conditions:{sm:"fyvr128",md:"fyvr129",lg:"fyvr12a",xl:"fyvr12b"},defaultClass:"fyvr128"},"1/2":{conditions:{sm:"fyvr12c",md:"fyvr12d",lg:"fyvr12e",xl:"fyvr12f"},defaultClass:"fyvr12c"},"1/3":{conditions:{sm:"fyvr12g",md:"fyvr12h",lg:"fyvr12i",xl:"fyvr12j"},defaultClass:"fyvr12g"},"2/3":{conditions:{sm:"fyvr12k",md:"fyvr12l",lg:"fyvr12m",xl:"fyvr12n"},defaultClass:"fyvr12k"},"1/4":{conditions:{sm:"fyvr12o",md:"fyvr12p",lg:"fyvr12q",xl:"fyvr12r"},defaultClass:"fyvr12o"},"3/4":{conditions:{sm:"fyvr12s",md:"fyvr12t",lg:"fyvr12u",xl:"fyvr12v"},defaultClass:"fyvr12s"},fit:{conditions:{sm:"fyvr12w",md:"fyvr12x",lg:"fyvr12y",xl:"fyvr12z"},defaultClass:"fyvr12w"},max:{conditions:{sm:"fyvr130",md:"fyvr131",lg:"fyvr132",xl:"fyvr133"},defaultClass:"fyvr130"},min:{conditions:{sm:"fyvr134",md:"fyvr135",lg:"fyvr136",xl:"fyvr137"},defaultClass:"fyvr134"},vw:{conditions:{sm:"fyvr138",md:"fyvr139",lg:"fyvr13a",xl:"fyvr13b"},defaultClass:"fyvr138"},vh:{conditions:{sm:"fyvr13c",md:"fyvr13d",lg:"fyvr13e",xl:"fyvr13f"},defaultClass:"fyvr13c"}}},height:{values:{0:{conditions:{sm:"fyvr13g",md:"fyvr13h",lg:"fyvr13i",xl:"fyvr13j"},defaultClass:"fyvr13g"},1:{conditions:{sm:"fyvr13k",md:"fyvr13l",lg:"fyvr13m",xl:"fyvr13n"},defaultClass:"fyvr13k"},2:{conditions:{sm:"fyvr13o",md:"fyvr13p",lg:"fyvr13q",xl:"fyvr13r"},defaultClass:"fyvr13o"},3:{conditions:{sm:"fyvr13s",md:"fyvr13t",lg:"fyvr13u",xl:"fyvr13v"},defaultClass:"fyvr13s"},4:{conditions:{sm:"fyvr13w",md:"fyvr13x",lg:"fyvr13y",xl:"fyvr13z"},defaultClass:"fyvr13w"},5:{conditions:{sm:"fyvr140",md:"fyvr141",lg:"fyvr142",xl:"fyvr143"},defaultClass:"fyvr140"},6:{conditions:{sm:"fyvr144",md:"fyvr145",lg:"fyvr146",xl:"fyvr147"},defaultClass:"fyvr144"},7:{conditions:{sm:"fyvr148",md:"fyvr149",lg:"fyvr14a",xl:"fyvr14b"},defaultClass:"fyvr148"},8:{conditions:{sm:"fyvr14c",md:"fyvr14d",lg:"fyvr14e",xl:"fyvr14f"},defaultClass:"fyvr14c"},9:{conditions:{sm:"fyvr14g",md:"fyvr14h",lg:"fyvr14i",xl:"fyvr14j"},defaultClass:"fyvr14g"},10:{conditions:{sm:"fyvr14k",md:"fyvr14l",lg:"fyvr14m",xl:"fyvr14n"},defaultClass:"fyvr14k"},12:{conditions:{sm:"fyvr14o",md:"fyvr14p",lg:"fyvr14q",xl:"fyvr14r"},defaultClass:"fyvr14o"},14:{conditions:{sm:"fyvr14s",md:"fyvr14t",lg:"fyvr14u",xl:"fyvr14v"},defaultClass:"fyvr14s"},16:{conditions:{sm:"fyvr14w",md:"fyvr14x",lg:"fyvr14y",xl:"fyvr14z"},defaultClass:"fyvr14w"},"0.25":{conditions:{sm:"fyvr150",md:"fyvr151",lg:"fyvr152",xl:"fyvr153"},defaultClass:"fyvr150"},"0.5":{conditions:{sm:"fyvr154",md:"fyvr155",lg:"fyvr156",xl:"fyvr157"},defaultClass:"fyvr154"},"1.5":{conditions:{sm:"fyvr158",md:"fyvr159",lg:"fyvr15a",xl:"fyvr15b"},defaultClass:"fyvr158"},none:{conditions:{sm:"fyvr15c",md:"fyvr15d",lg:"fyvr15e",xl:"fyvr15f"},defaultClass:"fyvr15c"},px:{conditions:{sm:"fyvr15g",md:"fyvr15h",lg:"fyvr15i",xl:"fyvr15j"},defaultClass:"fyvr15g"},auto:{conditions:{sm:"fyvr15k",md:"fyvr15l",lg:"fyvr15m",xl:"fyvr15n"},defaultClass:"fyvr15k"},full:{conditions:{sm:"fyvr15o",md:"fyvr15p",lg:"fyvr15q",xl:"fyvr15r"},defaultClass:"fyvr15o"},"1/2":{conditions:{sm:"fyvr15s",md:"fyvr15t",lg:"fyvr15u",xl:"fyvr15v"},defaultClass:"fyvr15s"},"1/3":{conditions:{sm:"fyvr15w",md:"fyvr15x",lg:"fyvr15y",xl:"fyvr15z"},defaultClass:"fyvr15w"},"2/3":{conditions:{sm:"fyvr160",md:"fyvr161",lg:"fyvr162",xl:"fyvr163"},defaultClass:"fyvr160"},"1/4":{conditions:{sm:"fyvr164",md:"fyvr165",lg:"fyvr166",xl:"fyvr167"},defaultClass:"fyvr164"},"3/4":{conditions:{sm:"fyvr168",md:"fyvr169",lg:"fyvr16a",xl:"fyvr16b"},defaultClass:"fyvr168"},fit:{conditions:{sm:"fyvr16c",md:"fyvr16d",lg:"fyvr16e",xl:"fyvr16f"},defaultClass:"fyvr16c"},max:{conditions:{sm:"fyvr16g",md:"fyvr16h",lg:"fyvr16i",xl:"fyvr16j"},defaultClass:"fyvr16g"},min:{conditions:{sm:"fyvr16k",md:"fyvr16l",lg:"fyvr16m",xl:"fyvr16n"},defaultClass:"fyvr16k"},vw:{conditions:{sm:"fyvr16o",md:"fyvr16p",lg:"fyvr16q",xl:"fyvr16r"},defaultClass:"fyvr16o"},vh:{conditions:{sm:"fyvr16s",md:"fyvr16t",lg:"fyvr16u",xl:"fyvr16v"},defaultClass:"fyvr16s"}}},maxWidth:{values:{0:{conditions:{sm:"fyvr16w",md:"fyvr16x",lg:"fyvr16y",xl:"fyvr16z"},defaultClass:"fyvr16w"},1:{conditions:{sm:"fyvr170",md:"fyvr171",lg:"fyvr172",xl:"fyvr173"},defaultClass:"fyvr170"},2:{conditions:{sm:"fyvr174",md:"fyvr175",lg:"fyvr176",xl:"fyvr177"},defaultClass:"fyvr174"},3:{conditions:{sm:"fyvr178",md:"fyvr179",lg:"fyvr17a",xl:"fyvr17b"},defaultClass:"fyvr178"},4:{conditions:{sm:"fyvr17c",md:"fyvr17d",lg:"fyvr17e",xl:"fyvr17f"},defaultClass:"fyvr17c"},5:{conditions:{sm:"fyvr17g",md:"fyvr17h",lg:"fyvr17i",xl:"fyvr17j"},defaultClass:"fyvr17g"},6:{conditions:{sm:"fyvr17k",md:"fyvr17l",lg:"fyvr17m",xl:"fyvr17n"},defaultClass:"fyvr17k"},7:{conditions:{sm:"fyvr17o",md:"fyvr17p",lg:"fyvr17q",xl:"fyvr17r"},defaultClass:"fyvr17o"},8:{conditions:{sm:"fyvr17s",md:"fyvr17t",lg:"fyvr17u",xl:"fyvr17v"},defaultClass:"fyvr17s"},9:{conditions:{sm:"fyvr17w",md:"fyvr17x",lg:"fyvr17y",xl:"fyvr17z"},defaultClass:"fyvr17w"},10:{conditions:{sm:"fyvr180",md:"fyvr181",lg:"fyvr182",xl:"fyvr183"},defaultClass:"fyvr180"},12:{conditions:{sm:"fyvr184",md:"fyvr185",lg:"fyvr186",xl:"fyvr187"},defaultClass:"fyvr184"},14:{conditions:{sm:"fyvr188",md:"fyvr189",lg:"fyvr18a",xl:"fyvr18b"},defaultClass:"fyvr188"},16:{conditions:{sm:"fyvr18c",md:"fyvr18d",lg:"fyvr18e",xl:"fyvr18f"},defaultClass:"fyvr18c"},"0.25":{conditions:{sm:"fyvr18g",md:"fyvr18h",lg:"fyvr18i",xl:"fyvr18j"},defaultClass:"fyvr18g"},"0.5":{conditions:{sm:"fyvr18k",md:"fyvr18l",lg:"fyvr18m",xl:"fyvr18n"},defaultClass:"fyvr18k"},"1.5":{conditions:{sm:"fyvr18o",md:"fyvr18p",lg:"fyvr18q",xl:"fyvr18r"},defaultClass:"fyvr18o"},none:{conditions:{sm:"fyvr18s",md:"fyvr18t",lg:"fyvr18u",xl:"fyvr18v"},defaultClass:"fyvr18s"},px:{conditions:{sm:"fyvr18w",md:"fyvr18x",lg:"fyvr18y",xl:"fyvr18z"},defaultClass:"fyvr18w"},auto:{conditions:{sm:"fyvr190",md:"fyvr191",lg:"fyvr192",xl:"fyvr193"},defaultClass:"fyvr190"},full:{conditions:{sm:"fyvr194",md:"fyvr195",lg:"fyvr196",xl:"fyvr197"},defaultClass:"fyvr194"},"1/2":{conditions:{sm:"fyvr198",md:"fyvr199",lg:"fyvr19a",xl:"fyvr19b"},defaultClass:"fyvr198"},"1/3":{conditions:{sm:"fyvr19c",md:"fyvr19d",lg:"fyvr19e",xl:"fyvr19f"},defaultClass:"fyvr19c"},"2/3":{conditions:{sm:"fyvr19g",md:"fyvr19h",lg:"fyvr19i",xl:"fyvr19j"},defaultClass:"fyvr19g"},"1/4":{conditions:{sm:"fyvr19k",md:"fyvr19l",lg:"fyvr19m",xl:"fyvr19n"},defaultClass:"fyvr19k"},"3/4":{conditions:{sm:"fyvr19o",md:"fyvr19p",lg:"fyvr19q",xl:"fyvr19r"},defaultClass:"fyvr19o"},fit:{conditions:{sm:"fyvr19s",md:"fyvr19t",lg:"fyvr19u",xl:"fyvr19v"},defaultClass:"fyvr19s"},max:{conditions:{sm:"fyvr19w",md:"fyvr19x",lg:"fyvr19y",xl:"fyvr19z"},defaultClass:"fyvr19w"},min:{conditions:{sm:"fyvr1a0",md:"fyvr1a1",lg:"fyvr1a2",xl:"fyvr1a3"},defaultClass:"fyvr1a0"},vw:{conditions:{sm:"fyvr1a4",md:"fyvr1a5",lg:"fyvr1a6",xl:"fyvr1a7"},defaultClass:"fyvr1a4"},vh:{conditions:{sm:"fyvr1a8",md:"fyvr1a9",lg:"fyvr1aa",xl:"fyvr1ab"},defaultClass:"fyvr1a8"}}},maxHeight:{values:{0:{conditions:{sm:"fyvr1ac",md:"fyvr1ad",lg:"fyvr1ae",xl:"fyvr1af"},defaultClass:"fyvr1ac"},1:{conditions:{sm:"fyvr1ag",md:"fyvr1ah",lg:"fyvr1ai",xl:"fyvr1aj"},defaultClass:"fyvr1ag"},2:{conditions:{sm:"fyvr1ak",md:"fyvr1al",lg:"fyvr1am",xl:"fyvr1an"},defaultClass:"fyvr1ak"},3:{conditions:{sm:"fyvr1ao",md:"fyvr1ap",lg:"fyvr1aq",xl:"fyvr1ar"},defaultClass:"fyvr1ao"},4:{conditions:{sm:"fyvr1as",md:"fyvr1at",lg:"fyvr1au",xl:"fyvr1av"},defaultClass:"fyvr1as"},5:{conditions:{sm:"fyvr1aw",md:"fyvr1ax",lg:"fyvr1ay",xl:"fyvr1az"},defaultClass:"fyvr1aw"},6:{conditions:{sm:"fyvr1b0",md:"fyvr1b1",lg:"fyvr1b2",xl:"fyvr1b3"},defaultClass:"fyvr1b0"},7:{conditions:{sm:"fyvr1b4",md:"fyvr1b5",lg:"fyvr1b6",xl:"fyvr1b7"},defaultClass:"fyvr1b4"},8:{conditions:{sm:"fyvr1b8",md:"fyvr1b9",lg:"fyvr1ba",xl:"fyvr1bb"},defaultClass:"fyvr1b8"},9:{conditions:{sm:"fyvr1bc",md:"fyvr1bd",lg:"fyvr1be",xl:"fyvr1bf"},defaultClass:"fyvr1bc"},10:{conditions:{sm:"fyvr1bg",md:"fyvr1bh",lg:"fyvr1bi",xl:"fyvr1bj"},defaultClass:"fyvr1bg"},12:{conditions:{sm:"fyvr1bk",md:"fyvr1bl",lg:"fyvr1bm",xl:"fyvr1bn"},defaultClass:"fyvr1bk"},14:{conditions:{sm:"fyvr1bo",md:"fyvr1bp",lg:"fyvr1bq",xl:"fyvr1br"},defaultClass:"fyvr1bo"},16:{conditions:{sm:"fyvr1bs",md:"fyvr1bt",lg:"fyvr1bu",xl:"fyvr1bv"},defaultClass:"fyvr1bs"},"0.25":{conditions:{sm:"fyvr1bw",md:"fyvr1bx",lg:"fyvr1by",xl:"fyvr1bz"},defaultClass:"fyvr1bw"},"0.5":{conditions:{sm:"fyvr1c0",md:"fyvr1c1",lg:"fyvr1c2",xl:"fyvr1c3"},defaultClass:"fyvr1c0"},"1.5":{conditions:{sm:"fyvr1c4",md:"fyvr1c5",lg:"fyvr1c6",xl:"fyvr1c7"},defaultClass:"fyvr1c4"},none:{conditions:{sm:"fyvr1c8",md:"fyvr1c9",lg:"fyvr1ca",xl:"fyvr1cb"},defaultClass:"fyvr1c8"},px:{conditions:{sm:"fyvr1cc",md:"fyvr1cd",lg:"fyvr1ce",xl:"fyvr1cf"},defaultClass:"fyvr1cc"},auto:{conditions:{sm:"fyvr1cg",md:"fyvr1ch",lg:"fyvr1ci",xl:"fyvr1cj"},defaultClass:"fyvr1cg"},full:{conditions:{sm:"fyvr1ck",md:"fyvr1cl",lg:"fyvr1cm",xl:"fyvr1cn"},defaultClass:"fyvr1ck"},"1/2":{conditions:{sm:"fyvr1co",md:"fyvr1cp",lg:"fyvr1cq",xl:"fyvr1cr"},defaultClass:"fyvr1co"},"1/3":{conditions:{sm:"fyvr1cs",md:"fyvr1ct",lg:"fyvr1cu",xl:"fyvr1cv"},defaultClass:"fyvr1cs"},"2/3":{conditions:{sm:"fyvr1cw",md:"fyvr1cx",lg:"fyvr1cy",xl:"fyvr1cz"},defaultClass:"fyvr1cw"},"1/4":{conditions:{sm:"fyvr1d0",md:"fyvr1d1",lg:"fyvr1d2",xl:"fyvr1d3"},defaultClass:"fyvr1d0"},"3/4":{conditions:{sm:"fyvr1d4",md:"fyvr1d5",lg:"fyvr1d6",xl:"fyvr1d7"},defaultClass:"fyvr1d4"},fit:{conditions:{sm:"fyvr1d8",md:"fyvr1d9",lg:"fyvr1da",xl:"fyvr1db"},defaultClass:"fyvr1d8"},max:{conditions:{sm:"fyvr1dc",md:"fyvr1dd",lg:"fyvr1de",xl:"fyvr1df"},defaultClass:"fyvr1dc"},min:{conditions:{sm:"fyvr1dg",md:"fyvr1dh",lg:"fyvr1di",xl:"fyvr1dj"},defaultClass:"fyvr1dg"},vw:{conditions:{sm:"fyvr1dk",md:"fyvr1dl",lg:"fyvr1dm",xl:"fyvr1dn"},defaultClass:"fyvr1dk"},vh:{conditions:{sm:"fyvr1do",md:"fyvr1dp",lg:"fyvr1dq",xl:"fyvr1dr"},defaultClass:"fyvr1do"}}},minWidth:{values:{0:{conditions:{sm:"fyvr1ds",md:"fyvr1dt",lg:"fyvr1du",xl:"fyvr1dv"},defaultClass:"fyvr1ds"},1:{conditions:{sm:"fyvr1dw",md:"fyvr1dx",lg:"fyvr1dy",xl:"fyvr1dz"},defaultClass:"fyvr1dw"},2:{conditions:{sm:"fyvr1e0",md:"fyvr1e1",lg:"fyvr1e2",xl:"fyvr1e3"},defaultClass:"fyvr1e0"},3:{conditions:{sm:"fyvr1e4",md:"fyvr1e5",lg:"fyvr1e6",xl:"fyvr1e7"},defaultClass:"fyvr1e4"},4:{conditions:{sm:"fyvr1e8",md:"fyvr1e9",lg:"fyvr1ea",xl:"fyvr1eb"},defaultClass:"fyvr1e8"},5:{conditions:{sm:"fyvr1ec",md:"fyvr1ed",lg:"fyvr1ee",xl:"fyvr1ef"},defaultClass:"fyvr1ec"},6:{conditions:{sm:"fyvr1eg",md:"fyvr1eh",lg:"fyvr1ei",xl:"fyvr1ej"},defaultClass:"fyvr1eg"},7:{conditions:{sm:"fyvr1ek",md:"fyvr1el",lg:"fyvr1em",xl:"fyvr1en"},defaultClass:"fyvr1ek"},8:{conditions:{sm:"fyvr1eo",md:"fyvr1ep",lg:"fyvr1eq",xl:"fyvr1er"},defaultClass:"fyvr1eo"},9:{conditions:{sm:"fyvr1es",md:"fyvr1et",lg:"fyvr1eu",xl:"fyvr1ev"},defaultClass:"fyvr1es"},10:{conditions:{sm:"fyvr1ew",md:"fyvr1ex",lg:"fyvr1ey",xl:"fyvr1ez"},defaultClass:"fyvr1ew"},12:{conditions:{sm:"fyvr1f0",md:"fyvr1f1",lg:"fyvr1f2",xl:"fyvr1f3"},defaultClass:"fyvr1f0"},14:{conditions:{sm:"fyvr1f4",md:"fyvr1f5",lg:"fyvr1f6",xl:"fyvr1f7"},defaultClass:"fyvr1f4"},16:{conditions:{sm:"fyvr1f8",md:"fyvr1f9",lg:"fyvr1fa",xl:"fyvr1fb"},defaultClass:"fyvr1f8"},"0.25":{conditions:{sm:"fyvr1fc",md:"fyvr1fd",lg:"fyvr1fe",xl:"fyvr1ff"},defaultClass:"fyvr1fc"},"0.5":{conditions:{sm:"fyvr1fg",md:"fyvr1fh",lg:"fyvr1fi",xl:"fyvr1fj"},defaultClass:"fyvr1fg"},"1.5":{conditions:{sm:"fyvr1fk",md:"fyvr1fl",lg:"fyvr1fm",xl:"fyvr1fn"},defaultClass:"fyvr1fk"},none:{conditions:{sm:"fyvr1fo",md:"fyvr1fp",lg:"fyvr1fq",xl:"fyvr1fr"},defaultClass:"fyvr1fo"},px:{conditions:{sm:"fyvr1fs",md:"fyvr1ft",lg:"fyvr1fu",xl:"fyvr1fv"},defaultClass:"fyvr1fs"},auto:{conditions:{sm:"fyvr1fw",md:"fyvr1fx",lg:"fyvr1fy",xl:"fyvr1fz"},defaultClass:"fyvr1fw"},full:{conditions:{sm:"fyvr1g0",md:"fyvr1g1",lg:"fyvr1g2",xl:"fyvr1g3"},defaultClass:"fyvr1g0"},"1/2":{conditions:{sm:"fyvr1g4",md:"fyvr1g5",lg:"fyvr1g6",xl:"fyvr1g7"},defaultClass:"fyvr1g4"},"1/3":{conditions:{sm:"fyvr1g8",md:"fyvr1g9",lg:"fyvr1ga",xl:"fyvr1gb"},defaultClass:"fyvr1g8"},"2/3":{conditions:{sm:"fyvr1gc",md:"fyvr1gd",lg:"fyvr1ge",xl:"fyvr1gf"},defaultClass:"fyvr1gc"},"1/4":{conditions:{sm:"fyvr1gg",md:"fyvr1gh",lg:"fyvr1gi",xl:"fyvr1gj"},defaultClass:"fyvr1gg"},"3/4":{conditions:{sm:"fyvr1gk",md:"fyvr1gl",lg:"fyvr1gm",xl:"fyvr1gn"},defaultClass:"fyvr1gk"},fit:{conditions:{sm:"fyvr1go",md:"fyvr1gp",lg:"fyvr1gq",xl:"fyvr1gr"},defaultClass:"fyvr1go"},max:{conditions:{sm:"fyvr1gs",md:"fyvr1gt",lg:"fyvr1gu",xl:"fyvr1gv"},defaultClass:"fyvr1gs"},min:{conditions:{sm:"fyvr1gw",md:"fyvr1gx",lg:"fyvr1gy",xl:"fyvr1gz"},defaultClass:"fyvr1gw"},vw:{conditions:{sm:"fyvr1h0",md:"fyvr1h1",lg:"fyvr1h2",xl:"fyvr1h3"},defaultClass:"fyvr1h0"},vh:{conditions:{sm:"fyvr1h4",md:"fyvr1h5",lg:"fyvr1h6",xl:"fyvr1h7"},defaultClass:"fyvr1h4"}}},minHeight:{values:{0:{conditions:{sm:"fyvr1h8",md:"fyvr1h9",lg:"fyvr1ha",xl:"fyvr1hb"},defaultClass:"fyvr1h8"},1:{conditions:{sm:"fyvr1hc",md:"fyvr1hd",lg:"fyvr1he",xl:"fyvr1hf"},defaultClass:"fyvr1hc"},2:{conditions:{sm:"fyvr1hg",md:"fyvr1hh",lg:"fyvr1hi",xl:"fyvr1hj"},defaultClass:"fyvr1hg"},3:{conditions:{sm:"fyvr1hk",md:"fyvr1hl",lg:"fyvr1hm",xl:"fyvr1hn"},defaultClass:"fyvr1hk"},4:{conditions:{sm:"fyvr1ho",md:"fyvr1hp",lg:"fyvr1hq",xl:"fyvr1hr"},defaultClass:"fyvr1ho"},5:{conditions:{sm:"fyvr1hs",md:"fyvr1ht",lg:"fyvr1hu",xl:"fyvr1hv"},defaultClass:"fyvr1hs"},6:{conditions:{sm:"fyvr1hw",md:"fyvr1hx",lg:"fyvr1hy",xl:"fyvr1hz"},defaultClass:"fyvr1hw"},7:{conditions:{sm:"fyvr1i0",md:"fyvr1i1",lg:"fyvr1i2",xl:"fyvr1i3"},defaultClass:"fyvr1i0"},8:{conditions:{sm:"fyvr1i4",md:"fyvr1i5",lg:"fyvr1i6",xl:"fyvr1i7"},defaultClass:"fyvr1i4"},9:{conditions:{sm:"fyvr1i8",md:"fyvr1i9",lg:"fyvr1ia",xl:"fyvr1ib"},defaultClass:"fyvr1i8"},10:{conditions:{sm:"fyvr1ic",md:"fyvr1id",lg:"fyvr1ie",xl:"fyvr1if"},defaultClass:"fyvr1ic"},12:{conditions:{sm:"fyvr1ig",md:"fyvr1ih",lg:"fyvr1ii",xl:"fyvr1ij"},defaultClass:"fyvr1ig"},14:{conditions:{sm:"fyvr1ik",md:"fyvr1il",lg:"fyvr1im",xl:"fyvr1in"},defaultClass:"fyvr1ik"},16:{conditions:{sm:"fyvr1io",md:"fyvr1ip",lg:"fyvr1iq",xl:"fyvr1ir"},defaultClass:"fyvr1io"},"0.25":{conditions:{sm:"fyvr1is",md:"fyvr1it",lg:"fyvr1iu",xl:"fyvr1iv"},defaultClass:"fyvr1is"},"0.5":{conditions:{sm:"fyvr1iw",md:"fyvr1ix",lg:"fyvr1iy",xl:"fyvr1iz"},defaultClass:"fyvr1iw"},"1.5":{conditions:{sm:"fyvr1j0",md:"fyvr1j1",lg:"fyvr1j2",xl:"fyvr1j3"},defaultClass:"fyvr1j0"},none:{conditions:{sm:"fyvr1j4",md:"fyvr1j5",lg:"fyvr1j6",xl:"fyvr1j7"},defaultClass:"fyvr1j4"},px:{conditions:{sm:"fyvr1j8",md:"fyvr1j9",lg:"fyvr1ja",xl:"fyvr1jb"},defaultClass:"fyvr1j8"},auto:{conditions:{sm:"fyvr1jc",md:"fyvr1jd",lg:"fyvr1je",xl:"fyvr1jf"},defaultClass:"fyvr1jc"},full:{conditions:{sm:"fyvr1jg",md:"fyvr1jh",lg:"fyvr1ji",xl:"fyvr1jj"},defaultClass:"fyvr1jg"},"1/2":{conditions:{sm:"fyvr1jk",md:"fyvr1jl",lg:"fyvr1jm",xl:"fyvr1jn"},defaultClass:"fyvr1jk"},"1/3":{conditions:{sm:"fyvr1jo",md:"fyvr1jp",lg:"fyvr1jq",xl:"fyvr1jr"},defaultClass:"fyvr1jo"},"2/3":{conditions:{sm:"fyvr1js",md:"fyvr1jt",lg:"fyvr1ju",xl:"fyvr1jv"},defaultClass:"fyvr1js"},"1/4":{conditions:{sm:"fyvr1jw",md:"fyvr1jx",lg:"fyvr1jy",xl:"fyvr1jz"},defaultClass:"fyvr1jw"},"3/4":{conditions:{sm:"fyvr1k0",md:"fyvr1k1",lg:"fyvr1k2",xl:"fyvr1k3"},defaultClass:"fyvr1k0"},fit:{conditions:{sm:"fyvr1k4",md:"fyvr1k5",lg:"fyvr1k6",xl:"fyvr1k7"},defaultClass:"fyvr1k4"},max:{conditions:{sm:"fyvr1k8",md:"fyvr1k9",lg:"fyvr1ka",xl:"fyvr1kb"},defaultClass:"fyvr1k8"},min:{conditions:{sm:"fyvr1kc",md:"fyvr1kd",lg:"fyvr1ke",xl:"fyvr1kf"},defaultClass:"fyvr1kc"},vw:{conditions:{sm:"fyvr1kg",md:"fyvr1kh",lg:"fyvr1ki",xl:"fyvr1kj"},defaultClass:"fyvr1kg"},vh:{conditions:{sm:"fyvr1kk",md:"fyvr1kl",lg:"fyvr1km",xl:"fyvr1kn"},defaultClass:"fyvr1kk"}}},top:{values:{0:{conditions:{sm:"fyvr1ko",md:"fyvr1kp",lg:"fyvr1kq",xl:"fyvr1kr"},defaultClass:"fyvr1ko"},1:{conditions:{sm:"fyvr1ks",md:"fyvr1kt",lg:"fyvr1ku",xl:"fyvr1kv"},defaultClass:"fyvr1ks"},2:{conditions:{sm:"fyvr1kw",md:"fyvr1kx",lg:"fyvr1ky",xl:"fyvr1kz"},defaultClass:"fyvr1kw"},3:{conditions:{sm:"fyvr1l0",md:"fyvr1l1",lg:"fyvr1l2",xl:"fyvr1l3"},defaultClass:"fyvr1l0"},4:{conditions:{sm:"fyvr1l4",md:"fyvr1l5",lg:"fyvr1l6",xl:"fyvr1l7"},defaultClass:"fyvr1l4"},5:{conditions:{sm:"fyvr1l8",md:"fyvr1l9",lg:"fyvr1la",xl:"fyvr1lb"},defaultClass:"fyvr1l8"},6:{conditions:{sm:"fyvr1lc",md:"fyvr1ld",lg:"fyvr1le",xl:"fyvr1lf"},defaultClass:"fyvr1lc"},7:{conditions:{sm:"fyvr1lg",md:"fyvr1lh",lg:"fyvr1li",xl:"fyvr1lj"},defaultClass:"fyvr1lg"},8:{conditions:{sm:"fyvr1lk",md:"fyvr1ll",lg:"fyvr1lm",xl:"fyvr1ln"},defaultClass:"fyvr1lk"},9:{conditions:{sm:"fyvr1lo",md:"fyvr1lp",lg:"fyvr1lq",xl:"fyvr1lr"},defaultClass:"fyvr1lo"},10:{conditions:{sm:"fyvr1ls",md:"fyvr1lt",lg:"fyvr1lu",xl:"fyvr1lv"},defaultClass:"fyvr1ls"},12:{conditions:{sm:"fyvr1lw",md:"fyvr1lx",lg:"fyvr1ly",xl:"fyvr1lz"},defaultClass:"fyvr1lw"},14:{conditions:{sm:"fyvr1m0",md:"fyvr1m1",lg:"fyvr1m2",xl:"fyvr1m3"},defaultClass:"fyvr1m0"},16:{conditions:{sm:"fyvr1m4",md:"fyvr1m5",lg:"fyvr1m6",xl:"fyvr1m7"},defaultClass:"fyvr1m4"},"0.25":{conditions:{sm:"fyvr1m8",md:"fyvr1m9",lg:"fyvr1ma",xl:"fyvr1mb"},defaultClass:"fyvr1m8"},"0.5":{conditions:{sm:"fyvr1mc",md:"fyvr1md",lg:"fyvr1me",xl:"fyvr1mf"},defaultClass:"fyvr1mc"},"1.5":{conditions:{sm:"fyvr1mg",md:"fyvr1mh",lg:"fyvr1mi",xl:"fyvr1mj"},defaultClass:"fyvr1mg"},auto:{conditions:{sm:"fyvr1mk",md:"fyvr1ml",lg:"fyvr1mm",xl:"fyvr1mn"},defaultClass:"fyvr1mk"}}},bottom:{values:{0:{conditions:{sm:"fyvr1mo",md:"fyvr1mp",lg:"fyvr1mq",xl:"fyvr1mr"},defaultClass:"fyvr1mo"},1:{conditions:{sm:"fyvr1ms",md:"fyvr1mt",lg:"fyvr1mu",xl:"fyvr1mv"},defaultClass:"fyvr1ms"},2:{conditions:{sm:"fyvr1mw",md:"fyvr1mx",lg:"fyvr1my",xl:"fyvr1mz"},defaultClass:"fyvr1mw"},3:{conditions:{sm:"fyvr1n0",md:"fyvr1n1",lg:"fyvr1n2",xl:"fyvr1n3"},defaultClass:"fyvr1n0"},4:{conditions:{sm:"fyvr1n4",md:"fyvr1n5",lg:"fyvr1n6",xl:"fyvr1n7"},defaultClass:"fyvr1n4"},5:{conditions:{sm:"fyvr1n8",md:"fyvr1n9",lg:"fyvr1na",xl:"fyvr1nb"},defaultClass:"fyvr1n8"},6:{conditions:{sm:"fyvr1nc",md:"fyvr1nd",lg:"fyvr1ne",xl:"fyvr1nf"},defaultClass:"fyvr1nc"},7:{conditions:{sm:"fyvr1ng",md:"fyvr1nh",lg:"fyvr1ni",xl:"fyvr1nj"},defaultClass:"fyvr1ng"},8:{conditions:{sm:"fyvr1nk",md:"fyvr1nl",lg:"fyvr1nm",xl:"fyvr1nn"},defaultClass:"fyvr1nk"},9:{conditions:{sm:"fyvr1no",md:"fyvr1np",lg:"fyvr1nq",xl:"fyvr1nr"},defaultClass:"fyvr1no"},10:{conditions:{sm:"fyvr1ns",md:"fyvr1nt",lg:"fyvr1nu",xl:"fyvr1nv"},defaultClass:"fyvr1ns"},12:{conditions:{sm:"fyvr1nw",md:"fyvr1nx",lg:"fyvr1ny",xl:"fyvr1nz"},defaultClass:"fyvr1nw"},14:{conditions:{sm:"fyvr1o0",md:"fyvr1o1",lg:"fyvr1o2",xl:"fyvr1o3"},defaultClass:"fyvr1o0"},16:{conditions:{sm:"fyvr1o4",md:"fyvr1o5",lg:"fyvr1o6",xl:"fyvr1o7"},defaultClass:"fyvr1o4"},"0.25":{conditions:{sm:"fyvr1o8",md:"fyvr1o9",lg:"fyvr1oa",xl:"fyvr1ob"},defaultClass:"fyvr1o8"},"0.5":{conditions:{sm:"fyvr1oc",md:"fyvr1od",lg:"fyvr1oe",xl:"fyvr1of"},defaultClass:"fyvr1oc"},"1.5":{conditions:{sm:"fyvr1og",md:"fyvr1oh",lg:"fyvr1oi",xl:"fyvr1oj"},defaultClass:"fyvr1og"},auto:{conditions:{sm:"fyvr1ok",md:"fyvr1ol",lg:"fyvr1om",xl:"fyvr1on"},defaultClass:"fyvr1ok"}}},left:{values:{0:{conditions:{sm:"fyvr1oo",md:"fyvr1op",lg:"fyvr1oq",xl:"fyvr1or"},defaultClass:"fyvr1oo"},1:{conditions:{sm:"fyvr1os",md:"fyvr1ot",lg:"fyvr1ou",xl:"fyvr1ov"},defaultClass:"fyvr1os"},2:{conditions:{sm:"fyvr1ow",md:"fyvr1ox",lg:"fyvr1oy",xl:"fyvr1oz"},defaultClass:"fyvr1ow"},3:{conditions:{sm:"fyvr1p0",md:"fyvr1p1",lg:"fyvr1p2",xl:"fyvr1p3"},defaultClass:"fyvr1p0"},4:{conditions:{sm:"fyvr1p4",md:"fyvr1p5",lg:"fyvr1p6",xl:"fyvr1p7"},defaultClass:"fyvr1p4"},5:{conditions:{sm:"fyvr1p8",md:"fyvr1p9",lg:"fyvr1pa",xl:"fyvr1pb"},defaultClass:"fyvr1p8"},6:{conditions:{sm:"fyvr1pc",md:"fyvr1pd",lg:"fyvr1pe",xl:"fyvr1pf"},defaultClass:"fyvr1pc"},7:{conditions:{sm:"fyvr1pg",md:"fyvr1ph",lg:"fyvr1pi",xl:"fyvr1pj"},defaultClass:"fyvr1pg"},8:{conditions:{sm:"fyvr1pk",md:"fyvr1pl",lg:"fyvr1pm",xl:"fyvr1pn"},defaultClass:"fyvr1pk"},9:{conditions:{sm:"fyvr1po",md:"fyvr1pp",lg:"fyvr1pq",xl:"fyvr1pr"},defaultClass:"fyvr1po"},10:{conditions:{sm:"fyvr1ps",md:"fyvr1pt",lg:"fyvr1pu",xl:"fyvr1pv"},defaultClass:"fyvr1ps"},12:{conditions:{sm:"fyvr1pw",md:"fyvr1px",lg:"fyvr1py",xl:"fyvr1pz"},defaultClass:"fyvr1pw"},14:{conditions:{sm:"fyvr1q0",md:"fyvr1q1",lg:"fyvr1q2",xl:"fyvr1q3"},defaultClass:"fyvr1q0"},16:{conditions:{sm:"fyvr1q4",md:"fyvr1q5",lg:"fyvr1q6",xl:"fyvr1q7"},defaultClass:"fyvr1q4"},"0.25":{conditions:{sm:"fyvr1q8",md:"fyvr1q9",lg:"fyvr1qa",xl:"fyvr1qb"},defaultClass:"fyvr1q8"},"0.5":{conditions:{sm:"fyvr1qc",md:"fyvr1qd",lg:"fyvr1qe",xl:"fyvr1qf"},defaultClass:"fyvr1qc"},"1.5":{conditions:{sm:"fyvr1qg",md:"fyvr1qh",lg:"fyvr1qi",xl:"fyvr1qj"},defaultClass:"fyvr1qg"},auto:{conditions:{sm:"fyvr1qk",md:"fyvr1ql",lg:"fyvr1qm",xl:"fyvr1qn"},defaultClass:"fyvr1qk"}}},right:{values:{0:{conditions:{sm:"fyvr1qo",md:"fyvr1qp",lg:"fyvr1qq",xl:"fyvr1qr"},defaultClass:"fyvr1qo"},1:{conditions:{sm:"fyvr1qs",md:"fyvr1qt",lg:"fyvr1qu",xl:"fyvr1qv"},defaultClass:"fyvr1qs"},2:{conditions:{sm:"fyvr1qw",md:"fyvr1qx",lg:"fyvr1qy",xl:"fyvr1qz"},defaultClass:"fyvr1qw"},3:{conditions:{sm:"fyvr1r0",md:"fyvr1r1",lg:"fyvr1r2",xl:"fyvr1r3"},defaultClass:"fyvr1r0"},4:{conditions:{sm:"fyvr1r4",md:"fyvr1r5",lg:"fyvr1r6",xl:"fyvr1r7"},defaultClass:"fyvr1r4"},5:{conditions:{sm:"fyvr1r8",md:"fyvr1r9",lg:"fyvr1ra",xl:"fyvr1rb"},defaultClass:"fyvr1r8"},6:{conditions:{sm:"fyvr1rc",md:"fyvr1rd",lg:"fyvr1re",xl:"fyvr1rf"},defaultClass:"fyvr1rc"},7:{conditions:{sm:"fyvr1rg",md:"fyvr1rh",lg:"fyvr1ri",xl:"fyvr1rj"},defaultClass:"fyvr1rg"},8:{conditions:{sm:"fyvr1rk",md:"fyvr1rl",lg:"fyvr1rm",xl:"fyvr1rn"},defaultClass:"fyvr1rk"},9:{conditions:{sm:"fyvr1ro",md:"fyvr1rp",lg:"fyvr1rq",xl:"fyvr1rr"},defaultClass:"fyvr1ro"},10:{conditions:{sm:"fyvr1rs",md:"fyvr1rt",lg:"fyvr1ru",xl:"fyvr1rv"},defaultClass:"fyvr1rs"},12:{conditions:{sm:"fyvr1rw",md:"fyvr1rx",lg:"fyvr1ry",xl:"fyvr1rz"},defaultClass:"fyvr1rw"},14:{conditions:{sm:"fyvr1s0",md:"fyvr1s1",lg:"fyvr1s2",xl:"fyvr1s3"},defaultClass:"fyvr1s0"},16:{conditions:{sm:"fyvr1s4",md:"fyvr1s5",lg:"fyvr1s6",xl:"fyvr1s7"},defaultClass:"fyvr1s4"},"0.25":{conditions:{sm:"fyvr1s8",md:"fyvr1s9",lg:"fyvr1sa",xl:"fyvr1sb"},defaultClass:"fyvr1s8"},"0.5":{conditions:{sm:"fyvr1sc",md:"fyvr1sd",lg:"fyvr1se",xl:"fyvr1sf"},defaultClass:"fyvr1sc"},"1.5":{conditions:{sm:"fyvr1sg",md:"fyvr1sh",lg:"fyvr1si",xl:"fyvr1sj"},defaultClass:"fyvr1sg"},auto:{conditions:{sm:"fyvr1sk",md:"fyvr1sl",lg:"fyvr1sm",xl:"fyvr1sn"},defaultClass:"fyvr1sk"}}},paddingTop:{values:{0:{conditions:{sm:"fyvr1so",md:"fyvr1sp",lg:"fyvr1sq",xl:"fyvr1sr"},defaultClass:"fyvr1so"},1:{conditions:{sm:"fyvr1ss",md:"fyvr1st",lg:"fyvr1su",xl:"fyvr1sv"},defaultClass:"fyvr1ss"},2:{conditions:{sm:"fyvr1sw",md:"fyvr1sx",lg:"fyvr1sy",xl:"fyvr1sz"},defaultClass:"fyvr1sw"},3:{conditions:{sm:"fyvr1t0",md:"fyvr1t1",lg:"fyvr1t2",xl:"fyvr1t3"},defaultClass:"fyvr1t0"},4:{conditions:{sm:"fyvr1t4",md:"fyvr1t5",lg:"fyvr1t6",xl:"fyvr1t7"},defaultClass:"fyvr1t4"},5:{conditions:{sm:"fyvr1t8",md:"fyvr1t9",lg:"fyvr1ta",xl:"fyvr1tb"},defaultClass:"fyvr1t8"},6:{conditions:{sm:"fyvr1tc",md:"fyvr1td",lg:"fyvr1te",xl:"fyvr1tf"},defaultClass:"fyvr1tc"},7:{conditions:{sm:"fyvr1tg",md:"fyvr1th",lg:"fyvr1ti",xl:"fyvr1tj"},defaultClass:"fyvr1tg"},8:{conditions:{sm:"fyvr1tk",md:"fyvr1tl",lg:"fyvr1tm",xl:"fyvr1tn"},defaultClass:"fyvr1tk"},9:{conditions:{sm:"fyvr1to",md:"fyvr1tp",lg:"fyvr1tq",xl:"fyvr1tr"},defaultClass:"fyvr1to"},10:{conditions:{sm:"fyvr1ts",md:"fyvr1tt",lg:"fyvr1tu",xl:"fyvr1tv"},defaultClass:"fyvr1ts"},12:{conditions:{sm:"fyvr1tw",md:"fyvr1tx",lg:"fyvr1ty",xl:"fyvr1tz"},defaultClass:"fyvr1tw"},14:{conditions:{sm:"fyvr1u0",md:"fyvr1u1",lg:"fyvr1u2",xl:"fyvr1u3"},defaultClass:"fyvr1u0"},16:{conditions:{sm:"fyvr1u4",md:"fyvr1u5",lg:"fyvr1u6",xl:"fyvr1u7"},defaultClass:"fyvr1u4"},"0.25":{conditions:{sm:"fyvr1u8",md:"fyvr1u9",lg:"fyvr1ua",xl:"fyvr1ub"},defaultClass:"fyvr1u8"},"0.5":{conditions:{sm:"fyvr1uc",md:"fyvr1ud",lg:"fyvr1ue",xl:"fyvr1uf"},defaultClass:"fyvr1uc"},"1.5":{conditions:{sm:"fyvr1ug",md:"fyvr1uh",lg:"fyvr1ui",xl:"fyvr1uj"},defaultClass:"fyvr1ug"}}},paddingBottom:{values:{0:{conditions:{sm:"fyvr1uk",md:"fyvr1ul",lg:"fyvr1um",xl:"fyvr1un"},defaultClass:"fyvr1uk"},1:{conditions:{sm:"fyvr1uo",md:"fyvr1up",lg:"fyvr1uq",xl:"fyvr1ur"},defaultClass:"fyvr1uo"},2:{conditions:{sm:"fyvr1us",md:"fyvr1ut",lg:"fyvr1uu",xl:"fyvr1uv"},defaultClass:"fyvr1us"},3:{conditions:{sm:"fyvr1uw",md:"fyvr1ux",lg:"fyvr1uy",xl:"fyvr1uz"},defaultClass:"fyvr1uw"},4:{conditions:{sm:"fyvr1v0",md:"fyvr1v1",lg:"fyvr1v2",xl:"fyvr1v3"},defaultClass:"fyvr1v0"},5:{conditions:{sm:"fyvr1v4",md:"fyvr1v5",lg:"fyvr1v6",xl:"fyvr1v7"},defaultClass:"fyvr1v4"},6:{conditions:{sm:"fyvr1v8",md:"fyvr1v9",lg:"fyvr1va",xl:"fyvr1vb"},defaultClass:"fyvr1v8"},7:{conditions:{sm:"fyvr1vc",md:"fyvr1vd",lg:"fyvr1ve",xl:"fyvr1vf"},defaultClass:"fyvr1vc"},8:{conditions:{sm:"fyvr1vg",md:"fyvr1vh",lg:"fyvr1vi",xl:"fyvr1vj"},defaultClass:"fyvr1vg"},9:{conditions:{sm:"fyvr1vk",md:"fyvr1vl",lg:"fyvr1vm",xl:"fyvr1vn"},defaultClass:"fyvr1vk"},10:{conditions:{sm:"fyvr1vo",md:"fyvr1vp",lg:"fyvr1vq",xl:"fyvr1vr"},defaultClass:"fyvr1vo"},12:{conditions:{sm:"fyvr1vs",md:"fyvr1vt",lg:"fyvr1vu",xl:"fyvr1vv"},defaultClass:"fyvr1vs"},14:{conditions:{sm:"fyvr1vw",md:"fyvr1vx",lg:"fyvr1vy",xl:"fyvr1vz"},defaultClass:"fyvr1vw"},16:{conditions:{sm:"fyvr1w0",md:"fyvr1w1",lg:"fyvr1w2",xl:"fyvr1w3"},defaultClass:"fyvr1w0"},"0.25":{conditions:{sm:"fyvr1w4",md:"fyvr1w5",lg:"fyvr1w6",xl:"fyvr1w7"},defaultClass:"fyvr1w4"},"0.5":{conditions:{sm:"fyvr1w8",md:"fyvr1w9",lg:"fyvr1wa",xl:"fyvr1wb"},defaultClass:"fyvr1w8"},"1.5":{conditions:{sm:"fyvr1wc",md:"fyvr1wd",lg:"fyvr1we",xl:"fyvr1wf"},defaultClass:"fyvr1wc"}}},paddingLeft:{values:{0:{conditions:{sm:"fyvr1wg",md:"fyvr1wh",lg:"fyvr1wi",xl:"fyvr1wj"},defaultClass:"fyvr1wg"},1:{conditions:{sm:"fyvr1wk",md:"fyvr1wl",lg:"fyvr1wm",xl:"fyvr1wn"},defaultClass:"fyvr1wk"},2:{conditions:{sm:"fyvr1wo",md:"fyvr1wp",lg:"fyvr1wq",xl:"fyvr1wr"},defaultClass:"fyvr1wo"},3:{conditions:{sm:"fyvr1ws",md:"fyvr1wt",lg:"fyvr1wu",xl:"fyvr1wv"},defaultClass:"fyvr1ws"},4:{conditions:{sm:"fyvr1ww",md:"fyvr1wx",lg:"fyvr1wy",xl:"fyvr1wz"},defaultClass:"fyvr1ww"},5:{conditions:{sm:"fyvr1x0",md:"fyvr1x1",lg:"fyvr1x2",xl:"fyvr1x3"},defaultClass:"fyvr1x0"},6:{conditions:{sm:"fyvr1x4",md:"fyvr1x5",lg:"fyvr1x6",xl:"fyvr1x7"},defaultClass:"fyvr1x4"},7:{conditions:{sm:"fyvr1x8",md:"fyvr1x9",lg:"fyvr1xa",xl:"fyvr1xb"},defaultClass:"fyvr1x8"},8:{conditions:{sm:"fyvr1xc",md:"fyvr1xd",lg:"fyvr1xe",xl:"fyvr1xf"},defaultClass:"fyvr1xc"},9:{conditions:{sm:"fyvr1xg",md:"fyvr1xh",lg:"fyvr1xi",xl:"fyvr1xj"},defaultClass:"fyvr1xg"},10:{conditions:{sm:"fyvr1xk",md:"fyvr1xl",lg:"fyvr1xm",xl:"fyvr1xn"},defaultClass:"fyvr1xk"},12:{conditions:{sm:"fyvr1xo",md:"fyvr1xp",lg:"fyvr1xq",xl:"fyvr1xr"},defaultClass:"fyvr1xo"},14:{conditions:{sm:"fyvr1xs",md:"fyvr1xt",lg:"fyvr1xu",xl:"fyvr1xv"},defaultClass:"fyvr1xs"},16:{conditions:{sm:"fyvr1xw",md:"fyvr1xx",lg:"fyvr1xy",xl:"fyvr1xz"},defaultClass:"fyvr1xw"},"0.25":{conditions:{sm:"fyvr1y0",md:"fyvr1y1",lg:"fyvr1y2",xl:"fyvr1y3"},defaultClass:"fyvr1y0"},"0.5":{conditions:{sm:"fyvr1y4",md:"fyvr1y5",lg:"fyvr1y6",xl:"fyvr1y7"},defaultClass:"fyvr1y4"},"1.5":{conditions:{sm:"fyvr1y8",md:"fyvr1y9",lg:"fyvr1ya",xl:"fyvr1yb"},defaultClass:"fyvr1y8"}}},paddingRight:{values:{0:{conditions:{sm:"fyvr1yc",md:"fyvr1yd",lg:"fyvr1ye",xl:"fyvr1yf"},defaultClass:"fyvr1yc"},1:{conditions:{sm:"fyvr1yg",md:"fyvr1yh",lg:"fyvr1yi",xl:"fyvr1yj"},defaultClass:"fyvr1yg"},2:{conditions:{sm:"fyvr1yk",md:"fyvr1yl",lg:"fyvr1ym",xl:"fyvr1yn"},defaultClass:"fyvr1yk"},3:{conditions:{sm:"fyvr1yo",md:"fyvr1yp",lg:"fyvr1yq",xl:"fyvr1yr"},defaultClass:"fyvr1yo"},4:{conditions:{sm:"fyvr1ys",md:"fyvr1yt",lg:"fyvr1yu",xl:"fyvr1yv"},defaultClass:"fyvr1ys"},5:{conditions:{sm:"fyvr1yw",md:"fyvr1yx",lg:"fyvr1yy",xl:"fyvr1yz"},defaultClass:"fyvr1yw"},6:{conditions:{sm:"fyvr1z0",md:"fyvr1z1",lg:"fyvr1z2",xl:"fyvr1z3"},defaultClass:"fyvr1z0"},7:{conditions:{sm:"fyvr1z4",md:"fyvr1z5",lg:"fyvr1z6",xl:"fyvr1z7"},defaultClass:"fyvr1z4"},8:{conditions:{sm:"fyvr1z8",md:"fyvr1z9",lg:"fyvr1za",xl:"fyvr1zb"},defaultClass:"fyvr1z8"},9:{conditions:{sm:"fyvr1zc",md:"fyvr1zd",lg:"fyvr1ze",xl:"fyvr1zf"},defaultClass:"fyvr1zc"},10:{conditions:{sm:"fyvr1zg",md:"fyvr1zh",lg:"fyvr1zi",xl:"fyvr1zj"},defaultClass:"fyvr1zg"},12:{conditions:{sm:"fyvr1zk",md:"fyvr1zl",lg:"fyvr1zm",xl:"fyvr1zn"},defaultClass:"fyvr1zk"},14:{conditions:{sm:"fyvr1zo",md:"fyvr1zp",lg:"fyvr1zq",xl:"fyvr1zr"},defaultClass:"fyvr1zo"},16:{conditions:{sm:"fyvr1zs",md:"fyvr1zt",lg:"fyvr1zu",xl:"fyvr1zv"},defaultClass:"fyvr1zs"},"0.25":{conditions:{sm:"fyvr1zw",md:"fyvr1zx",lg:"fyvr1zy",xl:"fyvr1zz"},defaultClass:"fyvr1zw"},"0.5":{conditions:{sm:"fyvr1100",md:"fyvr1101",lg:"fyvr1102",xl:"fyvr1103"},defaultClass:"fyvr1100"},"1.5":{conditions:{sm:"fyvr1104",md:"fyvr1105",lg:"fyvr1106",xl:"fyvr1107"},defaultClass:"fyvr1104"}}},marginTop:{values:{0:{conditions:{sm:"fyvr1108",md:"fyvr1109",lg:"fyvr110a",xl:"fyvr110b"},defaultClass:"fyvr1108"},1:{conditions:{sm:"fyvr110c",md:"fyvr110d",lg:"fyvr110e",xl:"fyvr110f"},defaultClass:"fyvr110c"},2:{conditions:{sm:"fyvr110g",md:"fyvr110h",lg:"fyvr110i",xl:"fyvr110j"},defaultClass:"fyvr110g"},3:{conditions:{sm:"fyvr110k",md:"fyvr110l",lg:"fyvr110m",xl:"fyvr110n"},defaultClass:"fyvr110k"},4:{conditions:{sm:"fyvr110o",md:"fyvr110p",lg:"fyvr110q",xl:"fyvr110r"},defaultClass:"fyvr110o"},5:{conditions:{sm:"fyvr110s",md:"fyvr110t",lg:"fyvr110u",xl:"fyvr110v"},defaultClass:"fyvr110s"},6:{conditions:{sm:"fyvr110w",md:"fyvr110x",lg:"fyvr110y",xl:"fyvr110z"},defaultClass:"fyvr110w"},7:{conditions:{sm:"fyvr1110",md:"fyvr1111",lg:"fyvr1112",xl:"fyvr1113"},defaultClass:"fyvr1110"},8:{conditions:{sm:"fyvr1114",md:"fyvr1115",lg:"fyvr1116",xl:"fyvr1117"},defaultClass:"fyvr1114"},9:{conditions:{sm:"fyvr1118",md:"fyvr1119",lg:"fyvr111a",xl:"fyvr111b"},defaultClass:"fyvr1118"},10:{conditions:{sm:"fyvr111c",md:"fyvr111d",lg:"fyvr111e",xl:"fyvr111f"},defaultClass:"fyvr111c"},12:{conditions:{sm:"fyvr111g",md:"fyvr111h",lg:"fyvr111i",xl:"fyvr111j"},defaultClass:"fyvr111g"},14:{conditions:{sm:"fyvr111k",md:"fyvr111l",lg:"fyvr111m",xl:"fyvr111n"},defaultClass:"fyvr111k"},16:{conditions:{sm:"fyvr111o",md:"fyvr111p",lg:"fyvr111q",xl:"fyvr111r"},defaultClass:"fyvr111o"},"0.25":{conditions:{sm:"fyvr111s",md:"fyvr111t",lg:"fyvr111u",xl:"fyvr111v"},defaultClass:"fyvr111s"},"0.5":{conditions:{sm:"fyvr111w",md:"fyvr111x",lg:"fyvr111y",xl:"fyvr111z"},defaultClass:"fyvr111w"},"1.5":{conditions:{sm:"fyvr1120",md:"fyvr1121",lg:"fyvr1122",xl:"fyvr1123"},defaultClass:"fyvr1120"},auto:{conditions:{sm:"fyvr1124",md:"fyvr1125",lg:"fyvr1126",xl:"fyvr1127"},defaultClass:"fyvr1124"}}},marginBottom:{values:{0:{conditions:{sm:"fyvr1128",md:"fyvr1129",lg:"fyvr112a",xl:"fyvr112b"},defaultClass:"fyvr1128"},1:{conditions:{sm:"fyvr112c",md:"fyvr112d",lg:"fyvr112e",xl:"fyvr112f"},defaultClass:"fyvr112c"},2:{conditions:{sm:"fyvr112g",md:"fyvr112h",lg:"fyvr112i",xl:"fyvr112j"},defaultClass:"fyvr112g"},3:{conditions:{sm:"fyvr112k",md:"fyvr112l",lg:"fyvr112m",xl:"fyvr112n"},defaultClass:"fyvr112k"},4:{conditions:{sm:"fyvr112o",md:"fyvr112p",lg:"fyvr112q",xl:"fyvr112r"},defaultClass:"fyvr112o"},5:{conditions:{sm:"fyvr112s",md:"fyvr112t",lg:"fyvr112u",xl:"fyvr112v"},defaultClass:"fyvr112s"},6:{conditions:{sm:"fyvr112w",md:"fyvr112x",lg:"fyvr112y",xl:"fyvr112z"},defaultClass:"fyvr112w"},7:{conditions:{sm:"fyvr1130",md:"fyvr1131",lg:"fyvr1132",xl:"fyvr1133"},defaultClass:"fyvr1130"},8:{conditions:{sm:"fyvr1134",md:"fyvr1135",lg:"fyvr1136",xl:"fyvr1137"},defaultClass:"fyvr1134"},9:{conditions:{sm:"fyvr1138",md:"fyvr1139",lg:"fyvr113a",xl:"fyvr113b"},defaultClass:"fyvr1138"},10:{conditions:{sm:"fyvr113c",md:"fyvr113d",lg:"fyvr113e",xl:"fyvr113f"},defaultClass:"fyvr113c"},12:{conditions:{sm:"fyvr113g",md:"fyvr113h",lg:"fyvr113i",xl:"fyvr113j"},defaultClass:"fyvr113g"},14:{conditions:{sm:"fyvr113k",md:"fyvr113l",lg:"fyvr113m",xl:"fyvr113n"},defaultClass:"fyvr113k"},16:{conditions:{sm:"fyvr113o",md:"fyvr113p",lg:"fyvr113q",xl:"fyvr113r"},defaultClass:"fyvr113o"},"0.25":{conditions:{sm:"fyvr113s",md:"fyvr113t",lg:"fyvr113u",xl:"fyvr113v"},defaultClass:"fyvr113s"},"0.5":{conditions:{sm:"fyvr113w",md:"fyvr113x",lg:"fyvr113y",xl:"fyvr113z"},defaultClass:"fyvr113w"},"1.5":{conditions:{sm:"fyvr1140",md:"fyvr1141",lg:"fyvr1142",xl:"fyvr1143"},defaultClass:"fyvr1140"},auto:{conditions:{sm:"fyvr1144",md:"fyvr1145",lg:"fyvr1146",xl:"fyvr1147"},defaultClass:"fyvr1144"}}},marginLeft:{values:{0:{conditions:{sm:"fyvr1148",md:"fyvr1149",lg:"fyvr114a",xl:"fyvr114b"},defaultClass:"fyvr1148"},1:{conditions:{sm:"fyvr114c",md:"fyvr114d",lg:"fyvr114e",xl:"fyvr114f"},defaultClass:"fyvr114c"},2:{conditions:{sm:"fyvr114g",md:"fyvr114h",lg:"fyvr114i",xl:"fyvr114j"},defaultClass:"fyvr114g"},3:{conditions:{sm:"fyvr114k",md:"fyvr114l",lg:"fyvr114m",xl:"fyvr114n"},defaultClass:"fyvr114k"},4:{conditions:{sm:"fyvr114o",md:"fyvr114p",lg:"fyvr114q",xl:"fyvr114r"},defaultClass:"fyvr114o"},5:{conditions:{sm:"fyvr114s",md:"fyvr114t",lg:"fyvr114u",xl:"fyvr114v"},defaultClass:"fyvr114s"},6:{conditions:{sm:"fyvr114w",md:"fyvr114x",lg:"fyvr114y",xl:"fyvr114z"},defaultClass:"fyvr114w"},7:{conditions:{sm:"fyvr1150",md:"fyvr1151",lg:"fyvr1152",xl:"fyvr1153"},defaultClass:"fyvr1150"},8:{conditions:{sm:"fyvr1154",md:"fyvr1155",lg:"fyvr1156",xl:"fyvr1157"},defaultClass:"fyvr1154"},9:{conditions:{sm:"fyvr1158",md:"fyvr1159",lg:"fyvr115a",xl:"fyvr115b"},defaultClass:"fyvr1158"},10:{conditions:{sm:"fyvr115c",md:"fyvr115d",lg:"fyvr115e",xl:"fyvr115f"},defaultClass:"fyvr115c"},12:{conditions:{sm:"fyvr115g",md:"fyvr115h",lg:"fyvr115i",xl:"fyvr115j"},defaultClass:"fyvr115g"},14:{conditions:{sm:"fyvr115k",md:"fyvr115l",lg:"fyvr115m",xl:"fyvr115n"},defaultClass:"fyvr115k"},16:{conditions:{sm:"fyvr115o",md:"fyvr115p",lg:"fyvr115q",xl:"fyvr115r"},defaultClass:"fyvr115o"},"0.25":{conditions:{sm:"fyvr115s",md:"fyvr115t",lg:"fyvr115u",xl:"fyvr115v"},defaultClass:"fyvr115s"},"0.5":{conditions:{sm:"fyvr115w",md:"fyvr115x",lg:"fyvr115y",xl:"fyvr115z"},defaultClass:"fyvr115w"},"1.5":{conditions:{sm:"fyvr1160",md:"fyvr1161",lg:"fyvr1162",xl:"fyvr1163"},defaultClass:"fyvr1160"},auto:{conditions:{sm:"fyvr1164",md:"fyvr1165",lg:"fyvr1166",xl:"fyvr1167"},defaultClass:"fyvr1164"}}},marginRight:{values:{0:{conditions:{sm:"fyvr1168",md:"fyvr1169",lg:"fyvr116a",xl:"fyvr116b"},defaultClass:"fyvr1168"},1:{conditions:{sm:"fyvr116c",md:"fyvr116d",lg:"fyvr116e",xl:"fyvr116f"},defaultClass:"fyvr116c"},2:{conditions:{sm:"fyvr116g",md:"fyvr116h",lg:"fyvr116i",xl:"fyvr116j"},defaultClass:"fyvr116g"},3:{conditions:{sm:"fyvr116k",md:"fyvr116l",lg:"fyvr116m",xl:"fyvr116n"},defaultClass:"fyvr116k"},4:{conditions:{sm:"fyvr116o",md:"fyvr116p",lg:"fyvr116q",xl:"fyvr116r"},defaultClass:"fyvr116o"},5:{conditions:{sm:"fyvr116s",md:"fyvr116t",lg:"fyvr116u",xl:"fyvr116v"},defaultClass:"fyvr116s"},6:{conditions:{sm:"fyvr116w",md:"fyvr116x",lg:"fyvr116y",xl:"fyvr116z"},defaultClass:"fyvr116w"},7:{conditions:{sm:"fyvr1170",md:"fyvr1171",lg:"fyvr1172",xl:"fyvr1173"},defaultClass:"fyvr1170"},8:{conditions:{sm:"fyvr1174",md:"fyvr1175",lg:"fyvr1176",xl:"fyvr1177"},defaultClass:"fyvr1174"},9:{conditions:{sm:"fyvr1178",md:"fyvr1179",lg:"fyvr117a",xl:"fyvr117b"},defaultClass:"fyvr1178"},10:{conditions:{sm:"fyvr117c",md:"fyvr117d",lg:"fyvr117e",xl:"fyvr117f"},defaultClass:"fyvr117c"},12:{conditions:{sm:"fyvr117g",md:"fyvr117h",lg:"fyvr117i",xl:"fyvr117j"},defaultClass:"fyvr117g"},14:{conditions:{sm:"fyvr117k",md:"fyvr117l",lg:"fyvr117m",xl:"fyvr117n"},defaultClass:"fyvr117k"},16:{conditions:{sm:"fyvr117o",md:"fyvr117p",lg:"fyvr117q",xl:"fyvr117r"},defaultClass:"fyvr117o"},"0.25":{conditions:{sm:"fyvr117s",md:"fyvr117t",lg:"fyvr117u",xl:"fyvr117v"},defaultClass:"fyvr117s"},"0.5":{conditions:{sm:"fyvr117w",md:"fyvr117x",lg:"fyvr117y",xl:"fyvr117z"},defaultClass:"fyvr117w"},"1.5":{conditions:{sm:"fyvr1180",md:"fyvr1181",lg:"fyvr1182",xl:"fyvr1183"},defaultClass:"fyvr1180"},auto:{conditions:{sm:"fyvr1184",md:"fyvr1185",lg:"fyvr1186",xl:"fyvr1187"},defaultClass:"fyvr1184"}}},gap:{values:{0:{conditions:{sm:"fyvr1188",md:"fyvr1189",lg:"fyvr118a",xl:"fyvr118b"},defaultClass:"fyvr1188"},1:{conditions:{sm:"fyvr118c",md:"fyvr118d",lg:"fyvr118e",xl:"fyvr118f"},defaultClass:"fyvr118c"},2:{conditions:{sm:"fyvr118g",md:"fyvr118h",lg:"fyvr118i",xl:"fyvr118j"},defaultClass:"fyvr118g"},3:{conditions:{sm:"fyvr118k",md:"fyvr118l",lg:"fyvr118m",xl:"fyvr118n"},defaultClass:"fyvr118k"},4:{conditions:{sm:"fyvr118o",md:"fyvr118p",lg:"fyvr118q",xl:"fyvr118r"},defaultClass:"fyvr118o"},5:{conditions:{sm:"fyvr118s",md:"fyvr118t",lg:"fyvr118u",xl:"fyvr118v"},defaultClass:"fyvr118s"},6:{conditions:{sm:"fyvr118w",md:"fyvr118x",lg:"fyvr118y",xl:"fyvr118z"},defaultClass:"fyvr118w"},7:{conditions:{sm:"fyvr1190",md:"fyvr1191",lg:"fyvr1192",xl:"fyvr1193"},defaultClass:"fyvr1190"},8:{conditions:{sm:"fyvr1194",md:"fyvr1195",lg:"fyvr1196",xl:"fyvr1197"},defaultClass:"fyvr1194"},9:{conditions:{sm:"fyvr1198",md:"fyvr1199",lg:"fyvr119a",xl:"fyvr119b"},defaultClass:"fyvr1198"},10:{conditions:{sm:"fyvr119c",md:"fyvr119d",lg:"fyvr119e",xl:"fyvr119f"},defaultClass:"fyvr119c"},12:{conditions:{sm:"fyvr119g",md:"fyvr119h",lg:"fyvr119i",xl:"fyvr119j"},defaultClass:"fyvr119g"},14:{conditions:{sm:"fyvr119k",md:"fyvr119l",lg:"fyvr119m",xl:"fyvr119n"},defaultClass:"fyvr119k"},16:{conditions:{sm:"fyvr119o",md:"fyvr119p",lg:"fyvr119q",xl:"fyvr119r"},defaultClass:"fyvr119o"},"0.25":{conditions:{sm:"fyvr119s",md:"fyvr119t",lg:"fyvr119u",xl:"fyvr119v"},defaultClass:"fyvr119s"},"0.5":{conditions:{sm:"fyvr119w",md:"fyvr119x",lg:"fyvr119y",xl:"fyvr119z"},defaultClass:"fyvr119w"},"1.5":{conditions:{sm:"fyvr11a0",md:"fyvr11a1",lg:"fyvr11a2",xl:"fyvr11a3"},defaultClass:"fyvr11a0"}}},borderBottomWidth:{values:{none:{conditions:{sm:"fyvr11a4",md:"fyvr11a5",lg:"fyvr11a6",xl:"fyvr11a7"},defaultClass:"fyvr11a4"},thin:{conditions:{sm:"fyvr11a8",md:"fyvr11a9",lg:"fyvr11aa",xl:"fyvr11ab"},defaultClass:"fyvr11a8"},thick:{conditions:{sm:"fyvr11ac",md:"fyvr11ad",lg:"fyvr11ae",xl:"fyvr11af"},defaultClass:"fyvr11ac"}}},borderLeftWidth:{values:{none:{conditions:{sm:"fyvr11ag",md:"fyvr11ah",lg:"fyvr11ai",xl:"fyvr11aj"},defaultClass:"fyvr11ag"},thin:{conditions:{sm:"fyvr11ak",md:"fyvr11al",lg:"fyvr11am",xl:"fyvr11an"},defaultClass:"fyvr11ak"},thick:{conditions:{sm:"fyvr11ao",md:"fyvr11ap",lg:"fyvr11aq",xl:"fyvr11ar"},defaultClass:"fyvr11ao"}}},borderRightWidth:{values:{none:{conditions:{sm:"fyvr11as",md:"fyvr11at",lg:"fyvr11au",xl:"fyvr11av"},defaultClass:"fyvr11as"},thin:{conditions:{sm:"fyvr11aw",md:"fyvr11ax",lg:"fyvr11ay",xl:"fyvr11az"},defaultClass:"fyvr11aw"},thick:{conditions:{sm:"fyvr11b0",md:"fyvr11b1",lg:"fyvr11b2",xl:"fyvr11b3"},defaultClass:"fyvr11b0"}}},borderTopWidth:{values:{none:{conditions:{sm:"fyvr11b4",md:"fyvr11b5",lg:"fyvr11b6",xl:"fyvr11b7"},defaultClass:"fyvr11b4"},thin:{conditions:{sm:"fyvr11b8",md:"fyvr11b9",lg:"fyvr11ba",xl:"fyvr11bb"},defaultClass:"fyvr11b8"},thick:{conditions:{sm:"fyvr11bc",md:"fyvr11bd",lg:"fyvr11be",xl:"fyvr11bf"},defaultClass:"fyvr11bc"}}},borderBottomLeftRadius:{values:{none:{conditions:{sm:"fyvr11bg",md:"fyvr11bh",lg:"fyvr11bi",xl:"fyvr11bj"},defaultClass:"fyvr11bg"},xs:{conditions:{sm:"fyvr11bk",md:"fyvr11bl",lg:"fyvr11bm",xl:"fyvr11bn"},defaultClass:"fyvr11bk"},sm:{conditions:{sm:"fyvr11bo",md:"fyvr11bp",lg:"fyvr11bq",xl:"fyvr11br"},defaultClass:"fyvr11bo"},md:{conditions:{sm:"fyvr11bs",md:"fyvr11bt",lg:"fyvr11bu",xl:"fyvr11bv"},defaultClass:"fyvr11bs"},lg:{conditions:{sm:"fyvr11bw",md:"fyvr11bx",lg:"fyvr11by",xl:"fyvr11bz"},defaultClass:"fyvr11bw"},circle:{conditions:{sm:"fyvr11c0",md:"fyvr11c1",lg:"fyvr11c2",xl:"fyvr11c3"},defaultClass:"fyvr11c0"}}},borderBottomRightRadius:{values:{none:{conditions:{sm:"fyvr11c4",md:"fyvr11c5",lg:"fyvr11c6",xl:"fyvr11c7"},defaultClass:"fyvr11c4"},xs:{conditions:{sm:"fyvr11c8",md:"fyvr11c9",lg:"fyvr11ca",xl:"fyvr11cb"},defaultClass:"fyvr11c8"},sm:{conditions:{sm:"fyvr11cc",md:"fyvr11cd",lg:"fyvr11ce",xl:"fyvr11cf"},defaultClass:"fyvr11cc"},md:{conditions:{sm:"fyvr11cg",md:"fyvr11ch",lg:"fyvr11ci",xl:"fyvr11cj"},defaultClass:"fyvr11cg"},lg:{conditions:{sm:"fyvr11ck",md:"fyvr11cl",lg:"fyvr11cm",xl:"fyvr11cn"},defaultClass:"fyvr11ck"},circle:{conditions:{sm:"fyvr11co",md:"fyvr11cp",lg:"fyvr11cq",xl:"fyvr11cr"},defaultClass:"fyvr11co"}}},borderTopLeftRadius:{values:{none:{conditions:{sm:"fyvr11cs",md:"fyvr11ct",lg:"fyvr11cu",xl:"fyvr11cv"},defaultClass:"fyvr11cs"},xs:{conditions:{sm:"fyvr11cw",md:"fyvr11cx",lg:"fyvr11cy",xl:"fyvr11cz"},defaultClass:"fyvr11cw"},sm:{conditions:{sm:"fyvr11d0",md:"fyvr11d1",lg:"fyvr11d2",xl:"fyvr11d3"},defaultClass:"fyvr11d0"},md:{conditions:{sm:"fyvr11d4",md:"fyvr11d5",lg:"fyvr11d6",xl:"fyvr11d7"},defaultClass:"fyvr11d4"},lg:{conditions:{sm:"fyvr11d8",md:"fyvr11d9",lg:"fyvr11da",xl:"fyvr11db"},defaultClass:"fyvr11d8"},circle:{conditions:{sm:"fyvr11dc",md:"fyvr11dd",lg:"fyvr11de",xl:"fyvr11df"},defaultClass:"fyvr11dc"}}},borderTopRightRadius:{values:{none:{conditions:{sm:"fyvr11dg",md:"fyvr11dh",lg:"fyvr11di",xl:"fyvr11dj"},defaultClass:"fyvr11dg"},xs:{conditions:{sm:"fyvr11dk",md:"fyvr11dl",lg:"fyvr11dm",xl:"fyvr11dn"},defaultClass:"fyvr11dk"},sm:{conditions:{sm:"fyvr11do",md:"fyvr11dp",lg:"fyvr11dq",xl:"fyvr11dr"},defaultClass:"fyvr11do"},md:{conditions:{sm:"fyvr11ds",md:"fyvr11dt",lg:"fyvr11du",xl:"fyvr11dv"},defaultClass:"fyvr11ds"},lg:{conditions:{sm:"fyvr11dw",md:"fyvr11dx",lg:"fyvr11dy",xl:"fyvr11dz"},defaultClass:"fyvr11dw"},circle:{conditions:{sm:"fyvr11e0",md:"fyvr11e1",lg:"fyvr11e2",xl:"fyvr11e3"},defaultClass:"fyvr11e0"}}},fontSize:{values:{inherit:{conditions:{sm:"fyvr11e4",md:"fyvr11e5",lg:"fyvr11e6",xl:"fyvr11e7"},defaultClass:"fyvr11e4"},xsmall:{conditions:{sm:"fyvr11e8",md:"fyvr11e9",lg:"fyvr11ea",xl:"fyvr11eb"},defaultClass:"fyvr11e8"},small:{conditions:{sm:"fyvr11ec",md:"fyvr11ed",lg:"fyvr11ee",xl:"fyvr11ef"},defaultClass:"fyvr11ec"},normal:{conditions:{sm:"fyvr11eg",md:"fyvr11eh",lg:"fyvr11ei",xl:"fyvr11ej"},defaultClass:"fyvr11eg"},medium:{conditions:{sm:"fyvr11ek",md:"fyvr11el",lg:"fyvr11em",xl:"fyvr11en"},defaultClass:"fyvr11ek"},large:{conditions:{sm:"fyvr11eo",md:"fyvr11ep",lg:"fyvr11eq",xl:"fyvr11er"},defaultClass:"fyvr11eo"},xlarge:{conditions:{sm:"fyvr11es",md:"fyvr11et",lg:"fyvr11eu",xl:"fyvr11ev"},defaultClass:"fyvr11es"}}},fontWeight:{values:{inherit:{conditions:{sm:"fyvr11ew",md:"fyvr11ex",lg:"fyvr11ey",xl:"fyvr11ez"},defaultClass:"fyvr11ew"},normal:{conditions:{sm:"fyvr11f0",md:"fyvr11f1",lg:"fyvr11f2",xl:"fyvr11f3"},defaultClass:"fyvr11f0"},medium:{conditions:{sm:"fyvr11f4",md:"fyvr11f5",lg:"fyvr11f6",xl:"fyvr11f7"},defaultClass:"fyvr11f4"},semibold:{conditions:{sm:"fyvr11f8",md:"fyvr11f9",lg:"fyvr11fa",xl:"fyvr11fb"},defaultClass:"fyvr11f8"},bold:{conditions:{sm:"fyvr11fc",md:"fyvr11fd",lg:"fyvr11fe",xl:"fyvr11ff"},defaultClass:"fyvr11fc"}}},letterSpacing:{values:{inherit:{conditions:{sm:"fyvr11fg",md:"fyvr11fh",lg:"fyvr11fi",xl:"fyvr11fj"},defaultClass:"fyvr11fg"},none:{conditions:{sm:"fyvr11fk",md:"fyvr11fl",lg:"fyvr11fm",xl:"fyvr11fn"},defaultClass:"fyvr11fk"},normal:{conditions:{sm:"fyvr11fo",md:"fyvr11fp",lg:"fyvr11fq",xl:"fyvr11fr"},defaultClass:"fyvr11fo"},wide:{conditions:{sm:"fyvr11fs",md:"fyvr11ft",lg:"fyvr11fu",xl:"fyvr11fv"},defaultClass:"fyvr11fs"}}},lineHeight:{values:{4:{conditions:{sm:"fyvr11fw",md:"fyvr11fx",lg:"fyvr11fy",xl:"fyvr11fz"},defaultClass:"fyvr11fw"},5:{conditions:{sm:"fyvr11g0",md:"fyvr11g1",lg:"fyvr11g2",xl:"fyvr11g3"},defaultClass:"fyvr11g0"},6:{conditions:{sm:"fyvr11g4",md:"fyvr11g5",lg:"fyvr11g6",xl:"fyvr11g7"},defaultClass:"fyvr11g4"},7:{conditions:{sm:"fyvr11g8",md:"fyvr11g9",lg:"fyvr11ga",xl:"fyvr11gb"},defaultClass:"fyvr11g8"},9:{conditions:{sm:"fyvr11gc",md:"fyvr11gd",lg:"fyvr11ge",xl:"fyvr11gf"},defaultClass:"fyvr11gc"},inherit:{conditions:{sm:"fyvr11gg",md:"fyvr11gh",lg:"fyvr11gi",xl:"fyvr11gj"},defaultClass:"fyvr11gg"}}},textAlign:{values:{center:{conditions:{sm:"fyvr11gk",md:"fyvr11gl",lg:"fyvr11gm",xl:"fyvr11gn"},defaultClass:"fyvr11gk"},left:{conditions:{sm:"fyvr11go",md:"fyvr11gp",lg:"fyvr11gq",xl:"fyvr11gr"},defaultClass:"fyvr11go"},right:{conditions:{sm:"fyvr11gs",md:"fyvr11gt",lg:"fyvr11gu",xl:"fyvr11gv"},defaultClass:"fyvr11gs"}}},display:{values:{block:{conditions:{sm:"fyvr11gw",md:"fyvr11gx",lg:"fyvr11gy",xl:"fyvr11gz"},defaultClass:"fyvr11gw"},flex:{conditions:{sm:"fyvr11h0",md:"fyvr11h1",lg:"fyvr11h2",xl:"fyvr11h3"},defaultClass:"fyvr11h0"},grid:{conditions:{sm:"fyvr11h4",md:"fyvr11h5",lg:"fyvr11h6",xl:"fyvr11h7"},defaultClass:"fyvr11h4"},"inline-block":{conditions:{sm:"fyvr11h8",md:"fyvr11h9",lg:"fyvr11ha",xl:"fyvr11hb"},defaultClass:"fyvr11h8"},"inline-flex":{conditions:{sm:"fyvr11hc",md:"fyvr11hd",lg:"fyvr11he",xl:"fyvr11hf"},defaultClass:"fyvr11hc"},none:{conditions:{sm:"fyvr11hg",md:"fyvr11hh",lg:"fyvr11hi",xl:"fyvr11hj"},defaultClass:"fyvr11hg"},contents:{conditions:{sm:"fyvr11hk",md:"fyvr11hl",lg:"fyvr11hm",xl:"fyvr11hn"},defaultClass:"fyvr11hk"}}},position:{values:{absolute:{conditions:{sm:"fyvr11ho",md:"fyvr11hp",lg:"fyvr11hq",xl:"fyvr11hr"},defaultClass:"fyvr11ho"},fixed:{conditions:{sm:"fyvr11hs",md:"fyvr11ht",lg:"fyvr11hu",xl:"fyvr11hv"},defaultClass:"fyvr11hs"},relative:{conditions:{sm:"fyvr11hw",md:"fyvr11hx",lg:"fyvr11hy",xl:"fyvr11hz"},defaultClass:"fyvr11hw"},sticky:{conditions:{sm:"fyvr11i0",md:"fyvr11i1",lg:"fyvr11i2",xl:"fyvr11i3"},defaultClass:"fyvr11i0"}}},flexDirection:{values:{column:{conditions:{sm:"fyvr11i4",md:"fyvr11i5",lg:"fyvr11i6",xl:"fyvr11i7"},defaultClass:"fyvr11i4"},"column-reverse":{conditions:{sm:"fyvr11i8",md:"fyvr11i9",lg:"fyvr11ia",xl:"fyvr11ib"},defaultClass:"fyvr11i8"},row:{conditions:{sm:"fyvr11ic",md:"fyvr11id",lg:"fyvr11ie",xl:"fyvr11if"},defaultClass:"fyvr11ic"},"row-reverse":{conditions:{sm:"fyvr11ig",md:"fyvr11ih",lg:"fyvr11ii",xl:"fyvr11ij"},defaultClass:"fyvr11ig"}}},flexShrink:{values:{0:{conditions:{sm:"fyvr11ik",md:"fyvr11il",lg:"fyvr11im",xl:"fyvr11in"},defaultClass:"fyvr11ik"},1:{conditions:{sm:"fyvr11io",md:"fyvr11ip",lg:"fyvr11iq",xl:"fyvr11ir"},defaultClass:"fyvr11io"}}},flexGrow:{values:{0:{conditions:{sm:"fyvr11is",md:"fyvr11it",lg:"fyvr11iu",xl:"fyvr11iv"},defaultClass:"fyvr11is"},1:{conditions:{sm:"fyvr11iw",md:"fyvr11ix",lg:"fyvr11iy",xl:"fyvr11iz"},defaultClass:"fyvr11iw"}}},flexWrap:{values:{nowrap:{conditions:{sm:"fyvr11j0",md:"fyvr11j1",lg:"fyvr11j2",xl:"fyvr11j3"},defaultClass:"fyvr11j0"},wrap:{conditions:{sm:"fyvr11j4",md:"fyvr11j5",lg:"fyvr11j6",xl:"fyvr11j7"},defaultClass:"fyvr11j4"},"wrap-reverse":{conditions:{sm:"fyvr11j8",md:"fyvr11j9",lg:"fyvr11ja",xl:"fyvr11jb"},defaultClass:"fyvr11j8"}}},justifyContent:{values:{"flex-start":{conditions:{sm:"fyvr11jc",md:"fyvr11jd",lg:"fyvr11je",xl:"fyvr11jf"},defaultClass:"fyvr11jc"},center:{conditions:{sm:"fyvr11jg",md:"fyvr11jh",lg:"fyvr11ji",xl:"fyvr11jj"},defaultClass:"fyvr11jg"},"flex-end":{conditions:{sm:"fyvr11jk",md:"fyvr11jl",lg:"fyvr11jm",xl:"fyvr11jn"},defaultClass:"fyvr11jk"},stretch:{conditions:{sm:"fyvr11jo",md:"fyvr11jp",lg:"fyvr11jq",xl:"fyvr11jr"},defaultClass:"fyvr11jo"},"space-around":{conditions:{sm:"fyvr11js",md:"fyvr11jt",lg:"fyvr11ju",xl:"fyvr11jv"},defaultClass:"fyvr11js"},"space-between":{conditions:{sm:"fyvr11jw",md:"fyvr11jx",lg:"fyvr11jy",xl:"fyvr11jz"},defaultClass:"fyvr11jw"},"space-evenly":{conditions:{sm:"fyvr11k0",md:"fyvr11k1",lg:"fyvr11k2",xl:"fyvr11k3"},defaultClass:"fyvr11k0"}}},justifySelf:{values:{"flex-start":{conditions:{sm:"fyvr11k4",md:"fyvr11k5",lg:"fyvr11k6",xl:"fyvr11k7"},defaultClass:"fyvr11k4"},center:{conditions:{sm:"fyvr11k8",md:"fyvr11k9",lg:"fyvr11ka",xl:"fyvr11kb"},defaultClass:"fyvr11k8"},"flex-end":{conditions:{sm:"fyvr11kc",md:"fyvr11kd",lg:"fyvr11ke",xl:"fyvr11kf"},defaultClass:"fyvr11kc"},stretch:{conditions:{sm:"fyvr11kg",md:"fyvr11kh",lg:"fyvr11ki",xl:"fyvr11kj"},defaultClass:"fyvr11kg"}}},alignItems:{values:{"flex-start":{conditions:{sm:"fyvr11kk",md:"fyvr11kl",lg:"fyvr11km",xl:"fyvr11kn"},defaultClass:"fyvr11kk"},center:{conditions:{sm:"fyvr11ko",md:"fyvr11kp",lg:"fyvr11kq",xl:"fyvr11kr"},defaultClass:"fyvr11ko"},"flex-end":{conditions:{sm:"fyvr11ks",md:"fyvr11kt",lg:"fyvr11ku",xl:"fyvr11kv"},defaultClass:"fyvr11ks"},stretch:{conditions:{sm:"fyvr11kw",md:"fyvr11kx",lg:"fyvr11ky",xl:"fyvr11kz"},defaultClass:"fyvr11kw"},baseline:{conditions:{sm:"fyvr11l0",md:"fyvr11l1",lg:"fyvr11l2",xl:"fyvr11l3"},defaultClass:"fyvr11l0"}}},alignSelf:{values:{"flex-start":{conditions:{sm:"fyvr11l4",md:"fyvr11l5",lg:"fyvr11l6",xl:"fyvr11l7"},defaultClass:"fyvr11l4"},center:{conditions:{sm:"fyvr11l8",md:"fyvr11l9",lg:"fyvr11la",xl:"fyvr11lb"},defaultClass:"fyvr11l8"},"flex-end":{conditions:{sm:"fyvr11lc",md:"fyvr11ld",lg:"fyvr11le",xl:"fyvr11lf"},defaultClass:"fyvr11lc"},stretch:{conditions:{sm:"fyvr11lg",md:"fyvr11lh",lg:"fyvr11li",xl:"fyvr11lj"},defaultClass:"fyvr11lg"},baseline:{conditions:{sm:"fyvr11lk",md:"fyvr11ll",lg:"fyvr11lm",xl:"fyvr11ln"},defaultClass:"fyvr11lk"}}},overflowX:{values:{auto:{conditions:{sm:"fyvr11lo",md:"fyvr11lp",lg:"fyvr11lq",xl:"fyvr11lr"},defaultClass:"fyvr11lo"},hidden:{conditions:{sm:"fyvr11ls",md:"fyvr11lt",lg:"fyvr11lu",xl:"fyvr11lv"},defaultClass:"fyvr11ls"},scroll:{conditions:{sm:"fyvr11lw",md:"fyvr11lx",lg:"fyvr11ly",xl:"fyvr11lz"},defaultClass:"fyvr11lw"},visible:{conditions:{sm:"fyvr11m0",md:"fyvr11m1",lg:"fyvr11m2",xl:"fyvr11m3"},defaultClass:"fyvr11m0"}}},overflowY:{values:{auto:{conditions:{sm:"fyvr11m4",md:"fyvr11m5",lg:"fyvr11m6",xl:"fyvr11m7"},defaultClass:"fyvr11m4"},hidden:{conditions:{sm:"fyvr11m8",md:"fyvr11m9",lg:"fyvr11ma",xl:"fyvr11mb"},defaultClass:"fyvr11m8"},scroll:{conditions:{sm:"fyvr11mc",md:"fyvr11md",lg:"fyvr11me",xl:"fyvr11mf"},defaultClass:"fyvr11mc"},visible:{conditions:{sm:"fyvr11mg",md:"fyvr11mh",lg:"fyvr11mi",xl:"fyvr11mj"},defaultClass:"fyvr11mg"}}},visibility:{values:{hidden:{conditions:{sm:"fyvr11mk",md:"fyvr11ml",lg:"fyvr11mm",xl:"fyvr11mn"},defaultClass:"fyvr11mk"},visible:{conditions:{sm:"fyvr11mo",md:"fyvr11mp",lg:"fyvr11mq",xl:"fyvr11mr"},defaultClass:"fyvr11mo"}}}}},{conditions:void 0,styles:{backdropFilter:{values:{blur:{defaultClass:"fyvr11ms"},none:{defaultClass:"fyvr11mt"}}},fontFamily:{values:{inherit:{defaultClass:"fyvr11mu"},body:{defaultClass:"fyvr11mv"},mono:{defaultClass:"fyvr11mw"}}},textOverflow:{values:{ellipsis:{defaultClass:"fyvr11mx"},clip:{defaultClass:"fyvr11my"}}},textTransform:{values:{capitalize:{defaultClass:"fyvr11mz"},lowercase:{defaultClass:"fyvr11n0"},uppercase:{defaultClass:"fyvr11n1"}}},textDecoration:{values:{none:{defaultClass:"fyvr11n2"},underline:{defaultClass:"fyvr11n3"}}},userSelect:{values:{none:{defaultClass:"fyvr11n4"},text:{defaultClass:"fyvr11n5"},all:{defaultClass:"fyvr11n6"},auto:{defaultClass:"fyvr11n7"}}},whiteSpace:{values:{normal:{defaultClass:"fyvr11n8"},nowrap:{defaultClass:"fyvr11n9"},initial:{defaultClass:"fyvr11na"},inherit:{defaultClass:"fyvr11nb"}}},wordBreak:{values:{"break-word":{defaultClass:"fyvr11nc"}}},wordWrap:{values:{normal:{defaultClass:"fyvr11nd"},"break-word":{defaultClass:"fyvr11ne"},initial:{defaultClass:"fyvr11nf"},inherit:{defaultClass:"fyvr11ng"}}},zIndex:{values:{0:{defaultClass:"fyvr11nh"},1:{defaultClass:"fyvr11ni"},10:{defaultClass:"fyvr11nj"},20:{defaultClass:"fyvr11nk"},30:{defaultClass:"fyvr11nl"},40:{defaultClass:"fyvr11nm"},50:{defaultClass:"fyvr11nn"},"-1":{defaultClass:"fyvr11no"},auto:{defaultClass:"fyvr11np"}}},aspectRatio:{values:{"1/1":{defaultClass:"fyvr11nq"},"16/9":{defaultClass:"fyvr11nr"},"4/3":{defaultClass:"fyvr11ns"},"3/1":{defaultClass:"fyvr11nt"},auto:{defaultClass:"fyvr11nu"}}}}},{conditions:{defaultCondition:"base",conditionNames:["base","active","disabled","focus","hover","checked"],responsiveArray:void 0},styles:{borderColor:{mappings:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]},borderStyle:{mappings:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},focusRing:{mappings:["boxShadow","outline"]},background:{values:{black:{conditions:{base:"fyvr11nv",active:"fyvr11nw",disabled:"fyvr11nx",focus:"fyvr11ny",hover:"fyvr11nz",checked:"fyvr11o0"},defaultClass:"fyvr11nv"},white:{conditions:{base:"fyvr11o1",active:"fyvr11o2",disabled:"fyvr11o3",focus:"fyvr11o4",hover:"fyvr11o5",checked:"fyvr11o6"},defaultClass:"fyvr11o1"},inherit:{conditions:{base:"fyvr11o7",active:"fyvr11o8",disabled:"fyvr11o9",focus:"fyvr11oa",hover:"fyvr11ob",checked:"fyvr11oc"},defaultClass:"fyvr11o7"},transparent:{conditions:{base:"fyvr11od",active:"fyvr11oe",disabled:"fyvr11of",focus:"fyvr11og",hover:"fyvr11oh",checked:"fyvr11oi"},defaultClass:"fyvr11od"},positive:{conditions:{base:"fyvr11oj",active:"fyvr11ok",disabled:"fyvr11ol",focus:"fyvr11om",hover:"fyvr11on",checked:"fyvr11oo"},defaultClass:"fyvr11oj"},negative:{conditions:{base:"fyvr11op",active:"fyvr11oq",disabled:"fyvr11or",focus:"fyvr11os",hover:"fyvr11ot",checked:"fyvr11ou"},defaultClass:"fyvr11op"},info:{conditions:{base:"fyvr11ov",active:"fyvr11ow",disabled:"fyvr11ox",focus:"fyvr11oy",hover:"fyvr11oz",checked:"fyvr11p0"},defaultClass:"fyvr11ov"},warning:{conditions:{base:"fyvr11p1",active:"fyvr11p2",disabled:"fyvr11p3",focus:"fyvr11p4",hover:"fyvr11p5",checked:"fyvr11p6"},defaultClass:"fyvr11p1"},gradientBackdrop:{conditions:{base:"fyvr11p7",active:"fyvr11p8",disabled:"fyvr11p9",focus:"fyvr11pa",hover:"fyvr11pb",checked:"fyvr11pc"},defaultClass:"fyvr11p7"},gradientPrimary:{conditions:{base:"fyvr11pd",active:"fyvr11pe",disabled:"fyvr11pf",focus:"fyvr11pg",hover:"fyvr11ph",checked:"fyvr11pi"},defaultClass:"fyvr11pd"},gradientSecondary:{conditions:{base:"fyvr11pj",active:"fyvr11pk",disabled:"fyvr11pl",focus:"fyvr11pm",hover:"fyvr11pn",checked:"fyvr11po"},defaultClass:"fyvr11pj"},arbitrumDark:{conditions:{base:"fyvr11pp",active:"fyvr11pq",disabled:"fyvr11pr",focus:"fyvr11ps",hover:"fyvr11pt",checked:"fyvr11pu"},defaultClass:"fyvr11pp"},arbitrumLight:{conditions:{base:"fyvr11pv",active:"fyvr11pw",disabled:"fyvr11px",focus:"fyvr11py",hover:"fyvr11pz",checked:"fyvr11q0"},defaultClass:"fyvr11pv"},avalanceDark:{conditions:{base:"fyvr11q1",active:"fyvr11q2",disabled:"fyvr11q3",focus:"fyvr11q4",hover:"fyvr11q5",checked:"fyvr11q6"},defaultClass:"fyvr11q1"},avalanceLight:{conditions:{base:"fyvr11q7",active:"fyvr11q8",disabled:"fyvr11q9",focus:"fyvr11qa",hover:"fyvr11qb",checked:"fyvr11qc"},defaultClass:"fyvr11q7"},bscDark:{conditions:{base:"fyvr11qd",active:"fyvr11qe",disabled:"fyvr11qf",focus:"fyvr11qg",hover:"fyvr11qh",checked:"fyvr11qi"},defaultClass:"fyvr11qd"},bscLight:{conditions:{base:"fyvr11qj",active:"fyvr11qk",disabled:"fyvr11ql",focus:"fyvr11qm",hover:"fyvr11qn",checked:"fyvr11qo"},defaultClass:"fyvr11qj"},ethereumDark:{conditions:{base:"fyvr11qp",active:"fyvr11qq",disabled:"fyvr11qr",focus:"fyvr11qs",hover:"fyvr11qt",checked:"fyvr11qu"},defaultClass:"fyvr11qp"},ethereumLight:{conditions:{base:"fyvr11qv",active:"fyvr11qw",disabled:"fyvr11qx",focus:"fyvr11qy",hover:"fyvr11qz",checked:"fyvr11r0"},defaultClass:"fyvr11qv"},gnosisDark:{conditions:{base:"fyvr11r1",active:"fyvr11r2",disabled:"fyvr11r3",focus:"fyvr11r4",hover:"fyvr11r5",checked:"fyvr11r6"},defaultClass:"fyvr11r1"},gnosisLight:{conditions:{base:"fyvr11r7",active:"fyvr11r8",disabled:"fyvr11r9",focus:"fyvr11ra",hover:"fyvr11rb",checked:"fyvr11rc"},defaultClass:"fyvr11r7"},polygonDark:{conditions:{base:"fyvr11rd",active:"fyvr11re",disabled:"fyvr11rf",focus:"fyvr11rg",hover:"fyvr11rh",checked:"fyvr11ri"},defaultClass:"fyvr11rd"},polygonLight:{conditions:{base:"fyvr11rj",active:"fyvr11rk",disabled:"fyvr11rl",focus:"fyvr11rm",hover:"fyvr11rn",checked:"fyvr11ro"},defaultClass:"fyvr11rj"},text100:{conditions:{base:"fyvr11rp",active:"fyvr11rq",disabled:"fyvr11rr",focus:"fyvr11rs",hover:"fyvr11rt",checked:"fyvr11ru"},defaultClass:"fyvr11rp"},text80:{conditions:{base:"fyvr11rv",active:"fyvr11rw",disabled:"fyvr11rx",focus:"fyvr11ry",hover:"fyvr11rz",checked:"fyvr11s0"},defaultClass:"fyvr11rv"},text50:{conditions:{base:"fyvr11s1",active:"fyvr11s2",disabled:"fyvr11s3",focus:"fyvr11s4",hover:"fyvr11s5",checked:"fyvr11s6"},defaultClass:"fyvr11s1"},textInverse100:{conditions:{base:"fyvr11s7",active:"fyvr11s8",disabled:"fyvr11s9",focus:"fyvr11sa",hover:"fyvr11sb",checked:"fyvr11sc"},defaultClass:"fyvr11s7"},backgroundPrimary:{conditions:{base:"fyvr11sd",active:"fyvr11se",disabled:"fyvr11sf",focus:"fyvr11sg",hover:"fyvr11sh",checked:"fyvr11si"},defaultClass:"fyvr11sd"},backgroundSecondary:{conditions:{base:"fyvr11sj",active:"fyvr11sk",disabled:"fyvr11sl",focus:"fyvr11sm",hover:"fyvr11sn",checked:"fyvr11so"},defaultClass:"fyvr11sj"},backgroundContrast:{conditions:{base:"fyvr11sp",active:"fyvr11sq",disabled:"fyvr11sr",focus:"fyvr11ss",hover:"fyvr11st",checked:"fyvr11su"},defaultClass:"fyvr11sp"},backgroundMuted:{conditions:{base:"fyvr11sv",active:"fyvr11sw",disabled:"fyvr11sx",focus:"fyvr11sy",hover:"fyvr11sz",checked:"fyvr11t0"},defaultClass:"fyvr11sv"},backgroundControl:{conditions:{base:"fyvr11t1",active:"fyvr11t2",disabled:"fyvr11t3",focus:"fyvr11t4",hover:"fyvr11t5",checked:"fyvr11t6"},defaultClass:"fyvr11t1"},backgroundInverse:{conditions:{base:"fyvr11t7",active:"fyvr11t8",disabled:"fyvr11t9",focus:"fyvr11ta",hover:"fyvr11tb",checked:"fyvr11tc"},defaultClass:"fyvr11t7"},backgroundBackdrop:{conditions:{base:"fyvr11td",active:"fyvr11te",disabled:"fyvr11tf",focus:"fyvr11tg",hover:"fyvr11th",checked:"fyvr11ti"},defaultClass:"fyvr11td"},backgroundOverlay:{conditions:{base:"fyvr11tj",active:"fyvr11tk",disabled:"fyvr11tl",focus:"fyvr11tm",hover:"fyvr11tn",checked:"fyvr11to"},defaultClass:"fyvr11tj"},backgroundRaised:{conditions:{base:"fyvr11tp",active:"fyvr11tq",disabled:"fyvr11tr",focus:"fyvr11ts",hover:"fyvr11tt",checked:"fyvr11tu"},defaultClass:"fyvr11tp"},buttonGlass:{conditions:{base:"fyvr11tv",active:"fyvr11tw",disabled:"fyvr11tx",focus:"fyvr11ty",hover:"fyvr11tz",checked:"fyvr11u0"},defaultClass:"fyvr11tv"},buttonEmphasis:{conditions:{base:"fyvr11u1",active:"fyvr11u2",disabled:"fyvr11u3",focus:"fyvr11u4",hover:"fyvr11u5",checked:"fyvr11u6"},defaultClass:"fyvr11u1"},buttonInverse:{conditions:{base:"fyvr11u7",active:"fyvr11u8",disabled:"fyvr11u9",focus:"fyvr11ua",hover:"fyvr11ub",checked:"fyvr11uc"},defaultClass:"fyvr11u7"},borderNormal:{conditions:{base:"fyvr11ud",active:"fyvr11ue",disabled:"fyvr11uf",focus:"fyvr11ug",hover:"fyvr11uh",checked:"fyvr11ui"},defaultClass:"fyvr11ud"},borderFocus:{conditions:{base:"fyvr11uj",active:"fyvr11uk",disabled:"fyvr11ul",focus:"fyvr11um",hover:"fyvr11un",checked:"fyvr11uo"},defaultClass:"fyvr11uj"}}},borderBottomColor:{values:{black:{conditions:{base:"fyvr11up",active:"fyvr11uq",disabled:"fyvr11ur",focus:"fyvr11us",hover:"fyvr11ut",checked:"fyvr11uu"},defaultClass:"fyvr11up"},white:{conditions:{base:"fyvr11uv",active:"fyvr11uw",disabled:"fyvr11ux",focus:"fyvr11uy",hover:"fyvr11uz",checked:"fyvr11v0"},defaultClass:"fyvr11uv"},inherit:{conditions:{base:"fyvr11v1",active:"fyvr11v2",disabled:"fyvr11v3",focus:"fyvr11v4",hover:"fyvr11v5",checked:"fyvr11v6"},defaultClass:"fyvr11v1"},transparent:{conditions:{base:"fyvr11v7",active:"fyvr11v8",disabled:"fyvr11v9",focus:"fyvr11va",hover:"fyvr11vb",checked:"fyvr11vc"},defaultClass:"fyvr11v7"},positive:{conditions:{base:"fyvr11vd",active:"fyvr11ve",disabled:"fyvr11vf",focus:"fyvr11vg",hover:"fyvr11vh",checked:"fyvr11vi"},defaultClass:"fyvr11vd"},negative:{conditions:{base:"fyvr11vj",active:"fyvr11vk",disabled:"fyvr11vl",focus:"fyvr11vm",hover:"fyvr11vn",checked:"fyvr11vo"},defaultClass:"fyvr11vj"},info:{conditions:{base:"fyvr11vp",active:"fyvr11vq",disabled:"fyvr11vr",focus:"fyvr11vs",hover:"fyvr11vt",checked:"fyvr11vu"},defaultClass:"fyvr11vp"},warning:{conditions:{base:"fyvr11vv",active:"fyvr11vw",disabled:"fyvr11vx",focus:"fyvr11vy",hover:"fyvr11vz",checked:"fyvr11w0"},defaultClass:"fyvr11vv"},gradientBackdrop:{conditions:{base:"fyvr11w1",active:"fyvr11w2",disabled:"fyvr11w3",focus:"fyvr11w4",hover:"fyvr11w5",checked:"fyvr11w6"},defaultClass:"fyvr11w1"},gradientPrimary:{conditions:{base:"fyvr11w7",active:"fyvr11w8",disabled:"fyvr11w9",focus:"fyvr11wa",hover:"fyvr11wb",checked:"fyvr11wc"},defaultClass:"fyvr11w7"},gradientSecondary:{conditions:{base:"fyvr11wd",active:"fyvr11we",disabled:"fyvr11wf",focus:"fyvr11wg",hover:"fyvr11wh",checked:"fyvr11wi"},defaultClass:"fyvr11wd"},arbitrumDark:{conditions:{base:"fyvr11wj",active:"fyvr11wk",disabled:"fyvr11wl",focus:"fyvr11wm",hover:"fyvr11wn",checked:"fyvr11wo"},defaultClass:"fyvr11wj"},arbitrumLight:{conditions:{base:"fyvr11wp",active:"fyvr11wq",disabled:"fyvr11wr",focus:"fyvr11ws",hover:"fyvr11wt",checked:"fyvr11wu"},defaultClass:"fyvr11wp"},avalanceDark:{conditions:{base:"fyvr11wv",active:"fyvr11ww",disabled:"fyvr11wx",focus:"fyvr11wy",hover:"fyvr11wz",checked:"fyvr11x0"},defaultClass:"fyvr11wv"},avalanceLight:{conditions:{base:"fyvr11x1",active:"fyvr11x2",disabled:"fyvr11x3",focus:"fyvr11x4",hover:"fyvr11x5",checked:"fyvr11x6"},defaultClass:"fyvr11x1"},bscDark:{conditions:{base:"fyvr11x7",active:"fyvr11x8",disabled:"fyvr11x9",focus:"fyvr11xa",hover:"fyvr11xb",checked:"fyvr11xc"},defaultClass:"fyvr11x7"},bscLight:{conditions:{base:"fyvr11xd",active:"fyvr11xe",disabled:"fyvr11xf",focus:"fyvr11xg",hover:"fyvr11xh",checked:"fyvr11xi"},defaultClass:"fyvr11xd"},ethereumDark:{conditions:{base:"fyvr11xj",active:"fyvr11xk",disabled:"fyvr11xl",focus:"fyvr11xm",hover:"fyvr11xn",checked:"fyvr11xo"},defaultClass:"fyvr11xj"},ethereumLight:{conditions:{base:"fyvr11xp",active:"fyvr11xq",disabled:"fyvr11xr",focus:"fyvr11xs",hover:"fyvr11xt",checked:"fyvr11xu"},defaultClass:"fyvr11xp"},gnosisDark:{conditions:{base:"fyvr11xv",active:"fyvr11xw",disabled:"fyvr11xx",focus:"fyvr11xy",hover:"fyvr11xz",checked:"fyvr11y0"},defaultClass:"fyvr11xv"},gnosisLight:{conditions:{base:"fyvr11y1",active:"fyvr11y2",disabled:"fyvr11y3",focus:"fyvr11y4",hover:"fyvr11y5",checked:"fyvr11y6"},defaultClass:"fyvr11y1"},polygonDark:{conditions:{base:"fyvr11y7",active:"fyvr11y8",disabled:"fyvr11y9",focus:"fyvr11ya",hover:"fyvr11yb",checked:"fyvr11yc"},defaultClass:"fyvr11y7"},polygonLight:{conditions:{base:"fyvr11yd",active:"fyvr11ye",disabled:"fyvr11yf",focus:"fyvr11yg",hover:"fyvr11yh",checked:"fyvr11yi"},defaultClass:"fyvr11yd"},text100:{conditions:{base:"fyvr11yj",active:"fyvr11yk",disabled:"fyvr11yl",focus:"fyvr11ym",hover:"fyvr11yn",checked:"fyvr11yo"},defaultClass:"fyvr11yj"},text80:{conditions:{base:"fyvr11yp",active:"fyvr11yq",disabled:"fyvr11yr",focus:"fyvr11ys",hover:"fyvr11yt",checked:"fyvr11yu"},defaultClass:"fyvr11yp"},text50:{conditions:{base:"fyvr11yv",active:"fyvr11yw",disabled:"fyvr11yx",focus:"fyvr11yy",hover:"fyvr11yz",checked:"fyvr11z0"},defaultClass:"fyvr11yv"},textInverse100:{conditions:{base:"fyvr11z1",active:"fyvr11z2",disabled:"fyvr11z3",focus:"fyvr11z4",hover:"fyvr11z5",checked:"fyvr11z6"},defaultClass:"fyvr11z1"},backgroundPrimary:{conditions:{base:"fyvr11z7",active:"fyvr11z8",disabled:"fyvr11z9",focus:"fyvr11za",hover:"fyvr11zb",checked:"fyvr11zc"},defaultClass:"fyvr11z7"},backgroundSecondary:{conditions:{base:"fyvr11zd",active:"fyvr11ze",disabled:"fyvr11zf",focus:"fyvr11zg",hover:"fyvr11zh",checked:"fyvr11zi"},defaultClass:"fyvr11zd"},backgroundContrast:{conditions:{base:"fyvr11zj",active:"fyvr11zk",disabled:"fyvr11zl",focus:"fyvr11zm",hover:"fyvr11zn",checked:"fyvr11zo"},defaultClass:"fyvr11zj"},backgroundMuted:{conditions:{base:"fyvr11zp",active:"fyvr11zq",disabled:"fyvr11zr",focus:"fyvr11zs",hover:"fyvr11zt",checked:"fyvr11zu"},defaultClass:"fyvr11zp"},backgroundControl:{conditions:{base:"fyvr11zv",active:"fyvr11zw",disabled:"fyvr11zx",focus:"fyvr11zy",hover:"fyvr11zz",checked:"fyvr1200"},defaultClass:"fyvr11zv"},backgroundInverse:{conditions:{base:"fyvr1201",active:"fyvr1202",disabled:"fyvr1203",focus:"fyvr1204",hover:"fyvr1205",checked:"fyvr1206"},defaultClass:"fyvr1201"},backgroundBackdrop:{conditions:{base:"fyvr1207",active:"fyvr1208",disabled:"fyvr1209",focus:"fyvr120a",hover:"fyvr120b",checked:"fyvr120c"},defaultClass:"fyvr1207"},backgroundOverlay:{conditions:{base:"fyvr120d",active:"fyvr120e",disabled:"fyvr120f",focus:"fyvr120g",hover:"fyvr120h",checked:"fyvr120i"},defaultClass:"fyvr120d"},backgroundRaised:{conditions:{base:"fyvr120j",active:"fyvr120k",disabled:"fyvr120l",focus:"fyvr120m",hover:"fyvr120n",checked:"fyvr120o"},defaultClass:"fyvr120j"},buttonGlass:{conditions:{base:"fyvr120p",active:"fyvr120q",disabled:"fyvr120r",focus:"fyvr120s",hover:"fyvr120t",checked:"fyvr120u"},defaultClass:"fyvr120p"},buttonEmphasis:{conditions:{base:"fyvr120v",active:"fyvr120w",disabled:"fyvr120x",focus:"fyvr120y",hover:"fyvr120z",checked:"fyvr1210"},defaultClass:"fyvr120v"},buttonInverse:{conditions:{base:"fyvr1211",active:"fyvr1212",disabled:"fyvr1213",focus:"fyvr1214",hover:"fyvr1215",checked:"fyvr1216"},defaultClass:"fyvr1211"},borderNormal:{conditions:{base:"fyvr1217",active:"fyvr1218",disabled:"fyvr1219",focus:"fyvr121a",hover:"fyvr121b",checked:"fyvr121c"},defaultClass:"fyvr1217"},borderFocus:{conditions:{base:"fyvr121d",active:"fyvr121e",disabled:"fyvr121f",focus:"fyvr121g",hover:"fyvr121h",checked:"fyvr121i"},defaultClass:"fyvr121d"}}},borderBottomStyle:{values:{solid:{conditions:{base:"fyvr121j",active:"fyvr121k",disabled:"fyvr121l",focus:"fyvr121m",hover:"fyvr121n",checked:"fyvr121o"},defaultClass:"fyvr121j"},dashed:{conditions:{base:"fyvr121p",active:"fyvr121q",disabled:"fyvr121r",focus:"fyvr121s",hover:"fyvr121t",checked:"fyvr121u"},defaultClass:"fyvr121p"},dotted:{conditions:{base:"fyvr121v",active:"fyvr121w",disabled:"fyvr121x",focus:"fyvr121y",hover:"fyvr121z",checked:"fyvr1220"},defaultClass:"fyvr121v"}}},borderLeftColor:{values:{black:{conditions:{base:"fyvr1221",active:"fyvr1222",disabled:"fyvr1223",focus:"fyvr1224",hover:"fyvr1225",checked:"fyvr1226"},defaultClass:"fyvr1221"},white:{conditions:{base:"fyvr1227",active:"fyvr1228",disabled:"fyvr1229",focus:"fyvr122a",hover:"fyvr122b",checked:"fyvr122c"},defaultClass:"fyvr1227"},inherit:{conditions:{base:"fyvr122d",active:"fyvr122e",disabled:"fyvr122f",focus:"fyvr122g",hover:"fyvr122h",checked:"fyvr122i"},defaultClass:"fyvr122d"},transparent:{conditions:{base:"fyvr122j",active:"fyvr122k",disabled:"fyvr122l",focus:"fyvr122m",hover:"fyvr122n",checked:"fyvr122o"},defaultClass:"fyvr122j"},positive:{conditions:{base:"fyvr122p",active:"fyvr122q",disabled:"fyvr122r",focus:"fyvr122s",hover:"fyvr122t",checked:"fyvr122u"},defaultClass:"fyvr122p"},negative:{conditions:{base:"fyvr122v",active:"fyvr122w",disabled:"fyvr122x",focus:"fyvr122y",hover:"fyvr122z",checked:"fyvr1230"},defaultClass:"fyvr122v"},info:{conditions:{base:"fyvr1231",active:"fyvr1232",disabled:"fyvr1233",focus:"fyvr1234",hover:"fyvr1235",checked:"fyvr1236"},defaultClass:"fyvr1231"},warning:{conditions:{base:"fyvr1237",active:"fyvr1238",disabled:"fyvr1239",focus:"fyvr123a",hover:"fyvr123b",checked:"fyvr123c"},defaultClass:"fyvr1237"},gradientBackdrop:{conditions:{base:"fyvr123d",active:"fyvr123e",disabled:"fyvr123f",focus:"fyvr123g",hover:"fyvr123h",checked:"fyvr123i"},defaultClass:"fyvr123d"},gradientPrimary:{conditions:{base:"fyvr123j",active:"fyvr123k",disabled:"fyvr123l",focus:"fyvr123m",hover:"fyvr123n",checked:"fyvr123o"},defaultClass:"fyvr123j"},gradientSecondary:{conditions:{base:"fyvr123p",active:"fyvr123q",disabled:"fyvr123r",focus:"fyvr123s",hover:"fyvr123t",checked:"fyvr123u"},defaultClass:"fyvr123p"},arbitrumDark:{conditions:{base:"fyvr123v",active:"fyvr123w",disabled:"fyvr123x",focus:"fyvr123y",hover:"fyvr123z",checked:"fyvr1240"},defaultClass:"fyvr123v"},arbitrumLight:{conditions:{base:"fyvr1241",active:"fyvr1242",disabled:"fyvr1243",focus:"fyvr1244",hover:"fyvr1245",checked:"fyvr1246"},defaultClass:"fyvr1241"},avalanceDark:{conditions:{base:"fyvr1247",active:"fyvr1248",disabled:"fyvr1249",focus:"fyvr124a",hover:"fyvr124b",checked:"fyvr124c"},defaultClass:"fyvr1247"},avalanceLight:{conditions:{base:"fyvr124d",active:"fyvr124e",disabled:"fyvr124f",focus:"fyvr124g",hover:"fyvr124h",checked:"fyvr124i"},defaultClass:"fyvr124d"},bscDark:{conditions:{base:"fyvr124j",active:"fyvr124k",disabled:"fyvr124l",focus:"fyvr124m",hover:"fyvr124n",checked:"fyvr124o"},defaultClass:"fyvr124j"},bscLight:{conditions:{base:"fyvr124p",active:"fyvr124q",disabled:"fyvr124r",focus:"fyvr124s",hover:"fyvr124t",checked:"fyvr124u"},defaultClass:"fyvr124p"},ethereumDark:{conditions:{base:"fyvr124v",active:"fyvr124w",disabled:"fyvr124x",focus:"fyvr124y",hover:"fyvr124z",checked:"fyvr1250"},defaultClass:"fyvr124v"},ethereumLight:{conditions:{base:"fyvr1251",active:"fyvr1252",disabled:"fyvr1253",focus:"fyvr1254",hover:"fyvr1255",checked:"fyvr1256"},defaultClass:"fyvr1251"},gnosisDark:{conditions:{base:"fyvr1257",active:"fyvr1258",disabled:"fyvr1259",focus:"fyvr125a",hover:"fyvr125b",checked:"fyvr125c"},defaultClass:"fyvr1257"},gnosisLight:{conditions:{base:"fyvr125d",active:"fyvr125e",disabled:"fyvr125f",focus:"fyvr125g",hover:"fyvr125h",checked:"fyvr125i"},defaultClass:"fyvr125d"},polygonDark:{conditions:{base:"fyvr125j",active:"fyvr125k",disabled:"fyvr125l",focus:"fyvr125m",hover:"fyvr125n",checked:"fyvr125o"},defaultClass:"fyvr125j"},polygonLight:{conditions:{base:"fyvr125p",active:"fyvr125q",disabled:"fyvr125r",focus:"fyvr125s",hover:"fyvr125t",checked:"fyvr125u"},defaultClass:"fyvr125p"},text100:{conditions:{base:"fyvr125v",active:"fyvr125w",disabled:"fyvr125x",focus:"fyvr125y",hover:"fyvr125z",checked:"fyvr1260"},defaultClass:"fyvr125v"},text80:{conditions:{base:"fyvr1261",active:"fyvr1262",disabled:"fyvr1263",focus:"fyvr1264",hover:"fyvr1265",checked:"fyvr1266"},defaultClass:"fyvr1261"},text50:{conditions:{base:"fyvr1267",active:"fyvr1268",disabled:"fyvr1269",focus:"fyvr126a",hover:"fyvr126b",checked:"fyvr126c"},defaultClass:"fyvr1267"},textInverse100:{conditions:{base:"fyvr126d",active:"fyvr126e",disabled:"fyvr126f",focus:"fyvr126g",hover:"fyvr126h",checked:"fyvr126i"},defaultClass:"fyvr126d"},backgroundPrimary:{conditions:{base:"fyvr126j",active:"fyvr126k",disabled:"fyvr126l",focus:"fyvr126m",hover:"fyvr126n",checked:"fyvr126o"},defaultClass:"fyvr126j"},backgroundSecondary:{conditions:{base:"fyvr126p",active:"fyvr126q",disabled:"fyvr126r",focus:"fyvr126s",hover:"fyvr126t",checked:"fyvr126u"},defaultClass:"fyvr126p"},backgroundContrast:{conditions:{base:"fyvr126v",active:"fyvr126w",disabled:"fyvr126x",focus:"fyvr126y",hover:"fyvr126z",checked:"fyvr1270"},defaultClass:"fyvr126v"},backgroundMuted:{conditions:{base:"fyvr1271",active:"fyvr1272",disabled:"fyvr1273",focus:"fyvr1274",hover:"fyvr1275",checked:"fyvr1276"},defaultClass:"fyvr1271"},backgroundControl:{conditions:{base:"fyvr1277",active:"fyvr1278",disabled:"fyvr1279",focus:"fyvr127a",hover:"fyvr127b",checked:"fyvr127c"},defaultClass:"fyvr1277"},backgroundInverse:{conditions:{base:"fyvr127d",active:"fyvr127e",disabled:"fyvr127f",focus:"fyvr127g",hover:"fyvr127h",checked:"fyvr127i"},defaultClass:"fyvr127d"},backgroundBackdrop:{conditions:{base:"fyvr127j",active:"fyvr127k",disabled:"fyvr127l",focus:"fyvr127m",hover:"fyvr127n",checked:"fyvr127o"},defaultClass:"fyvr127j"},backgroundOverlay:{conditions:{base:"fyvr127p",active:"fyvr127q",disabled:"fyvr127r",focus:"fyvr127s",hover:"fyvr127t",checked:"fyvr127u"},defaultClass:"fyvr127p"},backgroundRaised:{conditions:{base:"fyvr127v",active:"fyvr127w",disabled:"fyvr127x",focus:"fyvr127y",hover:"fyvr127z",checked:"fyvr1280"},defaultClass:"fyvr127v"},buttonGlass:{conditions:{base:"fyvr1281",active:"fyvr1282",disabled:"fyvr1283",focus:"fyvr1284",hover:"fyvr1285",checked:"fyvr1286"},defaultClass:"fyvr1281"},buttonEmphasis:{conditions:{base:"fyvr1287",active:"fyvr1288",disabled:"fyvr1289",focus:"fyvr128a",hover:"fyvr128b",checked:"fyvr128c"},defaultClass:"fyvr1287"},buttonInverse:{conditions:{base:"fyvr128d",active:"fyvr128e",disabled:"fyvr128f",focus:"fyvr128g",hover:"fyvr128h",checked:"fyvr128i"},defaultClass:"fyvr128d"},borderNormal:{conditions:{base:"fyvr128j",active:"fyvr128k",disabled:"fyvr128l",focus:"fyvr128m",hover:"fyvr128n",checked:"fyvr128o"},defaultClass:"fyvr128j"},borderFocus:{conditions:{base:"fyvr128p",active:"fyvr128q",disabled:"fyvr128r",focus:"fyvr128s",hover:"fyvr128t",checked:"fyvr128u"},defaultClass:"fyvr128p"}}},borderLeftStyle:{values:{solid:{conditions:{base:"fyvr128v",active:"fyvr128w",disabled:"fyvr128x",focus:"fyvr128y",hover:"fyvr128z",checked:"fyvr1290"},defaultClass:"fyvr128v"},dashed:{conditions:{base:"fyvr1291",active:"fyvr1292",disabled:"fyvr1293",focus:"fyvr1294",hover:"fyvr1295",checked:"fyvr1296"},defaultClass:"fyvr1291"},dotted:{conditions:{base:"fyvr1297",active:"fyvr1298",disabled:"fyvr1299",focus:"fyvr129a",hover:"fyvr129b",checked:"fyvr129c"},defaultClass:"fyvr1297"}}},borderRightColor:{values:{black:{conditions:{base:"fyvr129d",active:"fyvr129e",disabled:"fyvr129f",focus:"fyvr129g",hover:"fyvr129h",checked:"fyvr129i"},defaultClass:"fyvr129d"},white:{conditions:{base:"fyvr129j",active:"fyvr129k",disabled:"fyvr129l",focus:"fyvr129m",hover:"fyvr129n",checked:"fyvr129o"},defaultClass:"fyvr129j"},inherit:{conditions:{base:"fyvr129p",active:"fyvr129q",disabled:"fyvr129r",focus:"fyvr129s",hover:"fyvr129t",checked:"fyvr129u"},defaultClass:"fyvr129p"},transparent:{conditions:{base:"fyvr129v",active:"fyvr129w",disabled:"fyvr129x",focus:"fyvr129y",hover:"fyvr129z",checked:"fyvr12a0"},defaultClass:"fyvr129v"},positive:{conditions:{base:"fyvr12a1",active:"fyvr12a2",disabled:"fyvr12a3",focus:"fyvr12a4",hover:"fyvr12a5",checked:"fyvr12a6"},defaultClass:"fyvr12a1"},negative:{conditions:{base:"fyvr12a7",active:"fyvr12a8",disabled:"fyvr12a9",focus:"fyvr12aa",hover:"fyvr12ab",checked:"fyvr12ac"},defaultClass:"fyvr12a7"},info:{conditions:{base:"fyvr12ad",active:"fyvr12ae",disabled:"fyvr12af",focus:"fyvr12ag",hover:"fyvr12ah",checked:"fyvr12ai"},defaultClass:"fyvr12ad"},warning:{conditions:{base:"fyvr12aj",active:"fyvr12ak",disabled:"fyvr12al",focus:"fyvr12am",hover:"fyvr12an",checked:"fyvr12ao"},defaultClass:"fyvr12aj"},gradientBackdrop:{conditions:{base:"fyvr12ap",active:"fyvr12aq",disabled:"fyvr12ar",focus:"fyvr12as",hover:"fyvr12at",checked:"fyvr12au"},defaultClass:"fyvr12ap"},gradientPrimary:{conditions:{base:"fyvr12av",active:"fyvr12aw",disabled:"fyvr12ax",focus:"fyvr12ay",hover:"fyvr12az",checked:"fyvr12b0"},defaultClass:"fyvr12av"},gradientSecondary:{conditions:{base:"fyvr12b1",active:"fyvr12b2",disabled:"fyvr12b3",focus:"fyvr12b4",hover:"fyvr12b5",checked:"fyvr12b6"},defaultClass:"fyvr12b1"},arbitrumDark:{conditions:{base:"fyvr12b7",active:"fyvr12b8",disabled:"fyvr12b9",focus:"fyvr12ba",hover:"fyvr12bb",checked:"fyvr12bc"},defaultClass:"fyvr12b7"},arbitrumLight:{conditions:{base:"fyvr12bd",active:"fyvr12be",disabled:"fyvr12bf",focus:"fyvr12bg",hover:"fyvr12bh",checked:"fyvr12bi"},defaultClass:"fyvr12bd"},avalanceDark:{conditions:{base:"fyvr12bj",active:"fyvr12bk",disabled:"fyvr12bl",focus:"fyvr12bm",hover:"fyvr12bn",checked:"fyvr12bo"},defaultClass:"fyvr12bj"},avalanceLight:{conditions:{base:"fyvr12bp",active:"fyvr12bq",disabled:"fyvr12br",focus:"fyvr12bs",hover:"fyvr12bt",checked:"fyvr12bu"},defaultClass:"fyvr12bp"},bscDark:{conditions:{base:"fyvr12bv",active:"fyvr12bw",disabled:"fyvr12bx",focus:"fyvr12by",hover:"fyvr12bz",checked:"fyvr12c0"},defaultClass:"fyvr12bv"},bscLight:{conditions:{base:"fyvr12c1",active:"fyvr12c2",disabled:"fyvr12c3",focus:"fyvr12c4",hover:"fyvr12c5",checked:"fyvr12c6"},defaultClass:"fyvr12c1"},ethereumDark:{conditions:{base:"fyvr12c7",active:"fyvr12c8",disabled:"fyvr12c9",focus:"fyvr12ca",hover:"fyvr12cb",checked:"fyvr12cc"},defaultClass:"fyvr12c7"},ethereumLight:{conditions:{base:"fyvr12cd",active:"fyvr12ce",disabled:"fyvr12cf",focus:"fyvr12cg",hover:"fyvr12ch",checked:"fyvr12ci"},defaultClass:"fyvr12cd"},gnosisDark:{conditions:{base:"fyvr12cj",active:"fyvr12ck",disabled:"fyvr12cl",focus:"fyvr12cm",hover:"fyvr12cn",checked:"fyvr12co"},defaultClass:"fyvr12cj"},gnosisLight:{conditions:{base:"fyvr12cp",active:"fyvr12cq",disabled:"fyvr12cr",focus:"fyvr12cs",hover:"fyvr12ct",checked:"fyvr12cu"},defaultClass:"fyvr12cp"},polygonDark:{conditions:{base:"fyvr12cv",active:"fyvr12cw",disabled:"fyvr12cx",focus:"fyvr12cy",hover:"fyvr12cz",checked:"fyvr12d0"},defaultClass:"fyvr12cv"},polygonLight:{conditions:{base:"fyvr12d1",active:"fyvr12d2",disabled:"fyvr12d3",focus:"fyvr12d4",hover:"fyvr12d5",checked:"fyvr12d6"},defaultClass:"fyvr12d1"},text100:{conditions:{base:"fyvr12d7",active:"fyvr12d8",disabled:"fyvr12d9",focus:"fyvr12da",hover:"fyvr12db",checked:"fyvr12dc"},defaultClass:"fyvr12d7"},text80:{conditions:{base:"fyvr12dd",active:"fyvr12de",disabled:"fyvr12df",focus:"fyvr12dg",hover:"fyvr12dh",checked:"fyvr12di"},defaultClass:"fyvr12dd"},text50:{conditions:{base:"fyvr12dj",active:"fyvr12dk",disabled:"fyvr12dl",focus:"fyvr12dm",hover:"fyvr12dn",checked:"fyvr12do"},defaultClass:"fyvr12dj"},textInverse100:{conditions:{base:"fyvr12dp",active:"fyvr12dq",disabled:"fyvr12dr",focus:"fyvr12ds",hover:"fyvr12dt",checked:"fyvr12du"},defaultClass:"fyvr12dp"},backgroundPrimary:{conditions:{base:"fyvr12dv",active:"fyvr12dw",disabled:"fyvr12dx",focus:"fyvr12dy",hover:"fyvr12dz",checked:"fyvr12e0"},defaultClass:"fyvr12dv"},backgroundSecondary:{conditions:{base:"fyvr12e1",active:"fyvr12e2",disabled:"fyvr12e3",focus:"fyvr12e4",hover:"fyvr12e5",checked:"fyvr12e6"},defaultClass:"fyvr12e1"},backgroundContrast:{conditions:{base:"fyvr12e7",active:"fyvr12e8",disabled:"fyvr12e9",focus:"fyvr12ea",hover:"fyvr12eb",checked:"fyvr12ec"},defaultClass:"fyvr12e7"},backgroundMuted:{conditions:{base:"fyvr12ed",active:"fyvr12ee",disabled:"fyvr12ef",focus:"fyvr12eg",hover:"fyvr12eh",checked:"fyvr12ei"},defaultClass:"fyvr12ed"},backgroundControl:{conditions:{base:"fyvr12ej",active:"fyvr12ek",disabled:"fyvr12el",focus:"fyvr12em",hover:"fyvr12en",checked:"fyvr12eo"},defaultClass:"fyvr12ej"},backgroundInverse:{conditions:{base:"fyvr12ep",active:"fyvr12eq",disabled:"fyvr12er",focus:"fyvr12es",hover:"fyvr12et",checked:"fyvr12eu"},defaultClass:"fyvr12ep"},backgroundBackdrop:{conditions:{base:"fyvr12ev",active:"fyvr12ew",disabled:"fyvr12ex",focus:"fyvr12ey",hover:"fyvr12ez",checked:"fyvr12f0"},defaultClass:"fyvr12ev"},backgroundOverlay:{conditions:{base:"fyvr12f1",active:"fyvr12f2",disabled:"fyvr12f3",focus:"fyvr12f4",hover:"fyvr12f5",checked:"fyvr12f6"},defaultClass:"fyvr12f1"},backgroundRaised:{conditions:{base:"fyvr12f7",active:"fyvr12f8",disabled:"fyvr12f9",focus:"fyvr12fa",hover:"fyvr12fb",checked:"fyvr12fc"},defaultClass:"fyvr12f7"},buttonGlass:{conditions:{base:"fyvr12fd",active:"fyvr12fe",disabled:"fyvr12ff",focus:"fyvr12fg",hover:"fyvr12fh",checked:"fyvr12fi"},defaultClass:"fyvr12fd"},buttonEmphasis:{conditions:{base:"fyvr12fj",active:"fyvr12fk",disabled:"fyvr12fl",focus:"fyvr12fm",hover:"fyvr12fn",checked:"fyvr12fo"},defaultClass:"fyvr12fj"},buttonInverse:{conditions:{base:"fyvr12fp",active:"fyvr12fq",disabled:"fyvr12fr",focus:"fyvr12fs",hover:"fyvr12ft",checked:"fyvr12fu"},defaultClass:"fyvr12fp"},borderNormal:{conditions:{base:"fyvr12fv",active:"fyvr12fw",disabled:"fyvr12fx",focus:"fyvr12fy",hover:"fyvr12fz",checked:"fyvr12g0"},defaultClass:"fyvr12fv"},borderFocus:{conditions:{base:"fyvr12g1",active:"fyvr12g2",disabled:"fyvr12g3",focus:"fyvr12g4",hover:"fyvr12g5",checked:"fyvr12g6"},defaultClass:"fyvr12g1"}}},borderRightStyle:{values:{solid:{conditions:{base:"fyvr12g7",active:"fyvr12g8",disabled:"fyvr12g9",focus:"fyvr12ga",hover:"fyvr12gb",checked:"fyvr12gc"},defaultClass:"fyvr12g7"},dashed:{conditions:{base:"fyvr12gd",active:"fyvr12ge",disabled:"fyvr12gf",focus:"fyvr12gg",hover:"fyvr12gh",checked:"fyvr12gi"},defaultClass:"fyvr12gd"},dotted:{conditions:{base:"fyvr12gj",active:"fyvr12gk",disabled:"fyvr12gl",focus:"fyvr12gm",hover:"fyvr12gn",checked:"fyvr12go"},defaultClass:"fyvr12gj"}}},borderTopColor:{values:{black:{conditions:{base:"fyvr12gp",active:"fyvr12gq",disabled:"fyvr12gr",focus:"fyvr12gs",hover:"fyvr12gt",checked:"fyvr12gu"},defaultClass:"fyvr12gp"},white:{conditions:{base:"fyvr12gv",active:"fyvr12gw",disabled:"fyvr12gx",focus:"fyvr12gy",hover:"fyvr12gz",checked:"fyvr12h0"},defaultClass:"fyvr12gv"},inherit:{conditions:{base:"fyvr12h1",active:"fyvr12h2",disabled:"fyvr12h3",focus:"fyvr12h4",hover:"fyvr12h5",checked:"fyvr12h6"},defaultClass:"fyvr12h1"},transparent:{conditions:{base:"fyvr12h7",active:"fyvr12h8",disabled:"fyvr12h9",focus:"fyvr12ha",hover:"fyvr12hb",checked:"fyvr12hc"},defaultClass:"fyvr12h7"},positive:{conditions:{base:"fyvr12hd",active:"fyvr12he",disabled:"fyvr12hf",focus:"fyvr12hg",hover:"fyvr12hh",checked:"fyvr12hi"},defaultClass:"fyvr12hd"},negative:{conditions:{base:"fyvr12hj",active:"fyvr12hk",disabled:"fyvr12hl",focus:"fyvr12hm",hover:"fyvr12hn",checked:"fyvr12ho"},defaultClass:"fyvr12hj"},info:{conditions:{base:"fyvr12hp",active:"fyvr12hq",disabled:"fyvr12hr",focus:"fyvr12hs",hover:"fyvr12ht",checked:"fyvr12hu"},defaultClass:"fyvr12hp"},warning:{conditions:{base:"fyvr12hv",active:"fyvr12hw",disabled:"fyvr12hx",focus:"fyvr12hy",hover:"fyvr12hz",checked:"fyvr12i0"},defaultClass:"fyvr12hv"},gradientBackdrop:{conditions:{base:"fyvr12i1",active:"fyvr12i2",disabled:"fyvr12i3",focus:"fyvr12i4",hover:"fyvr12i5",checked:"fyvr12i6"},defaultClass:"fyvr12i1"},gradientPrimary:{conditions:{base:"fyvr12i7",active:"fyvr12i8",disabled:"fyvr12i9",focus:"fyvr12ia",hover:"fyvr12ib",checked:"fyvr12ic"},defaultClass:"fyvr12i7"},gradientSecondary:{conditions:{base:"fyvr12id",active:"fyvr12ie",disabled:"fyvr12if",focus:"fyvr12ig",hover:"fyvr12ih",checked:"fyvr12ii"},defaultClass:"fyvr12id"},arbitrumDark:{conditions:{base:"fyvr12ij",active:"fyvr12ik",disabled:"fyvr12il",focus:"fyvr12im",hover:"fyvr12in",checked:"fyvr12io"},defaultClass:"fyvr12ij"},arbitrumLight:{conditions:{base:"fyvr12ip",active:"fyvr12iq",disabled:"fyvr12ir",focus:"fyvr12is",hover:"fyvr12it",checked:"fyvr12iu"},defaultClass:"fyvr12ip"},avalanceDark:{conditions:{base:"fyvr12iv",active:"fyvr12iw",disabled:"fyvr12ix",focus:"fyvr12iy",hover:"fyvr12iz",checked:"fyvr12j0"},defaultClass:"fyvr12iv"},avalanceLight:{conditions:{base:"fyvr12j1",active:"fyvr12j2",disabled:"fyvr12j3",focus:"fyvr12j4",hover:"fyvr12j5",checked:"fyvr12j6"},defaultClass:"fyvr12j1"},bscDark:{conditions:{base:"fyvr12j7",active:"fyvr12j8",disabled:"fyvr12j9",focus:"fyvr12ja",hover:"fyvr12jb",checked:"fyvr12jc"},defaultClass:"fyvr12j7"},bscLight:{conditions:{base:"fyvr12jd",active:"fyvr12je",disabled:"fyvr12jf",focus:"fyvr12jg",hover:"fyvr12jh",checked:"fyvr12ji"},defaultClass:"fyvr12jd"},ethereumDark:{conditions:{base:"fyvr12jj",active:"fyvr12jk",disabled:"fyvr12jl",focus:"fyvr12jm",hover:"fyvr12jn",checked:"fyvr12jo"},defaultClass:"fyvr12jj"},ethereumLight:{conditions:{base:"fyvr12jp",active:"fyvr12jq",disabled:"fyvr12jr",focus:"fyvr12js",hover:"fyvr12jt",checked:"fyvr12ju"},defaultClass:"fyvr12jp"},gnosisDark:{conditions:{base:"fyvr12jv",active:"fyvr12jw",disabled:"fyvr12jx",focus:"fyvr12jy",hover:"fyvr12jz",checked:"fyvr12k0"},defaultClass:"fyvr12jv"},gnosisLight:{conditions:{base:"fyvr12k1",active:"fyvr12k2",disabled:"fyvr12k3",focus:"fyvr12k4",hover:"fyvr12k5",checked:"fyvr12k6"},defaultClass:"fyvr12k1"},polygonDark:{conditions:{base:"fyvr12k7",active:"fyvr12k8",disabled:"fyvr12k9",focus:"fyvr12ka",hover:"fyvr12kb",checked:"fyvr12kc"},defaultClass:"fyvr12k7"},polygonLight:{conditions:{base:"fyvr12kd",active:"fyvr12ke",disabled:"fyvr12kf",focus:"fyvr12kg",hover:"fyvr12kh",checked:"fyvr12ki"},defaultClass:"fyvr12kd"},text100:{conditions:{base:"fyvr12kj",active:"fyvr12kk",disabled:"fyvr12kl",focus:"fyvr12km",hover:"fyvr12kn",checked:"fyvr12ko"},defaultClass:"fyvr12kj"},text80:{conditions:{base:"fyvr12kp",active:"fyvr12kq",disabled:"fyvr12kr",focus:"fyvr12ks",hover:"fyvr12kt",checked:"fyvr12ku"},defaultClass:"fyvr12kp"},text50:{conditions:{base:"fyvr12kv",active:"fyvr12kw",disabled:"fyvr12kx",focus:"fyvr12ky",hover:"fyvr12kz",checked:"fyvr12l0"},defaultClass:"fyvr12kv"},textInverse100:{conditions:{base:"fyvr12l1",active:"fyvr12l2",disabled:"fyvr12l3",focus:"fyvr12l4",hover:"fyvr12l5",checked:"fyvr12l6"},defaultClass:"fyvr12l1"},backgroundPrimary:{conditions:{base:"fyvr12l7",active:"fyvr12l8",disabled:"fyvr12l9",focus:"fyvr12la",hover:"fyvr12lb",checked:"fyvr12lc"},defaultClass:"fyvr12l7"},backgroundSecondary:{conditions:{base:"fyvr12ld",active:"fyvr12le",disabled:"fyvr12lf",focus:"fyvr12lg",hover:"fyvr12lh",checked:"fyvr12li"},defaultClass:"fyvr12ld"},backgroundContrast:{conditions:{base:"fyvr12lj",active:"fyvr12lk",disabled:"fyvr12ll",focus:"fyvr12lm",hover:"fyvr12ln",checked:"fyvr12lo"},defaultClass:"fyvr12lj"},backgroundMuted:{conditions:{base:"fyvr12lp",active:"fyvr12lq",disabled:"fyvr12lr",focus:"fyvr12ls",hover:"fyvr12lt",checked:"fyvr12lu"},defaultClass:"fyvr12lp"},backgroundControl:{conditions:{base:"fyvr12lv",active:"fyvr12lw",disabled:"fyvr12lx",focus:"fyvr12ly",hover:"fyvr12lz",checked:"fyvr12m0"},defaultClass:"fyvr12lv"},backgroundInverse:{conditions:{base:"fyvr12m1",active:"fyvr12m2",disabled:"fyvr12m3",focus:"fyvr12m4",hover:"fyvr12m5",checked:"fyvr12m6"},defaultClass:"fyvr12m1"},backgroundBackdrop:{conditions:{base:"fyvr12m7",active:"fyvr12m8",disabled:"fyvr12m9",focus:"fyvr12ma",hover:"fyvr12mb",checked:"fyvr12mc"},defaultClass:"fyvr12m7"},backgroundOverlay:{conditions:{base:"fyvr12md",active:"fyvr12me",disabled:"fyvr12mf",focus:"fyvr12mg",hover:"fyvr12mh",checked:"fyvr12mi"},defaultClass:"fyvr12md"},backgroundRaised:{conditions:{base:"fyvr12mj",active:"fyvr12mk",disabled:"fyvr12ml",focus:"fyvr12mm",hover:"fyvr12mn",checked:"fyvr12mo"},defaultClass:"fyvr12mj"},buttonGlass:{conditions:{base:"fyvr12mp",active:"fyvr12mq",disabled:"fyvr12mr",focus:"fyvr12ms",hover:"fyvr12mt",checked:"fyvr12mu"},defaultClass:"fyvr12mp"},buttonEmphasis:{conditions:{base:"fyvr12mv",active:"fyvr12mw",disabled:"fyvr12mx",focus:"fyvr12my",hover:"fyvr12mz",checked:"fyvr12n0"},defaultClass:"fyvr12mv"},buttonInverse:{conditions:{base:"fyvr12n1",active:"fyvr12n2",disabled:"fyvr12n3",focus:"fyvr12n4",hover:"fyvr12n5",checked:"fyvr12n6"},defaultClass:"fyvr12n1"},borderNormal:{conditions:{base:"fyvr12n7",active:"fyvr12n8",disabled:"fyvr12n9",focus:"fyvr12na",hover:"fyvr12nb",checked:"fyvr12nc"},defaultClass:"fyvr12n7"},borderFocus:{conditions:{base:"fyvr12nd",active:"fyvr12ne",disabled:"fyvr12nf",focus:"fyvr12ng",hover:"fyvr12nh",checked:"fyvr12ni"},defaultClass:"fyvr12nd"}}},borderTopStyle:{values:{solid:{conditions:{base:"fyvr12nj",active:"fyvr12nk",disabled:"fyvr12nl",focus:"fyvr12nm",hover:"fyvr12nn",checked:"fyvr12no"},defaultClass:"fyvr12nj"},dashed:{conditions:{base:"fyvr12np",active:"fyvr12nq",disabled:"fyvr12nr",focus:"fyvr12ns",hover:"fyvr12nt",checked:"fyvr12nu"},defaultClass:"fyvr12np"},dotted:{conditions:{base:"fyvr12nv",active:"fyvr12nw",disabled:"fyvr12nx",focus:"fyvr12ny",hover:"fyvr12nz",checked:"fyvr12o0"},defaultClass:"fyvr12nv"}}},border:{values:{none:{conditions:{base:"fyvr12o1",active:"fyvr12o2",disabled:"fyvr12o3",focus:"fyvr12o4",hover:"fyvr12o5",checked:"fyvr12o6"},defaultClass:"fyvr12o1"}}},color:{values:{black:{conditions:{base:"fyvr12o7",active:"fyvr12o8",disabled:"fyvr12o9",focus:"fyvr12oa",hover:"fyvr12ob",checked:"fyvr12oc"},defaultClass:"fyvr12o7"},white:{conditions:{base:"fyvr12od",active:"fyvr12oe",disabled:"fyvr12of",focus:"fyvr12og",hover:"fyvr12oh",checked:"fyvr12oi"},defaultClass:"fyvr12od"},inherit:{conditions:{base:"fyvr12oj",active:"fyvr12ok",disabled:"fyvr12ol",focus:"fyvr12om",hover:"fyvr12on",checked:"fyvr12oo"},defaultClass:"fyvr12oj"},transparent:{conditions:{base:"fyvr12op",active:"fyvr12oq",disabled:"fyvr12or",focus:"fyvr12os",hover:"fyvr12ot",checked:"fyvr12ou"},defaultClass:"fyvr12op"},positive:{conditions:{base:"fyvr12ov",active:"fyvr12ow",disabled:"fyvr12ox",focus:"fyvr12oy",hover:"fyvr12oz",checked:"fyvr12p0"},defaultClass:"fyvr12ov"},negative:{conditions:{base:"fyvr12p1",active:"fyvr12p2",disabled:"fyvr12p3",focus:"fyvr12p4",hover:"fyvr12p5",checked:"fyvr12p6"},defaultClass:"fyvr12p1"},info:{conditions:{base:"fyvr12p7",active:"fyvr12p8",disabled:"fyvr12p9",focus:"fyvr12pa",hover:"fyvr12pb",checked:"fyvr12pc"},defaultClass:"fyvr12p7"},warning:{conditions:{base:"fyvr12pd",active:"fyvr12pe",disabled:"fyvr12pf",focus:"fyvr12pg",hover:"fyvr12ph",checked:"fyvr12pi"},defaultClass:"fyvr12pd"},gradientBackdrop:{conditions:{base:"fyvr12pj",active:"fyvr12pk",disabled:"fyvr12pl",focus:"fyvr12pm",hover:"fyvr12pn",checked:"fyvr12po"},defaultClass:"fyvr12pj"},gradientPrimary:{conditions:{base:"fyvr12pp",active:"fyvr12pq",disabled:"fyvr12pr",focus:"fyvr12ps",hover:"fyvr12pt",checked:"fyvr12pu"},defaultClass:"fyvr12pp"},gradientSecondary:{conditions:{base:"fyvr12pv",active:"fyvr12pw",disabled:"fyvr12px",focus:"fyvr12py",hover:"fyvr12pz",checked:"fyvr12q0"},defaultClass:"fyvr12pv"},arbitrumDark:{conditions:{base:"fyvr12q1",active:"fyvr12q2",disabled:"fyvr12q3",focus:"fyvr12q4",hover:"fyvr12q5",checked:"fyvr12q6"},defaultClass:"fyvr12q1"},arbitrumLight:{conditions:{base:"fyvr12q7",active:"fyvr12q8",disabled:"fyvr12q9",focus:"fyvr12qa",hover:"fyvr12qb",checked:"fyvr12qc"},defaultClass:"fyvr12q7"},avalanceDark:{conditions:{base:"fyvr12qd",active:"fyvr12qe",disabled:"fyvr12qf",focus:"fyvr12qg",hover:"fyvr12qh",checked:"fyvr12qi"},defaultClass:"fyvr12qd"},avalanceLight:{conditions:{base:"fyvr12qj",active:"fyvr12qk",disabled:"fyvr12ql",focus:"fyvr12qm",hover:"fyvr12qn",checked:"fyvr12qo"},defaultClass:"fyvr12qj"},bscDark:{conditions:{base:"fyvr12qp",active:"fyvr12qq",disabled:"fyvr12qr",focus:"fyvr12qs",hover:"fyvr12qt",checked:"fyvr12qu"},defaultClass:"fyvr12qp"},bscLight:{conditions:{base:"fyvr12qv",active:"fyvr12qw",disabled:"fyvr12qx",focus:"fyvr12qy",hover:"fyvr12qz",checked:"fyvr12r0"},defaultClass:"fyvr12qv"},ethereumDark:{conditions:{base:"fyvr12r1",active:"fyvr12r2",disabled:"fyvr12r3",focus:"fyvr12r4",hover:"fyvr12r5",checked:"fyvr12r6"},defaultClass:"fyvr12r1"},ethereumLight:{conditions:{base:"fyvr12r7",active:"fyvr12r8",disabled:"fyvr12r9",focus:"fyvr12ra",hover:"fyvr12rb",checked:"fyvr12rc"},defaultClass:"fyvr12r7"},gnosisDark:{conditions:{base:"fyvr12rd",active:"fyvr12re",disabled:"fyvr12rf",focus:"fyvr12rg",hover:"fyvr12rh",checked:"fyvr12ri"},defaultClass:"fyvr12rd"},gnosisLight:{conditions:{base:"fyvr12rj",active:"fyvr12rk",disabled:"fyvr12rl",focus:"fyvr12rm",hover:"fyvr12rn",checked:"fyvr12ro"},defaultClass:"fyvr12rj"},polygonDark:{conditions:{base:"fyvr12rp",active:"fyvr12rq",disabled:"fyvr12rr",focus:"fyvr12rs",hover:"fyvr12rt",checked:"fyvr12ru"},defaultClass:"fyvr12rp"},polygonLight:{conditions:{base:"fyvr12rv",active:"fyvr12rw",disabled:"fyvr12rx",focus:"fyvr12ry",hover:"fyvr12rz",checked:"fyvr12s0"},defaultClass:"fyvr12rv"},text100:{conditions:{base:"fyvr12s1",active:"fyvr12s2",disabled:"fyvr12s3",focus:"fyvr12s4",hover:"fyvr12s5",checked:"fyvr12s6"},defaultClass:"fyvr12s1"},text80:{conditions:{base:"fyvr12s7",active:"fyvr12s8",disabled:"fyvr12s9",focus:"fyvr12sa",hover:"fyvr12sb",checked:"fyvr12sc"},defaultClass:"fyvr12s7"},text50:{conditions:{base:"fyvr12sd",active:"fyvr12se",disabled:"fyvr12sf",focus:"fyvr12sg",hover:"fyvr12sh",checked:"fyvr12si"},defaultClass:"fyvr12sd"},textInverse100:{conditions:{base:"fyvr12sj",active:"fyvr12sk",disabled:"fyvr12sl",focus:"fyvr12sm",hover:"fyvr12sn",checked:"fyvr12so"},defaultClass:"fyvr12sj"},backgroundPrimary:{conditions:{base:"fyvr12sp",active:"fyvr12sq",disabled:"fyvr12sr",focus:"fyvr12ss",hover:"fyvr12st",checked:"fyvr12su"},defaultClass:"fyvr12sp"},backgroundSecondary:{conditions:{base:"fyvr12sv",active:"fyvr12sw",disabled:"fyvr12sx",focus:"fyvr12sy",hover:"fyvr12sz",checked:"fyvr12t0"},defaultClass:"fyvr12sv"},backgroundContrast:{conditions:{base:"fyvr12t1",active:"fyvr12t2",disabled:"fyvr12t3",focus:"fyvr12t4",hover:"fyvr12t5",checked:"fyvr12t6"},defaultClass:"fyvr12t1"},backgroundMuted:{conditions:{base:"fyvr12t7",active:"fyvr12t8",disabled:"fyvr12t9",focus:"fyvr12ta",hover:"fyvr12tb",checked:"fyvr12tc"},defaultClass:"fyvr12t7"},backgroundControl:{conditions:{base:"fyvr12td",active:"fyvr12te",disabled:"fyvr12tf",focus:"fyvr12tg",hover:"fyvr12th",checked:"fyvr12ti"},defaultClass:"fyvr12td"},backgroundInverse:{conditions:{base:"fyvr12tj",active:"fyvr12tk",disabled:"fyvr12tl",focus:"fyvr12tm",hover:"fyvr12tn",checked:"fyvr12to"},defaultClass:"fyvr12tj"},backgroundBackdrop:{conditions:{base:"fyvr12tp",active:"fyvr12tq",disabled:"fyvr12tr",focus:"fyvr12ts",hover:"fyvr12tt",checked:"fyvr12tu"},defaultClass:"fyvr12tp"},backgroundOverlay:{conditions:{base:"fyvr12tv",active:"fyvr12tw",disabled:"fyvr12tx",focus:"fyvr12ty",hover:"fyvr12tz",checked:"fyvr12u0"},defaultClass:"fyvr12tv"},backgroundRaised:{conditions:{base:"fyvr12u1",active:"fyvr12u2",disabled:"fyvr12u3",focus:"fyvr12u4",hover:"fyvr12u5",checked:"fyvr12u6"},defaultClass:"fyvr12u1"},buttonGlass:{conditions:{base:"fyvr12u7",active:"fyvr12u8",disabled:"fyvr12u9",focus:"fyvr12ua",hover:"fyvr12ub",checked:"fyvr12uc"},defaultClass:"fyvr12u7"},buttonEmphasis:{conditions:{base:"fyvr12ud",active:"fyvr12ue",disabled:"fyvr12uf",focus:"fyvr12ug",hover:"fyvr12uh",checked:"fyvr12ui"},defaultClass:"fyvr12ud"},buttonInverse:{conditions:{base:"fyvr12uj",active:"fyvr12uk",disabled:"fyvr12ul",focus:"fyvr12um",hover:"fyvr12un",checked:"fyvr12uo"},defaultClass:"fyvr12uj"},borderNormal:{conditions:{base:"fyvr12up",active:"fyvr12uq",disabled:"fyvr12ur",focus:"fyvr12us",hover:"fyvr12ut",checked:"fyvr12uu"},defaultClass:"fyvr12up"},borderFocus:{conditions:{base:"fyvr12uv",active:"fyvr12uw",disabled:"fyvr12ux",focus:"fyvr12uy",hover:"fyvr12uz",checked:"fyvr12v0"},defaultClass:"fyvr12uv"}}},cursor:{values:{default:{conditions:{base:"fyvr12v1",active:"fyvr12v2",disabled:"fyvr12v3",focus:"fyvr12v4",hover:"fyvr12v5",checked:"fyvr12v6"},defaultClass:"fyvr12v1"},pointer:{conditions:{base:"fyvr12v7",active:"fyvr12v8",disabled:"fyvr12v9",focus:"fyvr12va",hover:"fyvr12vb",checked:"fyvr12vc"},defaultClass:"fyvr12v7"},text:{conditions:{base:"fyvr12vd",active:"fyvr12ve",disabled:"fyvr12vf",focus:"fyvr12vg",hover:"fyvr12vh",checked:"fyvr12vi"},defaultClass:"fyvr12vd"}}},opacity:{values:{0:{conditions:{base:"fyvr12vj",active:"fyvr12vk",disabled:"fyvr12vl",focus:"fyvr12vm",hover:"fyvr12vn",checked:"fyvr12vo"},defaultClass:"fyvr12vj"},50:{conditions:{base:"fyvr12vp",active:"fyvr12vq",disabled:"fyvr12vr",focus:"fyvr12vs",hover:"fyvr12vt",checked:"fyvr12vu"},defaultClass:"fyvr12vp"},80:{conditions:{base:"fyvr12vv",active:"fyvr12vw",disabled:"fyvr12vx",focus:"fyvr12vy",hover:"fyvr12vz",checked:"fyvr12w0"},defaultClass:"fyvr12vv"},100:{conditions:{base:"fyvr12w1",active:"fyvr12w2",disabled:"fyvr12w3",focus:"fyvr12w4",hover:"fyvr12w5",checked:"fyvr12w6"},defaultClass:"fyvr12w1"}}},pointerEvents:{values:{none:{conditions:{base:"fyvr12w7",active:"fyvr12w8",disabled:"fyvr12w9",focus:"fyvr12wa",hover:"fyvr12wb",checked:"fyvr12wc"},defaultClass:"fyvr12w7"},auto:{conditions:{base:"fyvr12wd",active:"fyvr12we",disabled:"fyvr12wf",focus:"fyvr12wg",hover:"fyvr12wh",checked:"fyvr12wi"},defaultClass:"fyvr12wd"}}},outline:{values:{none:{conditions:{base:"fyvr12wj",active:"fyvr12wk",disabled:"fyvr12wl",focus:"fyvr12wm",hover:"fyvr12wn",checked:"fyvr12wo"},defaultClass:"fyvr12wj"}}},boxShadow:{values:{none:{conditions:{base:"fyvr12wp",active:"fyvr12wq",disabled:"fyvr12wr",focus:"fyvr12ws",hover:"fyvr12wt",checked:"fyvr12wu"},defaultClass:"fyvr12wp"}}}}});const Yce=["alignItems","alignSelf","flexDirection","gap","justifyContent","justifySelf","placeItems"],z6=t=>(t.display||(t.display=Object.keys(t).some(e=>Yce.includes(e))?"flex":void 0),Oj(t));z6.properties=Oj.properties;function Rj(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e{const{as:r="div",sx:n={},className:i,...s}=t,o={},a={};for(const l in s)z6.properties.has(l)?o[l]=s[l]:a[l]=s[l];const c=z6({...o,...n});return w.createElement(r,{className:fi(c,i),...a,ref:e})});var $j={exports:{}},kh={};/** * @license React * react-jsx-runtime.production.min.js * @@ -84,8 +84,8 @@ Error generating stack: `+s.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var DA;function xle(){if(DA)return Nh;DA=1;var t=g,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var u,f={},d=null,h=null;l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),c.ref!==void 0&&(h=c.ref);for(u in c)n.call(c,u)&&!s.hasOwnProperty(u)&&(f[u]=c[u]);if(a&&a.defaultProps)for(u in c=a.defaultProps,c)f[u]===void 0&&(f[u]=c[u]);return{$$typeof:e,type:a,key:d,ref:h,props:f,_owner:i.current}}return Nh.Fragment=r,Nh.jsx=o,Nh.jsxs=o,Nh}Xj.exports=xle();var X=Xj.exports;function wle(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ele(t){var e=wle(t,"string");return typeof e=="symbol"?e:String(e)}function Cle(t,e,r){return e=Ele(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function LA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function jA(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},Cr=t=>{var e=r=>{var n=t.defaultClassName,i=jA(jA({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var c=a;typeof c=="boolean"&&(c=c===!0?"true":"false");var l=t.variantClassNames[s][c];l&&(n+=" "+l)}}for(var[u,f]of t.compoundVariants)Sle(u,i,t.defaultVariants)&&(n+=" "+f);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return BA(t.variantClassNames,r=>BA(r,n=>n.split(" ")[0]))}},e};Cr({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"_2q9vfj8 _2q9vfj0 fyvr11ov",warning:"_2q9vfj9 _2q9vfj1 fyvr11p1",success:"_2q9vfja _2q9vfj2 fyvr11oj",error:"_2q9vfjb _2q9vfj3 fyvr11op"},size:{sm:"_2q9vfjc _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 _2q9vfj4 fyvr1wo fyvr1yk fyvr13w fyvr1e8",md:"_2q9vfjd _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _2q9vfj5 fyvr1ws fyvr1yo fyvr140 fyvr1ec",lg:"_2q9vfje _1qxj1ib9 _1qxj1ibd _1qxj1ib3 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc _2q9vfj6 fyvr1ww fyvr1ys fyvr144 fyvr1eg"}},defaultVariants:{},compoundVariants:[]});const m1=t=>{const{color:e="borderNormal",marginY:r="4",...n}=t;return X.jsx(q,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var Zj=Cr({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"_1qxj1iba _1qxj1ib0 fyvr11mu fyvr11e4 fyvr11gg fyvr11fg fyvr11ew",xlarge:"_1qxj1ibb _1qxj1ib1 fyvr11mv fyvr11es fyvr11gc fyvr11fk fyvr11fc",large:"_1qxj1ibc _1qxj1ib2 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8",medium:"_1qxj1ibd _1qxj1ib3 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc",normal:"_1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",small:"_1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4",xsmall:"_1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc",code:"_1qxj1ibh _1qxj1ib7 fyvr11mw fyvr11eg fyvr11g0 fyvr11fk fyvr11f0"},ellipsis:{true:"_1qxj1ibi _1qxj1ib8 fyvr11ls fyvr11m8 fyvr11n9 fyvr11mx"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const ae=x.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:c,ellipsis:l,uppercase:u,capitalize:f,...d}=t,h=dle[n];return X.jsx(q,{as:r,className:di(i,Zj({hidden:s,ellipsis:l,italic:o,underline:a,uppercase:u,capitalize:f})),ref:e,...h,...d,children:c})});var kle=Cr({defaultClassName:"_140wn8ni _140wn8n0 fyvr11ls fyvr11m8 fyvr11n9 fyvr11ko fyvr12o1 fyvr11n2 fyvr11h0",variantClassNames:{variant:{base:"_140wn8nj _140wn8n1 fyvr11od fyvr12s1",ghost:"_140wn8nk _140wn8n2 fyvr11od fyvr12s1",feature:"_140wn8nl _140wn8n3 fyvr11pj fyvr12od",primary:"_140wn8nm _140wn8n4 fyvr11pd fyvr12od",glass:"_140wn8nn _140wn8n5 fyvr11tv fyvr12s1",emphasis:"_140wn8no _140wn8n6 fyvr11u1 fyvr12s1",raised:"_140wn8np _140wn8n7 fyvr11tp fyvr12s1",danger:"_140wn8nq _140wn8n8 fyvr11op fyvr12od",text:"_140wn8nr _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 _140wn8n9 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr11od fyvr12sd"},shape:{circle:"_140wn8ns _140wn8na fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",square:"_140wn8nt _140wn8nb fyvr11d0 fyvr11do fyvr11bo fyvr11cc"},disabled:{true:"_140wn8nu _140wn8nc fyvr12v1 fyvr12vp",false:"_140wn8nv _140wn8nd fyvr12v7 fyvr12w1 fyvr12vz"},size:{xs:"_140wn8nw _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc _140wn8ne fyvr1ws fyvr1yo",sm:"_140wn8nx _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nf fyvr1ww fyvr1ys",md:"_140wn8ny _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8ng fyvr1x0 fyvr1yw",lg:"_140wn8nz _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nh fyvr1x0 fyvr1yw"},iconOnly:{true:"_140wn8n10"},hasLeftIcon:{true:"_140wn8n11"},hasRightIcon:{true:"_140wn8n12"},activeOutline:{light:"_140wn8n13",bold:"_140wn8n14"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n15"],[{iconOnly:!0,size:"sm"},"_140wn8n16"],[{iconOnly:!0,size:"md"},"_140wn8n17"],[{iconOnly:!0,size:"lg"},"_140wn8n18"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n1b"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n1c"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1d"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1e"]]});const rt=x.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:c=!1,label:l,leftIcon:u,rightIcon:f,size:d="md",variant:h="glass",width:p="fit",shape:m="circle",type:v="button",...y}=t,b=u!==void 0&&l!==void 0,E=f!==void 0&&l!==void 0,S=u!==void 0&&l===void 0,P=d==="xs"?"xs":"sm";return X.jsx(q,{as:r,className:di(i,kle({activeOutline:n,disabled:s||c,hasLeftIcon:b,hasRightIcon:E,iconOnly:S,size:h==="text"?void 0:d,shape:h==="text"?void 0:m,variant:h})),disabled:s||c,display:o,fontWeight:a,ref:e,type:v,width:p,...y,children:S?X.jsx(u,{size:P}):X.jsxs(q,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:d==="xs"?"1":"2",children:[X.jsxs(q,{justifyContent:"flex-start",alignItems:"center",gap:d==="xs"?"1":"2",children:[u&&X.jsx(u,{size:P}),X.jsx(ae,{children:l})]}),f&&X.jsx(f,{size:P})]})})});var Ale=Cr({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"rhmai64 rhmai60 fyvr12vz fyvr12v7"},disabled:{true:"rhmai65"},outlined:{true:"rhmai66 rhmai61 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr12n7 fyvr12fv fyvr1217 fyvr128j fyvr12nj fyvr12g7 fyvr121j fyvr128v"},blur:{true:"rhmai67 rhmai62 fyvr11ms"}},defaultVariants:{},compoundVariants:[]});const kn=x.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:c="full",...l}=t;return X.jsx(q,{className:di(r,Ale({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:c,ref:e,...l,children:n})});function mt(){return mt=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(r=>_le(r,e))}function Lt(...t){return x.useCallback(eB(...t),t)}function In(t,e=[]){let r=[];function n(s,o){const a=x.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:h,...p}=f,m=(d==null?void 0:d[t][c])||a,v=x.useMemo(()=>p,Object.values(p));return x.createElement(m.Provider,{value:v},h)}function u(f,d){const h=(d==null?void 0:d[t][c])||a,p=x.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>x.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return x.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,Ple(i,...e)]}function Ple(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function _e(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function is(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function pa({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=Ile({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=is(r),c=x.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function Ile({defaultProp:t,onChange:e}){const r=x.useState(t),[n]=r,i=x.useRef(n),s=is(e);return x.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function Lb(t){const e=x.useRef({value:t,previous:t});return x.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const Pi=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{};function jb(t){const[e,r]=x.useState(void 0);return Pi(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function Tle(t,e){return x.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const Da=t=>{const{present:e,children:r}=t,n=Ole(e),i=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),s=Lt(n.ref,i.ref);return typeof r=="function"||n.isPresent?x.cloneElement(i,{ref:s}):null};Da.displayName="Presence";function Ole(t){const[e,r]=x.useState(),n=x.useRef({}),i=x.useRef(t),s=x.useRef("none"),o=t?"mounted":"unmounted",[a,c]=Tle(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const l=ym(n.current);s.current=a==="mounted"?l:"none"},[a]),Pi(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,h=ym(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Pi(()=>{if(e){const l=f=>{const h=ym(n.current).includes(f.animationName);f.target===e&&h&&zs.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=ym(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function ym(t){return(t==null?void 0:t.animationName)||"none"}function Fe(){return Fe=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:r,...n}=t,i=x.Children.toArray(r),s=i.find($le);if(s){const o=s.props.children,a=i.map(c=>c===s?x.Children.count(o)>1?x.Children.only(null):x.isValidElement(o)?o.props.children:null:c);return x.createElement(n3,Fe({},n,{ref:e}),x.isValidElement(o)?x.cloneElement(o,void 0,a):null)}return x.createElement(n3,Fe({},n,{ref:e}),r)});Cd.displayName="Slot";const n3=x.forwardRef((t,e)=>{const{children:r,...n}=t;return x.isValidElement(r)?x.cloneElement(r,{...Mle(n,r.props),ref:e?eB(e,r.ref):r.ref}):x.Children.count(r)>1?x.Children.only(null):null});n3.displayName="SlotClone";const Rle=({children:t})=>x.createElement(x.Fragment,null,t);function $le(t){return x.isValidElement(t)&&t.type===Rle}function Mle(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const Nle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xe=Nle.reduce((t,e)=>{const r=x.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?Cd:e;return x.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),x.createElement(a,mt({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function c4(t,e){t&&zs.flushSync(()=>t.dispatchEvent(e))}const tB="Checkbox",[Dle,a_e]=In(tB),[Lle,jle]=Dle(tB),Ble=x.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=x.useState(null),h=Lt(e,E=>d(E)),p=x.useRef(!1),m=f?!!f.closest("form"):!0,[v=!1,y]=pa({prop:i,defaultProp:s,onChange:l}),b=x.useRef(v);return x.useEffect(()=>{const E=f==null?void 0:f.form;if(E){const S=()=>y(b.current);return E.addEventListener("reset",S),()=>E.removeEventListener("reset",S)}},[f,y]),x.createElement(Lle,{scope:r,state:v,disabled:a},x.createElement(Xe.button,mt({type:"button",role:"checkbox","aria-checked":Zl(v)?"mixed":v,"aria-required":o,"data-state":rB(v),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:h,onKeyDown:_e(t.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:_e(t.onClick,E=>{y(S=>Zl(S)?!0:!S),m&&(p.current=E.isPropagationStopped(),p.current||E.stopPropagation())})})),m&&x.createElement(zle,{control:f,bubbles:!p.current,name:n,value:c,checked:v,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),Fle="CheckboxIndicator",Ule=x.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=jle(Fle,r);return x.createElement(Da,{present:n||Zl(s.state)||s.state===!0},x.createElement(Xe.span,mt({"data-state":rB(s.state),"data-disabled":s.disabled?"":void 0},i,{ref:e,style:{pointerEvents:"none",...t.style}})))}),zle=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=x.useRef(null),o=Lb(r),a=jb(e);return x.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});c.indeterminate=Zl(r),f.call(c,Zl(r)?!1:r),c.dispatchEvent(d)}},[o,r,n]),x.createElement("input",mt({type:"checkbox","aria-hidden":!0,defaultChecked:Zl(r)?!1:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Zl(t){return t==="indeterminate"}function rB(t){return Zl(t)?"indeterminate":t?"checked":"unchecked"}const qle=Ble,Wle=Ule;var Hle=Cr({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"_43lu9r5 _43lu9r0 fyvr11kw fyvr11i4 fyvr118k fyvr11h0",left:"_43lu9r6 _43lu9r1 fyvr11ko fyvr11ic fyvr118k fyvr11h0",right:"_43lu9r7 _43lu9r2 fyvr11ko fyvr11ic fyvr118k fyvr11h0",hidden:"_43lu9r8 _43lu9r3 fyvr1188 fyvr11h0"}},defaultVariants:{},compoundVariants:[]});const Iu=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?X.jsxs(q,{flexDirection:"column",gap:"0.5",children:[r&&X.jsx(ae,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&X.jsx(ae,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return X.jsxs(q,{as:"label",className:Hle({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var Sr=Cr({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const Vle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.168 9.25V2.929h-1.5V9.25h-6.32v1.5h6.32v6.321h1.5V10.75h6.321v-1.5h-6.32Z",clipRule:"evenodd"})}),Gle=({size:t="sm",...e})=>X.jsx(q,{as:Vle,className:Sr({size:t}),...e}),Kle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.888 14.47 1.06 1.06L17.48 10l-5.53-5.53-1.06 1.06 3.719 3.72H4.418v1.5h10.19l-3.72 3.72Z",clipRule:"evenodd"})}),i3=({size:t="sm",...e})=>X.jsx(q,{as:Kle,className:Sr({size:t}),...e}),Qle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),Kd=({size:t="sm",...e})=>X.jsx(q,{as:Qle,className:Sr({size:t}),...e}),Yle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),l4=({size:t="sm",...e})=>X.jsx(q,{as:Yle,className:Sr({size:t}),...e}),Jle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.888 3.47 1.06 1.06L8.48 10l5.47 5.47-1.061 1.06L6.358 10l6.53-6.53Z",clipRule:"evenodd"})}),Bb=({size:t="sm",...e})=>X.jsx(q,{as:Jle,className:Sr({size:t}),...e}),Xle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m7.949 16.53-1.061-1.06 5.47-5.47-5.47-5.47 1.06-1.06L14.48 10l-6.53 6.53Z",clipRule:"evenodd"})}),bo=({size:t="sm",...e})=>X.jsx(q,{as:Xle,className:Sr({size:t}),...e}),Zle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),Tu=({size:t="sm",...e})=>X.jsx(q,{as:Zle,className:Sr({size:t}),...e}),eue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.918 4.5h-6V6h4.5v6.5h1.5v-8Zm-1.5 9.5v3h-9V6h3V3h9v11h-3Zm-7.5 1.5v-8h6v8h-6Z",clipRule:"evenodd"})}),Fb=({size:t="sm",...e})=>X.jsx(q,{as:eue,className:Sr({size:t}),...e}),tue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 6.714 3.618 3.547H2.5L4.158 7.02H2.98v.69h1.494v.663H2.981v.69h1.494v1.484h1.036V9.063h1.46v-.69h-1.46v-.66l.001-.003h1.46v-.69h-1.13L7.5 3.547H6.383L5 6.714Zm4.747 8.232v-.788a2.887 2.887 0 0 1-1.04-.249 2.04 2.04 0 0 1-.863-.727 2.213 2.213 0 0 1-.344-1.125h1.017c.02.26.098.476.236.65.14.171.319.299.535.383.144.054.297.09.46.109V10.81l-.319-.093c-.538-.157-.964-.388-1.28-.693-.312-.304-.469-.707-.469-1.209 0-.415.105-.777.315-1.086.21-.31.495-.55.853-.72.273-.133.573-.215.9-.246v-.817h.537v.81c.365.023.692.106.981.249.35.17.626.406.827.706.201.298.306.64.315 1.027h-.978a1.04 1.04 0 0 0-.433-.774 1.47 1.47 0 0 0-.712-.264v2.253l.283.079c.214.056.434.132.659.228a2.6 2.6 0 0 1 .627.38c.192.157.347.351.466.583.12.232.18.51.18.834 0 .407-.098.77-.295 1.086a2.006 2.006 0 0 1-.85.749c-.304.15-.66.239-1.07.265v.79h-.538Zm1.024-1.877c-.148.064-.31.106-.486.128v-2.23c.216.064.41.136.584.218.193.089.345.201.457.337.113.136.17.31.17.524 0 .234-.065.44-.194.615-.129.174-.306.31-.531.408ZM9.747 7.706v2.095a4.605 4.605 0 0 1-.246-.086 2.195 2.195 0 0 1-.4-.207 1.038 1.038 0 0 1-.299-.313.847.847 0 0 1-.111-.443.94.94 0 0 1 .164-.545c.112-.162.268-.288.47-.38.126-.059.267-.099.422-.12Zm7.677 10.086h-4.9v-.897h.34a.342.342 0 0 0 .29-.186c.068-.117.114-.254.137-.411.023-.16.032-.304.028-.432l-.027-.779H12.5v-.896h.76l-.043-1.262c-.018-.472.073-.866.273-1.183.203-.317.473-.555.809-.715.335-.16.697-.24 1.084-.24.346 0 .656.056.931.166.278.11.511.26.7.452.191.188.328.404.41.647.081.243.097.498.048.766l-1.01-.156c.023-.22-.014-.403-.11-.55a.891.891 0 0 0-.395-.33 1.31 1.31 0 0 0-1.102.024c-.177.09-.322.227-.434.411-.11.185-.164.42-.164.708l.048 1.261h1.649v.897H14.34l.029.752c.014.29-.025.55-.116.78-.04.1-.096.193-.166.276h3.337v.897Z",clipRule:"evenodd"})}),rue=({size:t="sm",...e})=>X.jsx(q,{as:tue,className:Sr({size:t}),...e}),nue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",d:"m5.285 12.883 6.53-6.53 2.254 2.253-6.531 6.531-2.878.618.625-2.872ZM14.674 8.001l-2.253-2.253 1.502-1.503L16.176 6.5 14.674 8Z"})}),iue=({size:t="sm",...e})=>X.jsx(q,{as:nue,className:Sr({size:t}),...e}),sue=t=>X.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[X.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M10.906 8.966c1.459 1.316 1.459 3.45 0 4.765l-2.53 2.282c-1.459 1.316-3.824 1.316-5.282 0-1.459-1.315-1.459-3.449 0-4.764l1.265-1.142"}),X.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M8.094 11c-1.459-1.316-1.459-3.449 0-4.765l2.53-2.282c1.459-1.316 3.823-1.316 5.282 0s1.459 3.449 0 4.765l-1.265 1.14"})]}),oue=({size:t="sm",...e})=>X.jsx(q,{as:sue,className:Sr({size:t}),...e}),aue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M15.918 14.994v.752A7.003 7.003 0 0 1 6.968 5.05a7.003 7.003 0 0 1 8.95-.796v.752a4.979 4.979 0 0 0-3.293 1.459 5 5 0 0 0 3.293 8.53Zm-4.353-.398c.329.329.684.615 1.059.859a5.5 5.5 0 1 1 0-10.91 6.5 6.5 0 0 0-1.06 10.051Z",clipRule:"evenodd"})}),cue=({size:t="sm",...e})=>X.jsx(q,{as:aue,className:Sr({size:t}),...e}),lue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.283 6.175a4.643 4.643 0 1 0-6.566 6.567l-.708.707a5.644 5.644 0 1 1 7.982 0l-.708-.707a4.644 4.644 0 0 0 0-6.567Zm-5.097 1.47a2.565 2.565 0 0 1 3.628 3.627l.707.707a3.565 3.565 0 1 0-5.042 0l.707-.707a2.565 2.565 0 0 1 0-3.627ZM10 10.959a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm0 .667-1.5 6h3l-1.5-6Z",clipRule:"evenodd"})}),uue=({size:t="sm",...e})=>X.jsx(q,{as:lue,className:Sr({size:t}),...e}),fue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.418 3.6h-2.5v2.5h2.5V3.6Zm0-1.5h1.5v5.5h-5.5V2.1h4Zm0 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4Zm8-9h2.5v2.5h-2.5V3.6Zm4-1.5h-5.5v5.5h5.5V2.1Zm-1.5 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4ZM9.668 2.1v7.25h-7.25v1.5h8.75V2.1h-1.5Zm1.5 10.5v5.5h-1.5v-5.5h1.5Zm1.75-1.75h5.5v-1.5h-5.5v1.5Z",clipRule:"evenodd"})}),due=({size:t="sm",...e})=>X.jsx(q,{as:fue,className:Sr({size:t}),...e}),hue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),Ub=({size:t="sm",...e})=>X.jsx(q,{as:hue,className:Sr({size:t}),...e}),pue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.529 15.925 9.419 11 4.493 8.89 2.418 8l2.142-.714 11.08-3.693L17.418 3l-.593 1.779-3.693 11.08L12.418 18l-.89-2.075Zm-1.71-6.386L6.635 8.175l6.82-2.273-3.638 3.637Zm1.06 1.061 1.364 3.183 2.273-6.82L10.88 10.6Z",clipRule:"evenodd"})}),zb=({size:t="sm",...e})=>X.jsx(q,{as:pue,className:Sr({size:t}),...e}),mue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.775 5.204a5.465 5.465 0 0 0-1.341-.537L11 2.5H9l-.443 2.214c-.444.128-.866.31-1.257.54L5.404 3.99 3.99 5.404l1.283 1.925c-.212.38-.38.787-.497 1.216L2.5 9v2l2.276.455c.118.429.285.836.497 1.216L3.99 14.596l1.414 1.414L7.3 14.746c.391.23.813.412 1.257.54L9 17.5h2l.434-2.167c.474-.12.925-.302 1.341-.537l1.821 1.214 1.414-1.414-1.195-1.793c.253-.427.45-.891.581-1.382L17.5 11V9l-2.104-.42a5.467 5.467 0 0 0-.581-1.383l1.195-1.793-1.414-1.414-1.82 1.214Zm-.59 2.692a2.976 2.976 0 1 0-4.208 4.208 2.976 2.976 0 0 0 4.209-4.208Z",clipRule:"evenodd"})}),nB=({size:t="sm",...e})=>X.jsx(q,{as:mue,className:Sr({size:t}),...e}),vue=t=>X.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[X.jsx("path",{fill:"currentColor",d:"M4 6.234a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V10.5L14 9v5.734a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h5.769l-1.516 1.5H4Z"}),X.jsx("path",{stroke:"currentColor",strokeWidth:1.25,d:"M11 3h5v5"}),X.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m16 3-8 8"})]}),yue=({size:t="sm",...e})=>X.jsx(q,{as:vue,className:Sr({size:t}),...e}),gue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.418 3.25h-5.75v13.5h5.75v-1.5h-4.25V4.75h4.25v-1.5Zm4.53 11.28-1.06-1.06 2.72-2.72h-8.19v-1.5h8.19l-2.72-2.72 1.06-1.06L18.48 10l-4.53 4.53Z",clipRule:"evenodd"})}),iB=({size:t="sm",...e})=>X.jsx(q,{as:gue,className:Sr({size:t}),...e}),bue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.539 10.75H4.298v-1.5h12.24v1.5Z",clipRule:"evenodd"})}),xue=({size:t="sm",...e})=>X.jsx(q,{as:bue,className:Sr({size:t}),...e}),wue=t=>X.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[X.jsx("path",{fill:"currentColor",d:"M4.633 10.75a5.878 5.878 0 0 1 .008-1.5H2.202v1.5h2.431ZM5.814 6.456A5.854 5.854 0 0 1 6.88 5.401L5.139 3.66l-1.06 1.06 1.735 1.736ZM4.078 15.28l1.711-1.711c.306.398.662.755 1.058 1.063L5.14 16.34l-1.06-1.06ZM9.668 15.802v2.414h1.5V15.8a5.876 5.876 0 0 1-1.5.003ZM13.98 14.623l1.718 1.717 1.06-1.06-1.721-1.723c-.305.4-.66.758-1.056 1.066ZM16.184 10.75h2.45v-1.5h-2.457a5.882 5.882 0 0 1 .007 1.5ZM15.012 6.467l1.747-1.747-1.061-1.06-1.75 1.75c.399.305.756.66 1.064 1.057ZM11.168 4.258V1.784h-1.5v2.472a5.875 5.875 0 0 1 1.5.002Z"}),X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.418 12.504a2.504 2.504 0 1 0 0-5.008 2.504 2.504 0 0 0 0 5.008Zm0 1.5a4.004 4.004 0 1 0 0-8.008 4.004 4.004 0 0 0 0 8.008Z",clipRule:"evenodd"})]}),Eue=({size:t="sm",...e})=>X.jsx(q,{as:wue,className:Sr({size:t}),...e}),Cue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.28 2.856-6.71 8.887h4.134l-1.424 6.2 6.887-8.71h-4.322l1.435-6.377Z",clipRule:"evenodd"})}),sB=({size:t="sm",...e})=>X.jsx(q,{as:Cue,className:Sr({size:t}),...e});var Sue=Cr({defaultClassName:"_1c9x66f1 _1c9x66f0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11h0 fyvr11ko fyvr11jg fyvr11od fyvr12w1 fyvr12vz fyvr12vr fyvr12v7 fyvr12v3",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),kue="_1c9x66f4 fyvr12s1 fyvr11h0 fyvr11ko fyvr11jg fyvr128 fyvr15o";const Aue=({size:t="sm"})=>X.jsx(Wle,{className:kue,children:X.jsx(Kd,{size:t==="lg"?"sm":"xs"})});x.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...c}=t;return X.jsx(Iu,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:X.jsx(qle,{className:Sue({size:a}),disabled:r,id:n??i,name:i,ref:e,...c,children:X.jsx(Aue,{size:a})})})});g.createContext(null);const _ue=dT.useId||(()=>{});let Pue=0;function ia(t){const[e,r]=x.useState(_ue());return Pi(()=>{t||r(n=>n??String(Pue++))},[t]),t||(e?`radix-${e}`:"")}const oB="Collapsible",[Iue,c_e]=In(oB),[Tue,u4]=Iue(oB),Oue=x.forwardRef((t,e)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:s,onOpenChange:o,...a}=t,[c=!1,l]=pa({prop:n,defaultProp:i,onChange:o});return x.createElement(Tue,{scope:r,disabled:s,contentId:ia(),open:c,onOpenToggle:x.useCallback(()=>l(u=>!u),[l])},x.createElement(Xe.div,mt({"data-state":f4(c),"data-disabled":s?"":void 0},a,{ref:e})))}),Rue="CollapsibleTrigger",$ue=x.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=u4(Rue,r);return x.createElement(Xe.button,mt({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":f4(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},n,{ref:e,onClick:_e(t.onClick,i.onOpenToggle)}))}),aB="CollapsibleContent",Mue=x.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=u4(aB,t.__scopeCollapsible);return x.createElement(Da,{present:r||i.open},({present:s})=>x.createElement(Nue,mt({},n,{ref:e,present:s})))}),Nue=x.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,o=u4(aB,r),[a,c]=x.useState(n),l=x.useRef(null),u=Lt(e,l),f=x.useRef(0),d=f.current,h=x.useRef(0),p=h.current,m=o.open||a,v=x.useRef(m),y=x.useRef();return x.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),Pi(()=>{const b=l.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const E=b.getBoundingClientRect();f.current=E.height,h.current=E.width,v.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),c(n)}},[o.open,n]),x.createElement(Xe.div,mt({"data-state":f4(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m},s,{ref:u,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...t.style}}),m&&i)});function f4(t){return t?"open":"closed"}const Due=Oue,Lue=$ue,jue=Mue;var FA="64px",Bue="_4j62fl0",Fue="_4j62fl2 _4j62fl1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11h0 fyvr11ko fyvr11od fyvr128 fyvr12v7 fyvr11n4",Uue="_4j62fl4 _4j62fl3 fyvr1ww fyvr1ys fyvr1so fyvr1v0 fyvr128",zue="_4j62fl5";const que=t=>{const{className:e,children:r,defaultOpen:n,open:i,onOpenChange:s,label:o,...a}=t,[c,l]=x.useState(n),u=i??c,f=h=>{i===void 0&&l(h)},d=h=>{f(h),s==null||s(h)};return X.jsx(Due,{open:u,defaultOpen:n,onOpenChange:d,asChild:!0,children:X.jsxs(q,{as:Ic.div,className:di(e,Bue),initial:{height:u?"auto":FA},animate:{height:u?"auto":FA},transition:{ease:"easeOut",duration:.3},borderRadius:"md",background:"backgroundSecondary",position:"relative",overflow:"hidden",width:"full",...a,children:[X.jsxs(Lue,{className:Fue,children:[X.jsx(ae,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:o}),X.jsx(q,{as:Ic.div,position:"absolute",right:"0",marginRight:"4",initial:{rotate:u?180:0},animate:{rotate:u?180:0},transition:{ease:"linear",duration:.1},children:X.jsx(l4,{className:zue,color:"text50"})})]}),X.jsx(wd,{children:u&&X.jsx(jue,{className:Uue,asChild:!0,forceMount:!0,children:X.jsx(Ic.div,{initial:{opacity:u?1:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:"easeOut",duration:.3},children:r})})})]})})};function qb(t){const e=t+"CollectionProvider",[r,n]=In(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=h=>{const{scope:p,children:m}=h,v=g.useRef(null),y=g.useRef(new Map).current;return g.createElement(i,{scope:p,itemMap:y,collectionRef:v},m)},a=t+"CollectionSlot",c=g.forwardRef((h,p)=>{const{scope:m,children:v}=h,y=s(a,m),b=Lt(p,y.collectionRef);return g.createElement(Cd,{ref:b},v)}),l=t+"CollectionItemSlot",u="data-radix-collection-item",f=g.forwardRef((h,p)=>{const{scope:m,children:v,...y}=h,b=g.useRef(null),E=Lt(p,b),S=s(l,m);return g.useEffect(()=>(S.itemMap.set(b,{ref:b,...y}),()=>void S.itemMap.delete(b))),g.createElement(Cd,{[u]:"",ref:E},v)});function d(h){const p=s(t+"CollectionConsumer",h);return g.useCallback(()=>{const v=p.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((S,P)=>y.indexOf(S.ref.current)-y.indexOf(P.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},d,n]}const Wue=x.createContext(void 0);function Wb(t){const e=x.useContext(Wue);return t||e||"ltr"}function Hue(t,e=globalThis==null?void 0:globalThis.document){const r=is(t);x.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const s3="dismissableLayer.update",Vue="dismissableLayer.pointerDownOutside",Gue="dismissableLayer.focusOutside";let UA;const Kue=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),d4=x.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=x.useContext(Kue),[f,d]=x.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,p]=x.useState({}),m=Lt(e,j=>d(j)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),E=f?v.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,P=E>=b,M=Que(j=>{const H=j.target,K=[...u.branches].some(Q=>Q.contains(H));!P||K||(s==null||s(j),a==null||a(j),j.defaultPrevented||c==null||c())},h),L=Yue(j=>{const H=j.target;[...u.branches].some(Q=>Q.contains(H))||(o==null||o(j),a==null||a(j),j.defaultPrevented||c==null||c())},h);return Hue(j=>{E===u.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&c&&(j.preventDefault(),c()))},h),x.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(UA=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),zA(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=UA)}},[f,h,n,u]),x.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),zA())},[f,u]),x.useEffect(()=>{const j=()=>p({});return document.addEventListener(s3,j),()=>document.removeEventListener(s3,j)},[]),x.createElement(Xe.div,Fe({},l,{ref:m,style:{pointerEvents:S?P?"auto":"none":void 0,...t.style},onFocusCapture:_e(t.onFocusCapture,L.onFocusCapture),onBlurCapture:_e(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:_e(t.onPointerDownCapture,M.onPointerDownCapture)}))});function Que(t,e=globalThis==null?void 0:globalThis.document){const r=is(t),n=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){cB(Vue,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function Yue(t,e=globalThis==null?void 0:globalThis.document){const r=is(t),n=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!n.current&&cB(Gue,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function zA(){const t=new CustomEvent(s3);document.dispatchEvent(t)}function cB(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?c4(i,s):i.dispatchEvent(s)}const Jue=d4;let hw=0;function lB(){x.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:qA()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:qA()),hw++,()=>{hw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),hw--}},[])}function qA(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const pw="focusScope.autoFocusOnMount",mw="focusScope.autoFocusOnUnmount",WA={bubbles:!1,cancelable:!0},uB=x.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=x.useState(null),l=is(i),u=is(s),f=x.useRef(null),d=Lt(e,m=>c(m)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let m=function(E){if(h.paused||!a)return;const S=E.target;a.contains(S)?f.current=S:Ja(f.current,{select:!0})},v=function(E){if(h.paused||!a)return;const S=E.relatedTarget;S!==null&&(a.contains(S)||Ja(f.current,{select:!0}))},y=function(E){if(document.activeElement===document.body)for(const P of E)P.removedNodes.length>0&&Ja(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[n,a,h.paused]),x.useEffect(()=>{if(a){VA.add(h);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(pw,WA);a.addEventListener(pw,l),a.dispatchEvent(y),y.defaultPrevented||(Xue(nfe(fB(a)),{select:!0}),document.activeElement===m&&Ja(a))}return()=>{a.removeEventListener(pw,l),setTimeout(()=>{const y=new CustomEvent(mw,WA);a.addEventListener(mw,u),a.dispatchEvent(y),y.defaultPrevented||Ja(m??document.body,{select:!0}),a.removeEventListener(mw,u),VA.remove(h)},0)}}},[a,l,u,h]);const p=x.useCallback(m=>{if(!r&&!n||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const b=m.currentTarget,[E,S]=Zue(b);E&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&Ja(E,{select:!0})):m.shiftKey&&y===E&&(m.preventDefault(),r&&Ja(S,{select:!0})):y===b&&m.preventDefault()}},[r,n,h.paused]);return x.createElement(Xe.div,Fe({tabIndex:-1},o,{ref:d,onKeyDown:p}))});function Xue(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Ja(n,{select:e}),document.activeElement!==r)return}function Zue(t){const e=fB(t),r=HA(e,t),n=HA(e.reverse(),t);return[r,n]}function fB(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function HA(t,e){for(const r of t)if(!efe(r,{upTo:e}))return r}function efe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function tfe(t){return t instanceof HTMLInputElement&&"select"in t}function Ja(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&tfe(t)&&e&&t.select()}}const VA=rfe();function rfe(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=GA(t,e),t.unshift(e)},remove(e){var r;t=GA(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function GA(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function nfe(t){return t.filter(e=>e.tagName!=="A")}const ife=["top","right","bottom","left"],qc=Math.min,gi=Math.max,Qy=Math.round,gm=Math.floor,Wc=t=>({x:t,y:t}),sfe={left:"right",right:"left",bottom:"top",top:"bottom"},ofe={start:"end",end:"start"};function o3(t,e,r){return gi(t,qc(e,r))}function ma(t,e){return typeof t=="function"?t(e):t}function va(t){return t.split("-")[0]}function Qd(t){return t.split("-")[1]}function h4(t){return t==="x"?"y":"x"}function p4(t){return t==="y"?"height":"width"}function Yd(t){return["top","bottom"].includes(va(t))?"y":"x"}function m4(t){return h4(Yd(t))}function afe(t,e,r){r===void 0&&(r=!1);const n=Qd(t),i=m4(t),s=p4(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Yy(o)),[o,Yy(o)]}function cfe(t){const e=Yy(t);return[a3(t),e,a3(e)]}function a3(t){return t.replace(/start|end/g,e=>ofe[e])}function lfe(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function ufe(t,e,r,n){const i=Qd(t);let s=lfe(va(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(a3)))),s}function Yy(t){return t.replace(/left|right|bottom|top/g,e=>sfe[e])}function ffe(t){return{top:0,right:0,bottom:0,left:0,...t}}function dB(t){return typeof t!="number"?ffe(t):{top:t,right:t,bottom:t,left:t}}function Jy(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function KA(t,e,r){let{reference:n,floating:i}=t;const s=Yd(e),o=m4(e),a=p4(o),c=va(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(Qd(e)){case"start":h[o]-=d*(r&&l?-1:1);break;case"end":h[o]+=d*(r&&l?-1:1);break}return h}const dfe=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=KA(l,n,c),d=n,h={},p=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=ma(t,e)||{};if(l==null)return{};const f=dB(u),d={x:r,y:n},h=m4(i),p=p4(h),m=await o.getDimensions(l),v=h==="y",y=v?"top":"left",b=v?"bottom":"right",E=v?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[h]-d[h]-s.floating[p],P=d[h]-s.reference[h],M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let L=M?M[E]:0;(!L||!await(o.isElement==null?void 0:o.isElement(M)))&&(L=a.floating[E]||s.floating[p]);const j=S/2-P/2,H=L/2-m[p]/2-1,K=qc(f[y],H),Q=qc(f[b],H),Y=K,F=L-m[p]-Q,w=L/2-m[p]/2+j,k=o3(Y,w,F),R=!c.arrow&&Qd(i)!=null&&w!=k&&s.reference[p]/2-(wY<=0)){var H,K;const Y=(((H=s.flip)==null?void 0:H.index)||0)+1,F=P[Y];if(F)return{data:{index:Y,overflows:j},reset:{placement:F}};let w=(K=j.filter(k=>k.overflows[0]<=0).sort((k,R)=>k.overflows[1]-R.overflows[1])[0])==null?void 0:K.placement;if(!w)switch(h){case"bestFit":{var Q;const k=(Q=j.map(R=>[R.placement,R.overflows.filter(N=>N>0).reduce((N,A)=>N+A,0)]).sort((R,N)=>R[1]-N[1])[0])==null?void 0:Q[0];k&&(w=k);break}case"initialPlacement":w=a;break}if(i!==w)return{reset:{placement:w}}}return{}}}};function YA(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function JA(t){return ife.some(e=>t[e]>=0)}const pfe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=ma(t,e);switch(n){case"referenceHidden":{const s=await v1(e,{...i,elementContext:"reference"}),o=YA(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:JA(o)}}}case"escaped":{const s=await v1(e,{...i,altBoundary:!0}),o=YA(s,r.floating);return{data:{escapedOffsets:o,escaped:JA(o)}}}default:return{}}}}};async function mfe(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=va(r),a=Qd(r),c=Yd(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=ma(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const vfe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await mfe(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},yfe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:v=>{let{x:y,y:b}=v;return{x:y,y:b}}},...c}=ma(t,e),l={x:r,y:n},u=await v1(e,c),f=Yd(va(i)),d=h4(f);let h=l[d],p=l[f];if(s){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=h+u[v],E=h-u[y];h=o3(b,h,E)}if(o){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=p+u[v],E=p-u[y];p=o3(b,p,E)}const m=a.fn({...e,[d]:h,[f]:p});return{...m,data:{x:m.x-r,y:m.y-n}}}}},gfe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=ma(t,e),u={x:r,y:n},f=Yd(i),d=h4(f);let h=u[d],p=u[f];const m=ma(a,e),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const E=d==="y"?"height":"width",S=s.reference[d]-s.floating[E]+v.mainAxis,P=s.reference[d]+s.reference[E]-v.mainAxis;hP&&(h=P)}if(l){var y,b;const E=d==="y"?"width":"height",S=["top","left"].includes(va(i)),P=s.reference[f]-s.floating[E]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),M=s.reference[f]+s.reference[E]+(S?0:((b=o.offset)==null?void 0:b[f])||0)-(S?v.crossAxis:0);pM&&(p=M)}return{[d]:h,[f]:p}}}},bfe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=ma(t,e),c=await v1(e,a),l=va(r),u=Qd(r),f=Yd(r)==="y",{width:d,height:h}=n.floating;let p,m;l==="top"||l==="bottom"?(p=l,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=l,p=u==="end"?"top":"bottom");const v=h-c[p],y=d-c[m],b=!e.middlewareData.shift;let E=v,S=y;if(f){const M=d-c.left-c.right;S=u||b?qc(y,M):M}else{const M=h-c.top-c.bottom;E=u||b?qc(v,M):M}if(b&&!u){const M=gi(c.left,0),L=gi(c.right,0),j=gi(c.top,0),H=gi(c.bottom,0);f?S=d-2*(M!==0||L!==0?M+L:gi(c.left,c.right)):E=h-2*(j!==0||H!==0?j+H:gi(c.top,c.bottom))}await o({...e,availableWidth:S,availableHeight:E});const P=await i.getDimensions(s.floating);return d!==P.width||h!==P.height?{reset:{rects:!0}}:{}}}};function Hc(t){return hB(t)?(t.nodeName||"").toLowerCase():"#document"}function Ci(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function La(t){var e;return(e=(hB(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function hB(t){return t instanceof Node||t instanceof Ci(t).Node}function ya(t){return t instanceof Element||t instanceof Ci(t).Element}function _o(t){return t instanceof HTMLElement||t instanceof Ci(t).HTMLElement}function XA(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ci(t).ShadowRoot}function yp(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=ss(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function xfe(t){return["table","td","th"].includes(Hc(t))}function v4(t){const e=y4(),r=ss(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function wfe(t){let e=Sd(t);for(;_o(e)&&!Hb(e);){if(v4(e))return e;e=Sd(e)}return null}function y4(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Hb(t){return["html","body","#document"].includes(Hc(t))}function ss(t){return Ci(t).getComputedStyle(t)}function Vb(t){return ya(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Sd(t){if(Hc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||XA(t)&&t.host||La(t);return XA(e)?e.host:e}function pB(t){const e=Sd(t);return Hb(e)?t.ownerDocument?t.ownerDocument.body:t.body:_o(e)&&yp(e)?e:pB(e)}function y1(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=pB(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=Ci(i);return s?e.concat(o,o.visualViewport||[],yp(i)?i:[],o.frameElement&&r?y1(o.frameElement):[]):e.concat(i,y1(i,[],r))}function mB(t){const e=ss(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=_o(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=Qy(r)!==s||Qy(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function g4(t){return ya(t)?t:t.contextElement}function Xf(t){const e=g4(t);if(!_o(e))return Wc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=mB(e);let o=(s?Qy(r.width):r.width)/n,a=(s?Qy(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Efe=Wc(0);function vB(t){const e=Ci(t);return!y4()||!e.visualViewport?Efe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Cfe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Ci(t)?!1:e}function yu(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=g4(t);let o=Wc(1);e&&(n?ya(n)&&(o=Xf(n)):o=Xf(t));const a=Cfe(s,r,n)?vB(s):Wc(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=Ci(s),h=n&&ya(n)?Ci(n):n;let p=d.frameElement;for(;p&&n&&h!==d;){const m=Xf(p),v=p.getBoundingClientRect(),y=ss(p),b=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,E=v.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,f*=m.y,c+=b,l+=E,p=Ci(p).frameElement}}return Jy({width:u,height:f,x:c,y:l})}function Sfe(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=_o(r),s=La(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=Wc(1);const c=Wc(0);if((i||!i&&n!=="fixed")&&((Hc(r)!=="body"||yp(s))&&(o=Vb(r)),_o(r))){const l=yu(r);a=Xf(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}}function kfe(t){return Array.from(t.getClientRects())}function yB(t){return yu(La(t)).left+Vb(t).scrollLeft}function Afe(t){const e=La(t),r=Vb(t),n=t.ownerDocument.body,i=gi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=gi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+yB(t);const a=-r.scrollTop;return ss(n).direction==="rtl"&&(o+=gi(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function _fe(t,e){const r=Ci(t),n=La(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=y4();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function Pfe(t,e){const r=yu(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=_o(t)?Xf(t):Wc(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function ZA(t,e,r){let n;if(e==="viewport")n=_fe(t,r);else if(e==="document")n=Afe(La(t));else if(ya(e))n=Pfe(e,r);else{const i=vB(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Jy(n)}function gB(t,e){const r=Sd(t);return r===e||!ya(r)||Hb(r)?!1:ss(r).position==="fixed"||gB(r,e)}function Ife(t,e){const r=e.get(t);if(r)return r;let n=y1(t,[],!1).filter(a=>ya(a)&&Hc(a)!=="body"),i=null;const s=ss(t).position==="fixed";let o=s?Sd(t):t;for(;ya(o)&&!Hb(o);){const a=ss(o),c=v4(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||yp(o)&&!c&&gB(t,o))?n=n.filter(u=>u!==o):i=a,o=Sd(o)}return e.set(t,n),n}function Tfe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?Ife(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=ZA(e,u,i);return l.top=gi(f.top,l.top),l.right=qc(f.right,l.right),l.bottom=qc(f.bottom,l.bottom),l.left=gi(f.left,l.left),l},ZA(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ofe(t){return mB(t)}function Rfe(t,e,r){const n=_o(e),i=La(e),s=r==="fixed",o=yu(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=Wc(0);if(n||!n&&!s)if((Hc(e)!=="body"||yp(i))&&(a=Vb(e)),n){const l=yu(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else i&&(c.x=yB(i));return{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function e_(t,e){return!_o(t)||ss(t).position==="fixed"?null:e?e(t):t.offsetParent}function bB(t,e){const r=Ci(t);if(!_o(t))return r;let n=e_(t,e);for(;n&&xfe(n)&&ss(n).position==="static";)n=e_(n,e);return n&&(Hc(n)==="html"||Hc(n)==="body"&&ss(n).position==="static"&&!v4(n))?r:n||wfe(t)||r}const $fe=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||bB,s=this.getDimensions;return{reference:Rfe(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function Mfe(t){return ss(t).direction==="rtl"}const Nfe={convertOffsetParentRelativeRectToViewportRelativeRect:Sfe,getDocumentElement:La,getClippingRect:Tfe,getOffsetParent:bB,getElementRects:$fe,getClientRects:kfe,getDimensions:Ofe,getScale:Xf,isElement:ya,isRTL:Mfe};function Dfe(t,e){let r=null,n;const i=La(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=gm(u),p=gm(i.clientWidth-(l+f)),m=gm(i.clientHeight-(u+d)),v=gm(l),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:gi(0,qc(1,c))||1};let E=!0;function S(P){const M=P[0].intersectionRatio;if(M!==c){if(!E)return o();M?o(!1,M):n=setTimeout(()=>{o(!1,1e-7)},100)}E=!1}try{r=new IntersectionObserver(S,{...b,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,b)}r.observe(t)}return o(!0),s}function Lfe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=g4(t),u=i||s?[...l?y1(l):[],...y1(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const f=l&&a?Dfe(l,r):null;let d=-1,h=null;o&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{h&&h.observe(e)})),r()}),l&&!c&&h.observe(l),h.observe(e));let p,m=c?yu(t):null;c&&v();function v(){const y=yu(t);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&r(),m=y,p=requestAnimationFrame(v)}return r(),()=>{u.forEach(y=>{i&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const jfe=(t,e,r)=>{const n=new Map,i={platform:Nfe,...r},s={...i.platform,_c:n};return dfe(t,e,{...i,platform:s})},Bfe=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?QA({element:n.current,padding:i}).fn(r):{}:n?QA({element:n,padding:i}).fn(r):{}}}};var bv=typeof document<"u"?x.useLayoutEffect:x.useEffect;function Xy(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Xy(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!Xy(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function xB(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function t_(t,e){const r=xB(t);return Math.round(e*r)/r}function r_(t){const e=x.useRef(t);return bv(()=>{e.current=t}),e}function Ffe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=x.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=x.useState(n);Xy(d,n)||h(n);const[p,m]=x.useState(null),[v,y]=x.useState(null),b=x.useCallback(R=>{R!=M.current&&(M.current=R,m(R))},[m]),E=x.useCallback(R=>{R!==L.current&&(L.current=R,y(R))},[y]),S=s||p,P=o||v,M=x.useRef(null),L=x.useRef(null),j=x.useRef(u),H=r_(c),K=r_(i),Q=x.useCallback(()=>{if(!M.current||!L.current)return;const R={placement:e,strategy:r,middleware:d};K.current&&(R.platform=K.current),jfe(M.current,L.current,R).then(N=>{const A={...N,isPositioned:!0};Y.current&&!Xy(j.current,A)&&(j.current=A,zs.flushSync(()=>{f(A)}))})},[d,e,r,K]);bv(()=>{l===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[l]);const Y=x.useRef(!1);bv(()=>(Y.current=!0,()=>{Y.current=!1}),[]),bv(()=>{if(S&&(M.current=S),P&&(L.current=P),S&&P){if(H.current)return H.current(S,P,Q);Q()}},[S,P,Q,H]);const F=x.useMemo(()=>({reference:M,floating:L,setReference:b,setFloating:E}),[b,E]),w=x.useMemo(()=>({reference:S,floating:P}),[S,P]),k=x.useMemo(()=>{const R={position:r,left:0,top:0};if(!w.floating)return R;const N=t_(w.floating,u.x),A=t_(w.floating,u.y);return a?{...R,transform:"translate("+N+"px, "+A+"px)",...xB(w.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:N,top:A}},[r,a,w.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:Q,refs:F,elements:w,floatingStyles:k}),[u,Q,F,w,k])}const wB="Popper",[EB,Jd]=In(wB),[Ufe,CB]=EB(wB),zfe=t=>{const{__scopePopper:e,children:r}=t,[n,i]=x.useState(null);return x.createElement(Ufe,{scope:e,anchor:n,onAnchorChange:i},r)},qfe="PopperAnchor",Wfe=x.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=CB(qfe,r),o=x.useRef(null),a=Lt(e,o);return x.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:x.createElement(Xe.div,Fe({},i,{ref:a}))}),SB="PopperContent",[Hfe,l_e]=EB(SB),Vfe=x.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:m=0,avoidCollisions:v=!0,collisionBoundary:y=[],collisionPadding:b=0,sticky:E="partial",hideWhenDetached:S=!1,updatePositionStrategy:P="optimized",onPlaced:M,...L}=t,j=CB(SB,u),[H,K]=x.useState(null),Q=Lt(e,ve=>K(ve)),[Y,F]=x.useState(null),w=jb(Y),k=(r=w==null?void 0:w.width)!==null&&r!==void 0?r:0,R=(n=w==null?void 0:w.height)!==null&&n!==void 0?n:0,N=f+(h!=="center"?"-"+h:""),A=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},O=Array.isArray(y)?y:[y],B=O.length>0,I={padding:A,boundary:O.filter(Gfe),altBoundary:B},{refs:C,floatingStyles:D,placement:z,isPositioned:_,middlewareData:W}=Ffe({strategy:"fixed",placement:N,whileElementsMounted:(...ve)=>Lfe(...ve,{animationFrame:P==="always"}),elements:{reference:j.anchor},middleware:[vfe({mainAxis:d+R,alignmentAxis:p}),v&&yfe({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?gfe():void 0,...I}),v&&hfe({...I}),bfe({...I,apply:({elements:ve,rects:$e,availableWidth:ge,availableHeight:Ee})=>{const{width:Ue,height:Ke}=$e.reference,Ye=ve.floating.style;Ye.setProperty("--radix-popper-available-width",`${ge}px`),Ye.setProperty("--radix-popper-available-height",`${Ee}px`),Ye.setProperty("--radix-popper-anchor-width",`${Ue}px`),Ye.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),Y&&Bfe({element:Y,padding:m}),Kfe({arrowWidth:k,arrowHeight:R}),S&&pfe({strategy:"referenceHidden",...I})]}),[G,J]=kB(z),ee=is(M);Pi(()=>{_&&(ee==null||ee())},[_,ee]);const se=(i=W.arrow)===null||i===void 0?void 0:i.x,ie=(s=W.arrow)===null||s===void 0?void 0:s.y,oe=((o=W.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[be,he]=x.useState();return Pi(()=>{H&&he(window.getComputedStyle(H).zIndex)},[H]),x.createElement("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:_?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(a=W.transformOrigin)===null||a===void 0?void 0:a.x,(c=W.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},x.createElement(Hfe,{scope:u,placedSide:G,onArrowChange:F,arrowX:se,arrowY:ie,shouldHideArrow:oe},x.createElement(Xe.div,Fe({"data-side":G,"data-align":J},L,{ref:Q,style:{...L.style,animation:_?void 0:"none",opacity:(l=W.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function Gfe(t){return t!==null}const Kfe=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,h=f?0:t.arrowHeight,[p,m]=kB(a),v={start:"0%",center:"50%",end:"100%"}[m],y=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,b=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+h/2;let E="",S="";return p==="bottom"?(E=f?v:`${y}px`,S=`${-h}px`):p==="top"?(E=f?v:`${y}px`,S=`${c.floating.height+h}px`):p==="right"?(E=`${-h}px`,S=f?v:`${b}px`):p==="left"&&(E=`${c.floating.width+h}px`,S=f?v:`${b}px`),{data:{x:E,y:S}}}});function kB(t){const[e,r="center"]=t.split("-");return[e,r]}const Qfe=zfe,Yfe=Wfe,Jfe=Vfe,AB=x.forwardRef((t,e)=>{var r;const{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...i}=t;return n?hG.createPortal(x.createElement(Xe.div,Fe({},i,{ref:e})),n):null}),vw="rovingFocusGroup.onEntryFocus",Xfe={bubbles:!1,cancelable:!0},b4="RovingFocusGroup",[c3,_B,Zfe]=qb(b4),[ede,Xd]=In(b4,[Zfe]),[tde,rde]=ede(b4),nde=x.forwardRef((t,e)=>x.createElement(c3.Provider,{scope:t.__scopeRovingFocusGroup},x.createElement(c3.Slot,{scope:t.__scopeRovingFocusGroup},x.createElement(ide,mt({},t,{ref:e}))))),ide=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,...u}=t,f=x.useRef(null),d=Lt(e,f),h=Wb(s),[p=null,m]=pa({prop:o,defaultProp:a,onChange:c}),[v,y]=x.useState(!1),b=is(l),E=_B(r),S=x.useRef(!1),[P,M]=x.useState(0);return x.useEffect(()=>{const L=f.current;if(L)return L.addEventListener(vw,b),()=>L.removeEventListener(vw,b)},[b]),x.createElement(tde,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:p,onItemFocus:x.useCallback(L=>m(L),[m]),onItemShiftTab:x.useCallback(()=>y(!0),[]),onFocusableItemAdd:x.useCallback(()=>M(L=>L+1),[]),onFocusableItemRemove:x.useCallback(()=>M(L=>L-1),[])},x.createElement(Xe.div,mt({tabIndex:v||P===0?-1:0,"data-orientation":n},u,{ref:d,style:{outline:"none",...t.style},onMouseDown:_e(t.onMouseDown,()=>{S.current=!0}),onFocus:_e(t.onFocus,L=>{const j=!S.current;if(L.target===L.currentTarget&&j&&!v){const H=new CustomEvent(vw,Xfe);if(L.currentTarget.dispatchEvent(H),!H.defaultPrevented){const K=E().filter(k=>k.focusable),Q=K.find(k=>k.active),Y=K.find(k=>k.id===p),w=[Q,Y,...K].filter(Boolean).map(k=>k.ref.current);PB(w)}}S.current=!1}),onBlur:_e(t.onBlur,()=>y(!1))})))}),sde="RovingFocusGroupItem",ode=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=ia(),c=s||a,l=rde(sde,r),u=l.currentTabStopId===c,f=_B(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return x.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),x.createElement(c3.ItemSlot,{scope:r,id:c,focusable:n,active:i},x.createElement(Xe.span,mt({tabIndex:u?0:-1,"data-orientation":l.orientation},o,{ref:e,onMouseDown:_e(t.onMouseDown,p=>{n?l.onItemFocus(c):p.preventDefault()}),onFocus:_e(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:_e(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){l.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=lde(p,l.orientation,l.dir);if(m!==void 0){p.preventDefault();let y=f().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const b=y.indexOf(p.currentTarget);y=l.loop?ude(y,b+1):y.slice(b+1)}setTimeout(()=>PB(y))}})})))}),ade={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cde(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function lde(t,e,r){const n=cde(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return ade[n]}function PB(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function ude(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const IB=nde,x4=ode;var fde=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Qu=new WeakMap,bm=new WeakMap,xm={},yw=0,TB=function(t){return t&&(t.host||TB(t.parentNode))},dde=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=TB(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},hde=function(t,e,r,n){var i=dde(e,Array.isArray(t)?t:[t]);xm[r]||(xm[r]=new WeakMap);var s=xm[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var h=d.getAttribute(n),p=h!==null&&h!=="false",m=(Qu.get(d)||0)+1,v=(s.get(d)||0)+1;Qu.set(d,m),s.set(d,v),o.push(d),m===1&&p&&bm.set(d,!0),v===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}})};return u(e),a.clear(),yw++,function(){o.forEach(function(f){var d=Qu.get(f)-1,h=s.get(f)-1;Qu.set(f,d),s.set(f,h),d||(bm.has(f)||f.removeAttribute(n),bm.delete(f)),h||f.removeAttribute(r)}),yw--,yw||(Qu=new WeakMap,Qu=new WeakMap,bm=new WeakMap,xm={})}},OB=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||fde(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),hde(n,i,r,"aria-hidden")):function(){return null}},co=function(){return co=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return Tde;var e=Ode(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},$de=NB(),Mde=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` - .`.concat(mde,` { + */var xA;function Jce(){if(xA)return kh;xA=1;var t=g,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var u,f={},d=null,h=null;l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),c.ref!==void 0&&(h=c.ref);for(u in c)n.call(c,u)&&!s.hasOwnProperty(u)&&(f[u]=c[u]);if(a&&a.defaultProps)for(u in c=a.defaultProps,c)f[u]===void 0&&(f[u]=c[u]);return{$$typeof:e,type:a,key:d,ref:h,props:f,_owner:i.current}}return kh.Fragment=r,kh.jsx=o,kh.jsxs=o,kh}$j.exports=Jce();var X=$j.exports;function Xce(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zce(t){var e=Xce(t,"string");return typeof e=="symbol"?e:String(e)}function ele(t,e,r){return e=Zce(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function EA(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},Er=t=>{var e=r=>{var n=t.defaultClassName,i=EA(EA({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var c=a;typeof c=="boolean"&&(c=c===!0?"true":"false");var l=t.variantClassNames[s][c];l&&(n+=" "+l)}}for(var[u,f]of t.compoundVariants)tle(u,i,t.defaultVariants)&&(n+=" "+f);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return CA(t.variantClassNames,r=>CA(r,n=>n.split(" ")[0]))}},e};Er({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"_2q9vfj8 _2q9vfj0 fyvr11ov",warning:"_2q9vfj9 _2q9vfj1 fyvr11p1",success:"_2q9vfja _2q9vfj2 fyvr11oj",error:"_2q9vfjb _2q9vfj3 fyvr11op"},size:{sm:"_2q9vfjc _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 _2q9vfj4 fyvr1wo fyvr1yk fyvr13w fyvr1e8",md:"_2q9vfjd _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _2q9vfj5 fyvr1ws fyvr1yo fyvr140 fyvr1ec",lg:"_2q9vfje _1qxj1ib9 _1qxj1ibd _1qxj1ib3 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc _2q9vfj6 fyvr1ww fyvr1ys fyvr144 fyvr1eg"}},defaultVariants:{},compoundVariants:[]});const s1=t=>{const{color:e="borderNormal",marginY:r="4",...n}=t;return X.jsx(q,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var Mj=Er({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"_1qxj1iba _1qxj1ib0 fyvr11mu fyvr11e4 fyvr11gg fyvr11fg fyvr11ew",xlarge:"_1qxj1ibb _1qxj1ib1 fyvr11mv fyvr11es fyvr11gc fyvr11fk fyvr11fc",large:"_1qxj1ibc _1qxj1ib2 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8",medium:"_1qxj1ibd _1qxj1ib3 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc",normal:"_1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",small:"_1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4",xsmall:"_1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc",code:"_1qxj1ibh _1qxj1ib7 fyvr11mw fyvr11eg fyvr11g0 fyvr11fk fyvr11f0"},ellipsis:{true:"_1qxj1ibi _1qxj1ib8 fyvr11ls fyvr11m8 fyvr11n9 fyvr11mx"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const ae=w.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:c,ellipsis:l,uppercase:u,capitalize:f,...d}=t,h=qce[n];return X.jsx(q,{as:r,className:fi(i,Mj({hidden:s,ellipsis:l,italic:o,underline:a,uppercase:u,capitalize:f})),ref:e,...h,...d,children:c})});var rle=Er({defaultClassName:"_140wn8ni _140wn8n0 fyvr11ls fyvr11m8 fyvr11n9 fyvr11ko fyvr12o1 fyvr11n2 fyvr11h0",variantClassNames:{variant:{base:"_140wn8nj _140wn8n1 fyvr11od fyvr12s1",ghost:"_140wn8nk _140wn8n2 fyvr11od fyvr12s1",feature:"_140wn8nl _140wn8n3 fyvr11pj fyvr12od",primary:"_140wn8nm _140wn8n4 fyvr11pd fyvr12od",glass:"_140wn8nn _140wn8n5 fyvr11tv fyvr12s1",emphasis:"_140wn8no _140wn8n6 fyvr11u1 fyvr12s1",raised:"_140wn8np _140wn8n7 fyvr11tp fyvr12s1",danger:"_140wn8nq _140wn8n8 fyvr11op fyvr12od",text:"_140wn8nr _1qxj1ib9 _1qxj1ibf _1qxj1ib5 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 _140wn8n9 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr11od fyvr12sd"},shape:{circle:"_140wn8ns _140wn8na fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",square:"_140wn8nt _140wn8nb fyvr11d0 fyvr11do fyvr11bo fyvr11cc"},disabled:{true:"_140wn8nu _140wn8nc fyvr12v1 fyvr12vp",false:"_140wn8nv _140wn8nd fyvr12v7 fyvr12w1 fyvr12vz"},size:{xs:"_140wn8nw _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc _140wn8ne fyvr1ws fyvr1yo",sm:"_140wn8nx _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nf fyvr1ww fyvr1ys",md:"_140wn8ny _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8ng fyvr1x0 fyvr1yw",lg:"_140wn8nz _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _140wn8nh fyvr1x0 fyvr1yw"},iconOnly:{true:"_140wn8n10"},hasLeftIcon:{true:"_140wn8n11"},hasRightIcon:{true:"_140wn8n12"},activeOutline:{light:"_140wn8n13",bold:"_140wn8n14"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n15"],[{iconOnly:!0,size:"sm"},"_140wn8n16"],[{iconOnly:!0,size:"md"},"_140wn8n17"],[{iconOnly:!0,size:"lg"},"_140wn8n18"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n1b"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n1c"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1d"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1e"]]});const rt=w.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:c=!1,label:l,leftIcon:u,rightIcon:f,size:d="md",variant:h="glass",width:p="fit",shape:m="circle",type:v="button",...y}=t,b=u!==void 0&&l!==void 0,E=f!==void 0&&l!==void 0,S=u!==void 0&&l===void 0,P=d==="xs"?"xs":"sm";return X.jsx(q,{as:r,className:fi(i,rle({activeOutline:n,disabled:s||c,hasLeftIcon:b,hasRightIcon:E,iconOnly:S,size:h==="text"?void 0:d,shape:h==="text"?void 0:m,variant:h})),disabled:s||c,display:o,fontWeight:a,ref:e,type:v,width:p,...y,children:S?X.jsx(u,{size:P}):X.jsxs(q,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:d==="xs"?"1":"2",children:[X.jsxs(q,{justifyContent:"flex-start",alignItems:"center",gap:d==="xs"?"1":"2",children:[u&&X.jsx(u,{size:P}),X.jsx(ae,{children:l})]}),f&&X.jsx(f,{size:P})]})})});var nle=Er({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"rhmai64 rhmai60 fyvr12vz fyvr12v7"},disabled:{true:"rhmai65"},outlined:{true:"rhmai66 rhmai61 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr12n7 fyvr12fv fyvr1217 fyvr128j fyvr12nj fyvr12g7 fyvr121j fyvr128v"},blur:{true:"rhmai67 rhmai62 fyvr11ms"}},defaultVariants:{},compoundVariants:[]});const kn=w.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:c="full",...l}=t;return X.jsx(q,{className:fi(r,nle({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:c,ref:e,...l,children:n})});function mt(){return mt=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(r=>ile(r,e))}function Lt(...t){return w.useCallback(Nj(...t),t)}function In(t,e=[]){let r=[];function n(s,o){const a=w.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:h,...p}=f,m=(d==null?void 0:d[t][c])||a,v=w.useMemo(()=>p,Object.values(p));return w.createElement(m.Provider,{value:v},h)}function u(f,d){const h=(d==null?void 0:d[t][c])||a,p=w.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>w.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return w.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,sle(i,...e)]}function sle(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function _e(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function rs(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function fa({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=ole({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=rs(r),c=w.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function ole({defaultProp:t,onChange:e}){const r=w.useState(t),[n]=r,i=w.useRef(n),s=rs(e);return w.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function kb(t){const e=w.useRef({value:t,previous:t});return w.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const Ai=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function Ab(t){const[e,r]=w.useState(void 0);return Ai(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function ale(t,e){return w.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const Ra=t=>{const{present:e,children:r}=t,n=cle(e),i=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),s=Lt(n.ref,i.ref);return typeof r=="function"||n.isPresent?w.cloneElement(i,{ref:s}):null};Ra.displayName="Presence";function cle(t){const[e,r]=w.useState(),n=w.useRef({}),i=w.useRef(t),s=w.useRef("none"),o=t?"mounted":"unmounted",[a,c]=ale(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const l=om(n.current);s.current=a==="mounted"?l:"none"},[a]),Ai(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,h=om(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Ai(()=>{if(e){const l=f=>{const h=om(n.current).includes(f.animationName);f.target===e&&h&&Fs.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=om(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function om(t){return(t==null?void 0:t.animationName)||"none"}function Fe(){return Fe=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:r,...n}=t,i=w.Children.toArray(r),s=i.find(ule);if(s){const o=s.props.children,a=i.map(c=>c===s?w.Children.count(o)>1?w.Children.only(null):w.isValidElement(o)?o.props.children:null:c);return w.createElement(q6,Fe({},n,{ref:e}),w.isValidElement(o)?w.cloneElement(o,void 0,a):null)}return w.createElement(q6,Fe({},n,{ref:e}),r)});pd.displayName="Slot";const q6=w.forwardRef((t,e)=>{const{children:r,...n}=t;return w.isValidElement(r)?w.cloneElement(r,{...fle(n,r.props),ref:e?Nj(e,r.ref):r.ref}):w.Children.count(r)>1?w.Children.only(null):null});q6.displayName="SlotClone";const lle=({children:t})=>w.createElement(w.Fragment,null,t);function ule(t){return w.isValidElement(t)&&t.type===lle}function fle(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const dle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xe=dle.reduce((t,e)=>{const r=w.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?pd:e;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(a,mt({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function KC(t,e){t&&Fs.flushSync(()=>t.dispatchEvent(e))}const Dj="Checkbox",[hle,CAe]=In(Dj),[ple,mle]=hle(Dj),vle=w.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=w.useState(null),h=Lt(e,E=>d(E)),p=w.useRef(!1),m=f?!!f.closest("form"):!0,[v=!1,y]=fa({prop:i,defaultProp:s,onChange:l}),b=w.useRef(v);return w.useEffect(()=>{const E=f==null?void 0:f.form;if(E){const S=()=>y(b.current);return E.addEventListener("reset",S),()=>E.removeEventListener("reset",S)}},[f,y]),w.createElement(ple,{scope:r,state:v,disabled:a},w.createElement(Xe.button,mt({type:"button",role:"checkbox","aria-checked":Vl(v)?"mixed":v,"aria-required":o,"data-state":Lj(v),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:h,onKeyDown:_e(t.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:_e(t.onClick,E=>{y(S=>Vl(S)?!0:!S),m&&(p.current=E.isPropagationStopped(),p.current||E.stopPropagation())})})),m&&w.createElement(ble,{control:f,bubbles:!p.current,name:n,value:c,checked:v,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),yle="CheckboxIndicator",gle=w.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=mle(yle,r);return w.createElement(Ra,{present:n||Vl(s.state)||s.state===!0},w.createElement(Xe.span,mt({"data-state":Lj(s.state),"data-disabled":s.disabled?"":void 0},i,{ref:e,style:{pointerEvents:"none",...t.style}})))}),ble=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=w.useRef(null),o=kb(r),a=Ab(e);return w.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});c.indeterminate=Vl(r),f.call(c,Vl(r)?!1:r),c.dispatchEvent(d)}},[o,r,n]),w.createElement("input",mt({type:"checkbox","aria-hidden":!0,defaultChecked:Vl(r)?!1:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Vl(t){return t==="indeterminate"}function Lj(t){return Vl(t)?"indeterminate":t?"checked":"unchecked"}const xle=vle,wle=gle;var Ele=Er({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"_43lu9r5 _43lu9r0 fyvr11kw fyvr11i4 fyvr118k fyvr11h0",left:"_43lu9r6 _43lu9r1 fyvr11ko fyvr11ic fyvr118k fyvr11h0",right:"_43lu9r7 _43lu9r2 fyvr11ko fyvr11ic fyvr118k fyvr11h0",hidden:"_43lu9r8 _43lu9r3 fyvr1188 fyvr11h0"}},defaultVariants:{},compoundVariants:[]});const Eu=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?X.jsxs(q,{flexDirection:"column",gap:"0.5",children:[r&&X.jsx(ae,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&X.jsx(ae,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return X.jsxs(q,{as:"label",className:Ele({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var Cr=Er({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const Cle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.168 9.25V2.929h-1.5V9.25h-6.32v1.5h6.32v6.321h1.5V10.75h6.321v-1.5h-6.32Z",clipRule:"evenodd"})}),Sle=({size:t="sm",...e})=>X.jsx(q,{as:Cle,className:Cr({size:t}),...e}),kle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.888 14.47 1.06 1.06L17.48 10l-5.53-5.53-1.06 1.06 3.719 3.72H4.418v1.5h10.19l-3.72 3.72Z",clipRule:"evenodd"})}),W6=({size:t="sm",...e})=>X.jsx(q,{as:kle,className:Cr({size:t}),...e}),Ale=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),Bd=({size:t="sm",...e})=>X.jsx(q,{as:Ale,className:Cr({size:t}),...e}),_le=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),QC=({size:t="sm",...e})=>X.jsx(q,{as:_le,className:Cr({size:t}),...e}),Ple=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.888 3.47 1.06 1.06L8.48 10l5.47 5.47-1.061 1.06L6.358 10l6.53-6.53Z",clipRule:"evenodd"})}),_b=({size:t="sm",...e})=>X.jsx(q,{as:Ple,className:Cr({size:t}),...e}),Ile=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m7.949 16.53-1.061-1.06 5.47-5.47-5.47-5.47 1.06-1.06L14.48 10l-6.53 6.53Z",clipRule:"evenodd"})}),yo=({size:t="sm",...e})=>X.jsx(q,{as:Ile,className:Cr({size:t}),...e}),Tle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),Cu=({size:t="sm",...e})=>X.jsx(q,{as:Tle,className:Cr({size:t}),...e}),Ole=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.918 4.5h-6V6h4.5v6.5h1.5v-8Zm-1.5 9.5v3h-9V6h3V3h9v11h-3Zm-7.5 1.5v-8h6v8h-6Z",clipRule:"evenodd"})}),Pb=({size:t="sm",...e})=>X.jsx(q,{as:Ole,className:Cr({size:t}),...e}),Rle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 6.714 3.618 3.547H2.5L4.158 7.02H2.98v.69h1.494v.663H2.981v.69h1.494v1.484h1.036V9.063h1.46v-.69h-1.46v-.66l.001-.003h1.46v-.69h-1.13L7.5 3.547H6.383L5 6.714Zm4.747 8.232v-.788a2.887 2.887 0 0 1-1.04-.249 2.04 2.04 0 0 1-.863-.727 2.213 2.213 0 0 1-.344-1.125h1.017c.02.26.098.476.236.65.14.171.319.299.535.383.144.054.297.09.46.109V10.81l-.319-.093c-.538-.157-.964-.388-1.28-.693-.312-.304-.469-.707-.469-1.209 0-.415.105-.777.315-1.086.21-.31.495-.55.853-.72.273-.133.573-.215.9-.246v-.817h.537v.81c.365.023.692.106.981.249.35.17.626.406.827.706.201.298.306.64.315 1.027h-.978a1.04 1.04 0 0 0-.433-.774 1.47 1.47 0 0 0-.712-.264v2.253l.283.079c.214.056.434.132.659.228a2.6 2.6 0 0 1 .627.38c.192.157.347.351.466.583.12.232.18.51.18.834 0 .407-.098.77-.295 1.086a2.006 2.006 0 0 1-.85.749c-.304.15-.66.239-1.07.265v.79h-.538Zm1.024-1.877c-.148.064-.31.106-.486.128v-2.23c.216.064.41.136.584.218.193.089.345.201.457.337.113.136.17.31.17.524 0 .234-.065.44-.194.615-.129.174-.306.31-.531.408ZM9.747 7.706v2.095a4.605 4.605 0 0 1-.246-.086 2.195 2.195 0 0 1-.4-.207 1.038 1.038 0 0 1-.299-.313.847.847 0 0 1-.111-.443.94.94 0 0 1 .164-.545c.112-.162.268-.288.47-.38.126-.059.267-.099.422-.12Zm7.677 10.086h-4.9v-.897h.34a.342.342 0 0 0 .29-.186c.068-.117.114-.254.137-.411.023-.16.032-.304.028-.432l-.027-.779H12.5v-.896h.76l-.043-1.262c-.018-.472.073-.866.273-1.183.203-.317.473-.555.809-.715.335-.16.697-.24 1.084-.24.346 0 .656.056.931.166.278.11.511.26.7.452.191.188.328.404.41.647.081.243.097.498.048.766l-1.01-.156c.023-.22-.014-.403-.11-.55a.891.891 0 0 0-.395-.33 1.31 1.31 0 0 0-1.102.024c-.177.09-.322.227-.434.411-.11.185-.164.42-.164.708l.048 1.261h1.649v.897H14.34l.029.752c.014.29-.025.55-.116.78-.04.1-.096.193-.166.276h3.337v.897Z",clipRule:"evenodd"})}),$le=({size:t="sm",...e})=>X.jsx(q,{as:Rle,className:Cr({size:t}),...e}),Mle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",d:"m5.285 12.883 6.53-6.53 2.254 2.253-6.531 6.531-2.878.618.625-2.872ZM14.674 8.001l-2.253-2.253 1.502-1.503L16.176 6.5 14.674 8Z"})}),Nle=({size:t="sm",...e})=>X.jsx(q,{as:Mle,className:Cr({size:t}),...e}),Dle=t=>X.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[X.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M10.906 8.966c1.459 1.316 1.459 3.45 0 4.765l-2.53 2.282c-1.459 1.316-3.824 1.316-5.282 0-1.459-1.315-1.459-3.449 0-4.764l1.265-1.142"}),X.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M8.094 11c-1.459-1.316-1.459-3.449 0-4.765l2.53-2.282c1.459-1.316 3.823-1.316 5.282 0s1.459 3.449 0 4.765l-1.265 1.14"})]}),Lle=({size:t="sm",...e})=>X.jsx(q,{as:Dle,className:Cr({size:t}),...e}),jle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M15.918 14.994v.752A7.003 7.003 0 0 1 6.968 5.05a7.003 7.003 0 0 1 8.95-.796v.752a4.979 4.979 0 0 0-3.293 1.459 5 5 0 0 0 3.293 8.53Zm-4.353-.398c.329.329.684.615 1.059.859a5.5 5.5 0 1 1 0-10.91 6.5 6.5 0 0 0-1.06 10.051Z",clipRule:"evenodd"})}),Ble=({size:t="sm",...e})=>X.jsx(q,{as:jle,className:Cr({size:t}),...e}),Fle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.283 6.175a4.643 4.643 0 1 0-6.566 6.567l-.708.707a5.644 5.644 0 1 1 7.982 0l-.708-.707a4.644 4.644 0 0 0 0-6.567Zm-5.097 1.47a2.565 2.565 0 0 1 3.628 3.627l.707.707a3.565 3.565 0 1 0-5.042 0l.707-.707a2.565 2.565 0 0 1 0-3.627ZM10 10.959a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm0 .667-1.5 6h3l-1.5-6Z",clipRule:"evenodd"})}),Ule=({size:t="sm",...e})=>X.jsx(q,{as:Fle,className:Cr({size:t}),...e}),zle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.418 3.6h-2.5v2.5h2.5V3.6Zm0-1.5h1.5v5.5h-5.5V2.1h4Zm0 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4Zm8-9h2.5v2.5h-2.5V3.6Zm4-1.5h-5.5v5.5h5.5V2.1Zm-1.5 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4ZM9.668 2.1v7.25h-7.25v1.5h8.75V2.1h-1.5Zm1.5 10.5v5.5h-1.5v-5.5h1.5Zm1.75-1.75h5.5v-1.5h-5.5v1.5Z",clipRule:"evenodd"})}),qle=({size:t="sm",...e})=>X.jsx(q,{as:zle,className:Cr({size:t}),...e}),Wle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),Ib=({size:t="sm",...e})=>X.jsx(q,{as:Wle,className:Cr({size:t}),...e}),Hle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.529 15.925 9.419 11 4.493 8.89 2.418 8l2.142-.714 11.08-3.693L17.418 3l-.593 1.779-3.693 11.08L12.418 18l-.89-2.075Zm-1.71-6.386L6.635 8.175l6.82-2.273-3.638 3.637Zm1.06 1.061 1.364 3.183 2.273-6.82L10.88 10.6Z",clipRule:"evenodd"})}),Tb=({size:t="sm",...e})=>X.jsx(q,{as:Hle,className:Cr({size:t}),...e}),Vle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.775 5.204a5.465 5.465 0 0 0-1.341-.537L11 2.5H9l-.443 2.214c-.444.128-.866.31-1.257.54L5.404 3.99 3.99 5.404l1.283 1.925c-.212.38-.38.787-.497 1.216L2.5 9v2l2.276.455c.118.429.285.836.497 1.216L3.99 14.596l1.414 1.414L7.3 14.746c.391.23.813.412 1.257.54L9 17.5h2l.434-2.167c.474-.12.925-.302 1.341-.537l1.821 1.214 1.414-1.414-1.195-1.793c.253-.427.45-.891.581-1.382L17.5 11V9l-2.104-.42a5.467 5.467 0 0 0-.581-1.383l1.195-1.793-1.414-1.414-1.82 1.214Zm-.59 2.692a2.976 2.976 0 1 0-4.208 4.208 2.976 2.976 0 0 0 4.209-4.208Z",clipRule:"evenodd"})}),jj=({size:t="sm",...e})=>X.jsx(q,{as:Vle,className:Cr({size:t}),...e}),Gle=t=>X.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[X.jsx("path",{fill:"currentColor",d:"M4 6.234a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V10.5L14 9v5.734a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h5.769l-1.516 1.5H4Z"}),X.jsx("path",{stroke:"currentColor",strokeWidth:1.25,d:"M11 3h5v5"}),X.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m16 3-8 8"})]}),Kle=({size:t="sm",...e})=>X.jsx(q,{as:Gle,className:Cr({size:t}),...e}),Qle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.418 3.25h-5.75v13.5h5.75v-1.5h-4.25V4.75h4.25v-1.5Zm4.53 11.28-1.06-1.06 2.72-2.72h-8.19v-1.5h8.19l-2.72-2.72 1.06-1.06L18.48 10l-4.53 4.53Z",clipRule:"evenodd"})}),Bj=({size:t="sm",...e})=>X.jsx(q,{as:Qle,className:Cr({size:t}),...e}),Yle=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.539 10.75H4.298v-1.5h12.24v1.5Z",clipRule:"evenodd"})}),Jle=({size:t="sm",...e})=>X.jsx(q,{as:Yle,className:Cr({size:t}),...e}),Xle=t=>X.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[X.jsx("path",{fill:"currentColor",d:"M4.633 10.75a5.878 5.878 0 0 1 .008-1.5H2.202v1.5h2.431ZM5.814 6.456A5.854 5.854 0 0 1 6.88 5.401L5.139 3.66l-1.06 1.06 1.735 1.736ZM4.078 15.28l1.711-1.711c.306.398.662.755 1.058 1.063L5.14 16.34l-1.06-1.06ZM9.668 15.802v2.414h1.5V15.8a5.876 5.876 0 0 1-1.5.003ZM13.98 14.623l1.718 1.717 1.06-1.06-1.721-1.723c-.305.4-.66.758-1.056 1.066ZM16.184 10.75h2.45v-1.5h-2.457a5.882 5.882 0 0 1 .007 1.5ZM15.012 6.467l1.747-1.747-1.061-1.06-1.75 1.75c.399.305.756.66 1.064 1.057ZM11.168 4.258V1.784h-1.5v2.472a5.875 5.875 0 0 1 1.5.002Z"}),X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.418 12.504a2.504 2.504 0 1 0 0-5.008 2.504 2.504 0 0 0 0 5.008Zm0 1.5a4.004 4.004 0 1 0 0-8.008 4.004 4.004 0 0 0 0 8.008Z",clipRule:"evenodd"})]}),Zle=({size:t="sm",...e})=>X.jsx(q,{as:Xle,className:Cr({size:t}),...e}),eue=t=>X.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:X.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.28 2.856-6.71 8.887h4.134l-1.424 6.2 6.887-8.71h-4.322l1.435-6.377Z",clipRule:"evenodd"})}),Fj=({size:t="sm",...e})=>X.jsx(q,{as:eue,className:Cr({size:t}),...e});var tue=Er({defaultClassName:"_1c9x66f1 _1c9x66f0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11h0 fyvr11ko fyvr11jg fyvr11od fyvr12w1 fyvr12vz fyvr12vr fyvr12v7 fyvr12v3",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),rue="_1c9x66f4 fyvr12s1 fyvr11h0 fyvr11ko fyvr11jg fyvr128 fyvr15o";const nue=({size:t="sm"})=>X.jsx(wle,{className:rue,children:X.jsx(Bd,{size:t==="lg"?"sm":"xs"})});w.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...c}=t;return X.jsx(Eu,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:X.jsx(xle,{className:tue({size:a}),disabled:r,id:n??i,name:i,ref:e,...c,children:X.jsx(nue,{size:a})})})});g.createContext(null);const iue=GI.useId||(()=>{});let sue=0;function ta(t){const[e,r]=w.useState(iue());return Ai(()=>{t||r(n=>n??String(sue++))},[t]),t||(e?`radix-${e}`:"")}const Uj="Collapsible",[oue,SAe]=In(Uj),[aue,YC]=oue(Uj),cue=w.forwardRef((t,e)=>{const{__scopeCollapsible:r,open:n,defaultOpen:i,disabled:s,onOpenChange:o,...a}=t,[c=!1,l]=fa({prop:n,defaultProp:i,onChange:o});return w.createElement(aue,{scope:r,disabled:s,contentId:ta(),open:c,onOpenToggle:w.useCallback(()=>l(u=>!u),[l])},w.createElement(Xe.div,mt({"data-state":JC(c),"data-disabled":s?"":void 0},a,{ref:e})))}),lue="CollapsibleTrigger",uue=w.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,i=YC(lue,r);return w.createElement(Xe.button,mt({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":JC(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},n,{ref:e,onClick:_e(t.onClick,i.onOpenToggle)}))}),zj="CollapsibleContent",fue=w.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=YC(zj,t.__scopeCollapsible);return w.createElement(Ra,{present:r||i.open},({present:s})=>w.createElement(due,mt({},n,{ref:e,present:s})))}),due=w.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:i,...s}=t,o=YC(zj,r),[a,c]=w.useState(n),l=w.useRef(null),u=Lt(e,l),f=w.useRef(0),d=f.current,h=w.useRef(0),p=h.current,m=o.open||a,v=w.useRef(m),y=w.useRef();return w.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),Ai(()=>{const b=l.current;if(b){y.current=y.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const E=b.getBoundingClientRect();f.current=E.height,h.current=E.width,v.current||(b.style.transitionDuration=y.current.transitionDuration,b.style.animationName=y.current.animationName),c(n)}},[o.open,n]),w.createElement(Xe.div,mt({"data-state":JC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m},s,{ref:u,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...t.style}}),m&&i)});function JC(t){return t?"open":"closed"}const hue=cue,pue=uue,mue=fue;var SA="64px",vue="_4j62fl0",yue="_4j62fl2 _4j62fl1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11h0 fyvr11ko fyvr11od fyvr128 fyvr12v7 fyvr11n4",gue="_4j62fl4 _4j62fl3 fyvr1ww fyvr1ys fyvr1so fyvr1v0 fyvr128",bue="_4j62fl5";const xue=t=>{const{className:e,children:r,defaultOpen:n,open:i,onOpenChange:s,label:o,...a}=t,[c,l]=w.useState(n),u=i??c,f=h=>{i===void 0&&l(h)},d=h=>{f(h),s==null||s(h)};return X.jsx(hue,{open:u,defaultOpen:n,onOpenChange:d,asChild:!0,children:X.jsxs(q,{as:Cc.div,className:fi(e,vue),initial:{height:u?"auto":SA},animate:{height:u?"auto":SA},transition:{ease:"easeOut",duration:.3},borderRadius:"md",background:"backgroundSecondary",position:"relative",overflow:"hidden",width:"full",...a,children:[X.jsxs(pue,{className:yue,children:[X.jsx(ae,{as:"div",variant:"normal",fontWeight:"bold",color:"text80",children:o}),X.jsx(q,{as:Cc.div,position:"absolute",right:"0",marginRight:"4",initial:{rotate:u?180:0},animate:{rotate:u?180:0},transition:{ease:"linear",duration:.1},children:X.jsx(QC,{className:bue,color:"text50"})})]}),X.jsx(dd,{children:u&&X.jsx(mue,{className:gue,asChild:!0,forceMount:!0,children:X.jsx(Cc.div,{initial:{opacity:u?1:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:"easeOut",duration:.3},children:r})})})]})})};function Ob(t){const e=t+"CollectionProvider",[r,n]=In(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=h=>{const{scope:p,children:m}=h,v=g.useRef(null),y=g.useRef(new Map).current;return g.createElement(i,{scope:p,itemMap:y,collectionRef:v},m)},a=t+"CollectionSlot",c=g.forwardRef((h,p)=>{const{scope:m,children:v}=h,y=s(a,m),b=Lt(p,y.collectionRef);return g.createElement(pd,{ref:b},v)}),l=t+"CollectionItemSlot",u="data-radix-collection-item",f=g.forwardRef((h,p)=>{const{scope:m,children:v,...y}=h,b=g.useRef(null),E=Lt(p,b),S=s(l,m);return g.useEffect(()=>(S.itemMap.set(b,{ref:b,...y}),()=>void S.itemMap.delete(b))),g.createElement(pd,{[u]:"",ref:E},v)});function d(h){const p=s(t+"CollectionConsumer",h);return g.useCallback(()=>{const v=p.collectionRef.current;if(!v)return[];const y=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((S,P)=>y.indexOf(S.ref.current)-y.indexOf(P.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},d,n]}const wue=w.createContext(void 0);function Rb(t){const e=w.useContext(wue);return t||e||"ltr"}function Eue(t,e=globalThis==null?void 0:globalThis.document){const r=rs(t);w.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const H6="dismissableLayer.update",Cue="dismissableLayer.pointerDownOutside",Sue="dismissableLayer.focusOutside";let kA;const kue=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),XC=w.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=w.useContext(kue),[f,d]=w.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,p]=w.useState({}),m=Lt(e,j=>d(j)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),E=f?v.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,P=E>=b,M=Aue(j=>{const H=j.target,K=[...u.branches].some(Q=>Q.contains(H));!P||K||(s==null||s(j),a==null||a(j),j.defaultPrevented||c==null||c())},h),L=_ue(j=>{const H=j.target;[...u.branches].some(Q=>Q.contains(H))||(o==null||o(j),a==null||a(j),j.defaultPrevented||c==null||c())},h);return Eue(j=>{E===u.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&c&&(j.preventDefault(),c()))},h),w.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(kA=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),AA(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=kA)}},[f,h,n,u]),w.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),AA())},[f,u]),w.useEffect(()=>{const j=()=>p({});return document.addEventListener(H6,j),()=>document.removeEventListener(H6,j)},[]),w.createElement(Xe.div,Fe({},l,{ref:m,style:{pointerEvents:S?P?"auto":"none":void 0,...t.style},onFocusCapture:_e(t.onFocusCapture,L.onFocusCapture),onBlurCapture:_e(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:_e(t.onPointerDownCapture,M.onPointerDownCapture)}))});function Aue(t,e=globalThis==null?void 0:globalThis.document){const r=rs(t),n=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){qj(Cue,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function _ue(t,e=globalThis==null?void 0:globalThis.document){const r=rs(t),n=w.useRef(!1);return w.useEffect(()=>{const i=s=>{s.target&&!n.current&&qj(Sue,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function AA(){const t=new CustomEvent(H6);document.dispatchEvent(t)}function qj(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?KC(i,s):i.dispatchEvent(s)}const Pue=XC;let ew=0;function Wj(){w.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:_A()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:_A()),ew++,()=>{ew===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),ew--}},[])}function _A(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const tw="focusScope.autoFocusOnMount",rw="focusScope.autoFocusOnUnmount",PA={bubbles:!1,cancelable:!0},Hj=w.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=w.useState(null),l=rs(i),u=rs(s),f=w.useRef(null),d=Lt(e,m=>c(m)),h=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let m=function(E){if(h.paused||!a)return;const S=E.target;a.contains(S)?f.current=S:Ga(f.current,{select:!0})},v=function(E){if(h.paused||!a)return;const S=E.relatedTarget;S!==null&&(a.contains(S)||Ga(f.current,{select:!0}))},y=function(E){if(document.activeElement===document.body)for(const P of E)P.removedNodes.length>0&&Ga(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[n,a,h.paused]),w.useEffect(()=>{if(a){TA.add(h);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(tw,PA);a.addEventListener(tw,l),a.dispatchEvent(y),y.defaultPrevented||(Iue(Mue(Vj(a)),{select:!0}),document.activeElement===m&&Ga(a))}return()=>{a.removeEventListener(tw,l),setTimeout(()=>{const y=new CustomEvent(rw,PA);a.addEventListener(rw,u),a.dispatchEvent(y),y.defaultPrevented||Ga(m??document.body,{select:!0}),a.removeEventListener(rw,u),TA.remove(h)},0)}}},[a,l,u,h]);const p=w.useCallback(m=>{if(!r&&!n||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const b=m.currentTarget,[E,S]=Tue(b);E&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&Ga(E,{select:!0})):m.shiftKey&&y===E&&(m.preventDefault(),r&&Ga(S,{select:!0})):y===b&&m.preventDefault()}},[r,n,h.paused]);return w.createElement(Xe.div,Fe({tabIndex:-1},o,{ref:d,onKeyDown:p}))});function Iue(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Ga(n,{select:e}),document.activeElement!==r)return}function Tue(t){const e=Vj(t),r=IA(e,t),n=IA(e.reverse(),t);return[r,n]}function Vj(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function IA(t,e){for(const r of t)if(!Oue(r,{upTo:e}))return r}function Oue(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Rue(t){return t instanceof HTMLInputElement&&"select"in t}function Ga(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Rue(t)&&e&&t.select()}}const TA=$ue();function $ue(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=OA(t,e),t.unshift(e)},remove(e){var r;t=OA(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function OA(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function Mue(t){return t.filter(e=>e.tagName!=="A")}const Nue=["top","right","bottom","left"],Lc=Math.min,vi=Math.max,Ly=Math.round,am=Math.floor,jc=t=>({x:t,y:t}),Due={left:"right",right:"left",bottom:"top",top:"bottom"},Lue={start:"end",end:"start"};function V6(t,e,r){return vi(t,Lc(e,r))}function da(t,e){return typeof t=="function"?t(e):t}function ha(t){return t.split("-")[0]}function Fd(t){return t.split("-")[1]}function ZC(t){return t==="x"?"y":"x"}function e4(t){return t==="y"?"height":"width"}function Ud(t){return["top","bottom"].includes(ha(t))?"y":"x"}function t4(t){return ZC(Ud(t))}function jue(t,e,r){r===void 0&&(r=!1);const n=Fd(t),i=t4(t),s=e4(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=jy(o)),[o,jy(o)]}function Bue(t){const e=jy(t);return[G6(t),e,G6(e)]}function G6(t){return t.replace(/start|end/g,e=>Lue[e])}function Fue(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function Uue(t,e,r,n){const i=Fd(t);let s=Fue(ha(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(G6)))),s}function jy(t){return t.replace(/left|right|bottom|top/g,e=>Due[e])}function zue(t){return{top:0,right:0,bottom:0,left:0,...t}}function Gj(t){return typeof t!="number"?zue(t):{top:t,right:t,bottom:t,left:t}}function By(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function RA(t,e,r){let{reference:n,floating:i}=t;const s=Ud(e),o=t4(e),a=e4(o),c=ha(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(Fd(e)){case"start":h[o]-=d*(r&&l?-1:1);break;case"end":h[o]+=d*(r&&l?-1:1);break}return h}const que=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=RA(l,n,c),d=n,h={},p=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=da(t,e)||{};if(l==null)return{};const f=Gj(u),d={x:r,y:n},h=t4(i),p=e4(h),m=await o.getDimensions(l),v=h==="y",y=v?"top":"left",b=v?"bottom":"right",E=v?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[h]-d[h]-s.floating[p],P=d[h]-s.reference[h],M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let L=M?M[E]:0;(!L||!await(o.isElement==null?void 0:o.isElement(M)))&&(L=a.floating[E]||s.floating[p]);const j=S/2-P/2,H=L/2-m[p]/2-1,K=Lc(f[y],H),Q=Lc(f[b],H),Y=K,F=L-m[p]-Q,x=L/2-m[p]/2+j,k=V6(Y,x,F),R=!c.arrow&&Fd(i)!=null&&x!=k&&s.reference[p]/2-(xY<=0)){var H,K;const Y=(((H=s.flip)==null?void 0:H.index)||0)+1,F=P[Y];if(F)return{data:{index:Y,overflows:j},reset:{placement:F}};let x=(K=j.filter(k=>k.overflows[0]<=0).sort((k,R)=>k.overflows[1]-R.overflows[1])[0])==null?void 0:K.placement;if(!x)switch(h){case"bestFit":{var Q;const k=(Q=j.map(R=>[R.placement,R.overflows.filter(N=>N>0).reduce((N,A)=>N+A,0)]).sort((R,N)=>R[1]-N[1])[0])==null?void 0:Q[0];k&&(x=k);break}case"initialPlacement":x=a;break}if(i!==x)return{reset:{placement:x}}}return{}}}};function MA(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function NA(t){return Nue.some(e=>t[e]>=0)}const Hue=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=da(t,e);switch(n){case"referenceHidden":{const s=await o1(e,{...i,elementContext:"reference"}),o=MA(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:NA(o)}}}case"escaped":{const s=await o1(e,{...i,altBoundary:!0}),o=MA(s,r.floating);return{data:{escapedOffsets:o,escaped:NA(o)}}}default:return{}}}}};async function Vue(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=ha(r),a=Fd(r),c=Ud(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=da(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const Gue=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await Vue(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},Kue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:v=>{let{x:y,y:b}=v;return{x:y,y:b}}},...c}=da(t,e),l={x:r,y:n},u=await o1(e,c),f=Ud(ha(i)),d=ZC(f);let h=l[d],p=l[f];if(s){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=h+u[v],E=h-u[y];h=V6(b,h,E)}if(o){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=p+u[v],E=p-u[y];p=V6(b,p,E)}const m=a.fn({...e,[d]:h,[f]:p});return{...m,data:{x:m.x-r,y:m.y-n}}}}},Que=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=da(t,e),u={x:r,y:n},f=Ud(i),d=ZC(f);let h=u[d],p=u[f];const m=da(a,e),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const E=d==="y"?"height":"width",S=s.reference[d]-s.floating[E]+v.mainAxis,P=s.reference[d]+s.reference[E]-v.mainAxis;hP&&(h=P)}if(l){var y,b;const E=d==="y"?"width":"height",S=["top","left"].includes(ha(i)),P=s.reference[f]-s.floating[E]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),M=s.reference[f]+s.reference[E]+(S?0:((b=o.offset)==null?void 0:b[f])||0)-(S?v.crossAxis:0);pM&&(p=M)}return{[d]:h,[f]:p}}}},Yue=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=da(t,e),c=await o1(e,a),l=ha(r),u=Fd(r),f=Ud(r)==="y",{width:d,height:h}=n.floating;let p,m;l==="top"||l==="bottom"?(p=l,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=l,p=u==="end"?"top":"bottom");const v=h-c[p],y=d-c[m],b=!e.middlewareData.shift;let E=v,S=y;if(f){const M=d-c.left-c.right;S=u||b?Lc(y,M):M}else{const M=h-c.top-c.bottom;E=u||b?Lc(v,M):M}if(b&&!u){const M=vi(c.left,0),L=vi(c.right,0),j=vi(c.top,0),H=vi(c.bottom,0);f?S=d-2*(M!==0||L!==0?M+L:vi(c.left,c.right)):E=h-2*(j!==0||H!==0?j+H:vi(c.top,c.bottom))}await o({...e,availableWidth:S,availableHeight:E});const P=await i.getDimensions(s.floating);return d!==P.width||h!==P.height?{reset:{rects:!0}}:{}}}};function Bc(t){return Kj(t)?(t.nodeName||"").toLowerCase():"#document"}function wi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $a(t){var e;return(e=(Kj(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Kj(t){return t instanceof Node||t instanceof wi(t).Node}function pa(t){return t instanceof Element||t instanceof wi(t).Element}function ko(t){return t instanceof HTMLElement||t instanceof wi(t).HTMLElement}function DA(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof wi(t).ShadowRoot}function sp(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=ns(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function Jue(t){return["table","td","th"].includes(Bc(t))}function r4(t){const e=n4(),r=ns(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function Xue(t){let e=md(t);for(;ko(e)&&!$b(e);){if(r4(e))return e;e=md(e)}return null}function n4(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $b(t){return["html","body","#document"].includes(Bc(t))}function ns(t){return wi(t).getComputedStyle(t)}function Mb(t){return pa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function md(t){if(Bc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||DA(t)&&t.host||$a(t);return DA(e)?e.host:e}function Qj(t){const e=md(t);return $b(e)?t.ownerDocument?t.ownerDocument.body:t.body:ko(e)&&sp(e)?e:Qj(e)}function a1(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=Qj(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=wi(i);return s?e.concat(o,o.visualViewport||[],sp(i)?i:[],o.frameElement&&r?a1(o.frameElement):[]):e.concat(i,a1(i,[],r))}function Yj(t){const e=ns(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=ko(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=Ly(r)!==s||Ly(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function i4(t){return pa(t)?t:t.contextElement}function Wf(t){const e=i4(t);if(!ko(e))return jc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=Yj(e);let o=(s?Ly(r.width):r.width)/n,a=(s?Ly(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Zue=jc(0);function Jj(t){const e=wi(t);return!n4()||!e.visualViewport?Zue:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function efe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==wi(t)?!1:e}function uu(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=i4(t);let o=jc(1);e&&(n?pa(n)&&(o=Wf(n)):o=Wf(t));const a=efe(s,r,n)?Jj(s):jc(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=wi(s),h=n&&pa(n)?wi(n):n;let p=d.frameElement;for(;p&&n&&h!==d;){const m=Wf(p),v=p.getBoundingClientRect(),y=ns(p),b=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*m.x,E=v.top+(p.clientTop+parseFloat(y.paddingTop))*m.y;c*=m.x,l*=m.y,u*=m.x,f*=m.y,c+=b,l+=E,p=wi(p).frameElement}}return By({width:u,height:f,x:c,y:l})}function tfe(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=ko(r),s=$a(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=jc(1);const c=jc(0);if((i||!i&&n!=="fixed")&&((Bc(r)!=="body"||sp(s))&&(o=Mb(r)),ko(r))){const l=uu(r);a=Wf(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}}function rfe(t){return Array.from(t.getClientRects())}function Xj(t){return uu($a(t)).left+Mb(t).scrollLeft}function nfe(t){const e=$a(t),r=Mb(t),n=t.ownerDocument.body,i=vi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=vi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Xj(t);const a=-r.scrollTop;return ns(n).direction==="rtl"&&(o+=vi(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function ife(t,e){const r=wi(t),n=$a(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=n4();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function sfe(t,e){const r=uu(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=ko(t)?Wf(t):jc(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function LA(t,e,r){let n;if(e==="viewport")n=ife(t,r);else if(e==="document")n=nfe($a(t));else if(pa(e))n=sfe(e,r);else{const i=Jj(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return By(n)}function Zj(t,e){const r=md(t);return r===e||!pa(r)||$b(r)?!1:ns(r).position==="fixed"||Zj(r,e)}function ofe(t,e){const r=e.get(t);if(r)return r;let n=a1(t,[],!1).filter(a=>pa(a)&&Bc(a)!=="body"),i=null;const s=ns(t).position==="fixed";let o=s?md(t):t;for(;pa(o)&&!$b(o);){const a=ns(o),c=r4(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||sp(o)&&!c&&Zj(t,o))?n=n.filter(u=>u!==o):i=a,o=md(o)}return e.set(t,n),n}function afe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?ofe(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=LA(e,u,i);return l.top=vi(f.top,l.top),l.right=Lc(f.right,l.right),l.bottom=Lc(f.bottom,l.bottom),l.left=vi(f.left,l.left),l},LA(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function cfe(t){return Yj(t)}function lfe(t,e,r){const n=ko(e),i=$a(e),s=r==="fixed",o=uu(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=jc(0);if(n||!n&&!s)if((Bc(e)!=="body"||sp(i))&&(a=Mb(e)),n){const l=uu(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else i&&(c.x=Xj(i));return{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function jA(t,e){return!ko(t)||ns(t).position==="fixed"?null:e?e(t):t.offsetParent}function eB(t,e){const r=wi(t);if(!ko(t))return r;let n=jA(t,e);for(;n&&Jue(n)&&ns(n).position==="static";)n=jA(n,e);return n&&(Bc(n)==="html"||Bc(n)==="body"&&ns(n).position==="static"&&!r4(n))?r:n||Xue(t)||r}const ufe=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||eB,s=this.getDimensions;return{reference:lfe(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function ffe(t){return ns(t).direction==="rtl"}const dfe={convertOffsetParentRelativeRectToViewportRelativeRect:tfe,getDocumentElement:$a,getClippingRect:afe,getOffsetParent:eB,getElementRects:ufe,getClientRects:rfe,getDimensions:cfe,getScale:Wf,isElement:pa,isRTL:ffe};function hfe(t,e){let r=null,n;const i=$a(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=am(u),p=am(i.clientWidth-(l+f)),m=am(i.clientHeight-(u+d)),v=am(l),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:vi(0,Lc(1,c))||1};let E=!0;function S(P){const M=P[0].intersectionRatio;if(M!==c){if(!E)return o();M?o(!1,M):n=setTimeout(()=>{o(!1,1e-7)},100)}E=!1}try{r=new IntersectionObserver(S,{...b,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,b)}r.observe(t)}return o(!0),s}function pfe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=i4(t),u=i||s?[...l?a1(l):[],...a1(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const f=l&&a?hfe(l,r):null;let d=-1,h=null;o&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{h&&h.observe(e)})),r()}),l&&!c&&h.observe(l),h.observe(e));let p,m=c?uu(t):null;c&&v();function v(){const y=uu(t);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&r(),m=y,p=requestAnimationFrame(v)}return r(),()=>{u.forEach(y=>{i&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const mfe=(t,e,r)=>{const n=new Map,i={platform:dfe,...r},s={...i.platform,_c:n};return que(t,e,{...i,platform:s})},vfe=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?$A({element:n.current,padding:i}).fn(r):{}:n?$A({element:n,padding:i}).fn(r):{}}}};var cv=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Fy(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Fy(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!Fy(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function tB(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function BA(t,e){const r=tB(t);return Math.round(e*r)/r}function FA(t){const e=w.useRef(t);return cv(()=>{e.current=t}),e}function yfe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=w.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=w.useState(n);Fy(d,n)||h(n);const[p,m]=w.useState(null),[v,y]=w.useState(null),b=w.useCallback(R=>{R!=M.current&&(M.current=R,m(R))},[m]),E=w.useCallback(R=>{R!==L.current&&(L.current=R,y(R))},[y]),S=s||p,P=o||v,M=w.useRef(null),L=w.useRef(null),j=w.useRef(u),H=FA(c),K=FA(i),Q=w.useCallback(()=>{if(!M.current||!L.current)return;const R={placement:e,strategy:r,middleware:d};K.current&&(R.platform=K.current),mfe(M.current,L.current,R).then(N=>{const A={...N,isPositioned:!0};Y.current&&!Fy(j.current,A)&&(j.current=A,Fs.flushSync(()=>{f(A)}))})},[d,e,r,K]);cv(()=>{l===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[l]);const Y=w.useRef(!1);cv(()=>(Y.current=!0,()=>{Y.current=!1}),[]),cv(()=>{if(S&&(M.current=S),P&&(L.current=P),S&&P){if(H.current)return H.current(S,P,Q);Q()}},[S,P,Q,H]);const F=w.useMemo(()=>({reference:M,floating:L,setReference:b,setFloating:E}),[b,E]),x=w.useMemo(()=>({reference:S,floating:P}),[S,P]),k=w.useMemo(()=>{const R={position:r,left:0,top:0};if(!x.floating)return R;const N=BA(x.floating,u.x),A=BA(x.floating,u.y);return a?{...R,transform:"translate("+N+"px, "+A+"px)",...tB(x.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:N,top:A}},[r,a,x.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:Q,refs:F,elements:x,floatingStyles:k}),[u,Q,F,x,k])}const rB="Popper",[nB,zd]=In(rB),[gfe,iB]=nB(rB),bfe=t=>{const{__scopePopper:e,children:r}=t,[n,i]=w.useState(null);return w.createElement(gfe,{scope:e,anchor:n,onAnchorChange:i},r)},xfe="PopperAnchor",wfe=w.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=iB(xfe,r),o=w.useRef(null),a=Lt(e,o);return w.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:w.createElement(Xe.div,Fe({},i,{ref:a}))}),sB="PopperContent",[Efe,kAe]=nB(sB),Cfe=w.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:m=0,avoidCollisions:v=!0,collisionBoundary:y=[],collisionPadding:b=0,sticky:E="partial",hideWhenDetached:S=!1,updatePositionStrategy:P="optimized",onPlaced:M,...L}=t,j=iB(sB,u),[H,K]=w.useState(null),Q=Lt(e,ve=>K(ve)),[Y,F]=w.useState(null),x=Ab(Y),k=(r=x==null?void 0:x.width)!==null&&r!==void 0?r:0,R=(n=x==null?void 0:x.height)!==null&&n!==void 0?n:0,N=f+(h!=="center"?"-"+h:""),A=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},O=Array.isArray(y)?y:[y],B=O.length>0,I={padding:A,boundary:O.filter(Sfe),altBoundary:B},{refs:C,floatingStyles:D,placement:z,isPositioned:_,middlewareData:W}=yfe({strategy:"fixed",placement:N,whileElementsMounted:(...ve)=>pfe(...ve,{animationFrame:P==="always"}),elements:{reference:j.anchor},middleware:[Gue({mainAxis:d+R,alignmentAxis:p}),v&&Kue({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?Que():void 0,...I}),v&&Wue({...I}),Yue({...I,apply:({elements:ve,rects:$e,availableWidth:ge,availableHeight:Ee})=>{const{width:Ue,height:Ke}=$e.reference,Ye=ve.floating.style;Ye.setProperty("--radix-popper-available-width",`${ge}px`),Ye.setProperty("--radix-popper-available-height",`${Ee}px`),Ye.setProperty("--radix-popper-anchor-width",`${Ue}px`),Ye.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),Y&&vfe({element:Y,padding:m}),kfe({arrowWidth:k,arrowHeight:R}),S&&Hue({strategy:"referenceHidden",...I})]}),[G,J]=oB(z),ee=rs(M);Ai(()=>{_&&(ee==null||ee())},[_,ee]);const se=(i=W.arrow)===null||i===void 0?void 0:i.x,ie=(s=W.arrow)===null||s===void 0?void 0:s.y,oe=((o=W.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[be,he]=w.useState();return Ai(()=>{H&&he(window.getComputedStyle(H).zIndex)},[H]),w.createElement("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:_?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(a=W.transformOrigin)===null||a===void 0?void 0:a.x,(c=W.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},w.createElement(Efe,{scope:u,placedSide:G,onArrowChange:F,arrowX:se,arrowY:ie,shouldHideArrow:oe},w.createElement(Xe.div,Fe({"data-side":G,"data-align":J},L,{ref:Q,style:{...L.style,animation:_?void 0:"none",opacity:(l=W.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function Sfe(t){return t!==null}const kfe=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,h=f?0:t.arrowHeight,[p,m]=oB(a),v={start:"0%",center:"50%",end:"100%"}[m],y=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,b=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+h/2;let E="",S="";return p==="bottom"?(E=f?v:`${y}px`,S=`${-h}px`):p==="top"?(E=f?v:`${y}px`,S=`${c.floating.height+h}px`):p==="right"?(E=`${-h}px`,S=f?v:`${b}px`):p==="left"&&(E=`${c.floating.width+h}px`,S=f?v:`${b}px`),{data:{x:E,y:S}}}});function oB(t){const[e,r="center"]=t.split("-");return[e,r]}const Afe=bfe,_fe=wfe,Pfe=Cfe,aB=w.forwardRef((t,e)=>{var r;const{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...i}=t;return n?WV.createPortal(w.createElement(Xe.div,Fe({},i,{ref:e})),n):null}),nw="rovingFocusGroup.onEntryFocus",Ife={bubbles:!1,cancelable:!0},s4="RovingFocusGroup",[K6,cB,Tfe]=Ob(s4),[Ofe,qd]=In(s4,[Tfe]),[Rfe,$fe]=Ofe(s4),Mfe=w.forwardRef((t,e)=>w.createElement(K6.Provider,{scope:t.__scopeRovingFocusGroup},w.createElement(K6.Slot,{scope:t.__scopeRovingFocusGroup},w.createElement(Nfe,mt({},t,{ref:e}))))),Nfe=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,...u}=t,f=w.useRef(null),d=Lt(e,f),h=Rb(s),[p=null,m]=fa({prop:o,defaultProp:a,onChange:c}),[v,y]=w.useState(!1),b=rs(l),E=cB(r),S=w.useRef(!1),[P,M]=w.useState(0);return w.useEffect(()=>{const L=f.current;if(L)return L.addEventListener(nw,b),()=>L.removeEventListener(nw,b)},[b]),w.createElement(Rfe,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:p,onItemFocus:w.useCallback(L=>m(L),[m]),onItemShiftTab:w.useCallback(()=>y(!0),[]),onFocusableItemAdd:w.useCallback(()=>M(L=>L+1),[]),onFocusableItemRemove:w.useCallback(()=>M(L=>L-1),[])},w.createElement(Xe.div,mt({tabIndex:v||P===0?-1:0,"data-orientation":n},u,{ref:d,style:{outline:"none",...t.style},onMouseDown:_e(t.onMouseDown,()=>{S.current=!0}),onFocus:_e(t.onFocus,L=>{const j=!S.current;if(L.target===L.currentTarget&&j&&!v){const H=new CustomEvent(nw,Ife);if(L.currentTarget.dispatchEvent(H),!H.defaultPrevented){const K=E().filter(k=>k.focusable),Q=K.find(k=>k.active),Y=K.find(k=>k.id===p),x=[Q,Y,...K].filter(Boolean).map(k=>k.ref.current);lB(x)}}S.current=!1}),onBlur:_e(t.onBlur,()=>y(!1))})))}),Dfe="RovingFocusGroupItem",Lfe=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=ta(),c=s||a,l=$fe(Dfe,r),u=l.currentTabStopId===c,f=cB(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return w.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),w.createElement(K6.ItemSlot,{scope:r,id:c,focusable:n,active:i},w.createElement(Xe.span,mt({tabIndex:u?0:-1,"data-orientation":l.orientation},o,{ref:e,onMouseDown:_e(t.onMouseDown,p=>{n?l.onItemFocus(c):p.preventDefault()}),onFocus:_e(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:_e(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){l.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const m=Ffe(p,l.orientation,l.dir);if(m!==void 0){p.preventDefault();let y=f().filter(b=>b.focusable).map(b=>b.ref.current);if(m==="last")y.reverse();else if(m==="prev"||m==="next"){m==="prev"&&y.reverse();const b=y.indexOf(p.currentTarget);y=l.loop?Ufe(y,b+1):y.slice(b+1)}setTimeout(()=>lB(y))}})})))}),jfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Bfe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Ffe(t,e,r){const n=Bfe(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return jfe[n]}function lB(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function Ufe(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const uB=Mfe,o4=Lfe;var zfe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Uu=new WeakMap,cm=new WeakMap,lm={},iw=0,fB=function(t){return t&&(t.host||fB(t.parentNode))},qfe=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=fB(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},Wfe=function(t,e,r,n){var i=qfe(e,Array.isArray(t)?t:[t]);lm[r]||(lm[r]=new WeakMap);var s=lm[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var h=d.getAttribute(n),p=h!==null&&h!=="false",m=(Uu.get(d)||0)+1,v=(s.get(d)||0)+1;Uu.set(d,m),s.set(d,v),o.push(d),m===1&&p&&cm.set(d,!0),v===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}})};return u(e),a.clear(),iw++,function(){o.forEach(function(f){var d=Uu.get(f)-1,h=s.get(f)-1;Uu.set(f,d),s.set(f,h),d||(cm.has(f)||f.removeAttribute(n),cm.delete(f)),h||f.removeAttribute(r)}),iw--,iw||(Uu=new WeakMap,Uu=new WeakMap,cm=new WeakMap,lm={})}},dB=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||zfe(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Wfe(n,i,r,"aria-hidden")):function(){return null}},oo=function(){return oo=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return ade;var e=cde(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},ude=vB(),fde=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` + .`.concat(Vfe,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; } @@ -102,72 +102,72 @@ Error generating stack: `+s.message+` `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` } - .`).concat(xv,` { + .`).concat(lv,` { right: `).concat(a,"px ").concat(n,`; } - .`).concat(wv,` { + .`).concat(uv,` { margin-right: `).concat(a,"px ").concat(n,`; } - .`).concat(xv," .").concat(xv,` { + .`).concat(lv," .").concat(lv,` { right: 0 `).concat(n,`; } - .`).concat(wv," .").concat(wv,` { + .`).concat(uv," .").concat(uv,` { margin-right: 0 `).concat(n,`; } body { - `).concat(vde,": ").concat(a,`px; + `).concat(Gfe,": ").concat(a,`px; } -`)},Nde=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=x.useMemo(function(){return Rde(i)},[i]);return x.createElement($de,{styles:Mde(s,!e,i,r?"":"!important")})},l3=!1;if(typeof window<"u")try{var wm=Object.defineProperty({},"passive",{get:function(){return l3=!0,!0}});window.addEventListener("test",wm,wm),window.removeEventListener("test",wm,wm)}catch{l3=!1}var Yu=l3?{passive:!1}:!1,Dde=function(t){return t.tagName==="TEXTAREA"},DB=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!Dde(t)&&r[e]==="visible")},Lde=function(t){return DB(t,"overflowY")},jde=function(t){return DB(t,"overflowX")},n_=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=LB(t,r);if(n){var i=jB(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},Bde=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Fde=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},LB=function(t,e){return t==="v"?Lde(e):jde(e)},jB=function(t,e){return t==="v"?Bde(e):Fde(e)},Ude=function(t,e){return t==="h"&&e==="rtl"?-1:1},zde=function(t,e,r,n,i){var s=Ude(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var h=jB(t,a),p=h[0],m=h[1],v=h[2],y=m-v-s*p;(p||y)&&LB(t,a)&&(f+=y,d+=p),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},Em=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},i_=function(t){return[t.deltaX,t.deltaY]},s_=function(t){return t&&"current"in t?t.current:t},qde=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Wde=function(t){return` +`)},dde=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=w.useMemo(function(){return lde(i)},[i]);return w.createElement(ude,{styles:fde(s,!e,i,r?"":"!important")})},Q6=!1;if(typeof window<"u")try{var um=Object.defineProperty({},"passive",{get:function(){return Q6=!0,!0}});window.addEventListener("test",um,um),window.removeEventListener("test",um,um)}catch{Q6=!1}var zu=Q6?{passive:!1}:!1,hde=function(t){return t.tagName==="TEXTAREA"},yB=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!hde(t)&&r[e]==="visible")},pde=function(t){return yB(t,"overflowY")},mde=function(t){return yB(t,"overflowX")},UA=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=gB(t,r);if(n){var i=bB(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},vde=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},yde=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},gB=function(t,e){return t==="v"?pde(e):mde(e)},bB=function(t,e){return t==="v"?vde(e):yde(e)},gde=function(t,e){return t==="h"&&e==="rtl"?-1:1},bde=function(t,e,r,n,i){var s=gde(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var h=bB(t,a),p=h[0],m=h[1],v=h[2],y=m-v-s*p;(p||y)&&gB(t,a)&&(f+=y,d+=p),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},fm=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},zA=function(t){return[t.deltaX,t.deltaY]},qA=function(t){return t&&"current"in t?t.current:t},xde=function(t,e){return t[0]===e[0]&&t[1]===e[1]},wde=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},Hde=0,Ju=[];function Vde(t){var e=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),i=x.useState(Hde++)[0],s=x.useState(function(){return NB()})[0],o=x.useRef(t);x.useEffect(function(){o.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=pde([t.lockRef.current],(t.shards||[]).map(s_),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=x.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var y=Em(m),b=r.current,E="deltaX"in m?m.deltaX:b[0]-y[0],S="deltaY"in m?m.deltaY:b[1]-y[1],P,M=m.target,L=Math.abs(E)>Math.abs(S)?"h":"v";if("touches"in m&&L==="h"&&M.type==="range")return!1;var j=n_(L,M);if(!j)return!0;if(j?P=L:(P=L==="v"?"h":"v",j=n_(L,M)),!j)return!1;if(!n.current&&"changedTouches"in m&&(E||S)&&(n.current=P),!P)return!0;var H=n.current||P;return zde(H,v,m,H==="h"?E:S,!0)},[]),c=x.useCallback(function(m){var v=m;if(!(!Ju.length||Ju[Ju.length-1]!==s)){var y="deltaY"in v?i_(v):Em(v),b=e.current.filter(function(P){return P.name===v.type&&P.target===v.target&&qde(P.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var E=(o.current.shards||[]).map(s_).filter(Boolean).filter(function(P){return P.contains(v.target)}),S=E.length>0?a(v,E[0]):!o.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),l=x.useCallback(function(m,v,y,b){var E={name:m,delta:v,target:y,should:b};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(S){return S!==E})},1)},[]),u=x.useCallback(function(m){r.current=Em(m),n.current=void 0},[]),f=x.useCallback(function(m){l(m.type,i_(m),m.target,a(m,t.lockRef.current))},[]),d=x.useCallback(function(m){l(m.type,Em(m),m.target,a(m,t.lockRef.current))},[]);x.useEffect(function(){return Ju.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Yu),document.addEventListener("touchmove",c,Yu),document.addEventListener("touchstart",u,Yu),function(){Ju=Ju.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,Yu),document.removeEventListener("touchmove",c,Yu),document.removeEventListener("touchstart",u,Yu)}},[]);var h=t.removeScrollBar,p=t.inert;return x.createElement(x.Fragment,null,p?x.createElement(s,{styles:Wde(i)}):null,h?x.createElement(Nde,{gapMode:"margin"}):null)}const Gde=Cde(MB,Vde);var BB=x.forwardRef(function(t,e){return x.createElement(Gb,co({},t,{ref:e,sideCar:Gde}))});BB.classNames=Gb.classNames;const FB=BB,Kde=["Enter"," "],Kb="Menu",[Qde,u_e,Yde]=qb(Kb),[Ou,UB]=In(Kb,[Yde,Jd,Xd]);Jd();const Jde=Xd();Ou(Kb);const[f_e,Xde]=Ou(Kb),Zde="MenuPortal";Ou(Zde,{forceMount:void 0});const ehe="MenuContent",[d_e,zB]=Ou(ehe),u3="MenuItem",o_="menu.itemSelect",qB=x.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=x.useRef(null),o=Xde(u3,t.__scopeMenu),a=zB(u3,t.__scopeMenu),c=Lt(e,s),l=x.useRef(!1),u=()=>{const f=s.current;if(!r&&f){const d=new CustomEvent(o_,{bubbles:!0,cancelable:!0});f.addEventListener(o_,h=>n==null?void 0:n(h),{once:!0}),c4(f,d),d.defaultPrevented?l.current=!1:o.onClose()}};return x.createElement(the,Fe({},i,{ref:c,disabled:r,onClick:_e(t.onClick,u),onPointerDown:f=>{var d;(d=t.onPointerDown)===null||d===void 0||d.call(t,f),l.current=!0},onPointerUp:_e(t.onPointerUp,f=>{var d;l.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:_e(t.onKeyDown,f=>{const d=a.searchRef.current!=="";r||d&&f.key===" "||Kde.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),the=x.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=zB(u3,r),a=Jde(r),c=x.useRef(null),l=Lt(e,c),[u,f]=x.useState(!1),[d,h]=x.useState("");return x.useEffect(()=>{const p=c.current;if(p){var m;h(((m=p.textContent)!==null&&m!==void 0?m:"").trim())}},[s.children]),x.createElement(Qde.ItemSlot,{scope:r,disabled:n,textValue:i??d},x.createElement(x4,Fe({asChild:!0},a,{focusable:!n}),x.createElement(Xe.div,Fe({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},s,{ref:l,onPointerMove:_e(t.onPointerMove,a_(p=>{n?o.onItemLeave(p):(o.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus())})),onPointerLeave:_e(t.onPointerLeave,a_(p=>o.onItemLeave(p))),onFocus:_e(t.onFocus,()=>f(!0)),onBlur:_e(t.onBlur,()=>f(!1))}))))}),rhe=x.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return x.createElement(HB,{scope:t.__scopeMenu,checked:r},x.createElement(qB,Fe({role:"menuitemcheckbox","aria-checked":Zy(r)?"mixed":r},i,{ref:e,"data-state":w4(r),onSelect:_e(i.onSelect,()=>n==null?void 0:n(Zy(r)?!0:!r),{checkForDefaultPrevented:!1})})))}),nhe="MenuRadioGroup",[h_e,ihe]=Ou(nhe,{value:void 0,onValueChange:()=>{}}),she="MenuRadioItem",ohe=x.forwardRef((t,e)=>{const{value:r,...n}=t,i=ihe(she,t.__scopeMenu),s=r===i.value;return x.createElement(HB,{scope:t.__scopeMenu,checked:s},x.createElement(qB,Fe({role:"menuitemradio","aria-checked":s},n,{ref:e,"data-state":w4(s),onSelect:_e(n.onSelect,()=>{var o;return(o=i.onValueChange)===null||o===void 0?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})))}),WB="MenuItemIndicator",[HB,ahe]=Ou(WB,{checked:!1}),che=x.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=ahe(WB,r);return x.createElement(Da,{present:n||Zy(s.checked)||s.checked===!0},x.createElement(Xe.span,Fe({},i,{ref:e,"data-state":w4(s.checked)})))}),lhe="MenuSub";Ou(lhe);function Zy(t){return t==="indeterminate"}function w4(t){return Zy(t)?"indeterminate":t?"checked":"unchecked"}function a_(t){return e=>e.pointerType==="mouse"?t(e):void 0}const uhe=rhe,fhe=ohe,dhe=che,VB="DropdownMenu",[hhe,p_e]=In(VB,[UB]),E4=UB();hhe(VB);const phe=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=E4(r);return x.createElement(uhe,Fe({},i,n,{ref:e}))}),mhe=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=E4(r);return x.createElement(fhe,Fe({},i,n,{ref:e}))}),vhe=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=E4(r);return x.createElement(dhe,Fe({},i,n,{ref:e}))}),yhe=phe,ghe=mhe,GB=vhe;var KB="_1k2mbvi4 _1k2mbvi3 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1x4 fyvr1yk fyvr1ss fyvr1uo fyvr12ws fyvr12wm fyvr11h0 fyvr11ko fyvr11jw fyvr12v7 fyvr11n4 fyvr11hw fyvr12s7",QB="_1k2mbvi5";const bhe=({children:t})=>X.jsx(GB,{className:QB,children:t});x.forwardRef(({className:t,children:e,...r},n)=>X.jsxs(yhe,{className:di(KB,t),...r,ref:n,children:[X.jsx(bhe,{children:X.jsx(Kd,{size:"xs"})}),X.jsx(ae,{variant:"small",children:e})]}));x.forwardRef(({className:t,children:e,...r},n)=>X.jsxs(ghe,{className:di(KB,t),...r,ref:n,children:[X.jsx(GB,{className:QB,children:X.jsx(ae,{children:"•"})}),X.jsx(ae,{variant:"small",children:e})]}));const Po=x.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return X.jsx(rt,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),xhe=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var whe="_1hq71vk1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _1hq71vk0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr12n7 fyvr12fv fyvr1217 fyvr128j fyvr12np fyvr12gd fyvr121p fyvr1291 fyvr11ko fyvr11hc fyvr11ic fyvr11jc fyvr1g0 fyvr11hw",Ehe=Cr({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"_1hq71vk6 _1hq71vk2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"_1hq71vk7 _1hq71vk3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"_1hq71vk8 _1hq71vk4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),Che="_1hq71vka _1hq71vk9 fyvr12wp fyvr12wj fyvr11ho fyvr12vj fyvr1ko fyvr1oo fyvr1mo fyvr1qo";const She={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*",pdf:".pdf,application/pdf"};x.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:c,onValueChange:l,placeholder:u="Upload a file",validExtensions:f,...d}=t,h=x.useRef(null),p=xhe(h,e),[m,v]=x.useState(null),y=E=>{const S=E.currentTarget.files;if(!S||!S[0])return;const P=S[0],M=P.name,L=P.size/1e3;v({name:M,size:L,extension:M.split(".").pop()??""}),l==null||l(P)},b=f.map(E=>She[E]).join(",");return X.jsx(Iu,{description:n,disabled:i,display:"grid",id:s??c,label:o,labelLocation:a,children:X.jsxs(q,{width:"full",minWidth:"0",justifyContent:m?"space-between":"flex-start",gap:"2",color:m?"text100":"text50",className:di(whe,Ehe({borderRadius:r})),children:[m?X.jsxs(q,{flexDirection:"row",gap:"2",alignItems:"center",minWidth:"0",children:[X.jsx(ae,{ellipsis:!0,children:m.name}),X.jsxs(ae,{color:"text50",variant:"xsmall",whiteSpace:"nowrap",children:[m.size.toFixed(2)," kb"]})]}):X.jsx(ae,{ellipsis:!0,children:u}),X.jsx(q,{accept:b,as:"input",className:Che,cursor:"pointer",disabled:i,id:s??c,name:c,onChange:y,ref:p,type:"file",...d}),m&&X.jsx(Po,{cursor:"pointer",icon:Tu,size:"xs",onClick:E=>{var S;E.preventDefault(),E.stopPropagation(),(S=h.current)!=null&&S.value&&(h.current.value=""),l==null||l(null),v(null)},zIndex:"10"})]})})});var khe=Cr({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const f3=1e3,Zf=64,xw=Zf/2,ww=(t,e=f3)=>t%e/(f3/Zf),Tl=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},Ahe=(t,e,r)=>{const n=Math.random().toString(36).slice(2,12),i=t%360,s=(t+120)%360,o=r%360;return{id:Tl(n),a:`hsl(${i}deg 100% 40%)`,b:`hsl(${s}deg 100% 50%)`,c:`hsl(${o}deg 100% 50%)`}},_he=(t,e)=>{const r=[];for(let n=0;n{const s=Zf/10+ww(n.r,f3*1.5/(i+1));return{...Ahe(n.a,n.b,n.c),x:ww(n.x),y:ww(n.y),r:s}})},Ru=x.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=_he(r,i);return X.jsxs(q,{as:"svg",className:di(e,khe({size:n})),viewBox:`0 0 ${Zf} ${Zf}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[X.jsxs("defs",{children:[X.jsx("clipPath",{id:"circle-clip",children:X.jsx("circle",{cx:xw,cy:xw,r:xw})}),X.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[X.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),X.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),X.jsx("feGaussianBlur",{stdDeviation:Zf/10,result:"effect1_foregroundBlur"})]}),X.jsxs("linearGradient",{id:`gradient-background-${o[0].id}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[X.jsx("stop",{offset:"0",stopColor:o[0].c}),X.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map(a=>X.jsxs(x.Fragment,{children:[X.jsxs("radialGradient",{id:`gradient-primary-${a.id}`,children:[X.jsx("stop",{offset:"0",stopColor:a.a}),X.jsx("stop",{offset:"1",stopColor:a.b})]}),X.jsxs("radialGradient",{id:`gradient-secondary-${a.id}`,children:[X.jsx("stop",{offset:"0",stopColor:a.c}),X.jsx("stop",{offset:"1",stopColor:a.b})]})]},a.id))]}),X.jsxs("g",{clipPath:"url(#circle-clip)",children:[X.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${o[0].id})`}),X.jsx("g",{filter:"url(#blur)",children:o.map(a=>X.jsxs(x.Fragment,{children:[X.jsx("circle",{fill:`url(#gradient-primary-${a.id})`,cx:a.x,cy:a.y,r:a.r}),X.jsx("circle",{fill:`url(#gradient-secondary-${a.id})`,cx:a.y,cy:a.x,r:a.r/2})]},a.id))})]})]})}),xr=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=x.useState(!1),o=a=>{s(!0),r==null||r(a)};return X.jsx(q,{as:Ic.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})},YB="Dialog",[JB,m_e]=In(YB),[Phe,ll]=JB(YB),Ihe=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=x.useRef(null),c=x.useRef(null),[l=!1,u]=pa({prop:n,defaultProp:i,onChange:s});return x.createElement(Phe,{scope:e,triggerRef:a,contentRef:c,contentId:ia(),titleId:ia(),descriptionId:ia(),open:l,onOpenChange:u,onOpenToggle:x.useCallback(()=>u(f=>!f),[u]),modal:o},r)},XB="DialogPortal",[The,ZB]=JB(XB,{forceMount:void 0}),Ohe=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=ll(XB,e);return x.createElement(The,{scope:e,forceMount:r},x.Children.map(n,o=>x.createElement(Da,{present:r||s.open},x.createElement(AB,{asChild:!0,container:i},o))))},d3="DialogOverlay",Rhe=x.forwardRef((t,e)=>{const r=ZB(d3,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=ll(d3,t.__scopeDialog);return s.modal?x.createElement(Da,{present:n||s.open},x.createElement($he,Fe({},i,{ref:e}))):null}),$he=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=ll(d3,r);return x.createElement(FB,{as:Cd,allowPinchZoom:!0,shards:[i.contentRef]},x.createElement(Xe.div,Fe({"data-state":tF(i.open)},n,{ref:e,style:{pointerEvents:"auto",...n.style}})))}),g1="DialogContent",Mhe=x.forwardRef((t,e)=>{const r=ZB(g1,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=ll(g1,t.__scopeDialog);return x.createElement(Da,{present:n||s.open},s.modal?x.createElement(Nhe,Fe({},i,{ref:e})):x.createElement(Dhe,Fe({},i,{ref:e})))}),Nhe=x.forwardRef((t,e)=>{const r=ll(g1,t.__scopeDialog),n=x.useRef(null),i=Lt(e,r.contentRef,n);return x.useEffect(()=>{const s=n.current;if(s)return OB(s)},[]),x.createElement(eF,Fe({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:_e(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:_e(t.onFocusOutside,s=>s.preventDefault())}))}),Dhe=x.forwardRef((t,e)=>{const r=ll(g1,t.__scopeDialog),n=x.useRef(!1),i=x.useRef(!1);return x.createElement(eF,Fe({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),eF=x.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=ll(g1,r),c=x.useRef(null),l=Lt(e,c);return lB(),x.createElement(x.Fragment,null,x.createElement(uB,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},x.createElement(d4,Fe({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":tF(a.open)},o,{ref:l,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),Lhe="DialogClose",jhe=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=ll(Lhe,r);return x.createElement(Xe.button,Fe({type:"button"},n,{ref:e,onClick:_e(t.onClick,()=>i.onOpenChange(!1))}))});function tF(t){return t?"open":"closed"}const Bhe=Ihe,Fhe=Ohe,Uhe=Rhe,zhe=Mhe,qhe=jhe;var Whe=Cr({defaultClassName:"_1vqx0w91 _1vqx0w90 fyvr128 fyvr15o",variantClassNames:{direction:{vertical:"_1vqx0w92",horizontal:"_1vqx0w93"}},defaultVariants:{},compoundVariants:[]}),Hhe=Cr({defaultClassName:"_1vqx0w94",variantClassNames:{shadows:{true:"_1vqx0w95",false:"_1vqx0w96"},direction:{vertical:"_1vqx0w97",horizontal:"_1vqx0w98"}},defaultVariants:{},compoundVariants:[]});const rF=t=>{const{children:e,shadows:r=!0,direction:n="vertical",contentProps:i,...s}=t;return X.jsx(q,{className:Hhe({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:X.jsx(q,{className:Whe({direction:n}),background:"backgroundPrimary",...i,children:e})})};function Vhe(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}function Ghe(t,e){var r=t;for(var n of e){if(!(n in r))throw new Error("Path ".concat(e.join(" -> ")," does not exist in object"));r=r[n]}return r}function nF(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=t.constructor();for(var i in t){var s=t[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=e(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=nF(s,e,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function c_(t,e,r){t.style.setProperty(Vhe(e),r)}function l_(t,e,r){if(typeof r=="object"){var n=e;nF(r,(a,c)=>{a!=null&&c_(t,Ghe(n,c),String(a))})}else{var i=e;for(var s in i){var o=i[s];o!=null&&c_(t,s,i[s])}}}const C4=["dark","light"],Khe="dark",Qhe="data-theme",u_="@sequence.theme",Yhe=t=>C4.includes(t),Jhe=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),iF=t=>t?`${u_}.${t}`:u_,Xhe=t=>{const e=localStorage.getItem(iF(t));return e&&C4.includes(e)?e:Khe},sF=x.createContext(null),Qb=t=>{const[e,r]=x.useState(t.theme||Xhe(t.scope));x.useEffect(()=>{/Mac/.test(window.navigator.userAgent)&&window.document.documentElement.classList.add("is-apple")},[]),x.useEffect(()=>{t.theme&&r(t.theme)},[t.theme]),x.useEffect(()=>{const i=document.querySelector(t.root||":root");i&&(Yhe(e)?(i.setAttribute(Qhe,e),l_(i,MA,{colors:fle[e]})):Jhe(e)&&l_(i,MA,{colors:e}))},[e,t.root]);const n=x.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{C4.includes(i)&&(localStorage.setItem(iF(t.scope),i),r(i))}}),[e,t.root,t.scope]);return X.jsx(sF.Provider,{value:n,children:t.children})},gp=()=>{const t=x.useContext(sF);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var Zhe="_5b32m91 _5b32m90 fyvr11jg fyvr11ko fyvr11h0 fyvr11hs fyvr11nk fyvr1ko fyvr1oo fyvr1qo fyvr1mo",e0e="_5b32m93 _5b32m92 fyvr11hs fyvr1ko fyvr1oo fyvr1qo fyvr1mo",t0e=Cr({defaultClassName:"_5b32m95 _5b32m94 fyvr11d8 fyvr11dw fyvr11bg fyvr11by fyvr11c4 fyvr11cm fyvr11ls fyvr11m8 fyvr12ws fyvr12wm fyvr11h0 fyvr11i4 fyvr11hs fyvr11sd fyvr1mo fyvr1om",variantClassNames:{size:{sm:"_5b32m96",lg:"_5b32m97"},autoHeight:{true:"_5b32m98"}},defaultVariants:{},compoundVariants:[[{autoHeight:!0,size:"lg"},"_5b32m99"]]}),r0e="_5b32m9b _5b32m9a fyvr110o fyvr112o fyvr114o fyvr116o fyvr11ho fyvr1qo fyvr1ko fyvr11nk";const eg=t=>{const{autoHeight:e=!1,backdropColor:r="backgroundBackdrop",children:n,disableAnimation:i=!1,isDismissible:s=!0,onClose:o,scroll:a=!0,size:c="lg",overlayProps:l,contentProps:u}=t,{root:f}=gp(),d=document.querySelector(f||"body");return X.jsx(Bhe,{modal:!0,defaultOpen:!0,onOpenChange:o,children:X.jsx(Fhe,{forceMount:!0,container:d,children:X.jsxs(q,{className:Zhe,children:[X.jsx(q,{as:Uhe,asChild:!0,background:r,className:e0e,forceMount:!0,children:X.jsx(Ic.div,{initial:i?!1:{opacity:0},animate:i?!1:{opacity:1},exit:i?void 0:{opacity:0},transition:{type:"tween",ease:"linear"},...l},"modal-overlay")}),X.jsx(zhe,{asChild:!0,className:t0e({autoHeight:e,size:c}),forceMount:!0,onEscapeKeyDown:h=>{s?o==null||o():h.preventDefault()},onInteractOutside:h=>{s||h.preventDefault()},children:X.jsxs(Ic.div,{initial:i?!1:{y:"100%",opacity:c==="sm"?0:1},animate:i?!1:{y:0,opacity:1},exit:i?void 0:{y:"100%",opacity:c==="sm"?0:1},transition:{type:"tween",ease:"easeOut"},...u,children:[a?X.jsx(rF,{children:n}):n,s&&X.jsx(qhe,{asChild:!0,children:X.jsx(Po,{icon:Tu,backdropFilter:"blur",size:"xs",className:r0e,"aria-label":"Close"})})]},"modal-content")})]})})})};var n0e="_1acm19y1 _1acm19y0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1ww fyvr1ys fyvr11hc fyvr11ko fyvr11od fyvr12s1 fyvr1g0 fyvr118g",i0e=Cr({defaultClassName:"_1acm19y5",variantClassNames:{borderRadius:{xs:"_1acm19y6 _1acm19y2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"_1acm19y7 _1acm19y3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"_1acm19y8 _1acm19y4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),s0e=Cr({defaultClassName:"_1acm19ya _1acm19y9 fyvr1wg fyvr1yc fyvr1t4 fyvr1v0 fyvr12wp fyvr12wj fyvr11gw fyvr11od fyvr12s1 fyvr12o1 fyvr128 fyvr15o",variantClassNames:{numeric:{false:"_1acm19yb _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",true:"_1acm19yc _1qxj1ib9 _1qxj1ibc _1qxj1ib2 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8"}},defaultVariants:{},compoundVariants:[]});const ul=x.forwardRef((t,e)=>{const{as:r="input",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",leftIcon:u,rightIcon:f,name:d,controls:h,type:p="text",numeric:m=!1,...v}=t;return X.jsx(Iu,{description:s,disabled:o,display:"grid",id:a??d,label:c,labelLocation:l,children:X.jsx(q,{width:"full",children:X.jsxs(q,{className:di(n0e,i0e({borderRadius:i})),children:[u&&X.jsx(u,{size:"sm"}),X.jsx(q,{as:r,autoComplete:n,spellCheck:"false",className:s0e({numeric:m}),disabled:o,id:a??d,name:d,ref:e,type:p,...v}),f&&X.jsx(f,{size:"sm"}),h]})})})}),o0e=RegExp("^\\d*(?:\\\\[.])?\\d*$");function a0e(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const oF=x.forwardRef((t,e)=>{const{name:r="amount",placeholder:n,onChange:i,onBlur:s,...o}=t,a=l=>{let{value:u}=l.target;u=u.replace(/,/g,"."),u.startsWith(".")&&(u="0"+u),u.startsWith("0")&&(u=u.replace(/^0+(?=\d)/,"")),(u===""||o0e.test(a0e(u)))&&(i==null||i({...l,target:{...l.target,value:u}}))},c=l=>{const{value:u}=l.target;let f=u;f.endsWith(".")&&(f=f.slice(0,-1)),f.endsWith(".0")&&(f=f.slice(0,-2)),f==="0"&&(f=""),s==null||s(l),f!==u&&(i==null||i({...l,target:{...l.target,value:f}}))};return X.jsx(ul,{name:r,onChange:a,onBlur:c,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",type:"text",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:n||"0",minLength:1,maxLength:79,spellCheck:"false",numeric:!0,ref:e,...o})});Cr({defaultClassName:"dtv8gt1",variantClassNames:{size:{sm:"dtv8gt2",normal:"dtv8gt3",md:"dtv8gt4",lg:"dtv8gt5",xl:"dtv8gt6"}},defaultVariants:{},compoundVariants:[]});const aF="Progress",Yb=100,[c0e,v_e]=In(aF),[l0e,y_e]=c0e(aF),u0e=x.forwardRef((t,e)=>{const{__scopeProgress:r,value:n,max:i,getValueLabel:s=f0e,...o}=t,a=h3(i)?i:Yb,c=cF(n,a)?n:null,l=tg(c)?s(c,a):void 0;return x.createElement(l0e,{scope:r,value:c,max:a},x.createElement(Xe.div,mt({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":tg(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":d0e(c,a),"data-value":c??void 0,"data-max":a},o,{ref:e})))});u0e.propTypes={max(t,e,r){const n=t[e],i=String(n);return n&&!h3(n)?new Error(h0e(i,r)):null},value(t,e,r){const n=t[e],i=String(n),s=h3(t.max)?t.max:Yb;return n!=null&&!cF(n,s)?new Error(p0e(i,r)):null}};function f0e(t,e){return`${Math.round(t/e*100)}%`}function d0e(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function tg(t){return typeof t=="number"}function h3(t){return tg(t)&&!isNaN(t)&&t>0}function cF(t,e){return tg(t)&&!isNaN(t)&&t<=e&&t>=0}function h0e(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Yb}\`.`}function p0e(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: +`)},Ede=0,qu=[];function Cde(t){var e=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),i=w.useState(Ede++)[0],s=w.useState(function(){return vB()})[0],o=w.useRef(t);w.useEffect(function(){o.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=Hfe([t.lockRef.current],(t.shards||[]).map(qA),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var y=fm(m),b=r.current,E="deltaX"in m?m.deltaX:b[0]-y[0],S="deltaY"in m?m.deltaY:b[1]-y[1],P,M=m.target,L=Math.abs(E)>Math.abs(S)?"h":"v";if("touches"in m&&L==="h"&&M.type==="range")return!1;var j=UA(L,M);if(!j)return!0;if(j?P=L:(P=L==="v"?"h":"v",j=UA(L,M)),!j)return!1;if(!n.current&&"changedTouches"in m&&(E||S)&&(n.current=P),!P)return!0;var H=n.current||P;return bde(H,v,m,H==="h"?E:S,!0)},[]),c=w.useCallback(function(m){var v=m;if(!(!qu.length||qu[qu.length-1]!==s)){var y="deltaY"in v?zA(v):fm(v),b=e.current.filter(function(P){return P.name===v.type&&P.target===v.target&&xde(P.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var E=(o.current.shards||[]).map(qA).filter(Boolean).filter(function(P){return P.contains(v.target)}),S=E.length>0?a(v,E[0]):!o.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),l=w.useCallback(function(m,v,y,b){var E={name:m,delta:v,target:y,should:b};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(S){return S!==E})},1)},[]),u=w.useCallback(function(m){r.current=fm(m),n.current=void 0},[]),f=w.useCallback(function(m){l(m.type,zA(m),m.target,a(m,t.lockRef.current))},[]),d=w.useCallback(function(m){l(m.type,fm(m),m.target,a(m,t.lockRef.current))},[]);w.useEffect(function(){return qu.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,zu),document.addEventListener("touchmove",c,zu),document.addEventListener("touchstart",u,zu),function(){qu=qu.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,zu),document.removeEventListener("touchmove",c,zu),document.removeEventListener("touchstart",u,zu)}},[]);var h=t.removeScrollBar,p=t.inert;return w.createElement(w.Fragment,null,p?w.createElement(s,{styles:wde(i)}):null,h?w.createElement(dde,{gapMode:"margin"}):null)}const Sde=ede(mB,Cde);var xB=w.forwardRef(function(t,e){return w.createElement(Nb,oo({},t,{ref:e,sideCar:Sde}))});xB.classNames=Nb.classNames;const wB=xB,kde=["Enter"," "],Db="Menu",[Ade,AAe,_de]=Ob(Db),[Su,EB]=In(Db,[_de,zd,qd]);zd();const Pde=qd();Su(Db);const[_Ae,Ide]=Su(Db),Tde="MenuPortal";Su(Tde,{forceMount:void 0});const Ode="MenuContent",[PAe,CB]=Su(Ode),Y6="MenuItem",WA="menu.itemSelect",SB=w.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=w.useRef(null),o=Ide(Y6,t.__scopeMenu),a=CB(Y6,t.__scopeMenu),c=Lt(e,s),l=w.useRef(!1),u=()=>{const f=s.current;if(!r&&f){const d=new CustomEvent(WA,{bubbles:!0,cancelable:!0});f.addEventListener(WA,h=>n==null?void 0:n(h),{once:!0}),KC(f,d),d.defaultPrevented?l.current=!1:o.onClose()}};return w.createElement(Rde,Fe({},i,{ref:c,disabled:r,onClick:_e(t.onClick,u),onPointerDown:f=>{var d;(d=t.onPointerDown)===null||d===void 0||d.call(t,f),l.current=!0},onPointerUp:_e(t.onPointerUp,f=>{var d;l.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:_e(t.onKeyDown,f=>{const d=a.searchRef.current!=="";r||d&&f.key===" "||kde.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),Rde=w.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=CB(Y6,r),a=Pde(r),c=w.useRef(null),l=Lt(e,c),[u,f]=w.useState(!1),[d,h]=w.useState("");return w.useEffect(()=>{const p=c.current;if(p){var m;h(((m=p.textContent)!==null&&m!==void 0?m:"").trim())}},[s.children]),w.createElement(Ade.ItemSlot,{scope:r,disabled:n,textValue:i??d},w.createElement(o4,Fe({asChild:!0},a,{focusable:!n}),w.createElement(Xe.div,Fe({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},s,{ref:l,onPointerMove:_e(t.onPointerMove,HA(p=>{n?o.onItemLeave(p):(o.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus())})),onPointerLeave:_e(t.onPointerLeave,HA(p=>o.onItemLeave(p))),onFocus:_e(t.onFocus,()=>f(!0)),onBlur:_e(t.onBlur,()=>f(!1))}))))}),$de=w.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return w.createElement(AB,{scope:t.__scopeMenu,checked:r},w.createElement(SB,Fe({role:"menuitemcheckbox","aria-checked":Uy(r)?"mixed":r},i,{ref:e,"data-state":a4(r),onSelect:_e(i.onSelect,()=>n==null?void 0:n(Uy(r)?!0:!r),{checkForDefaultPrevented:!1})})))}),Mde="MenuRadioGroup",[IAe,Nde]=Su(Mde,{value:void 0,onValueChange:()=>{}}),Dde="MenuRadioItem",Lde=w.forwardRef((t,e)=>{const{value:r,...n}=t,i=Nde(Dde,t.__scopeMenu),s=r===i.value;return w.createElement(AB,{scope:t.__scopeMenu,checked:s},w.createElement(SB,Fe({role:"menuitemradio","aria-checked":s},n,{ref:e,"data-state":a4(s),onSelect:_e(n.onSelect,()=>{var o;return(o=i.onValueChange)===null||o===void 0?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})))}),kB="MenuItemIndicator",[AB,jde]=Su(kB,{checked:!1}),Bde=w.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=jde(kB,r);return w.createElement(Ra,{present:n||Uy(s.checked)||s.checked===!0},w.createElement(Xe.span,Fe({},i,{ref:e,"data-state":a4(s.checked)})))}),Fde="MenuSub";Su(Fde);function Uy(t){return t==="indeterminate"}function a4(t){return Uy(t)?"indeterminate":t?"checked":"unchecked"}function HA(t){return e=>e.pointerType==="mouse"?t(e):void 0}const Ude=$de,zde=Lde,qde=Bde,_B="DropdownMenu",[Wde,TAe]=In(_B,[EB]),c4=EB();Wde(_B);const Hde=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=c4(r);return w.createElement(Ude,Fe({},i,n,{ref:e}))}),Vde=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=c4(r);return w.createElement(zde,Fe({},i,n,{ref:e}))}),Gde=w.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=c4(r);return w.createElement(qde,Fe({},i,n,{ref:e}))}),Kde=Hde,Qde=Vde,PB=Gde;var IB="_1k2mbvi4 _1k2mbvi3 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1x4 fyvr1yk fyvr1ss fyvr1uo fyvr12ws fyvr12wm fyvr11h0 fyvr11ko fyvr11jw fyvr12v7 fyvr11n4 fyvr11hw fyvr12s7",TB="_1k2mbvi5";const Yde=({children:t})=>X.jsx(PB,{className:TB,children:t});w.forwardRef(({className:t,children:e,...r},n)=>X.jsxs(Kde,{className:fi(IB,t),...r,ref:n,children:[X.jsx(Yde,{children:X.jsx(Bd,{size:"xs"})}),X.jsx(ae,{variant:"small",children:e})]}));w.forwardRef(({className:t,children:e,...r},n)=>X.jsxs(Qde,{className:fi(IB,t),...r,ref:n,children:[X.jsx(PB,{className:TB,children:X.jsx(ae,{children:"•"})}),X.jsx(ae,{variant:"small",children:e})]}));const Ao=w.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return X.jsx(rt,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),Jde=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var Xde="_1hq71vk1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _1hq71vk0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr12n7 fyvr12fv fyvr1217 fyvr128j fyvr12np fyvr12gd fyvr121p fyvr1291 fyvr11ko fyvr11hc fyvr11ic fyvr11jc fyvr1g0 fyvr11hw",Zde=Er({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"_1hq71vk6 _1hq71vk2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"_1hq71vk7 _1hq71vk3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"_1hq71vk8 _1hq71vk4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),ehe="_1hq71vka _1hq71vk9 fyvr12wp fyvr12wj fyvr11ho fyvr12vj fyvr1ko fyvr1oo fyvr1mo fyvr1qo";const the={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*",pdf:".pdf,application/pdf"};w.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:c,onValueChange:l,placeholder:u="Upload a file",validExtensions:f,...d}=t,h=w.useRef(null),p=Jde(h,e),[m,v]=w.useState(null),y=E=>{const S=E.currentTarget.files;if(!S||!S[0])return;const P=S[0],M=P.name,L=P.size/1e3;v({name:M,size:L,extension:M.split(".").pop()??""}),l==null||l(P)},b=f.map(E=>the[E]).join(",");return X.jsx(Eu,{description:n,disabled:i,display:"grid",id:s??c,label:o,labelLocation:a,children:X.jsxs(q,{width:"full",minWidth:"0",justifyContent:m?"space-between":"flex-start",gap:"2",color:m?"text100":"text50",className:fi(Xde,Zde({borderRadius:r})),children:[m?X.jsxs(q,{flexDirection:"row",gap:"2",alignItems:"center",minWidth:"0",children:[X.jsx(ae,{ellipsis:!0,children:m.name}),X.jsxs(ae,{color:"text50",variant:"xsmall",whiteSpace:"nowrap",children:[m.size.toFixed(2)," kb"]})]}):X.jsx(ae,{ellipsis:!0,children:u}),X.jsx(q,{accept:b,as:"input",className:ehe,cursor:"pointer",disabled:i,id:s??c,name:c,onChange:y,ref:p,type:"file",...d}),m&&X.jsx(Ao,{cursor:"pointer",icon:Cu,size:"xs",onClick:E=>{var S;E.preventDefault(),E.stopPropagation(),(S=h.current)!=null&&S.value&&(h.current.value=""),l==null||l(null),v(null)},zIndex:"10"})]})})});var rhe=Er({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const J6=1e3,Hf=64,aw=Hf/2,cw=(t,e=J6)=>t%e/(J6/Hf),Cl=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},nhe=(t,e,r)=>{const n=Math.random().toString(36).slice(2,12),i=t%360,s=(t+120)%360,o=r%360;return{id:Cl(n),a:`hsl(${i}deg 100% 40%)`,b:`hsl(${s}deg 100% 50%)`,c:`hsl(${o}deg 100% 50%)`}},ihe=(t,e)=>{const r=[];for(let n=0;n{const s=Hf/10+cw(n.r,J6*1.5/(i+1));return{...nhe(n.a,n.b,n.c),x:cw(n.x),y:cw(n.y),r:s}})},ku=w.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=ihe(r,i);return X.jsxs(q,{as:"svg",className:fi(e,rhe({size:n})),viewBox:`0 0 ${Hf} ${Hf}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[X.jsxs("defs",{children:[X.jsx("clipPath",{id:"circle-clip",children:X.jsx("circle",{cx:aw,cy:aw,r:aw})}),X.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[X.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),X.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),X.jsx("feGaussianBlur",{stdDeviation:Hf/10,result:"effect1_foregroundBlur"})]}),X.jsxs("linearGradient",{id:`gradient-background-${o[0].id}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[X.jsx("stop",{offset:"0",stopColor:o[0].c}),X.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map(a=>X.jsxs(w.Fragment,{children:[X.jsxs("radialGradient",{id:`gradient-primary-${a.id}`,children:[X.jsx("stop",{offset:"0",stopColor:a.a}),X.jsx("stop",{offset:"1",stopColor:a.b})]}),X.jsxs("radialGradient",{id:`gradient-secondary-${a.id}`,children:[X.jsx("stop",{offset:"0",stopColor:a.c}),X.jsx("stop",{offset:"1",stopColor:a.b})]})]},a.id))]}),X.jsxs("g",{clipPath:"url(#circle-clip)",children:[X.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${o[0].id})`}),X.jsx("g",{filter:"url(#blur)",children:o.map(a=>X.jsxs(w.Fragment,{children:[X.jsx("circle",{fill:`url(#gradient-primary-${a.id})`,cx:a.x,cy:a.y,r:a.r}),X.jsx("circle",{fill:`url(#gradient-secondary-${a.id})`,cx:a.y,cy:a.x,r:a.r/2})]},a.id))})]})]})}),br=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=w.useState(!1),o=a=>{s(!0),r==null||r(a)};return X.jsx(q,{as:Cc.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})},OB="Dialog",[RB,OAe]=In(OB),[she,il]=RB(OB),ohe=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=w.useRef(null),c=w.useRef(null),[l=!1,u]=fa({prop:n,defaultProp:i,onChange:s});return w.createElement(she,{scope:e,triggerRef:a,contentRef:c,contentId:ta(),titleId:ta(),descriptionId:ta(),open:l,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(f=>!f),[u]),modal:o},r)},$B="DialogPortal",[ahe,MB]=RB($B,{forceMount:void 0}),che=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=il($B,e);return w.createElement(ahe,{scope:e,forceMount:r},w.Children.map(n,o=>w.createElement(Ra,{present:r||s.open},w.createElement(aB,{asChild:!0,container:i},o))))},X6="DialogOverlay",lhe=w.forwardRef((t,e)=>{const r=MB(X6,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=il(X6,t.__scopeDialog);return s.modal?w.createElement(Ra,{present:n||s.open},w.createElement(uhe,Fe({},i,{ref:e}))):null}),uhe=w.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=il(X6,r);return w.createElement(wB,{as:pd,allowPinchZoom:!0,shards:[i.contentRef]},w.createElement(Xe.div,Fe({"data-state":DB(i.open)},n,{ref:e,style:{pointerEvents:"auto",...n.style}})))}),c1="DialogContent",fhe=w.forwardRef((t,e)=>{const r=MB(c1,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=il(c1,t.__scopeDialog);return w.createElement(Ra,{present:n||s.open},s.modal?w.createElement(dhe,Fe({},i,{ref:e})):w.createElement(hhe,Fe({},i,{ref:e})))}),dhe=w.forwardRef((t,e)=>{const r=il(c1,t.__scopeDialog),n=w.useRef(null),i=Lt(e,r.contentRef,n);return w.useEffect(()=>{const s=n.current;if(s)return dB(s)},[]),w.createElement(NB,Fe({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_e(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:_e(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:_e(t.onFocusOutside,s=>s.preventDefault())}))}),hhe=w.forwardRef((t,e)=>{const r=il(c1,t.__scopeDialog),n=w.useRef(!1),i=w.useRef(!1);return w.createElement(NB,Fe({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),NB=w.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=il(c1,r),c=w.useRef(null),l=Lt(e,c);return Wj(),w.createElement(w.Fragment,null,w.createElement(Hj,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},w.createElement(XC,Fe({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":DB(a.open)},o,{ref:l,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),phe="DialogClose",mhe=w.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=il(phe,r);return w.createElement(Xe.button,Fe({type:"button"},n,{ref:e,onClick:_e(t.onClick,()=>i.onOpenChange(!1))}))});function DB(t){return t?"open":"closed"}const vhe=ohe,yhe=che,ghe=lhe,bhe=fhe,xhe=mhe;var whe=Er({defaultClassName:"_1vqx0w91 _1vqx0w90 fyvr128 fyvr15o",variantClassNames:{direction:{vertical:"_1vqx0w92",horizontal:"_1vqx0w93"}},defaultVariants:{},compoundVariants:[]}),Ehe=Er({defaultClassName:"_1vqx0w94",variantClassNames:{shadows:{true:"_1vqx0w95",false:"_1vqx0w96"},direction:{vertical:"_1vqx0w97",horizontal:"_1vqx0w98"}},defaultVariants:{},compoundVariants:[]});const LB=t=>{const{children:e,shadows:r=!0,direction:n="vertical",contentProps:i,...s}=t;return X.jsx(q,{className:Ehe({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:X.jsx(q,{className:whe({direction:n}),background:"backgroundPrimary",...i,children:e})})};function Che(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}function She(t,e){var r=t;for(var n of e){if(!(n in r))throw new Error("Path ".concat(e.join(" -> ")," does not exist in object"));r=r[n]}return r}function jB(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=t.constructor();for(var i in t){var s=t[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=e(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=jB(s,e,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function VA(t,e,r){t.style.setProperty(Che(e),r)}function GA(t,e,r){if(typeof r=="object"){var n=e;jB(r,(a,c)=>{a!=null&&VA(t,She(n,c),String(a))})}else{var i=e;for(var s in i){var o=i[s];o!=null&&VA(t,s,i[s])}}}const l4=["dark","light"],khe="dark",Ahe="data-theme",KA="@sequence.theme",_he=t=>l4.includes(t),Phe=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),BB=t=>t?`${KA}.${t}`:KA,Ihe=t=>{const e=localStorage.getItem(BB(t));return e&&l4.includes(e)?e:khe},FB=w.createContext(null),Lb=t=>{const[e,r]=w.useState(t.theme||Ihe(t.scope));w.useEffect(()=>{/Mac/.test(window.navigator.userAgent)&&window.document.documentElement.classList.add("is-apple")},[]),w.useEffect(()=>{t.theme&&r(t.theme)},[t.theme]),w.useEffect(()=>{const i=document.querySelector(t.root||":root");i&&(_he(e)?(i.setAttribute(Ahe,e),GA(i,gA,{colors:zce[e]})):Phe(e)&&GA(i,gA,{colors:e}))},[e,t.root]);const n=w.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{l4.includes(i)&&(localStorage.setItem(BB(t.scope),i),r(i))}}),[e,t.root,t.scope]);return X.jsx(FB.Provider,{value:n,children:t.children})},op=()=>{const t=w.useContext(FB);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var The="_5b32m91 _5b32m90 fyvr11jg fyvr11ko fyvr11h0 fyvr11hs fyvr11nk fyvr1ko fyvr1oo fyvr1qo fyvr1mo",Ohe="_5b32m93 _5b32m92 fyvr11hs fyvr1ko fyvr1oo fyvr1qo fyvr1mo",Rhe=Er({defaultClassName:"_5b32m95 _5b32m94 fyvr11d8 fyvr11dw fyvr11bg fyvr11by fyvr11c4 fyvr11cm fyvr11ls fyvr11m8 fyvr12ws fyvr12wm fyvr11h0 fyvr11i4 fyvr11hs fyvr11sd fyvr1mo fyvr1om",variantClassNames:{size:{sm:"_5b32m96",lg:"_5b32m97"},autoHeight:{true:"_5b32m98"}},defaultVariants:{},compoundVariants:[[{autoHeight:!0,size:"lg"},"_5b32m99"]]}),$he="_5b32m9b _5b32m9a fyvr110o fyvr112o fyvr114o fyvr116o fyvr11ho fyvr1qo fyvr1ko fyvr11nk";const zy=t=>{const{autoHeight:e=!1,backdropColor:r="backgroundBackdrop",children:n,disableAnimation:i=!1,isDismissible:s=!0,onClose:o,scroll:a=!0,size:c="lg",overlayProps:l,contentProps:u}=t,{root:f}=op(),d=document.querySelector(f||"body");return X.jsx(vhe,{modal:!0,defaultOpen:!0,onOpenChange:o,children:X.jsx(yhe,{forceMount:!0,container:d,children:X.jsxs(q,{className:The,children:[X.jsx(q,{as:ghe,asChild:!0,background:r,className:Ohe,forceMount:!0,children:X.jsx(Cc.div,{initial:i?!1:{opacity:0},animate:i?!1:{opacity:1},exit:i?void 0:{opacity:0},transition:{type:"tween",ease:"linear"},...l},"modal-overlay")}),X.jsx(bhe,{asChild:!0,className:Rhe({autoHeight:e,size:c}),forceMount:!0,onEscapeKeyDown:h=>{s?o==null||o():h.preventDefault()},onInteractOutside:h=>{s||h.preventDefault()},children:X.jsxs(Cc.div,{initial:i?!1:{y:"100%",opacity:c==="sm"?0:1},animate:i?!1:{y:0,opacity:1},exit:i?void 0:{y:"100%",opacity:c==="sm"?0:1},transition:{type:"tween",ease:"easeOut"},...u,children:[a?X.jsx(LB,{children:n}):n,s&&X.jsx(xhe,{asChild:!0,children:X.jsx(Ao,{icon:Cu,backdropFilter:"blur",size:"xs",className:$he,"aria-label":"Close"})})]},"modal-content")})]})})})};var Mhe="_1acm19y1 _1acm19y0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1ww fyvr1ys fyvr11hc fyvr11ko fyvr11od fyvr12s1 fyvr1g0 fyvr118g",Nhe=Er({defaultClassName:"_1acm19y5",variantClassNames:{borderRadius:{xs:"_1acm19y6 _1acm19y2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"_1acm19y7 _1acm19y3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"_1acm19y8 _1acm19y4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),Dhe=Er({defaultClassName:"_1acm19ya _1acm19y9 fyvr1wg fyvr1yc fyvr1t4 fyvr1v0 fyvr12wp fyvr12wj fyvr11gw fyvr11od fyvr12s1 fyvr12o1 fyvr128 fyvr15o",variantClassNames:{numeric:{false:"_1acm19yb _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",true:"_1acm19yc _1qxj1ib9 _1qxj1ibc _1qxj1ib2 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8"}},defaultVariants:{},compoundVariants:[]});const sl=w.forwardRef((t,e)=>{const{as:r="input",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",leftIcon:u,rightIcon:f,name:d,controls:h,type:p="text",numeric:m=!1,...v}=t;return X.jsx(Eu,{description:s,disabled:o,display:"grid",id:a??d,label:c,labelLocation:l,children:X.jsx(q,{width:"full",children:X.jsxs(q,{className:fi(Mhe,Nhe({borderRadius:i})),children:[u&&X.jsx(u,{size:"sm"}),X.jsx(q,{as:r,autoComplete:n,spellCheck:"false",className:Dhe({numeric:m}),disabled:o,id:a??d,name:d,ref:e,type:p,...v}),f&&X.jsx(f,{size:"sm"}),h]})})})}),Lhe=RegExp("^\\d*(?:\\\\[.])?\\d*$");function jhe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const UB=w.forwardRef((t,e)=>{const{name:r="amount",placeholder:n,onChange:i,onBlur:s,...o}=t,a=l=>{let{value:u}=l.target;u=u.replace(/,/g,"."),u.startsWith(".")&&(u="0"+u),u.startsWith("0")&&(u=u.replace(/^0+(?=\d)/,"")),(u===""||Lhe.test(jhe(u)))&&(i==null||i({...l,target:{...l.target,value:u}}))},c=l=>{const{value:u}=l.target;let f=u;f.endsWith(".")&&(f=f.slice(0,-1)),f.endsWith(".0")&&(f=f.slice(0,-2)),f==="0"&&(f=""),s==null||s(l),f!==u&&(i==null||i({...l,target:{...l.target,value:f}}))};return X.jsx(sl,{name:r,onChange:a,onBlur:c,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",type:"text",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:n||"0",minLength:1,maxLength:79,spellCheck:"false",numeric:!0,ref:e,...o})});Er({defaultClassName:"dtv8gt1",variantClassNames:{size:{sm:"dtv8gt2",normal:"dtv8gt3",md:"dtv8gt4",lg:"dtv8gt5",xl:"dtv8gt6"}},defaultVariants:{},compoundVariants:[]});const zB="Progress",jb=100,[Bhe,RAe]=In(zB),[Fhe,$Ae]=Bhe(zB),Uhe=w.forwardRef((t,e)=>{const{__scopeProgress:r,value:n,max:i,getValueLabel:s=zhe,...o}=t,a=Z6(i)?i:jb,c=qB(n,a)?n:null,l=qy(c)?s(c,a):void 0;return w.createElement(Fhe,{scope:r,value:c,max:a},w.createElement(Xe.div,mt({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":qy(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":qhe(c,a),"data-value":c??void 0,"data-max":a},o,{ref:e})))});Uhe.propTypes={max(t,e,r){const n=t[e],i=String(n);return n&&!Z6(n)?new Error(Whe(i,r)):null},value(t,e,r){const n=t[e],i=String(n),s=Z6(t.max)?t.max:jb;return n!=null&&!qB(n,s)?new Error(Hhe(i,r)):null}};function zhe(t,e){return`${Math.round(t/e*100)}%`}function qhe(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function qy(t){return typeof t=="number"}function Z6(t){return qy(t)&&!isNaN(t)&&t>0}function qB(t,e){return qy(t)&&!isNaN(t)&&t<=e&&t>=0}function Whe(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${jb}\`.`}function Hhe(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: - a positive number - - less than the value passed to \`max\` (or ${Yb} if no \`max\` prop is set) + - less than the value passed to \`max\` (or ${jb} if no \`max\` prop is set) - \`null\` if the progress is indeterminate. -Defaulting to \`null\`.`}const lF="Radio",[m0e,uF]=In(lF),[v0e,y0e]=m0e(lF),g0e=x.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:c,...l}=t,[u,f]=x.useState(null),d=Lt(e,m=>f(m)),h=x.useRef(!1),p=u?!!u.closest("form"):!0;return x.createElement(v0e,{scope:r,checked:i,disabled:o},x.createElement(Xe.button,mt({type:"button",role:"radio","aria-checked":i,"data-state":fF(i),"data-disabled":o?"":void 0,disabled:o,value:a},l,{ref:d,onClick:_e(t.onClick,m=>{i||c==null||c(),p&&(h.current=m.isPropagationStopped(),h.current||m.stopPropagation())})})),p&&x.createElement(w0e,{control:u,bubbles:!h.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}}))}),b0e="RadioIndicator",x0e=x.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=y0e(b0e,r);return x.createElement(Da,{present:n||s.checked},x.createElement(Xe.span,mt({"data-state":fF(s.checked),"data-disabled":s.disabled?"":void 0},i,{ref:e})))}),w0e=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=x.useRef(null),o=Lb(r),a=jb(e);return x.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),x.createElement("input",mt({type:"radio","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function fF(t){return t?"checked":"unchecked"}const E0e=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],dF="RadioGroup",[C0e,g_e]=In(dF,[Xd,uF]),hF=Xd(),pF=uF(),[S0e,k0e]=C0e(dF),A0e=x.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:c,dir:l,loop:u=!0,onValueChange:f,...d}=t,h=hF(r),p=Wb(l),[m,v]=pa({prop:s,defaultProp:i,onChange:f});return x.createElement(S0e,{scope:r,name:n,required:o,disabled:a,value:m,onValueChange:v},x.createElement(IB,mt({asChild:!0},h,{orientation:c,dir:p,loop:u}),x.createElement(Xe.div,mt({role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:p},d,{ref:e}))))}),_0e="RadioGroupItem",P0e=x.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=k0e(_0e,r),o=s.disabled||n,a=hF(r),c=pF(r),l=x.useRef(null),u=Lt(e,l),f=s.value===i.value,d=x.useRef(!1);return x.useEffect(()=>{const h=m=>{E0e.includes(m.key)&&(d.current=!0)},p=()=>d.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),x.createElement(x4,mt({asChild:!0},a,{focusable:!o,active:f}),x.createElement(g0e,mt({disabled:o,required:s.required,checked:f},c,i,{name:s.name,ref:u,onCheck:()=>s.onValueChange(i.value),onKeyDown:_e(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:_e(i.onFocus,()=>{var h;d.current&&((h=l.current)===null||h===void 0||h.click())})})))}),I0e=x.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=pF(r);return x.createElement(x0e,mt({},i,n,{ref:e}))}),T0e=A0e,O0e=P0e,R0e=I0e;var $0e=Cr({defaultClassName:"io59uy3 io59uy0 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1so fyvr1uk fyvr1wg fyvr1yc fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11od fyvr12v7 fyvr12v3 fyvr12vz fyvr12vr",variantClassNames:{size:{sm:"io59uy4 io59uy1 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8",lg:"io59uy5 io59uy2 fyvr11ac fyvr11ao fyvr11b0 fyvr11bc"}},defaultVariants:{},compoundVariants:[]}),M0e=Cr({defaultClassName:"io59uy8 io59uy7 io59uy6 fyvr11h0 fyvr11ko fyvr11jg fyvr11hw fyvr128 fyvr15o fyvr12s1",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]});const N0e=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return X.jsx(q,{alignItems:"center",children:X.jsx(Iu,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:X.jsx(O0e,{className:$0e({size:n}),value:i,id:e,disabled:s,children:X.jsx(R0e,{className:M0e({size:n})})})})})};x.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...c}=t;return X.jsx(T0e,{disabled:n,name:s,ref:e,...c,children:X.jsx(q,{flexDirection:r,gap:i,children:o.map(({label:l,value:u,disabled:f})=>X.jsx(N0e,{id:`${s}-${u}`,label:l,size:a,value:u,disabled:f},u))})})});function f_(t,[e,r]){return Math.min(r,Math.max(e,t))}const mF=x.forwardRef((t,e)=>x.createElement(Xe.span,Fe({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),D0e=[" ","Enter","ArrowUp","ArrowDown"],L0e=[" ","Enter"],Jb="Select",[Xb,S4,j0e]=qb(Jb),[Zd,b_e]=In(Jb,[j0e,Jd]),k4=Jd(),[B0e,$u]=Zd(Jb),[F0e,U0e]=Zd(Jb),z0e=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:f,disabled:d,required:h}=t,p=k4(e),[m,v]=x.useState(null),[y,b]=x.useState(null),[E,S]=x.useState(!1),P=Wb(l),[M=!1,L]=pa({prop:n,defaultProp:i,onChange:s}),[j,H]=pa({prop:o,defaultProp:a,onChange:c}),K=x.useRef(null),Q=m?!!m.closest("form"):!0,[Y,F]=x.useState(new Set),w=Array.from(Y).map(k=>k.props.value).join(";");return x.createElement(Qfe,p,x.createElement(B0e,{required:h,scope:e,trigger:m,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:ia(),value:j,onValueChange:H,open:M,onOpenChange:L,dir:P,triggerPointerDownPosRef:K,disabled:d},x.createElement(Xb.Provider,{scope:e},x.createElement(F0e,{scope:t.__scopeSelect,onNativeOptionAdd:x.useCallback(k=>{F(R=>new Set(R).add(k))},[]),onNativeOptionRemove:x.useCallback(k=>{F(R=>{const N=new Set(R);return N.delete(k),N})},[])},r)),Q?x.createElement(gF,{key:w,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:j,onChange:k=>H(k.target.value),disabled:d},j===void 0?x.createElement("option",{value:""}):null,Array.from(Y)):null))},q0e="SelectTrigger",W0e=x.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=k4(r),o=$u(q0e,r),a=o.disabled||n,c=Lt(e,o.onTriggerChange),l=S4(r),[u,f,d]=bF(p=>{const m=l().filter(b=>!b.disabled),v=m.find(b=>b.value===o.value),y=xF(m,p,v);y!==void 0&&o.onValueChange(y.value)}),h=()=>{a||(o.onOpenChange(!0),d())};return x.createElement(Yfe,Fe({asChild:!0},s),x.createElement(Xe.button,Fe({type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":yF(o.value)?"":void 0},i,{ref:c,onClick:_e(i.onClick,p=>{p.currentTarget.focus()}),onPointerDown:_e(i.onPointerDown,p=>{const m=p.target;m.hasPointerCapture(p.pointerId)&&m.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&(h(),o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)},p.preventDefault())}),onKeyDown:_e(i.onKeyDown,p=>{const m=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(m&&p.key===" ")&&D0e.includes(p.key)&&(h(),p.preventDefault())})})))}),H0e="SelectValue",V0e=x.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=$u(H0e,r),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,f=Lt(e,c.onValueNodeChange);return Pi(()=>{l(u)},[l,u]),x.createElement(Xe.span,Fe({},a,{ref:f,style:{pointerEvents:"none"}}),yF(c.value)?x.createElement(x.Fragment,null,o):s)}),G0e=x.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return x.createElement(Xe.span,Fe({"aria-hidden":!0},i,{ref:e}),n||"▼")}),kd="SelectContent",K0e=x.forwardRef((t,e)=>{const r=$u(kd,t.__scopeSelect),[n,i]=x.useState();if(Pi(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?zs.createPortal(x.createElement(vF,{scope:t.__scopeSelect},x.createElement(Xb.Slot,{scope:t.__scopeSelect},x.createElement("div",null,t.children))),s):null}return x.createElement(Q0e,Fe({},t,{ref:e}))}),Uo=10,[vF,Zb]=Zd(kd),Q0e=x.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v,...y}=t,b=$u(kd,r),[E,S]=x.useState(null),[P,M]=x.useState(null),L=Lt(e,G=>S(G)),[j,H]=x.useState(null),[K,Q]=x.useState(null),Y=S4(r),[F,w]=x.useState(!1),k=x.useRef(!1);x.useEffect(()=>{if(E)return OB(E)},[E]),lB();const R=x.useCallback(G=>{const[J,...ee]=Y().map(oe=>oe.ref.current),[se]=ee.slice(-1),ie=document.activeElement;for(const oe of G)if(oe===ie||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===J&&P&&(P.scrollTop=0),oe===se&&P&&(P.scrollTop=P.scrollHeight),oe==null||oe.focus(),document.activeElement!==ie))return},[Y,P]),N=x.useCallback(()=>R([j,E]),[R,j,E]);x.useEffect(()=>{F&&N()},[F,N]);const{onOpenChange:A,triggerPointerDownPosRef:O}=b;x.useEffect(()=>{if(E){let G={x:0,y:0};const J=se=>{var ie,oe,be,he;G={x:Math.abs(Math.round(se.pageX)-((ie=(oe=O.current)===null||oe===void 0?void 0:oe.x)!==null&&ie!==void 0?ie:0)),y:Math.abs(Math.round(se.pageY)-((be=(he=O.current)===null||he===void 0?void 0:he.y)!==null&&be!==void 0?be:0))}},ee=se=>{G.x<=10&&G.y<=10?se.preventDefault():E.contains(se.target)||A(!1),document.removeEventListener("pointermove",J),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ee,{capture:!0})}}},[E,A,O]),x.useEffect(()=>{const G=()=>A(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[A]);const[B,I]=bF(G=>{const J=Y().filter(ie=>!ie.disabled),ee=J.find(ie=>ie.ref.current===document.activeElement),se=xF(J,G,ee);se&&setTimeout(()=>se.ref.current.focus())}),C=x.useCallback((G,J,ee)=>{const se=!k.current&&!ee;(b.value!==void 0&&b.value===J||se)&&(H(G),se&&(k.current=!0))},[b.value]),D=x.useCallback(()=>E==null?void 0:E.focus(),[E]),z=x.useCallback((G,J,ee)=>{const se=!k.current&&!ee;(b.value!==void 0&&b.value===J||se)&&Q(G)},[b.value]),_=n==="popper"?d_:Y0e,W=_===d_?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v}:{};return x.createElement(vF,{scope:r,content:E,viewport:P,onViewportChange:M,itemRefCallback:C,selectedItem:j,onItemLeave:D,itemTextRefCallback:z,focusSelectedItem:N,selectedItemText:K,position:n,isPositioned:F,searchRef:B},x.createElement(FB,{as:Cd,allowPinchZoom:!0},x.createElement(uB,{asChild:!0,trapped:b.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:_e(i,G=>{var J;(J=b.trigger)===null||J===void 0||J.focus({preventScroll:!0}),G.preventDefault()})},x.createElement(d4,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>b.onOpenChange(!1)},x.createElement(_,Fe({role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:G=>G.preventDefault()},y,W,{onPlaced:()=>w(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:_e(y.onKeyDown,G=>{const J=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!J&&G.key.length===1&&I(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let se=Y().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(G.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const ie=G.target,oe=se.indexOf(ie);se=se.slice(oe+1)}setTimeout(()=>R(se)),G.preventDefault()}})}))))))}),Y0e=x.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=$u(kd,r),o=Zb(kd,r),[a,c]=x.useState(null),[l,u]=x.useState(null),f=Lt(e,L=>u(L)),d=S4(r),h=x.useRef(!1),p=x.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,E=x.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&m&&v&&y){const L=s.trigger.getBoundingClientRect(),j=l.getBoundingClientRect(),H=s.valueNode.getBoundingClientRect(),K=y.getBoundingClientRect();if(s.dir!=="rtl"){const ie=K.left-j.left,oe=H.left-ie,be=L.left-oe,he=L.width+be,ve=Math.max(he,j.width),$e=window.innerWidth-Uo,ge=f_(oe,[Uo,$e-ve]);a.style.minWidth=he+"px",a.style.left=ge+"px"}else{const ie=j.right-K.right,oe=window.innerWidth-H.right-ie,be=window.innerWidth-L.right-oe,he=L.width+be,ve=Math.max(he,j.width),$e=window.innerWidth-Uo,ge=f_(oe,[Uo,$e-ve]);a.style.minWidth=he+"px",a.style.right=ge+"px"}const Q=d(),Y=window.innerHeight-Uo*2,F=m.scrollHeight,w=window.getComputedStyle(l),k=parseInt(w.borderTopWidth,10),R=parseInt(w.paddingTop,10),N=parseInt(w.borderBottomWidth,10),A=parseInt(w.paddingBottom,10),O=k+R+F+A+N,B=Math.min(v.offsetHeight*5,O),I=window.getComputedStyle(m),C=parseInt(I.paddingTop,10),D=parseInt(I.paddingBottom,10),z=L.top+L.height/2-Uo,_=Y-z,W=v.offsetHeight/2,G=v.offsetTop+W,J=k+R+G,ee=O-J;if(J<=z){const ie=v===Q[Q.length-1].ref.current;a.style.bottom="0px";const oe=l.clientHeight-m.offsetTop-m.offsetHeight,be=Math.max(_,W+(ie?D:0)+oe+N),he=J+be;a.style.height=he+"px"}else{const ie=v===Q[0].ref.current;a.style.top="0px";const be=Math.max(z,k+m.offsetTop+(ie?C:0)+W)+ee;a.style.height=be+"px",m.scrollTop=J-z+m.offsetTop}a.style.margin=`${Uo}px 0`,a.style.minHeight=B+"px",a.style.maxHeight=Y+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[d,s.trigger,s.valueNode,a,l,m,v,y,s.dir,n]);Pi(()=>E(),[E]);const[S,P]=x.useState();Pi(()=>{l&&P(window.getComputedStyle(l).zIndex)},[l]);const M=x.useCallback(L=>{L&&p.current===!0&&(E(),b==null||b(),p.current=!1)},[E,b]);return x.createElement(J0e,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:M},x.createElement("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},x.createElement(Xe.div,Fe({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),d_=x.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Uo,...s}=t,o=k4(r);return x.createElement(Jfe,Fe({},o,s,{ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[J0e,X0e]=Zd(kd,{}),h_="SelectViewport",Z0e=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=Zb(h_,r),s=X0e(h_,r),o=Lt(e,i.onViewportChange),a=x.useRef(0);return x.createElement(x.Fragment,null,x.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),x.createElement(Xb.Slot,{scope:r},x.createElement(Xe.div,Fe({"data-radix-select-viewport":"",role:"presentation"},n,{ref:o,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:_e(n.onScroll,c=>{const l=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&u){const d=Math.abs(a.current-l.scrollTop);if(d>0){const h=window.innerHeight-Uo*2,p=parseFloat(u.style.minHeight),m=parseFloat(u.style.height),v=Math.max(p,m);if(v0?E:0,u.style.justifyContent="flex-end")}}}a.current=l.scrollTop})}))))}),e1e="SelectGroup",[t1e,x_e]=Zd(e1e),r1e=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=ia();return x.createElement(t1e,{scope:r,id:i},x.createElement(Xe.div,Fe({role:"group","aria-labelledby":i},n,{ref:e})))}),p3="SelectItem",[n1e,i1e]=Zd(p3),s1e=x.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=$u(p3,r),c=Zb(p3,r),l=a.value===n,[u,f]=x.useState(s??""),[d,h]=x.useState(!1),p=Lt(e,y=>{var b;return(b=c.itemRefCallback)===null||b===void 0?void 0:b.call(c,y,n,i)}),m=ia(),v=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.createElement(n1e,{scope:r,value:n,disabled:i,textId:m,isSelected:l,onItemTextChange:x.useCallback(y=>{f(b=>{var E;return b||((E=y==null?void 0:y.textContent)!==null&&E!==void 0?E:"").trim()})},[])},x.createElement(Xb.ItemSlot,{scope:r,value:n,disabled:i,textValue:u},x.createElement(Xe.div,Fe({role:"option","aria-labelledby":m,"data-highlighted":d?"":void 0,"aria-selected":l&&d,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},o,{ref:p,onFocus:_e(o.onFocus,()=>h(!0)),onBlur:_e(o.onBlur,()=>h(!1)),onPointerUp:_e(o.onPointerUp,v),onPointerMove:_e(o.onPointerMove,y=>{if(i){var b;(b=c.onItemLeave)===null||b===void 0||b.call(c)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(o.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var b;(b=c.onItemLeave)===null||b===void 0||b.call(c)}}),onKeyDown:_e(o.onKeyDown,y=>{var b;((b=c.searchRef)===null||b===void 0?void 0:b.current)!==""&&y.key===" "||(L0e.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})}))))}),Cm="SelectItemText",o1e=x.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=$u(Cm,r),a=Zb(Cm,r),c=i1e(Cm,r),l=U0e(Cm,r),[u,f]=x.useState(null),d=Lt(e,y=>f(y),c.onItemTextChange,y=>{var b;return(b=a.itemTextRefCallback)===null||b===void 0?void 0:b.call(a,y,c.value,c.disabled)}),h=u==null?void 0:u.textContent,p=x.useMemo(()=>x.createElement("option",{key:c.value,value:c.value,disabled:c.disabled},h),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=l;return Pi(()=>(m(p),()=>v(p)),[m,v,p]),x.createElement(x.Fragment,null,x.createElement(Xe.span,Fe({id:c.textId},s,{ref:d})),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?zs.createPortal(s.children,o.valueNode):null)});function yF(t){return t===""||t===void 0}const gF=x.forwardRef((t,e)=>{const{value:r,...n}=t,i=x.useRef(null),s=Lt(e,i),o=Lb(r);return x.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&u){const f=new Event("change",{bubbles:!0});u.call(a,r),a.dispatchEvent(f)}},[o,r]),x.createElement(mF,{asChild:!0},x.createElement("select",Fe({},n,{ref:s,defaultValue:r})))});gF.displayName="BubbleSelect";function bF(t){const e=is(t),r=x.useRef(""),n=x.useRef(0),i=x.useCallback(o=>{const a=r.current+o;e(a),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function xF(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=a1e(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function a1e(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const c1e=z0e,l1e=W0e,u1e=V0e,f1e=G0e,d1e=K0e,h1e=Z0e,p1e=r1e,m1e=s1e,v1e=o1e;var y1e="gohwum1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 gohwum0 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11od fyvr11hc fyvr11f4 fyvr12s1 fyvr118c fyvr11jw fyvr11n4 fyvr12v7 fyvr12o1",g1e=Cr({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"gohwum6 gohwum2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"gohwum7 gohwum3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"gohwum8 gohwum4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),b1e="gohwuma gohwum9 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ls fyvr11m8 fyvr11ms fyvr11tv fyvr12s1 fyvr11nl",x1e="gohwume _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 gohwumd fyvr1ww fyvr1ys fyvr1t0 fyvr1uw fyvr12ws fyvr12wt fyvr12wm fyvr12wn fyvr11h0 fyvr11jw fyvr11ko fyvr12v7 fyvr12v3 fyvr12s1 fyvr12w1 fyvr12vr";const w1e=x.forwardRef(({children:t,className:e,...r},n)=>X.jsx(m1e,{className:di(x1e,e),...r,ref:n,children:X.jsx(v1e,{children:t})})),E1e=x.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:c,options:l,placeholder:u,...f}=t;return X.jsx(Iu,{disabled:n,display:"grid",id:i??c,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:X.jsxs(c1e,{disabled:n,name:c,...f,children:[X.jsxs(l1e,{id:i??c,className:di(y1e,g1e({borderRadius:r})),ref:e,children:[X.jsx(u1e,{placeholder:u}),X.jsx(q,{as:f1e,display:"inline-flex",children:X.jsx(l4,{})})]}),X.jsx(d1e,{className:b1e,children:X.jsx(h1e,{children:X.jsx(p1e,{children:l.map(({value:d,label:h,...p})=>X.jsx(w1e,{value:d,...p,children:h},d))})})})]})})});x.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,c=o?X.jsx(Po,{icon:Tu,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return X.jsx(ul,{ref:e,name:s,leftIcon:Ub,controls:r||c,placeholder:i,value:o,onChange:l=>n==null?void 0:n(l),...a})});var C1e=Cr({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const Vc=x.forwardRef((t,e)=>{const{size:r="md",...n}=t;return X.jsx(q,{className:C1e({size:r}),color:"text50",ref:e,...n,children:X.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[X.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),X.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});x.forwardRef(({children:t},e)=>X.jsx(q,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));const wF="Switch",[S1e,w_e]=In(wF),[k1e,A1e]=S1e(wF),_1e=x.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=x.useState(null),h=Lt(e,b=>d(b)),p=x.useRef(!1),m=f?!!f.closest("form"):!0,[v=!1,y]=pa({prop:i,defaultProp:s,onChange:l});return x.createElement(k1e,{scope:r,checked:v,disabled:a},x.createElement(Xe.button,mt({type:"button",role:"switch","aria-checked":v,"aria-required":o,"data-state":EF(v),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:h,onClick:_e(t.onClick,b=>{y(E=>!E),m&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})),m&&x.createElement(T1e,{control:f,bubbles:!p.current,name:n,value:c,checked:v,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),P1e="SwitchThumb",I1e=x.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=A1e(P1e,r);return x.createElement(Xe.span,mt({"data-state":EF(i.checked),"data-disabled":i.disabled?"":void 0},n,{ref:e}))}),T1e=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=x.useRef(null),o=Lb(r),a=jb(e);return x.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),x.createElement("input",mt({type:"checkbox","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function EF(t){return t?"checked":"unchecked"}const O1e=_1e,R1e=I1e;var $1e="_1lp2u8e1 _1lp2u8e0 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1ss fyvr1uo fyvr1wk fyvr1yg fyvr11t1 fyvr11hw fyvr12v7 fyvr12o1",M1e="_1lp2u8e3 _1lp2u8e2 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ho fyvr1ko fyvr1oo fyvr1k fyvr140 fyvr11o1";const m3=t=>{const{disabled:e,label:r,labelLocation:n="left",description:i,id:s,name:o,...a}=t;return X.jsx(Iu,{disabled:e,display:"flex",id:s??o,label:r,labelLocation:n,description:i,whiteSpace:"nowrap",children:X.jsx(O1e,{className:$1e,disabled:e,...a,children:X.jsx(q,{position:"relative",width:"full",height:"full",children:X.jsx(R1e,{className:M1e})})})})};Cr({defaultClassName:"nwwh3z8",variantClassNames:{variant:{pill:"nwwh3z9",line:"nwwh3za nwwh3z1 fyvr11g0"},active:{true:"nwwh3zb nwwh3z2 fyvr12w5",false:"nwwh3zc"},disabled:{true:"nwwh3zd nwwh3z3 fyvr12vp"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"nwwh3z4 fyvr11u7 fyvr12sj"],[{active:!1,variant:"pill"},"nwwh3z5 fyvr11od fyvr12s7"],[{active:!0,variant:"line"},"nwwh3z6 fyvr12s1"],[{active:!1,variant:"line"},"nwwh3z7 fyvr12s7"]]});const CF="Tabs",[N1e,E_e]=In(CF,[Xd]),SF=Xd(),[D1e,A4]=N1e(CF),L1e=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...l}=t,u=Wb(a),[f,d]=pa({prop:n,onChange:i,defaultProp:s});return x.createElement(D1e,{scope:r,baseId:ia(),value:f,onValueChange:d,orientation:o,dir:u,activationMode:c},x.createElement(Xe.div,mt({dir:u,"data-orientation":o},l,{ref:e})))}),j1e="TabsList",B1e=x.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=A4(j1e,r),o=SF(r);return x.createElement(IB,mt({asChild:!0},o,{orientation:s.orientation,dir:s.dir,loop:n}),x.createElement(Xe.div,mt({role:"tablist","aria-orientation":s.orientation},i,{ref:e})))}),F1e="TabsTrigger",U1e=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=A4(F1e,r),a=SF(r),c=kF(o.baseId,n),l=AF(o.baseId,n),u=n===o.value;return x.createElement(x4,mt({asChild:!0},a,{focusable:!i,active:u}),x.createElement(Xe.button,mt({type:"button",role:"tab","aria-selected":u,"aria-controls":l,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c},s,{ref:e,onMouseDown:_e(t.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:_e(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:_e(t.onFocus,()=>{const f=o.activationMode!=="manual";!u&&!i&&f&&o.onValueChange(n)})})))}),z1e="TabsContent",q1e=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=A4(z1e,r),c=kF(a.baseId,n),l=AF(a.baseId,n),u=n===a.value,f=x.useRef(u);return x.useEffect(()=>{const d=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(d)},[]),x.createElement(Da,{present:i||u},({present:d})=>x.createElement(Xe.div,mt({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:l,tabIndex:0},o,{ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0}}),d&&s))});function kF(t,e){return`${t}-trigger-${e}`}function AF(t,e){return`${t}-content-${e}`}const W1e=L1e,H1e=B1e,V1e=U1e;var G1e="_10c8o0n1 _10c8o0n0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr11h0 fyvr11hw fyvr128 fyvr11sj fyvr14o",K1e="_10c8o0n3 _10c8o0n2 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr12wp fyvr12wj fyvr128 fyvr15o fyvr12v7 fyvr11hw fyvr11od fyvr11n4 fyvr12s7",Q1e="_10c8o0n5 _10c8o0n4 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ho fyvr1ko fyvr1oo fyvr14c fyvr11tv fyvr12w7";const Y1e=t=>{const{tabs:e,value:r}=t;if(!e.length)return null;const n=100/e.length,i=e.findIndex(s=>s.value===r);return X.jsxs(H1e,{className:G1e,style:{outline:void 0},children:[X.jsx(q,{display:"flex",position:"absolute",inset:"2",height:"8",children:X.jsx("div",{className:Q1e,style:{width:`${n}%`,transform:`translateX(${i*100}%)`}})}),e.map(s=>X.jsx(V1e,{className:K1e,value:s.value,children:X.jsx(ae,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},J1e=W1e,p_=q1e;var X1e="_1ppqbnx1 _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc _1ppqbnx0 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1wo fyvr1yk fyvr1ss fyvr1uo fyvr11hc fyvr118c fyvr11n9";x.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return X.jsxs(q,{className:X1e,ref:e,background:"buttonGlass",color:"text80",...i,children:[r&&X.jsx(r,{size:"xs"}),X.jsx(ae,{children:n})]})});const Z1e="ToastProvider",[epe,C_e,tpe]=qb("Toast"),[_F,S_e]=In("Toast",[tpe]),[k_e,PF]=_F(Z1e),m_="toast.viewportPause",v_="toast.viewportResume",e2="Toast",rpe="toast.swipeStart",npe="toast.swipeMove",ipe="toast.swipeCancel",spe="toast.swipeEnd",[ope,ape]=_F(e2,{onClose(){}}),cpe=x.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...p}=t,m=PF(e2,r),[v,y]=x.useState(null),b=Lt(e,w=>y(w)),E=x.useRef(null),S=x.useRef(null),P=i||m.duration,M=x.useRef(0),L=x.useRef(P),j=x.useRef(0),{onToastAdd:H,onToastRemove:K}=m,Q=is(()=>{var w;(v==null?void 0:v.contains(document.activeElement))&&((w=m.viewport)===null||w===void 0||w.focus()),o()}),Y=x.useCallback(w=>{!w||w===1/0||(window.clearTimeout(j.current),M.current=new Date().getTime(),j.current=window.setTimeout(Q,w))},[Q]);x.useEffect(()=>{const w=m.viewport;if(w){const k=()=>{Y(L.current),l==null||l()},R=()=>{const N=new Date().getTime()-M.current;L.current=L.current-N,window.clearTimeout(j.current),c==null||c()};return w.addEventListener(m_,R),w.addEventListener(v_,k),()=>{w.removeEventListener(m_,R),w.removeEventListener(v_,k)}}},[m.viewport,P,c,l,Y]),x.useEffect(()=>{s&&!m.isClosePausedRef.current&&Y(P)},[s,P,m.isClosePausedRef,Y]),x.useEffect(()=>(H(),()=>K()),[H,K]);const F=x.useMemo(()=>v?TF(v):null,[v]);return m.viewport?x.createElement(x.Fragment,null,F&&x.createElement(lpe,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},F),x.createElement(ope,{scope:r,onClose:Q},zs.createPortal(x.createElement(epe.ItemSlot,{scope:r},x.createElement(Jue,{asChild:!0,onEscapeKeyDown:_e(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||Q(),m.isFocusedToastEscapeKeyDownRef.current=!1})},x.createElement(Xe.li,Fe({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection},p,{ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:_e(t.onKeyDown,w=>{w.key==="Escape"&&(a==null||a(w.nativeEvent),w.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,Q()))}),onPointerDown:_e(t.onPointerDown,w=>{w.button===0&&(E.current={x:w.clientX,y:w.clientY})}),onPointerMove:_e(t.onPointerMove,w=>{if(!E.current)return;const k=w.clientX-E.current.x,R=w.clientY-E.current.y,N=!!S.current,A=["left","right"].includes(m.swipeDirection),O=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,B=A?O(0,k):0,I=A?0:O(0,R),C=w.pointerType==="touch"?10:2,D={x:B,y:I},z={originalEvent:w,delta:D};N?(S.current=D,Sm(npe,f,z,{discrete:!1})):y_(D,m.swipeDirection,C)?(S.current=D,Sm(rpe,u,z,{discrete:!1}),w.target.setPointerCapture(w.pointerId)):(Math.abs(k)>C||Math.abs(R)>C)&&(E.current=null)}),onPointerUp:_e(t.onPointerUp,w=>{const k=S.current,R=w.target;if(R.hasPointerCapture(w.pointerId)&&R.releasePointerCapture(w.pointerId),S.current=null,E.current=null,k){const N=w.currentTarget,A={originalEvent:w,delta:k};y_(k,m.swipeDirection,m.swipeThreshold)?Sm(spe,h,A,{discrete:!0}):Sm(ipe,d,A,{discrete:!0}),N.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})))),m.viewport))):null});cpe.propTypes={type(t){if(t.type&&!["foreground","background"].includes(t.type)){const e=`Invalid prop \`type\` supplied to \`${e2}\`. Expected \`foreground | background\`.`;return new Error(e)}return null}};const lpe=t=>{const{__scopeToast:e,children:r,...n}=t,i=PF(e2,e),[s,o]=x.useState(!1),[a,c]=x.useState(!1);return ppe(()=>o(!0)),x.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:x.createElement(AB,{asChild:!0},x.createElement(mF,n,s&&x.createElement(x.Fragment,null,i.label," ",r)))},upe="ToastAction",fpe=x.forwardRef((t,e)=>{const{altText:r,...n}=t;return r?x.createElement(IF,{altText:r,asChild:!0},x.createElement(hpe,Fe({},n,{ref:e}))):null});fpe.propTypes={altText(t){return t.altText?null:new Error(`Missing prop \`altText\` expected on \`${upe}\``)}};const dpe="ToastClose",hpe=x.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=ape(dpe,r);return x.createElement(IF,{asChild:!0},x.createElement(Xe.button,Fe({type:"button"},n,{ref:e,onClick:_e(t.onClick,i.onClose)})))}),IF=x.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return x.createElement(Xe.div,Fe({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:e}))});function TF(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),mpe(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...TF(n))}}),e}function Sm(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?c4(i,s):i.dispatchEvent(s)}const y_=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function ppe(t=()=>{}){const e=is(t);Pi(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function mpe(t){return t.nodeType===t.ELEMENT_NODE}Cr({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});x.createContext(null);var vpe="_15pztn1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _15pztn0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11od fyvr12s1 fyvr12o1 fyvr12wj fyvr128 fyvr11h0",ype="_15pztn2";x.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",name:u,rows:f,resize:d=!1,...h}=t;return X.jsx(Iu,{description:s,disabled:o,display:"grid",id:a??u,label:c,labelLocation:l,children:X.jsx(q,{as:r,autoComplete:n,spellCheck:"false",className:di(vpe,d&&ype),disabled:o,id:a??u,name:u,ref:e,rows:f,borderRadius:i,...h})})});var gpe=Cr({defaultClassName:"bnrreb5 bnrreb0 fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11h0",variantClassNames:{size:{xs:"bnrreb6",sm:"bnrreb7",md:"bnrreb8",lg:"bnrreb9",xl:"bnrreba"},borderRadius:{circle:"bnrrebb bnrreb1 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",lg:"bnrrebc bnrreb2 fyvr11d8 fyvr11dw fyvr11bw fyvr11ck",md:"bnrrebd bnrreb3 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg",sm:"bnrrebe bnrreb4 fyvr11d0 fyvr11do fyvr11bo fyvr11cc"}},defaultVariants:{},compoundVariants:[]}),bpe="bnrrebf",xpe="bnrrebh bnrrebg fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11sj fyvr128 fyvr15o fyvr11h0";x.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",...c}=t;return X.jsx(q,{className:di(r,gpe({borderRadius:e,size:a})),style:i,flexShrink:"0",...c,children:s?X.jsx(xr,{className:bpe,disableAnimation:n,src:s}):X.jsx(ae,{className:xpe,variant:"normal",fontWeight:"medium",color:"text50",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)})})});const[t2,A_e]=In("Tooltip",[Jd]);Jd();const wpe="TooltipProvider";t2(wpe);const OF="Tooltip";t2(OF);const Epe="TooltipPortal";t2(Epe,{forceMount:void 0});t2(OF,{isInside:!1});const RF=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${$A.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${$A.lg}px)`);if(!t.startsWith("@media")){const c=r.get(t);if(!c||c==="")throw new Error(`useMediaQuery failed to get breakpoint from theme for: ${t}`);t=c}const n=t.replace(/^@media( ?)/m,""),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:s=!1}=e,[o,a]=x.useState(()=>i?window.matchMedia(n).matches:s);return x.useEffect(()=>{let c=!0;if(!i)return;const l=window.matchMedia(n),u=()=>{c&&a(l.matches)};return u(),l.addListener(u),()=>{c=!1,l.removeListener(u)}},[n,i]),o};function Cpe(t={}){const{nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n}=t,[i,s]=x.useState(!1),o=x.useRef(r);o.current=r;const a=x.useRef(n);return a.current=n,x.useEffect(()=>{const c=document.createElement("script");return c.src="https://accounts.google.com/gsi/client",c.async=!0,c.defer=!0,c.nonce=e,c.onload=()=>{var l;s(!0),(l=o.current)===null||l===void 0||l.call(o)},c.onerror=()=>{var l;s(!1),(l=a.current)===null||l===void 0||l.call(a)},document.body.appendChild(c),()=>{document.body.removeChild(c)}},[e]),i}const $F=x.createContext(null);function Spe({clientId:t,nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n,children:i}){const s=Cpe({nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n}),o=x.useMemo(()=>({clientId:t,scriptLoadedSuccessfully:s}),[t,s]);return g.createElement($F.Provider,{value:o},i)}function kpe(){const t=x.useContext($F);if(!t)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return t}function Ape(t){var e;return(e=t==null?void 0:t.clientId)!==null&&e!==void 0?e:t==null?void 0:t.client_id}const _pe={large:40,medium:32,small:20};function Ppe({onSuccess:t,onError:e,useOneTap:r,promptMomentNotification:n,type:i="standard",theme:s="outline",size:o="large",text:a,shape:c,logo_alignment:l,width:u,locale:f,click_listener:d,containerProps:h,...p}){const m=x.useRef(null),{clientId:v,scriptLoadedSuccessfully:y}=kpe(),b=x.useRef(t);b.current=t;const E=x.useRef(e);E.current=e;const S=x.useRef(n);return S.current=n,x.useEffect(()=>{var P,M,L,j,H,K,Q,Y,F;if(y)return(L=(M=(P=window==null?void 0:window.google)===null||P===void 0?void 0:P.accounts)===null||M===void 0?void 0:M.id)===null||L===void 0||L.initialize({client_id:v,callback:w=>{var k;if(!(w!=null&&w.credential))return(k=E.current)===null||k===void 0?void 0:k.call(E);const{credential:R,select_by:N}=w;b.current({credential:R,clientId:Ape(w),select_by:N})},...p}),(K=(H=(j=window==null?void 0:window.google)===null||j===void 0?void 0:j.accounts)===null||H===void 0?void 0:H.id)===null||K===void 0||K.renderButton(m.current,{type:i,theme:s,size:o,text:a,shape:c,logo_alignment:l,width:u,locale:f,click_listener:d}),r&&((F=(Y=(Q=window==null?void 0:window.google)===null||Q===void 0?void 0:Q.accounts)===null||Y===void 0?void 0:Y.id)===null||F===void 0||F.prompt(S.current)),()=>{var w,k,R;r&&((R=(k=(w=window==null?void 0:window.google)===null||w===void 0?void 0:w.accounts)===null||k===void 0?void 0:k.id)===null||R===void 0||R.cancel())}},[v,y,r,i,s,o,a,c,l,u,f]),g.createElement("div",{...h,ref:m,style:{height:_pe[o],...h==null?void 0:h.style}})}const Ipe="2.7.9",Tpe=t=>t,_4=t=>t,Ope=()=>`viem@${Ipe}`;let ye=class v3 extends Error{constructor(e,r={}){var s;super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:Ope()});const n=r.cause instanceof v3?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof v3&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://viem.sh${i}${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 MF(this,e)}};function MF(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t?MF(t.cause,e):e?null:t}class Rpe extends ye{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class $pe extends ye{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class Mpe extends ye{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class Npe extends ye{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}class NF extends ye{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class DF extends ye{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class g_ extends ye{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${e} ${n} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function eh(t,{dir:e,size:r=32}={}){return typeof t=="string"?Tc(t,{dir:e,size:r}):Dpe(t,{dir:e,size:r})}function Tc(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new DF({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function Dpe(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new DF({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;i=Do.zero&&t<=Do.nine)return t-Do.zero;if(t>=Do.A&&t<=Do.F)return t-(Do.A-10);if(t>=Do.a&&t<=Do.f)return t-(Do.a-10)}function bp(t,e={}){let r=t;e.size&&(fs(r,{size:e.size}),r=eh(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,s=new Uint8Array(i);for(let o=0,a=0;oe)throw new Npe({givenSize:Wr(t),maxSize:e})}function x_(t,e){const r=typeof e=="string"?{to:e}:e,n=r.to;return n==="number"?ga(t,r):n==="bigint"?xp(t,r):n==="string"?Upe(t,r):n==="boolean"?Fpe(t,r):bp(t,r)}function xp(t,e={}){const{signed:r}=e;e.size&&fs(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<e.toString(16).padStart(2,"0"));function ja(t,e={}){return typeof t=="number"||typeof t=="bigint"?Me(t,e):typeof t=="string"?P4(t,e):typeof t=="boolean"?LF(t,e):Us(t,e)}function LF(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(fs(r,{size:e.size}),eh(r,{size:e.size})):r}function Us(t,e={}){let r="";for(let i=0;is||ia):void 0}]},{retryCount:0})}function ba(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new nme(t.type);return`${t.name}(${r2(t.inputs,{includeName:e})})`}function r2(t,{includeName:e=!1}={}){return t?t.map(r=>Hpe(r,{includeName:e})).join(e?", ":","):""}function Hpe(t,{includeName:e}){return t.type.startsWith("tuple")?`(${r2(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class Vpe extends ye{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` -`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class w_ extends ye{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` -`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class jF extends ye{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` -`),{metaMessages:[`Params: (${r2(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class n2 extends ye{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Gpe extends ye{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class Kpe extends ye{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${Wr(r)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class Qpe extends ye{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class BF extends ye{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on 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=${e}.`].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class Ype extends ye{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class FF extends ye{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class E_ extends ye{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class rg extends ye{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class Jpe extends ye{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class Xpe extends ye{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${ba(e.abiItem)}\`, and`,`\`${r.type}\` in \`${ba(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class Zpe extends ye{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class b1 extends ye{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` -`),{metaMessages:[`Params: (${r2(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class i2 extends ye{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${ba(e,{includeName:!0})}".`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class eme extends ye{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class tme extends ye{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class rme extends ye{constructor(e){super([`Value "${e}" is not a valid array.`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class nme extends ye{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}function xa(t){return typeof t[0]=="string"?I4(t):ime(t)}function ime(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function I4(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}class Ad extends ye{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}const sme=/^0x[a-fA-F0-9]{40}$/;function wa(t){return sme.test(t)}function ng(t,e,r,{strict:n}={}){return Io(t,{strict:!1})?ome(t,e,r,{strict:n}):qF(t,e,r,{strict:n})}function UF(t,e){if(typeof e=="number"&&e>0&&e>Wr(t)-1)throw new NF({offset:e,position:"start",size:Wr(t)})}function zF(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Wr(t)!==r-e)throw new NF({offset:r,position:"end",size:Wr(t)})}function qF(t,e,r,{strict:n}={}){UF(t,e);const i=t.slice(e,r);return n&&zF(i,e,r),i}function ome(t,e,r,{strict:n}={}){UF(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&zF(i,e,r),i}function wp(t,e){if(t.length!==e.length)throw new Qpe({expectedLength:t.length,givenLength:e.length});const r=ame({params:t,values:e}),n=O4(r);return n.length===0?"0x":n}function ame({params:t,values:e}){const r=[];for(let n=0;n0?xa([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:xa(s.map(({encoded:o})=>o))}}function ume(t,{param:e}){const[,r]=e.type.split("bytes"),n=Wr(t);if(!r){let i=t;return n%32!==0&&(i=Tc(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:xa([Tc(Me(n,{size:32})),i])}}if(n!==parseInt(r))throw new Kpe({expectedSize:parseInt(r),value:t});return{dynamic:!1,encoded:Tc(t,{dir:"right"})}}function fme(t){return{dynamic:!1,encoded:Tc(LF(t))}}function dme(t,{signed:e}){return{dynamic:!1,encoded:Me(t,{size:32,signed:e})}}function hme(t){const e=P4(t),r=Math.ceil(Wr(e)/32),n=[];for(let i=0;ii))}}function R4(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const Ew="/docs/contract/encodeDeployData";function WF(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(o=>"type"in o&&o.type==="constructor");if(!i)throw new Vpe({docsPath:Ew});if(!("inputs"in i))throw new w_({docsPath:Ew});if(!i.inputs||i.inputs.length===0)throw new w_({docsPath:Ew});const s=wp(i.inputs,r);return I4([n,s])}function Mi(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}class s2 extends ye{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join(` -`),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class y3 extends ye{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class mme extends ye{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class vme extends ye{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class HF extends ye{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}function VF({chain:t,currentChainId:e}){if(!t)throw new vme;if(e!==t.id)throw new mme({chain:t,currentChainId:e})}const yme={gwei:9,wei:18},gme={ether:-9,wei:9};function GF(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function ai(t,e="wei"){return GF(t,gme[e])}class Rf extends ye{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(Rf,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Rf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class ig extends ye{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${ai(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(ig,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class g3 extends ye{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${ai(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(g3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class b3 extends ye{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(b3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class x3 extends ye{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` -`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(x3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class w3 extends ye{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(w3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class E3 extends ye{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` -`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(E3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class C3 extends ye{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(C3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class S3 extends ye{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(S3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class k3 extends ye{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(k3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class sg extends ye{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${ai(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${ai(n)} gwei`:""}).`].join(` -`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(sg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class o2 extends ye{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function $4(t,e="wei"){return GF(t,yme[e])}function Ep(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` -`)}class bme extends ye{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class xme extends ye{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Ep(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class wme extends ye{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var p;const h=Ep({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${$4(d)} ${((p=i==null?void 0:i.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ai(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ai(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ai(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].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:"TransactionExecutionError"}),this.cause=e}}class KF extends ye{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let o="Transaction";n&&s!==void 0&&(o=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(o=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(o=`Transaction at block number "${r}" at index "${s}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class QF extends ye{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class Eme extends ye{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}const ci=(t,e,r)=>JSON.stringify(t,(n,i)=>{const s=typeof i=="bigint"?i.toString():i;return typeof e=="function"?e(n,s):s},r);class I0 extends ye{constructor({body:e,details:r,headers:n,status:i,url:s}){super("HTTP request failed.",{details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${_4(s)}`,e&&`Request body: ${ci(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=i,this.url=s}}class M4 extends ye{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${_4(n)}`,`Request body: ${ci(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}}class C_ extends ye{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${_4(r)}`,`Request body: ${ci(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const Cme=-1;class hi extends ye{constructor(e,{code:r,docsPath:n,metaMessages:i,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof M4?e.code:r??Cme}}class th extends hi{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class x1 extends hi{constructor(e){super(e,{code:x1.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(x1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class w1 extends hi{constructor(e){super(e,{code:w1.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(w1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class E1 extends hi{constructor(e){super(e,{code:E1.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(E1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class C1 extends hi{constructor(e){super(e,{code:C1.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` -`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(C1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class bu extends hi{constructor(e){super(e,{code:bu.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(bu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class xu extends hi{constructor(e){super(e,{code:xu.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(xu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class S1 extends hi{constructor(e){super(e,{code:S1.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(S1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Rc extends hi{constructor(e){super(e,{code:Rc.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(Rc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class k1 extends hi{constructor(e){super(e,{code:k1.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(k1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class A1 extends hi{constructor(e){super(e,{code:A1.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(A1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class _d extends hi{constructor(e){super(e,{code:_d.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(_d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class _1 extends hi{constructor(e){super(e,{code:_1.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(_1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Ot extends th{constructor(e){super(e,{code:Ot.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(Ot,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class P1 extends th{constructor(e){super(e,{code:P1.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(P1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class I1 extends th{constructor(e){super(e,{code:I1.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(I1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class T1 extends th{constructor(e){super(e,{code:T1.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(T1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class O1 extends th{constructor(e){super(e,{code:O1.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(O1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class os extends th{constructor(e){super(e,{code:os.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(os,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Sme extends hi{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}function N4(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof ye?t.walk(i=>i.code===Rf.code):t;return n instanceof ye?new Rf({cause:t,message:n.details}):Rf.nodeMessage.test(r)?new Rf({cause:t,message:t.details}):ig.nodeMessage.test(r)?new ig({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):g3.nodeMessage.test(r)?new g3({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):b3.nodeMessage.test(r)?new b3({cause:t,nonce:e==null?void 0:e.nonce}):x3.nodeMessage.test(r)?new x3({cause:t,nonce:e==null?void 0:e.nonce}):w3.nodeMessage.test(r)?new w3({cause:t,nonce:e==null?void 0:e.nonce}):E3.nodeMessage.test(r)?new E3({cause:t}):C3.nodeMessage.test(r)?new C3({cause:t,gas:e==null?void 0:e.gas}):S3.nodeMessage.test(r)?new S3({cause:t,gas:e==null?void 0:e.gas}):k3.nodeMessage.test(r)?new k3({cause:t}):sg.nodeMessage.test(r)?new sg({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new o2({cause:t})}function kme(t,{docsPath:e,...r}){const n=(()=>{const i=N4(t,r);return i instanceof o2?t:i})();return new wme(n,{docsPath:e,...r})}function D4(t,{format:e}){if(!e)return{};const r={};function n(s){const o=Object.keys(s);for(const a of o)a in t&&(r[a]=t[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&n(s[a])}const i=e(t||{});return n(i),r}const Ame={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function a2(t){return{...t,gas:typeof t.gas<"u"?Me(t.gas):void 0,gasPrice:typeof t.gasPrice<"u"?Me(t.gasPrice):void 0,maxFeePerGas:typeof t.maxFeePerGas<"u"?Me(t.maxFeePerGas):void 0,maxPriorityFeePerGas:typeof t.maxPriorityFeePerGas<"u"?Me(t.maxPriorityFeePerGas):void 0,nonce:typeof t.nonce<"u"?Me(t.nonce):void 0,type:typeof t.type<"u"?Ame[t.type]:void 0,value:typeof t.value<"u"?Me(t.value):void 0}}function Re(t,e,r){return n=>{var i;return((i=t[e.name||r])==null?void 0:i.call(t,n))??e(t,n)}}function Cp(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:s}=t,o=e?Mi(e):void 0;if(o&&!wa(o.address))throw new Ad({address:o.address});if(s&&!wa(s))throw new Ad({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new bme;if(n&&n>2n**256n-1n)throw new ig({maxFeePerGas:n});if(i&&n&&i>n)throw new sg({maxFeePerGas:n,maxPriorityFeePerGas:i})}async function R1(t){const e=await t.request({method:"eth_chainId"});return ga(e)}class _me extends ye{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class L4 extends ye{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class Pme extends ye{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${ai(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class YF extends ye{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const JF={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function XF(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?ga(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?ga(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?JF[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return e.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}function ZF(t){var r;const e=(r=t.transactions)==null?void 0:r.map(n=>typeof n=="string"?n:XF(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}async function Gc(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,d;const s=n??"latest",o=i??!1,a=r!==void 0?Me(r):void 0;let c=null;if(e?c=await t.request({method:"eth_getBlockByHash",params:[e,o]}):c=await t.request({method:"eth_getBlockByNumber",params:[a||s,o]}),!c)throw new YF({blockHash:e,blockNumber:r});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:d.format)||ZF)(c)}async function j4(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function Ime(t,e){return eU(t,e)}async function eU(t,e){var s,o,a;const{block:r,chain:n=t.chain,request:i}=e||{};if(typeof((s=n==null?void 0:n.fees)==null?void 0:s.defaultPriorityFee)=="function"){const c=r||await Re(t,Gc,"getBlock")({});return n.fees.defaultPriorityFee({block:c,client:t,request:i})}if(typeof((o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee)<"u")return(a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee;try{const c=await t.request({method:"eth_maxPriorityFeePerGas"});return xp(c)}catch{const[c,l]=await Promise.all([r?Promise.resolve(r):Re(t,Gc,"getBlock")({}),Re(t,j4,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new L4;const u=l-c.baseFeePerGas;return u<0n?0n:u}}async function Tme(t,e){return A3(t,e)}async function A3(t,e){var d,h;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>{var p,m;return typeof((p=n==null?void 0:n.fees)==null?void 0:p.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((m=n==null?void 0:n.fees)==null?void 0:m.baseFeeMultiplier)??1.2})();if(o<1)throw new _me;const c=10**(((d=o.toString().split(".")[1])==null?void 0:d.length)??0),l=p=>p*BigInt(Math.ceil(o*c))/BigInt(c),u=r||await Re(t,Gc,"getBlock")({});if(typeof((h=n==null?void 0:n.fees)==null?void 0:h.estimateFeesPerGas)=="function")return n.fees.estimateFeesPerGas({block:r,client:t,multiply:l,request:i,type:s});if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new L4;const p=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await eU(t,{block:u,chain:n,request:i}),m=l(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??m+p,maxPriorityFeePerGas:p}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await Re(t,j4,"getGasPrice")({}))}}class Ome extends ye{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var p;const h=Ep({from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${$4(d)} ${((p=i==null?void 0:i.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ai(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ai(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ai(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].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:"EstimateGasExecutionError"}),this.cause=e}}function Rme(t,{docsPath:e,...r}){const n=(()=>{const i=N4(t,r);return i instanceof o2?t:i})();return new Ome(n,{docsPath:e,...r})}async function c2(t,e){var i,s,o;const r=e.account??t.account,n=r?Mi(r):void 0;try{const{accessList:a,blockNumber:c,blockTag:l,data:u,gas:f,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:m,to:v,value:y,...b}=(n==null?void 0:n.type)==="local"?await l2(t,e):e,S=(c?Me(c):void 0)||l;Cp(e);const P=(o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format,L=(P||a2)({...D4(b,{format:P}),from:n==null?void 0:n.address,accessList:a,data:u,gas:f,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:m,to:v,value:y}),j=await t.request({method:"eth_estimateGas",params:S?[L,S]:[L]});return BigInt(j)}catch(a){throw Rme(a,{...e,account:n,chain:t.chain})}}async function tU(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?Me(n):r]});return ga(i)}function $me(t){if(t.type)return t.type;if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new xme({transaction:t})}async function l2(t,e){const{account:r=t.account,chain:n,gas:i,nonce:s,parameters:o=["fees","gas","nonce","type"],type:a}=e,c=r?Mi(r):void 0,l=await Re(t,Gc,"getBlock")({blockTag:"latest"}),u={...e,...c?{from:c==null?void 0:c.address}:{}};if(o.includes("nonce")&&typeof s>"u"&&c&&(u.nonce=await Re(t,tU,"getTransactionCount")({address:c.address,blockTag:"pending"})),(o.includes("fees")||o.includes("type"))&&typeof a>"u")try{u.type=$me(u)}catch{u.type=typeof l.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(o.includes("fees"))if(u.type==="eip1559"){const{maxFeePerGas:f,maxPriorityFeePerGas:d}=await A3(t,{block:l,chain:n,request:u});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(u.gas=await Re(t,c2,"estimateGas")({...u,account:c?{address:c.address,type:"json-rpc"}:void 0})),Cp(u),delete u.parameters,u}async function B4(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}async function u2(t,e){var m,v,y,b;const{account:r=t.account,chain:n=t.chain,accessList:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...h}=e;if(!r)throw new s2({docsPath:"/docs/actions/wallet/sendTransaction"});const p=Mi(r);try{Cp(e);let E;if(n!==null&&(E=await Re(t,R1,"getChainId")({}),VF({currentChainId:E,chain:n})),p.type==="local"){const L=await Re(t,l2,"prepareTransactionRequest")({account:p,accessList:i,chain:n,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...h});E||(E=await Re(t,R1,"getChainId")({}));const j=(m=n==null?void 0:n.serializers)==null?void 0:m.transaction,H=await p.signTransaction({...L,chainId:E},{serializer:j});return await Re(t,B4,"sendRawTransaction")({serializedTransaction:H})}const S=(b=(y=(v=t.chain)==null?void 0:v.formatters)==null?void 0:y.transactionRequest)==null?void 0:b.format,M=(S||a2)({...D4(h,{format:S}),accessList:i,data:s,from:p.address,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d});return await t.request({method:"eth_sendTransaction",params:[M]},{retryCount:0})}catch(E){throw kme(E,{...e,account:p,chain:e.chain||void 0})}}function Mme(t,e){const{abi:r,args:n,bytecode:i,...s}=e,o=WF({abi:r,args:n,bytecode:i});return u2(t,{...s,data:o})}const _3=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],rU=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],nU=[...rU,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Nme=[...rU,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],S_=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],k_=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],Dme=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}];function A_(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function iU(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function __(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Lme(t,e){iU(t);const r=e.outputLen;if(t.length>P_&km)}:{h:Number(t>>P_&km)|0,l:Number(t&km)|0}}function Bme(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,Ume=(t,e,r)=>e<>>32-r,zme=(t,e,r)=>e<>>64-r,qme=(t,e,r)=>t<>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Wme=t=>t instanceof Uint8Array,Hme=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Vme=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Vme)throw new Error("Non little-endian hardware is not supported");function Gme(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function sU(t){if(typeof t=="string"&&(t=Gme(t)),!Wme(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}class Kme{clone(){return this._cloneInto()}}function Qme(t){const e=n=>t().update(sU(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}const[oU,aU,cU]=[[],[],[]],Yme=BigInt(0),Dh=BigInt(1),Jme=BigInt(2),Xme=BigInt(7),Zme=BigInt(256),eve=BigInt(113);for(let t=0,e=Dh,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],oU.push(2*(5*n+r)),aU.push((t+1)*(t+2)/2%64);let i=Yme;for(let s=0;s<7;s++)e=(e<>Xme)*eve)%Zme,e&Jme&&(i^=Dh<<(Dh<r>32?zme(t,e,r):Fme(t,e,r),T_=(t,e,r)=>r>32?qme(t,e,r):Ume(t,e,r);function nve(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],u=r[c+1],f=I_(l,u,1)^r[a],d=T_(l,u,1)^r[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=aU[o],c=I_(i,s,a),l=T_(i,s,a),u=oU[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=tve[n],t[1]^=rve[n]}r.fill(0)}class F4 extends Kme{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,A_(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Hme(this.state)}keccak(){nve(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){__(this);const{blockLen:r,state:n}=this;e=sU(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return A_(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Lme(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new F4(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const ive=(t,e,r)=>Qme(()=>new F4(e,t,r)),sve=ive(1,136,256/8);function ti(t,e){const r=e||"hex",n=sve(Io(t,{strict:!1})?gu(t):t);return r==="bytes"?n:ja(n)}function U4(t,e){const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=ti(sa(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&i[s]&&(i[s]=i[s].toUpperCase()),(n[s>>1]&15)>=8&&i[s+1]&&(i[s+1]=i[s+1].toUpperCase());return`0x${i.join("")}`}function ri(t,e){if(!wa(t))throw new Ad({address:t});return U4(t,e)}class O_ extends ye{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class lU extends ye{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class ove extends ye{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const ave={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new ove({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new lU({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new O_({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new O_({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===1/0)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function cve(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(ave);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function lve(t,e={}){typeof e.size<"u"&&fs(t,{size:e.size});const r=Us(t,e);return xp(r,e)}function uve(t,e={}){let r=t;if(typeof e.size<"u"&&(fs(r,{size:e.size}),r=Oc(r)),r.length>1||r[0]>1)throw new $pe(r);return!!r[0]}function oa(t,e={}){typeof e.size<"u"&&fs(t,{size:e.size});const r=Us(t,e);return ga(r,e)}function fve(t,e={}){let r=t;return typeof e.size<"u"&&(fs(r,{size:e.size}),r=Oc(r,{dir:"right"})),new TextDecoder().decode(r)}function f2(t,e){const r=typeof e=="string"?bp(e):e,n=cve(r);if(Wr(r)===0&&t.length>0)throw new n2;if(Wr(e)&&Wr(e)<32)throw new jF({data:typeof e=="string"?e:Us(e),params:t,size:Wr(e)});let i=0;const s=[];for(let o=0;o48?lve(i,{signed:r}):oa(i,{signed:r}),32]}function yve(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if($1(e)){const o=oa(t.readBytes(P3)),a=r+o;for(let c=0;c(\[(\d*)\])*)$/;function I3(t){let e=t.type;if($_.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;iti(gu(t));function Eve(t){return wve(t)}function Cve(t){let e=!0,r="",n=0,i="",s=!1;for(let o=0;o{const e=typeof t=="string"?t:xve(t);return Cve(e)};function uU(t){return Eve(Sve(t))}const z4=uU,q4=t=>ng(uU(t),0,4);function Sp(t){const{abi:e,args:r=[],name:n}=t,i=Io(n,{strict:!1}),s=e.filter(a=>i?a.type==="function"?q4(a)===n:a.type==="event"?z4(a)===n:!1:"name"in a&&a.name===n);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const a of s){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((l,u)=>{const f="inputs"in a&&a.inputs[u];return f?T3(l,f):!1})){if(o&&"inputs"in o&&o.inputs){const l=fU(a.inputs,o.inputs,r);if(l)throw new Xpe({abiItem:a,type:l[0]},{abiItem:o,type:l[1]})}o=a}}return o||s[0]}function T3(t,e){const r=typeof t,n=e.type;switch(n){case"address":return wa(t);case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>T3(Object.values(t)[s],i)):/^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)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>T3(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function fU(t,e,r){for(const n in t){const i=t[n],s=e[n];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return fU(i.components,s.components,r[n]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")||o.includes("address")&&o.includes("bytes")?wa(r[n]):!1)return o}}const Cw="/docs/contract/decodeFunctionResult";function rh(t){const{abi:e,args:r,functionName:n,data:i}=t;let s=e[0];if(n){const a=Sp({abi:e,args:r,name:n});if(!a)throw new rg(n,{docsPath:Cw});s=a}if(s.type!=="function")throw new rg(void 0,{docsPath:Cw});if(!s.outputs)throw new Jpe(s.name,{docsPath:Cw});const o=f2(s.outputs,i);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const M_="/docs/contract/encodeFunctionData";function fl(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const c=Sp({abi:e,args:r,name:n});if(!c)throw new rg(n,{docsPath:M_});i=c}if(i.type!=="function")throw new rg(void 0,{docsPath:M_});const s=ba(i),o=q4(s),a="inputs"in i&&i.inputs?wp(i.inputs,r??[]):void 0;return I4([o,a??"0x"])}function nh({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new y3({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new y3({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}const dU={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},kve={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Ave={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function _ve(t){const{abi:e,data:r}=t,n=ng(r,0,4);if(n==="0x")throw new n2;const s=[...e||[],kve,Ave].find(o=>o.type==="error"&&n===q4(ba(o)));if(!s)throw new BF(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?f2(s.inputs,ng(r,4)):void 0,errorName:s.name}}function hU({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?ci(e[s]):e[s]}`).join(", ")})`}class Pve extends ye{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class Ive extends ye{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function N_(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} -`,"")}function Tve(t){return t.reduce((e,{address:r,...n})=>{let i=`${e} ${r}: +Defaulting to \`null\`.`}const WB="Radio",[Vhe,HB]=In(WB),[Ghe,Khe]=Vhe(WB),Qhe=w.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:c,...l}=t,[u,f]=w.useState(null),d=Lt(e,m=>f(m)),h=w.useRef(!1),p=u?!!u.closest("form"):!0;return w.createElement(Ghe,{scope:r,checked:i,disabled:o},w.createElement(Xe.button,mt({type:"button",role:"radio","aria-checked":i,"data-state":VB(i),"data-disabled":o?"":void 0,disabled:o,value:a},l,{ref:d,onClick:_e(t.onClick,m=>{i||c==null||c(),p&&(h.current=m.isPropagationStopped(),h.current||m.stopPropagation())})})),p&&w.createElement(Xhe,{control:u,bubbles:!h.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}}))}),Yhe="RadioIndicator",Jhe=w.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=Khe(Yhe,r);return w.createElement(Ra,{present:n||s.checked},w.createElement(Xe.span,mt({"data-state":VB(s.checked),"data-disabled":s.disabled?"":void 0},i,{ref:e})))}),Xhe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=w.useRef(null),o=kb(r),a=Ab(e);return w.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),w.createElement("input",mt({type:"radio","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function VB(t){return t?"checked":"unchecked"}const Zhe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],GB="RadioGroup",[e0e,MAe]=In(GB,[qd,HB]),KB=qd(),QB=HB(),[t0e,r0e]=e0e(GB),n0e=w.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:c,dir:l,loop:u=!0,onValueChange:f,...d}=t,h=KB(r),p=Rb(l),[m,v]=fa({prop:s,defaultProp:i,onChange:f});return w.createElement(t0e,{scope:r,name:n,required:o,disabled:a,value:m,onValueChange:v},w.createElement(uB,mt({asChild:!0},h,{orientation:c,dir:p,loop:u}),w.createElement(Xe.div,mt({role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:p},d,{ref:e}))))}),i0e="RadioGroupItem",s0e=w.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=r0e(i0e,r),o=s.disabled||n,a=KB(r),c=QB(r),l=w.useRef(null),u=Lt(e,l),f=s.value===i.value,d=w.useRef(!1);return w.useEffect(()=>{const h=m=>{Zhe.includes(m.key)&&(d.current=!0)},p=()=>d.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),w.createElement(o4,mt({asChild:!0},a,{focusable:!o,active:f}),w.createElement(Qhe,mt({disabled:o,required:s.required,checked:f},c,i,{name:s.name,ref:u,onCheck:()=>s.onValueChange(i.value),onKeyDown:_e(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:_e(i.onFocus,()=>{var h;d.current&&((h=l.current)===null||h===void 0||h.click())})})))}),o0e=w.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=QB(r);return w.createElement(Jhe,mt({},i,n,{ref:e}))}),a0e=n0e,c0e=s0e,l0e=o0e;var u0e=Er({defaultClassName:"io59uy3 io59uy0 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1so fyvr1uk fyvr1wg fyvr1yc fyvr12nd fyvr12g1 fyvr121d fyvr128p fyvr12nj fyvr12g7 fyvr121j fyvr128v fyvr11od fyvr12v7 fyvr12v3 fyvr12vz fyvr12vr",variantClassNames:{size:{sm:"io59uy4 io59uy1 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8",lg:"io59uy5 io59uy2 fyvr11ac fyvr11ao fyvr11b0 fyvr11bc"}},defaultVariants:{},compoundVariants:[]}),f0e=Er({defaultClassName:"io59uy8 io59uy7 io59uy6 fyvr11h0 fyvr11ko fyvr11jg fyvr11hw fyvr128 fyvr15o fyvr12s1",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]});const d0e=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return X.jsx(q,{alignItems:"center",children:X.jsx(Eu,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:X.jsx(c0e,{className:u0e({size:n}),value:i,id:e,disabled:s,children:X.jsx(l0e,{className:f0e({size:n})})})})})};w.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...c}=t;return X.jsx(a0e,{disabled:n,name:s,ref:e,...c,children:X.jsx(q,{flexDirection:r,gap:i,children:o.map(({label:l,value:u,disabled:f})=>X.jsx(d0e,{id:`${s}-${u}`,label:l,size:a,value:u,disabled:f},u))})})});function QA(t,[e,r]){return Math.min(r,Math.max(e,t))}const YB=w.forwardRef((t,e)=>w.createElement(Xe.span,Fe({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),h0e=[" ","Enter","ArrowUp","ArrowDown"],p0e=[" ","Enter"],Bb="Select",[Fb,u4,m0e]=Ob(Bb),[Wd,NAe]=In(Bb,[m0e,zd]),f4=zd(),[v0e,Au]=Wd(Bb),[y0e,g0e]=Wd(Bb),b0e=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:f,disabled:d,required:h}=t,p=f4(e),[m,v]=w.useState(null),[y,b]=w.useState(null),[E,S]=w.useState(!1),P=Rb(l),[M=!1,L]=fa({prop:n,defaultProp:i,onChange:s}),[j,H]=fa({prop:o,defaultProp:a,onChange:c}),K=w.useRef(null),Q=m?!!m.closest("form"):!0,[Y,F]=w.useState(new Set),x=Array.from(Y).map(k=>k.props.value).join(";");return w.createElement(Afe,p,w.createElement(v0e,{required:h,scope:e,trigger:m,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:ta(),value:j,onValueChange:H,open:M,onOpenChange:L,dir:P,triggerPointerDownPosRef:K,disabled:d},w.createElement(Fb.Provider,{scope:e},w.createElement(y0e,{scope:t.__scopeSelect,onNativeOptionAdd:w.useCallback(k=>{F(R=>new Set(R).add(k))},[]),onNativeOptionRemove:w.useCallback(k=>{F(R=>{const N=new Set(R);return N.delete(k),N})},[])},r)),Q?w.createElement(ZB,{key:x,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:j,onChange:k=>H(k.target.value),disabled:d},j===void 0?w.createElement("option",{value:""}):null,Array.from(Y)):null))},x0e="SelectTrigger",w0e=w.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=f4(r),o=Au(x0e,r),a=o.disabled||n,c=Lt(e,o.onTriggerChange),l=u4(r),[u,f,d]=eF(p=>{const m=l().filter(b=>!b.disabled),v=m.find(b=>b.value===o.value),y=tF(m,p,v);y!==void 0&&o.onValueChange(y.value)}),h=()=>{a||(o.onOpenChange(!0),d())};return w.createElement(_fe,Fe({asChild:!0},s),w.createElement(Xe.button,Fe({type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":XB(o.value)?"":void 0},i,{ref:c,onClick:_e(i.onClick,p=>{p.currentTarget.focus()}),onPointerDown:_e(i.onPointerDown,p=>{const m=p.target;m.hasPointerCapture(p.pointerId)&&m.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&(h(),o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)},p.preventDefault())}),onKeyDown:_e(i.onKeyDown,p=>{const m=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(m&&p.key===" ")&&h0e.includes(p.key)&&(h(),p.preventDefault())})})))}),E0e="SelectValue",C0e=w.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=Au(E0e,r),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,f=Lt(e,c.onValueNodeChange);return Ai(()=>{l(u)},[l,u]),w.createElement(Xe.span,Fe({},a,{ref:f,style:{pointerEvents:"none"}}),XB(c.value)?w.createElement(w.Fragment,null,o):s)}),S0e=w.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return w.createElement(Xe.span,Fe({"aria-hidden":!0},i,{ref:e}),n||"▼")}),vd="SelectContent",k0e=w.forwardRef((t,e)=>{const r=Au(vd,t.__scopeSelect),[n,i]=w.useState();if(Ai(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?Fs.createPortal(w.createElement(JB,{scope:t.__scopeSelect},w.createElement(Fb.Slot,{scope:t.__scopeSelect},w.createElement("div",null,t.children))),s):null}return w.createElement(A0e,Fe({},t,{ref:e}))}),Bo=10,[JB,Ub]=Wd(vd),A0e=w.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v,...y}=t,b=Au(vd,r),[E,S]=w.useState(null),[P,M]=w.useState(null),L=Lt(e,G=>S(G)),[j,H]=w.useState(null),[K,Q]=w.useState(null),Y=u4(r),[F,x]=w.useState(!1),k=w.useRef(!1);w.useEffect(()=>{if(E)return dB(E)},[E]),Wj();const R=w.useCallback(G=>{const[J,...ee]=Y().map(oe=>oe.ref.current),[se]=ee.slice(-1),ie=document.activeElement;for(const oe of G)if(oe===ie||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===J&&P&&(P.scrollTop=0),oe===se&&P&&(P.scrollTop=P.scrollHeight),oe==null||oe.focus(),document.activeElement!==ie))return},[Y,P]),N=w.useCallback(()=>R([j,E]),[R,j,E]);w.useEffect(()=>{F&&N()},[F,N]);const{onOpenChange:A,triggerPointerDownPosRef:O}=b;w.useEffect(()=>{if(E){let G={x:0,y:0};const J=se=>{var ie,oe,be,he;G={x:Math.abs(Math.round(se.pageX)-((ie=(oe=O.current)===null||oe===void 0?void 0:oe.x)!==null&&ie!==void 0?ie:0)),y:Math.abs(Math.round(se.pageY)-((be=(he=O.current)===null||he===void 0?void 0:he.y)!==null&&be!==void 0?be:0))}},ee=se=>{G.x<=10&&G.y<=10?se.preventDefault():E.contains(se.target)||A(!1),document.removeEventListener("pointermove",J),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ee,{capture:!0})}}},[E,A,O]),w.useEffect(()=>{const G=()=>A(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[A]);const[B,I]=eF(G=>{const J=Y().filter(ie=>!ie.disabled),ee=J.find(ie=>ie.ref.current===document.activeElement),se=tF(J,G,ee);se&&setTimeout(()=>se.ref.current.focus())}),C=w.useCallback((G,J,ee)=>{const se=!k.current&&!ee;(b.value!==void 0&&b.value===J||se)&&(H(G),se&&(k.current=!0))},[b.value]),D=w.useCallback(()=>E==null?void 0:E.focus(),[E]),z=w.useCallback((G,J,ee)=>{const se=!k.current&&!ee;(b.value!==void 0&&b.value===J||se)&&Q(G)},[b.value]),_=n==="popper"?YA:_0e,W=_===YA?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:m,avoidCollisions:v}:{};return w.createElement(JB,{scope:r,content:E,viewport:P,onViewportChange:M,itemRefCallback:C,selectedItem:j,onItemLeave:D,itemTextRefCallback:z,focusSelectedItem:N,selectedItemText:K,position:n,isPositioned:F,searchRef:B},w.createElement(wB,{as:pd,allowPinchZoom:!0},w.createElement(Hj,{asChild:!0,trapped:b.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:_e(i,G=>{var J;(J=b.trigger)===null||J===void 0||J.focus({preventScroll:!0}),G.preventDefault()})},w.createElement(XC,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>b.onOpenChange(!1)},w.createElement(_,Fe({role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:G=>G.preventDefault()},y,W,{onPlaced:()=>x(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:_e(y.onKeyDown,G=>{const J=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!J&&G.key.length===1&&I(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let se=Y().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(G.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const ie=G.target,oe=se.indexOf(ie);se=se.slice(oe+1)}setTimeout(()=>R(se)),G.preventDefault()}})}))))))}),_0e=w.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=Au(vd,r),o=Ub(vd,r),[a,c]=w.useState(null),[l,u]=w.useState(null),f=Lt(e,L=>u(L)),d=u4(r),h=w.useRef(!1),p=w.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=o,E=w.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&m&&v&&y){const L=s.trigger.getBoundingClientRect(),j=l.getBoundingClientRect(),H=s.valueNode.getBoundingClientRect(),K=y.getBoundingClientRect();if(s.dir!=="rtl"){const ie=K.left-j.left,oe=H.left-ie,be=L.left-oe,he=L.width+be,ve=Math.max(he,j.width),$e=window.innerWidth-Bo,ge=QA(oe,[Bo,$e-ve]);a.style.minWidth=he+"px",a.style.left=ge+"px"}else{const ie=j.right-K.right,oe=window.innerWidth-H.right-ie,be=window.innerWidth-L.right-oe,he=L.width+be,ve=Math.max(he,j.width),$e=window.innerWidth-Bo,ge=QA(oe,[Bo,$e-ve]);a.style.minWidth=he+"px",a.style.right=ge+"px"}const Q=d(),Y=window.innerHeight-Bo*2,F=m.scrollHeight,x=window.getComputedStyle(l),k=parseInt(x.borderTopWidth,10),R=parseInt(x.paddingTop,10),N=parseInt(x.borderBottomWidth,10),A=parseInt(x.paddingBottom,10),O=k+R+F+A+N,B=Math.min(v.offsetHeight*5,O),I=window.getComputedStyle(m),C=parseInt(I.paddingTop,10),D=parseInt(I.paddingBottom,10),z=L.top+L.height/2-Bo,_=Y-z,W=v.offsetHeight/2,G=v.offsetTop+W,J=k+R+G,ee=O-J;if(J<=z){const ie=v===Q[Q.length-1].ref.current;a.style.bottom="0px";const oe=l.clientHeight-m.offsetTop-m.offsetHeight,be=Math.max(_,W+(ie?D:0)+oe+N),he=J+be;a.style.height=he+"px"}else{const ie=v===Q[0].ref.current;a.style.top="0px";const be=Math.max(z,k+m.offsetTop+(ie?C:0)+W)+ee;a.style.height=be+"px",m.scrollTop=J-z+m.offsetTop}a.style.margin=`${Bo}px 0`,a.style.minHeight=B+"px",a.style.maxHeight=Y+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[d,s.trigger,s.valueNode,a,l,m,v,y,s.dir,n]);Ai(()=>E(),[E]);const[S,P]=w.useState();Ai(()=>{l&&P(window.getComputedStyle(l).zIndex)},[l]);const M=w.useCallback(L=>{L&&p.current===!0&&(E(),b==null||b(),p.current=!1)},[E,b]);return w.createElement(P0e,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:M},w.createElement("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S}},w.createElement(Xe.div,Fe({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),YA=w.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Bo,...s}=t,o=f4(r);return w.createElement(Pfe,Fe({},o,s,{ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[P0e,I0e]=Wd(vd,{}),JA="SelectViewport",T0e=w.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=Ub(JA,r),s=I0e(JA,r),o=Lt(e,i.onViewportChange),a=w.useRef(0);return w.createElement(w.Fragment,null,w.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),w.createElement(Fb.Slot,{scope:r},w.createElement(Xe.div,Fe({"data-radix-select-viewport":"",role:"presentation"},n,{ref:o,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:_e(n.onScroll,c=>{const l=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&u){const d=Math.abs(a.current-l.scrollTop);if(d>0){const h=window.innerHeight-Bo*2,p=parseFloat(u.style.minHeight),m=parseFloat(u.style.height),v=Math.max(p,m);if(v0?E:0,u.style.justifyContent="flex-end")}}}a.current=l.scrollTop})}))))}),O0e="SelectGroup",[R0e,DAe]=Wd(O0e),$0e=w.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=ta();return w.createElement(R0e,{scope:r,id:i},w.createElement(Xe.div,Fe({role:"group","aria-labelledby":i},n,{ref:e})))}),e3="SelectItem",[M0e,N0e]=Wd(e3),D0e=w.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=Au(e3,r),c=Ub(e3,r),l=a.value===n,[u,f]=w.useState(s??""),[d,h]=w.useState(!1),p=Lt(e,y=>{var b;return(b=c.itemRefCallback)===null||b===void 0?void 0:b.call(c,y,n,i)}),m=ta(),v=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return w.createElement(M0e,{scope:r,value:n,disabled:i,textId:m,isSelected:l,onItemTextChange:w.useCallback(y=>{f(b=>{var E;return b||((E=y==null?void 0:y.textContent)!==null&&E!==void 0?E:"").trim()})},[])},w.createElement(Fb.ItemSlot,{scope:r,value:n,disabled:i,textValue:u},w.createElement(Xe.div,Fe({role:"option","aria-labelledby":m,"data-highlighted":d?"":void 0,"aria-selected":l&&d,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},o,{ref:p,onFocus:_e(o.onFocus,()=>h(!0)),onBlur:_e(o.onBlur,()=>h(!1)),onPointerUp:_e(o.onPointerUp,v),onPointerMove:_e(o.onPointerMove,y=>{if(i){var b;(b=c.onItemLeave)===null||b===void 0||b.call(c)}else y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(o.onPointerLeave,y=>{if(y.currentTarget===document.activeElement){var b;(b=c.onItemLeave)===null||b===void 0||b.call(c)}}),onKeyDown:_e(o.onKeyDown,y=>{var b;((b=c.searchRef)===null||b===void 0?void 0:b.current)!==""&&y.key===" "||(p0e.includes(y.key)&&v(),y.key===" "&&y.preventDefault())})}))))}),dm="SelectItemText",L0e=w.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=Au(dm,r),a=Ub(dm,r),c=N0e(dm,r),l=g0e(dm,r),[u,f]=w.useState(null),d=Lt(e,y=>f(y),c.onItemTextChange,y=>{var b;return(b=a.itemTextRefCallback)===null||b===void 0?void 0:b.call(a,y,c.value,c.disabled)}),h=u==null?void 0:u.textContent,p=w.useMemo(()=>w.createElement("option",{key:c.value,value:c.value,disabled:c.disabled},h),[c.disabled,c.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=l;return Ai(()=>(m(p),()=>v(p)),[m,v,p]),w.createElement(w.Fragment,null,w.createElement(Xe.span,Fe({id:c.textId},s,{ref:d})),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Fs.createPortal(s.children,o.valueNode):null)});function XB(t){return t===""||t===void 0}const ZB=w.forwardRef((t,e)=>{const{value:r,...n}=t,i=w.useRef(null),s=Lt(e,i),o=kb(r);return w.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&u){const f=new Event("change",{bubbles:!0});u.call(a,r),a.dispatchEvent(f)}},[o,r]),w.createElement(YB,{asChild:!0},w.createElement("select",Fe({},n,{ref:s,defaultValue:r})))});ZB.displayName="BubbleSelect";function eF(t){const e=rs(t),r=w.useRef(""),n=w.useRef(0),i=w.useCallback(o=>{const a=r.current+o;e(a),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=w.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function tF(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=j0e(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function j0e(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const B0e=b0e,F0e=w0e,U0e=C0e,z0e=S0e,q0e=k0e,W0e=T0e,H0e=$0e,V0e=D0e,G0e=L0e;var K0e="gohwum1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 gohwum0 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11od fyvr11hc fyvr11f4 fyvr12s1 fyvr118c fyvr11jw fyvr11n4 fyvr12v7 fyvr12o1",Q0e=Er({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"gohwum6 gohwum2 fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"gohwum7 gohwum3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"gohwum8 gohwum4 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]}),Y0e="gohwuma gohwum9 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ls fyvr11m8 fyvr11ms fyvr11tv fyvr12s1 fyvr11nl",J0e="gohwume _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 gohwumd fyvr1ww fyvr1ys fyvr1t0 fyvr1uw fyvr12ws fyvr12wt fyvr12wm fyvr12wn fyvr11h0 fyvr11jw fyvr11ko fyvr12v7 fyvr12v3 fyvr12s1 fyvr12w1 fyvr12vr";const X0e=w.forwardRef(({children:t,className:e,...r},n)=>X.jsx(V0e,{className:fi(J0e,e),...r,ref:n,children:X.jsx(G0e,{children:t})})),Z0e=w.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:c,options:l,placeholder:u,...f}=t;return X.jsx(Eu,{disabled:n,display:"grid",id:i??c,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:X.jsxs(B0e,{disabled:n,name:c,...f,children:[X.jsxs(F0e,{id:i??c,className:fi(K0e,Q0e({borderRadius:r})),ref:e,children:[X.jsx(U0e,{placeholder:u}),X.jsx(q,{as:z0e,display:"inline-flex",children:X.jsx(QC,{})})]}),X.jsx(q0e,{className:Y0e,children:X.jsx(W0e,{children:X.jsx(H0e,{children:l.map(({value:d,label:h,...p})=>X.jsx(X0e,{value:d,...p,children:h},d))})})})]})})});w.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,c=o?X.jsx(Ao,{icon:Cu,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return X.jsx(sl,{ref:e,name:s,leftIcon:Ib,controls:r||c,placeholder:i,value:o,onChange:l=>n==null?void 0:n(l),...a})});var e1e=Er({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const Fc=w.forwardRef((t,e)=>{const{size:r="md",...n}=t;return X.jsx(q,{className:e1e({size:r}),color:"text50",ref:e,...n,children:X.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[X.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),X.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});w.forwardRef(({children:t},e)=>X.jsx(q,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));const rF="Switch",[t1e,LAe]=In(rF),[r1e,n1e]=t1e(rF),i1e=w.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=w.useState(null),h=Lt(e,b=>d(b)),p=w.useRef(!1),m=f?!!f.closest("form"):!0,[v=!1,y]=fa({prop:i,defaultProp:s,onChange:l});return w.createElement(r1e,{scope:r,checked:v,disabled:a},w.createElement(Xe.button,mt({type:"button",role:"switch","aria-checked":v,"aria-required":o,"data-state":nF(v),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:h,onClick:_e(t.onClick,b=>{y(E=>!E),m&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})),m&&w.createElement(a1e,{control:f,bubbles:!p.current,name:n,value:c,checked:v,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),s1e="SwitchThumb",o1e=w.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=n1e(s1e,r);return w.createElement(Xe.span,mt({"data-state":nF(i.checked),"data-disabled":i.disabled?"":void 0},n,{ref:e}))}),a1e=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=w.useRef(null),o=kb(r),a=Ab(e);return w.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),w.createElement("input",mt({type:"checkbox","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function nF(t){return t?"checked":"unchecked"}const c1e=i1e,l1e=o1e;var u1e="_1lp2u8e1 _1lp2u8e0 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1ss fyvr1uo fyvr1wk fyvr1yg fyvr11t1 fyvr11hw fyvr12v7 fyvr12o1",f1e="_1lp2u8e3 _1lp2u8e2 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ho fyvr1ko fyvr1oo fyvr1k fyvr140 fyvr11o1";const t3=t=>{const{disabled:e,label:r,labelLocation:n="left",description:i,id:s,name:o,...a}=t;return X.jsx(Eu,{disabled:e,display:"flex",id:s??o,label:r,labelLocation:n,description:i,whiteSpace:"nowrap",children:X.jsx(c1e,{className:u1e,disabled:e,...a,children:X.jsx(q,{position:"relative",width:"full",height:"full",children:X.jsx(l1e,{className:f1e})})})})};Er({defaultClassName:"nwwh3z8",variantClassNames:{variant:{pill:"nwwh3z9",line:"nwwh3za nwwh3z1 fyvr11g0"},active:{true:"nwwh3zb nwwh3z2 fyvr12w5",false:"nwwh3zc"},disabled:{true:"nwwh3zd nwwh3z3 fyvr12vp"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"nwwh3z4 fyvr11u7 fyvr12sj"],[{active:!1,variant:"pill"},"nwwh3z5 fyvr11od fyvr12s7"],[{active:!0,variant:"line"},"nwwh3z6 fyvr12s1"],[{active:!1,variant:"line"},"nwwh3z7 fyvr12s7"]]});const iF="Tabs",[d1e,jAe]=In(iF,[qd]),sF=qd(),[h1e,d4]=d1e(iF),p1e=w.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...l}=t,u=Rb(a),[f,d]=fa({prop:n,onChange:i,defaultProp:s});return w.createElement(h1e,{scope:r,baseId:ta(),value:f,onValueChange:d,orientation:o,dir:u,activationMode:c},w.createElement(Xe.div,mt({dir:u,"data-orientation":o},l,{ref:e})))}),m1e="TabsList",v1e=w.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=d4(m1e,r),o=sF(r);return w.createElement(uB,mt({asChild:!0},o,{orientation:s.orientation,dir:s.dir,loop:n}),w.createElement(Xe.div,mt({role:"tablist","aria-orientation":s.orientation},i,{ref:e})))}),y1e="TabsTrigger",g1e=w.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=d4(y1e,r),a=sF(r),c=oF(o.baseId,n),l=aF(o.baseId,n),u=n===o.value;return w.createElement(o4,mt({asChild:!0},a,{focusable:!i,active:u}),w.createElement(Xe.button,mt({type:"button",role:"tab","aria-selected":u,"aria-controls":l,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c},s,{ref:e,onMouseDown:_e(t.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:_e(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:_e(t.onFocus,()=>{const f=o.activationMode!=="manual";!u&&!i&&f&&o.onValueChange(n)})})))}),b1e="TabsContent",x1e=w.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=d4(b1e,r),c=oF(a.baseId,n),l=aF(a.baseId,n),u=n===a.value,f=w.useRef(u);return w.useEffect(()=>{const d=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(d)},[]),w.createElement(Ra,{present:i||u},({present:d})=>w.createElement(Xe.div,mt({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:l,tabIndex:0},o,{ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0}}),d&&s))});function oF(t,e){return`${t}-trigger-${e}`}function aF(t,e){return`${t}-content-${e}`}const w1e=p1e,E1e=v1e,C1e=g1e;var S1e="_10c8o0n1 _10c8o0n0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr11h0 fyvr11hw fyvr128 fyvr11sj fyvr14o",k1e="_10c8o0n3 _10c8o0n2 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr12wp fyvr12wj fyvr128 fyvr15o fyvr12v7 fyvr11hw fyvr11od fyvr11n4 fyvr12s7",A1e="_10c8o0n5 _10c8o0n4 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ho fyvr1ko fyvr1oo fyvr14c fyvr11tv fyvr12w7";const _1e=t=>{const{tabs:e,value:r}=t;if(!e.length)return null;const n=100/e.length,i=e.findIndex(s=>s.value===r);return X.jsxs(E1e,{className:S1e,style:{outline:void 0},children:[X.jsx(q,{display:"flex",position:"absolute",inset:"2",height:"8",children:X.jsx("div",{className:A1e,style:{width:`${n}%`,transform:`translateX(${i*100}%)`}})}),e.map(s=>X.jsx(C1e,{className:k1e,value:s.value,children:X.jsx(ae,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},P1e=w1e,XA=x1e;var I1e="_1ppqbnx1 _1qxj1ib9 _1qxj1ibg _1qxj1ib6 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc _1ppqbnx0 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1wo fyvr1yk fyvr1ss fyvr1uo fyvr11hc fyvr118c fyvr11n9";w.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return X.jsxs(q,{className:I1e,ref:e,background:"buttonGlass",color:"text80",...i,children:[r&&X.jsx(r,{size:"xs"}),X.jsx(ae,{children:n})]})});const T1e="ToastProvider",[O1e,BAe,R1e]=Ob("Toast"),[cF,FAe]=In("Toast",[R1e]),[UAe,lF]=cF(T1e),ZA="toast.viewportPause",e_="toast.viewportResume",zb="Toast",$1e="toast.swipeStart",M1e="toast.swipeMove",N1e="toast.swipeCancel",D1e="toast.swipeEnd",[L1e,j1e]=cF(zb,{onClose(){}}),B1e=w.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...p}=t,m=lF(zb,r),[v,y]=w.useState(null),b=Lt(e,x=>y(x)),E=w.useRef(null),S=w.useRef(null),P=i||m.duration,M=w.useRef(0),L=w.useRef(P),j=w.useRef(0),{onToastAdd:H,onToastRemove:K}=m,Q=rs(()=>{var x;(v==null?void 0:v.contains(document.activeElement))&&((x=m.viewport)===null||x===void 0||x.focus()),o()}),Y=w.useCallback(x=>{!x||x===1/0||(window.clearTimeout(j.current),M.current=new Date().getTime(),j.current=window.setTimeout(Q,x))},[Q]);w.useEffect(()=>{const x=m.viewport;if(x){const k=()=>{Y(L.current),l==null||l()},R=()=>{const N=new Date().getTime()-M.current;L.current=L.current-N,window.clearTimeout(j.current),c==null||c()};return x.addEventListener(ZA,R),x.addEventListener(e_,k),()=>{x.removeEventListener(ZA,R),x.removeEventListener(e_,k)}}},[m.viewport,P,c,l,Y]),w.useEffect(()=>{s&&!m.isClosePausedRef.current&&Y(P)},[s,P,m.isClosePausedRef,Y]),w.useEffect(()=>(H(),()=>K()),[H,K]);const F=w.useMemo(()=>v?fF(v):null,[v]);return m.viewport?w.createElement(w.Fragment,null,F&&w.createElement(F1e,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},F),w.createElement(L1e,{scope:r,onClose:Q},Fs.createPortal(w.createElement(O1e.ItemSlot,{scope:r},w.createElement(Pue,{asChild:!0,onEscapeKeyDown:_e(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||Q(),m.isFocusedToastEscapeKeyDownRef.current=!1})},w.createElement(Xe.li,Fe({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection},p,{ref:b,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:_e(t.onKeyDown,x=>{x.key==="Escape"&&(a==null||a(x.nativeEvent),x.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,Q()))}),onPointerDown:_e(t.onPointerDown,x=>{x.button===0&&(E.current={x:x.clientX,y:x.clientY})}),onPointerMove:_e(t.onPointerMove,x=>{if(!E.current)return;const k=x.clientX-E.current.x,R=x.clientY-E.current.y,N=!!S.current,A=["left","right"].includes(m.swipeDirection),O=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,B=A?O(0,k):0,I=A?0:O(0,R),C=x.pointerType==="touch"?10:2,D={x:B,y:I},z={originalEvent:x,delta:D};N?(S.current=D,hm(M1e,f,z,{discrete:!1})):t_(D,m.swipeDirection,C)?(S.current=D,hm($1e,u,z,{discrete:!1}),x.target.setPointerCapture(x.pointerId)):(Math.abs(k)>C||Math.abs(R)>C)&&(E.current=null)}),onPointerUp:_e(t.onPointerUp,x=>{const k=S.current,R=x.target;if(R.hasPointerCapture(x.pointerId)&&R.releasePointerCapture(x.pointerId),S.current=null,E.current=null,k){const N=x.currentTarget,A={originalEvent:x,delta:k};t_(k,m.swipeDirection,m.swipeThreshold)?hm(D1e,h,A,{discrete:!0}):hm(N1e,d,A,{discrete:!0}),N.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})))),m.viewport))):null});B1e.propTypes={type(t){if(t.type&&!["foreground","background"].includes(t.type)){const e=`Invalid prop \`type\` supplied to \`${zb}\`. Expected \`foreground | background\`.`;return new Error(e)}return null}};const F1e=t=>{const{__scopeToast:e,children:r,...n}=t,i=lF(zb,e),[s,o]=w.useState(!1),[a,c]=w.useState(!1);return H1e(()=>o(!0)),w.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:w.createElement(aB,{asChild:!0},w.createElement(YB,n,s&&w.createElement(w.Fragment,null,i.label," ",r)))},U1e="ToastAction",z1e=w.forwardRef((t,e)=>{const{altText:r,...n}=t;return r?w.createElement(uF,{altText:r,asChild:!0},w.createElement(W1e,Fe({},n,{ref:e}))):null});z1e.propTypes={altText(t){return t.altText?null:new Error(`Missing prop \`altText\` expected on \`${U1e}\``)}};const q1e="ToastClose",W1e=w.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=j1e(q1e,r);return w.createElement(uF,{asChild:!0},w.createElement(Xe.button,Fe({type:"button"},n,{ref:e,onClick:_e(t.onClick,i.onClose)})))}),uF=w.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return w.createElement(Xe.div,Fe({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:e}))});function fF(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),V1e(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...fF(n))}}),e}function hm(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?KC(i,s):i.dispatchEvent(s)}const t_=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function H1e(t=()=>{}){const e=rs(t);Ai(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function V1e(t){return t.nodeType===t.ELEMENT_NODE}Er({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});w.createContext(null);var G1e="_15pztn1 _1qxj1ib9 _1qxj1ibe _1qxj1ib4 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 _15pztn0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11od fyvr12s1 fyvr12o1 fyvr12wj fyvr128 fyvr11h0",K1e="_15pztn2";w.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",name:u,rows:f,resize:d=!1,...h}=t;return X.jsx(Eu,{description:s,disabled:o,display:"grid",id:a??u,label:c,labelLocation:l,children:X.jsx(q,{as:r,autoComplete:n,spellCheck:"false",className:fi(G1e,d&&K1e),disabled:o,id:a??u,name:u,ref:e,rows:f,borderRadius:i,...h})})});var Q1e=Er({defaultClassName:"bnrreb5 bnrreb0 fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11h0",variantClassNames:{size:{xs:"bnrreb6",sm:"bnrreb7",md:"bnrreb8",lg:"bnrreb9",xl:"bnrreba"},borderRadius:{circle:"bnrrebb bnrreb1 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",lg:"bnrrebc bnrreb2 fyvr11d8 fyvr11dw fyvr11bw fyvr11ck",md:"bnrrebd bnrreb3 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg",sm:"bnrrebe bnrreb4 fyvr11d0 fyvr11do fyvr11bo fyvr11cc"}},defaultVariants:{},compoundVariants:[]}),Y1e="bnrrebf",J1e="bnrrebh bnrrebg fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11sj fyvr128 fyvr15o fyvr11h0";w.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",...c}=t;return X.jsx(q,{className:fi(r,Q1e({borderRadius:e,size:a})),style:i,flexShrink:"0",...c,children:s?X.jsx(br,{className:Y1e,disableAnimation:n,src:s}):X.jsx(ae,{className:J1e,variant:"normal",fontWeight:"medium",color:"text50",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)})})});const[qb,zAe]=In("Tooltip",[zd]);zd();const X1e="TooltipProvider";qb(X1e);const dF="Tooltip";qb(dF);const Z1e="TooltipPortal";qb(Z1e,{forceMount:void 0});qb(dF,{isInside:!1});const hF=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${yA.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${yA.lg}px)`);if(!t.startsWith("@media")){const c=r.get(t);if(!c||c==="")throw new Error(`useMediaQuery failed to get breakpoint from theme for: ${t}`);t=c}const n=t.replace(/^@media( ?)/m,""),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:s=!1}=e,[o,a]=w.useState(()=>i?window.matchMedia(n).matches:s);return w.useEffect(()=>{let c=!0;if(!i)return;const l=window.matchMedia(n),u=()=>{c&&a(l.matches)};return u(),l.addListener(u),()=>{c=!1,l.removeListener(u)}},[n,i]),o};function epe(t={}){const{nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n}=t,[i,s]=w.useState(!1),o=w.useRef(r);o.current=r;const a=w.useRef(n);return a.current=n,w.useEffect(()=>{const c=document.createElement("script");return c.src="https://accounts.google.com/gsi/client",c.async=!0,c.defer=!0,c.nonce=e,c.onload=()=>{var l;s(!0),(l=o.current)===null||l===void 0||l.call(o)},c.onerror=()=>{var l;s(!1),(l=a.current)===null||l===void 0||l.call(a)},document.body.appendChild(c),()=>{document.body.removeChild(c)}},[e]),i}const pF=w.createContext(null);function tpe({clientId:t,nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n,children:i}){const s=epe({nonce:e,onScriptLoadSuccess:r,onScriptLoadError:n}),o=w.useMemo(()=>({clientId:t,scriptLoadedSuccessfully:s}),[t,s]);return g.createElement(pF.Provider,{value:o},i)}function rpe(){const t=w.useContext(pF);if(!t)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return t}function npe(t){var e;return(e=t==null?void 0:t.clientId)!==null&&e!==void 0?e:t==null?void 0:t.client_id}const ipe={large:40,medium:32,small:20};function spe({onSuccess:t,onError:e,useOneTap:r,promptMomentNotification:n,type:i="standard",theme:s="outline",size:o="large",text:a,shape:c,logo_alignment:l,width:u,locale:f,click_listener:d,containerProps:h,...p}){const m=w.useRef(null),{clientId:v,scriptLoadedSuccessfully:y}=rpe(),b=w.useRef(t);b.current=t;const E=w.useRef(e);E.current=e;const S=w.useRef(n);return S.current=n,w.useEffect(()=>{var P,M,L,j,H,K,Q,Y,F;if(y)return(L=(M=(P=window==null?void 0:window.google)===null||P===void 0?void 0:P.accounts)===null||M===void 0?void 0:M.id)===null||L===void 0||L.initialize({client_id:v,callback:x=>{var k;if(!(x!=null&&x.credential))return(k=E.current)===null||k===void 0?void 0:k.call(E);const{credential:R,select_by:N}=x;b.current({credential:R,clientId:npe(x),select_by:N})},...p}),(K=(H=(j=window==null?void 0:window.google)===null||j===void 0?void 0:j.accounts)===null||H===void 0?void 0:H.id)===null||K===void 0||K.renderButton(m.current,{type:i,theme:s,size:o,text:a,shape:c,logo_alignment:l,width:u,locale:f,click_listener:d}),r&&((F=(Y=(Q=window==null?void 0:window.google)===null||Q===void 0?void 0:Q.accounts)===null||Y===void 0?void 0:Y.id)===null||F===void 0||F.prompt(S.current)),()=>{var x,k,R;r&&((R=(k=(x=window==null?void 0:window.google)===null||x===void 0?void 0:x.accounts)===null||k===void 0?void 0:k.id)===null||R===void 0||R.cancel())}},[v,y,r,i,s,o,a,c,l,u,f]),g.createElement("div",{...h,ref:m,style:{height:ipe[o],...h==null?void 0:h.style}})}const ope="2.7.9",ape=t=>t,h4=t=>t,cpe=()=>`viem@${ope}`;let ye=class r3 extends Error{constructor(e,r={}){var s;super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:cpe()});const n=r.cause instanceof r3?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof r3&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://viem.sh${i}${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 mF(this,e)}};function mF(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t?mF(t.cause,e):e?null:t}class lpe extends ye{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class upe extends ye{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class fpe extends ye{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class dpe extends ye{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}class vF extends ye{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class yF extends ye{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class r_ extends ye{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${e} ${n} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function Hd(t,{dir:e,size:r=32}={}){return typeof t=="string"?Sc(t,{dir:e,size:r}):hpe(t,{dir:e,size:r})}function Sc(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new yF({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function hpe(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new yF({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;i=Mo.zero&&t<=Mo.nine)return t-Mo.zero;if(t>=Mo.A&&t<=Mo.F)return t-(Mo.A-10);if(t>=Mo.a&&t<=Mo.f)return t-(Mo.a-10)}function ap(t,e={}){let r=t;e.size&&(ls(r,{size:e.size}),r=Hd(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,s=new Uint8Array(i);for(let o=0,a=0;oe)throw new dpe({givenSize:qr(t),maxSize:e})}function i_(t,e){const r=typeof e=="string"?{to:e}:e,n=r.to;return n==="number"?ma(t,r):n==="bigint"?cp(t,r):n==="string"?gpe(t,r):n==="boolean"?ype(t,r):ap(t,r)}function cp(t,e={}){const{signed:r}=e;e.size&&ls(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<e.toString(16).padStart(2,"0"));function Ma(t,e={}){return typeof t=="number"||typeof t=="bigint"?Me(t,e):typeof t=="string"?p4(t,e):typeof t=="boolean"?gF(t,e):Bs(t,e)}function gF(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(ls(r,{size:e.size}),Hd(r,{size:e.size})):r}function Bs(t,e={}){let r="";for(let i=0;is||ia):void 0}]},{retryCount:0})}function va(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new Mpe(t.type);return`${t.name}(${Wb(t.inputs,{includeName:e})})`}function Wb(t,{includeName:e=!1}={}){return t?t.map(r=>Epe(r,{includeName:e})).join(e?", ":","):""}function Epe(t,{includeName:e}){return t.type.startsWith("tuple")?`(${Wb(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class Cpe extends ye{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` +`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class s_ extends ye{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` +`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class bF extends ye{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${Wb(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class Hb extends ye{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class Spe extends ye{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class kpe extends ye{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${qr(r)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class Ape extends ye{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class xF extends ye{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on 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=${e}.`].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class _pe extends ye{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class wF extends ye{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class o_ extends ye{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class Wy extends ye{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class Ppe extends ye{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class Ipe extends ye{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${va(e.abiItem)}\`, and`,`\`${r.type}\` in \`${va(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class Tpe extends ye{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class l1 extends ye{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` +`),{metaMessages:[`Params: (${Wb(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class Vb extends ye{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${va(e,{includeName:!0})}".`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class Ope extends ye{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class Rpe extends ye{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class $pe extends ye{constructor(e){super([`Value "${e}" is not a valid array.`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class Mpe extends ye{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}function ya(t){return typeof t[0]=="string"?m4(t):Npe(t)}function Npe(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function m4(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}class yd extends ye{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}const Dpe=/^0x[a-fA-F0-9]{40}$/;function ga(t){return Dpe.test(t)}function Hy(t,e,r,{strict:n}={}){return _o(t,{strict:!1})?Lpe(t,e,r,{strict:n}):SF(t,e,r,{strict:n})}function EF(t,e){if(typeof e=="number"&&e>0&&e>qr(t)-1)throw new vF({offset:e,position:"start",size:qr(t)})}function CF(t,e,r){if(typeof e=="number"&&typeof r=="number"&&qr(t)!==r-e)throw new vF({offset:r,position:"end",size:qr(t)})}function SF(t,e,r,{strict:n}={}){EF(t,e);const i=t.slice(e,r);return n&&CF(i,e,r),i}function Lpe(t,e,r,{strict:n}={}){EF(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&CF(i,e,r),i}function lp(t,e){if(t.length!==e.length)throw new Ape({expectedLength:t.length,givenLength:e.length});const r=jpe({params:t,values:e}),n=y4(r);return n.length===0?"0x":n}function jpe({params:t,values:e}){const r=[];for(let n=0;n0?ya([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:ya(s.map(({encoded:o})=>o))}}function Upe(t,{param:e}){const[,r]=e.type.split("bytes"),n=qr(t);if(!r){let i=t;return n%32!==0&&(i=Sc(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:ya([Sc(Me(n,{size:32})),i])}}if(n!==parseInt(r))throw new kpe({expectedSize:parseInt(r),value:t});return{dynamic:!1,encoded:Sc(t,{dir:"right"})}}function zpe(t){return{dynamic:!1,encoded:Sc(gF(t))}}function qpe(t,{signed:e}){return{dynamic:!1,encoded:Me(t,{size:32,signed:e})}}function Wpe(t){const e=p4(t),r=Math.ceil(qr(e)/32),n=[];for(let i=0;ii))}}function g4(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const lw="/docs/contract/encodeDeployData";function kF(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(o=>"type"in o&&o.type==="constructor");if(!i)throw new Cpe({docsPath:lw});if(!("inputs"in i))throw new s_({docsPath:lw});if(!i.inputs||i.inputs.length===0)throw new s_({docsPath:lw});const s=lp(i.inputs,r);return m4([n,s])}function Ri(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}class Gb extends ye{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join(` +`),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class n3 extends ye{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class Vpe extends ye{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class Gpe extends ye{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class AF extends ye{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}function _F({chain:t,currentChainId:e}){if(!t)throw new Gpe;if(e!==t.id)throw new Vpe({chain:t,currentChainId:e})}const Kpe={gwei:9,wei:18},Qpe={ether:-9,wei:9};function PF(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function oi(t,e="wei"){return PF(t,Qpe[e])}class Sf extends ye{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(Sf,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Sf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Vy extends ye{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${oi(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(Vy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class i3 extends ye{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${oi(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(i3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class s3 extends ye{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(s3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class o3 extends ye{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` +`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(o3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class a3 extends ye{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(a3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class c3 extends ye{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` +`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(c3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class l3 extends ye{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(l3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class u3 extends ye{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(u3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class f3 extends ye{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(f3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Gy extends ye{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${oi(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${oi(n)} gwei`:""}).`].join(` +`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(Gy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Kb extends ye{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function b4(t,e="wei"){return PF(t,Kpe[e])}function up(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` +`)}class Ype extends ye{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class Jpe extends ye{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",up(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class Xpe extends ye{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var p;const h=up({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${b4(d)} ${((p=i==null?void 0:i.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${oi(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${oi(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${oi(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].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:"TransactionExecutionError"}),this.cause=e}}class IF extends ye{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let o="Transaction";n&&s!==void 0&&(o=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(o=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(o=`Transaction at block number "${r}" at index "${s}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class TF extends ye{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class Zpe extends ye{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}const ai=(t,e,r)=>JSON.stringify(t,(n,i)=>{const s=typeof i=="bigint"?i.toString():i;return typeof e=="function"?e(n,s):s},r);class b0 extends ye{constructor({body:e,details:r,headers:n,status:i,url:s}){super("HTTP request failed.",{details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${h4(s)}`,e&&`Request body: ${ai(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=i,this.url=s}}class x4 extends ye{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${h4(n)}`,`Request body: ${ai(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}}class a_ extends ye{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${h4(r)}`,`Request body: ${ai(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const eme=-1;class di extends ye{constructor(e,{code:r,docsPath:n,metaMessages:i,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof x4?e.code:r??eme}}class Vd extends di{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class u1 extends di{constructor(e){super(e,{code:u1.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(u1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class f1 extends di{constructor(e){super(e,{code:f1.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(f1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class d1 extends di{constructor(e){super(e,{code:d1.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(d1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class h1 extends di{constructor(e){super(e,{code:h1.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` +`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(h1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class du extends di{constructor(e){super(e,{code:du.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(du,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class hu extends di{constructor(e){super(e,{code:hu.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` +`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(hu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class p1 extends di{constructor(e){super(e,{code:p1.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(p1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Ac extends di{constructor(e){super(e,{code:Ac.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(Ac,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class m1 extends di{constructor(e){super(e,{code:m1.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(m1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class v1 extends di{constructor(e){super(e,{code:v1.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(v1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class gd extends di{constructor(e){super(e,{code:gd.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(gd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class y1 extends di{constructor(e){super(e,{code:y1.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(y1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Ot extends Vd{constructor(e){super(e,{code:Ot.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(Ot,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class g1 extends Vd{constructor(e){super(e,{code:g1.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(g1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class b1 extends Vd{constructor(e){super(e,{code:b1.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(b1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class x1 extends Vd{constructor(e){super(e,{code:x1.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(x1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class w1 extends Vd{constructor(e){super(e,{code:w1.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(w1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class is extends Vd{constructor(e){super(e,{code:is.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(is,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class tme extends di{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}function w4(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof ye?t.walk(i=>i.code===Sf.code):t;return n instanceof ye?new Sf({cause:t,message:n.details}):Sf.nodeMessage.test(r)?new Sf({cause:t,message:t.details}):Vy.nodeMessage.test(r)?new Vy({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):i3.nodeMessage.test(r)?new i3({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):s3.nodeMessage.test(r)?new s3({cause:t,nonce:e==null?void 0:e.nonce}):o3.nodeMessage.test(r)?new o3({cause:t,nonce:e==null?void 0:e.nonce}):a3.nodeMessage.test(r)?new a3({cause:t,nonce:e==null?void 0:e.nonce}):c3.nodeMessage.test(r)?new c3({cause:t}):l3.nodeMessage.test(r)?new l3({cause:t,gas:e==null?void 0:e.gas}):u3.nodeMessage.test(r)?new u3({cause:t,gas:e==null?void 0:e.gas}):f3.nodeMessage.test(r)?new f3({cause:t}):Gy.nodeMessage.test(r)?new Gy({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Kb({cause:t})}function rme(t,{docsPath:e,...r}){const n=(()=>{const i=w4(t,r);return i instanceof Kb?t:i})();return new Xpe(n,{docsPath:e,...r})}function E4(t,{format:e}){if(!e)return{};const r={};function n(s){const o=Object.keys(s);for(const a of o)a in t&&(r[a]=t[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&n(s[a])}const i=e(t||{});return n(i),r}const nme={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function Qb(t){return{...t,gas:typeof t.gas<"u"?Me(t.gas):void 0,gasPrice:typeof t.gasPrice<"u"?Me(t.gasPrice):void 0,maxFeePerGas:typeof t.maxFeePerGas<"u"?Me(t.maxFeePerGas):void 0,maxPriorityFeePerGas:typeof t.maxPriorityFeePerGas<"u"?Me(t.maxPriorityFeePerGas):void 0,nonce:typeof t.nonce<"u"?Me(t.nonce):void 0,type:typeof t.type<"u"?nme[t.type]:void 0,value:typeof t.value<"u"?Me(t.value):void 0}}function Re(t,e,r){return n=>{var i;return((i=t[e.name||r])==null?void 0:i.call(t,n))??e(t,n)}}function fp(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:s}=t,o=e?Ri(e):void 0;if(o&&!ga(o.address))throw new yd({address:o.address});if(s&&!ga(s))throw new yd({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new Ype;if(n&&n>2n**256n-1n)throw new Vy({maxFeePerGas:n});if(i&&n&&i>n)throw new Gy({maxFeePerGas:n,maxPriorityFeePerGas:i})}async function E1(t){const e=await t.request({method:"eth_chainId"});return ma(e)}class ime extends ye{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class C4 extends ye{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class sme extends ye{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${oi(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class OF extends ye{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const RF={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function $F(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?ma(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?ma(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?RF[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return e.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}function MF(t){var r;const e=(r=t.transactions)==null?void 0:r.map(n=>typeof n=="string"?n:$F(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}async function Uc(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,d;const s=n??"latest",o=i??!1,a=r!==void 0?Me(r):void 0;let c=null;if(e?c=await t.request({method:"eth_getBlockByHash",params:[e,o]}):c=await t.request({method:"eth_getBlockByNumber",params:[a||s,o]}),!c)throw new OF({blockHash:e,blockNumber:r});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:d.format)||MF)(c)}async function S4(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function ome(t,e){return NF(t,e)}async function NF(t,e){var s,o,a;const{block:r,chain:n=t.chain,request:i}=e||{};if(typeof((s=n==null?void 0:n.fees)==null?void 0:s.defaultPriorityFee)=="function"){const c=r||await Re(t,Uc,"getBlock")({});return n.fees.defaultPriorityFee({block:c,client:t,request:i})}if(typeof((o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee)<"u")return(a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee;try{const c=await t.request({method:"eth_maxPriorityFeePerGas"});return cp(c)}catch{const[c,l]=await Promise.all([r?Promise.resolve(r):Re(t,Uc,"getBlock")({}),Re(t,S4,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new C4;const u=l-c.baseFeePerGas;return u<0n?0n:u}}async function ame(t,e){return d3(t,e)}async function d3(t,e){var d,h;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>{var p,m;return typeof((p=n==null?void 0:n.fees)==null?void 0:p.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((m=n==null?void 0:n.fees)==null?void 0:m.baseFeeMultiplier)??1.2})();if(o<1)throw new ime;const c=10**(((d=o.toString().split(".")[1])==null?void 0:d.length)??0),l=p=>p*BigInt(Math.ceil(o*c))/BigInt(c),u=r||await Re(t,Uc,"getBlock")({});if(typeof((h=n==null?void 0:n.fees)==null?void 0:h.estimateFeesPerGas)=="function")return n.fees.estimateFeesPerGas({block:r,client:t,multiply:l,request:i,type:s});if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new C4;const p=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await NF(t,{block:u,chain:n,request:i}),m=l(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??m+p,maxPriorityFeePerGas:p}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await Re(t,S4,"getGasPrice")({}))}}class cme extends ye{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var p;const h=up({from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${b4(d)} ${((p=i==null?void 0:i.nativeCurrency)==null?void 0:p.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${oi(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${oi(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${oi(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].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:"EstimateGasExecutionError"}),this.cause=e}}function lme(t,{docsPath:e,...r}){const n=(()=>{const i=w4(t,r);return i instanceof Kb?t:i})();return new cme(n,{docsPath:e,...r})}async function Yb(t,e){var i,s,o;const r=e.account??t.account,n=r?Ri(r):void 0;try{const{accessList:a,blockNumber:c,blockTag:l,data:u,gas:f,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:m,to:v,value:y,...b}=(n==null?void 0:n.type)==="local"?await Jb(t,e):e,S=(c?Me(c):void 0)||l;fp(e);const P=(o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format,L=(P||Qb)({...E4(b,{format:P}),from:n==null?void 0:n.address,accessList:a,data:u,gas:f,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:m,to:v,value:y}),j=await t.request({method:"eth_estimateGas",params:S?[L,S]:[L]});return BigInt(j)}catch(a){throw lme(a,{...e,account:n,chain:t.chain})}}async function DF(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?Me(n):r]});return ma(i)}function ume(t){if(t.type)return t.type;if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new Jpe({transaction:t})}async function Jb(t,e){const{account:r=t.account,chain:n,gas:i,nonce:s,parameters:o=["fees","gas","nonce","type"],type:a}=e,c=r?Ri(r):void 0,l=await Re(t,Uc,"getBlock")({blockTag:"latest"}),u={...e,...c?{from:c==null?void 0:c.address}:{}};if(o.includes("nonce")&&typeof s>"u"&&c&&(u.nonce=await Re(t,DF,"getTransactionCount")({address:c.address,blockTag:"pending"})),(o.includes("fees")||o.includes("type"))&&typeof a>"u")try{u.type=ume(u)}catch{u.type=typeof l.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(o.includes("fees"))if(u.type==="eip1559"){const{maxFeePerGas:f,maxPriorityFeePerGas:d}=await d3(t,{block:l,chain:n,request:u});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(u.gas=await Re(t,Yb,"estimateGas")({...u,account:c?{address:c.address,type:"json-rpc"}:void 0})),fp(u),delete u.parameters,u}async function k4(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}async function Xb(t,e){var m,v,y,b;const{account:r=t.account,chain:n=t.chain,accessList:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...h}=e;if(!r)throw new Gb({docsPath:"/docs/actions/wallet/sendTransaction"});const p=Ri(r);try{fp(e);let E;if(n!==null&&(E=await Re(t,E1,"getChainId")({}),_F({currentChainId:E,chain:n})),p.type==="local"){const L=await Re(t,Jb,"prepareTransactionRequest")({account:p,accessList:i,chain:n,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...h});E||(E=await Re(t,E1,"getChainId")({}));const j=(m=n==null?void 0:n.serializers)==null?void 0:m.transaction,H=await p.signTransaction({...L,chainId:E},{serializer:j});return await Re(t,k4,"sendRawTransaction")({serializedTransaction:H})}const S=(b=(y=(v=t.chain)==null?void 0:v.formatters)==null?void 0:y.transactionRequest)==null?void 0:b.format,M=(S||Qb)({...E4(h,{format:S}),accessList:i,data:s,from:p.address,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d});return await t.request({method:"eth_sendTransaction",params:[M]},{retryCount:0})}catch(E){throw rme(E,{...e,account:p,chain:e.chain||void 0})}}function fme(t,e){const{abi:r,args:n,bytecode:i,...s}=e,o=kF({abi:r,args:n,bytecode:i});return Xb(t,{...s,data:o})}const h3=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],LF=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],jF=[...LF,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],dme=[...LF,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],c_=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],l_=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],hme=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}];function u_(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function BF(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function f_(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function pme(t,e){BF(t);const r=e.outputLen;if(t.length>d_&pm)}:{h:Number(t>>d_&pm)|0,l:Number(t&pm)|0}}function vme(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,gme=(t,e,r)=>e<>>32-r,bme=(t,e,r)=>e<>>64-r,xme=(t,e,r)=>t<>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const wme=t=>t instanceof Uint8Array,Eme=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Cme=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Cme)throw new Error("Non little-endian hardware is not supported");function Sme(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function FF(t){if(typeof t=="string"&&(t=Sme(t)),!wme(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}class kme{clone(){return this._cloneInto()}}function Ame(t){const e=n=>t().update(FF(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}const[UF,zF,qF]=[[],[],[]],_me=BigInt(0),Ah=BigInt(1),Pme=BigInt(2),Ime=BigInt(7),Tme=BigInt(256),Ome=BigInt(113);for(let t=0,e=Ah,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],UF.push(2*(5*n+r)),zF.push((t+1)*(t+2)/2%64);let i=_me;for(let s=0;s<7;s++)e=(e<>Ime)*Ome)%Tme,e&Pme&&(i^=Ah<<(Ah<r>32?bme(t,e,r):yme(t,e,r),p_=(t,e,r)=>r>32?xme(t,e,r):gme(t,e,r);function Mme(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],u=r[c+1],f=h_(l,u,1)^r[a],d=p_(l,u,1)^r[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=zF[o],c=h_(i,s,a),l=p_(i,s,a),u=UF[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=Rme[n],t[1]^=$me[n]}r.fill(0)}class A4 extends kme{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,u_(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Eme(this.state)}keccak(){Mme(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){f_(this);const{blockLen:r,state:n}=this;e=FF(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return u_(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(pme(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new A4(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Nme=(t,e,r)=>Ame(()=>new A4(e,t,r)),Dme=Nme(1,136,256/8);function ei(t,e){const r=e||"hex",n=Dme(_o(t,{strict:!1})?fu(t):t);return r==="bytes"?n:Ma(n)}function _4(t,e){const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=ei(ra(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&i[s]&&(i[s]=i[s].toUpperCase()),(n[s>>1]&15)>=8&&i[s+1]&&(i[s+1]=i[s+1].toUpperCase());return`0x${i.join("")}`}function ti(t,e){if(!ga(t))throw new yd({address:t});return _4(t,e)}class m_ extends ye{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class WF extends ye{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class Lme extends ye{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const jme={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Lme({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new WF({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new m_({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new m_({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===1/0)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function Bme(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(jme);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function Fme(t,e={}){typeof e.size<"u"&&ls(t,{size:e.size});const r=Bs(t,e);return cp(r,e)}function Ume(t,e={}){let r=t;if(typeof e.size<"u"&&(ls(r,{size:e.size}),r=kc(r)),r.length>1||r[0]>1)throw new upe(r);return!!r[0]}function na(t,e={}){typeof e.size<"u"&&ls(t,{size:e.size});const r=Bs(t,e);return ma(r,e)}function zme(t,e={}){let r=t;return typeof e.size<"u"&&(ls(r,{size:e.size}),r=kc(r,{dir:"right"})),new TextDecoder().decode(r)}function Zb(t,e){const r=typeof e=="string"?ap(e):e,n=Bme(r);if(qr(r)===0&&t.length>0)throw new Hb;if(qr(e)&&qr(e)<32)throw new bF({data:typeof e=="string"?e:Bs(e),params:t,size:qr(e)});let i=0;const s=[];for(let o=0;o48?Fme(i,{signed:r}):na(i,{signed:r}),32]}function Kme(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(C1(e)){const o=na(t.readBytes(p3)),a=r+o;for(let c=0;c(\[(\d*)\])*)$/;function m3(t){let e=t.type;if(y_.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;iei(fu(t));function Zme(t){return Xme(t)}function eve(t){let e=!0,r="",n=0,i="",s=!1;for(let o=0;o{const e=typeof t=="string"?t:Jme(t);return eve(e)};function HF(t){return Zme(tve(t))}const P4=HF,I4=t=>Hy(HF(t),0,4);function dp(t){const{abi:e,args:r=[],name:n}=t,i=_o(n,{strict:!1}),s=e.filter(a=>i?a.type==="function"?I4(a)===n:a.type==="event"?P4(a)===n:!1:"name"in a&&a.name===n);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const a of s){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((l,u)=>{const f="inputs"in a&&a.inputs[u];return f?v3(l,f):!1})){if(o&&"inputs"in o&&o.inputs){const l=VF(a.inputs,o.inputs,r);if(l)throw new Ipe({abiItem:a,type:l[0]},{abiItem:o,type:l[1]})}o=a}}return o||s[0]}function v3(t,e){const r=typeof t,n=e.type;switch(n){case"address":return ga(t);case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>v3(Object.values(t)[s],i)):/^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)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>v3(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function VF(t,e,r){for(const n in t){const i=t[n],s=e[n];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return VF(i.components,s.components,r[n]);const o=[i.type,s.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")||o.includes("address")&&o.includes("bytes")?ga(r[n]):!1)return o}}const uw="/docs/contract/decodeFunctionResult";function Gd(t){const{abi:e,args:r,functionName:n,data:i}=t;let s=e[0];if(n){const a=dp({abi:e,args:r,name:n});if(!a)throw new Wy(n,{docsPath:uw});s=a}if(s.type!=="function")throw new Wy(void 0,{docsPath:uw});if(!s.outputs)throw new Ppe(s.name,{docsPath:uw});const o=Zb(s.outputs,i);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const g_="/docs/contract/encodeFunctionData";function ol(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const c=dp({abi:e,args:r,name:n});if(!c)throw new Wy(n,{docsPath:g_});i=c}if(i.type!=="function")throw new Wy(void 0,{docsPath:g_});const s=va(i),o=I4(s),a="inputs"in i&&i.inputs?lp(i.inputs,r??[]):void 0;return m4([o,a??"0x"])}function Kd({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new n3({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new n3({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}const GF={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},rve={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},nve={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function ive(t){const{abi:e,data:r}=t,n=Hy(r,0,4);if(n==="0x")throw new Hb;const s=[...e||[],rve,nve].find(o=>o.type==="error"&&n===I4(va(o)));if(!s)throw new xF(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?Zb(s.inputs,Hy(r,4)):void 0,errorName:s.name}}function KF({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?ai(e[s]):e[s]}`).join(", ")})`}class sve extends ye{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class ove extends ye{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function b_(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} +`,"")}function ave(t){return t.reduce((e,{address:r,...n})=>{let i=`${e} ${r}: `;return n.nonce&&(i+=` nonce: ${n.nonce} `),n.balance&&(i+=` balance: ${n.balance} `),n.code&&(i+=` code: ${n.code} `),n.state&&(i+=` state: -`,i+=N_(n.state)),n.stateDiff&&(i+=` stateDiff: -`,i+=N_(n.stateDiff)),i},` State Override: -`).slice(0,-1)}class pU extends ye{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?Mi(r):void 0;let m=Ep({from:p==null?void 0:p.address,to:f,value:typeof d<"u"&&`${$4(d)} ${((v=i==null?void 0:i.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ai(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ai(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ai(l)} gwei`,nonce:u});h&&(m+=` -${Tve(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 Ove extends ye{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=Sp({abi:r,args:n,name:o}),l=c?hU({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?ba(c,{includeName:!0}):void 0,f=Ep({address:i&&Tpe(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 O3 extends ye{constructor({abi:e,data:r,functionName:n,message:i}){let s,o,a,c;if(r&&r!=="0x")try{o=_ve({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=dU[h]}else{const h=u?ba(u,{includeName:!0}):void 0,p=u&&d?hU({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 BF&&(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 Rve extends ye{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 W4 extends ye{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 H4(t,e){var n,i,s,o,a,c;if(!(t instanceof ye))return!1;const r=t.walk(l=>l instanceof O3);return r instanceof O3?!!(((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===dU[50]):!1}function mU(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return Io(e)?e:null}function Ev(t){let e=new Uint8Array(32).fill(0);if(!t)return Us(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=mU(r[n]),s=i?gu(i):ti(sa(r[n]),"bytes");e=ti(xa([e,s]),"bytes")}return Us(e)}function $ve(t){return`[${t.slice(2)}]`}function Mve(t){const e=new Uint8Array(32).fill(0);return t?mU(t)||ti(sa(t)):Us(e)}function d2(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(sa(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=sa($ve(Mve(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 Nve=3;function M1(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:u}=t instanceof W4?t:t instanceof ye?t.walk(d=>"data"in d)||t.walk():{},f=t instanceof n2?new Rve({functionName:s}):[Nve,bu.code].includes(a)&&(c||l||u)?new O3({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:u??l}):t;return new Ove(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}const Dve="modulepreload",Lve=function(t,e){return new URL(t,e).href},D_={},V4=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=Lve(o,n),o in D_)return;D_[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":Dve,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})},jve="0x82ad56cb";function Bve(t,{docsPath:e,...r}){const n=(()=>{const i=N4(t,r);return i instanceof o2?t:i})();return new pU(n,{docsPath:e,...r})}const Sw=new Map;function vU({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;pSw.delete(e),a=()=>c().map(({args:u})=>u),c=()=>Sw.get(e)||[],l=u=>Sw.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 h2(t,e){var b,E,S,P;const{account:r=t.account,batch:n=!!((b=t.batch)!=null&&b.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?Mi(r):void 0;try{Cp(e);const L=(i?Me(i):void 0)||s,j=Wve(m),H=(P=(S=(E=t.chain)==null?void 0:E.formatters)==null?void 0:S.transactionRequest)==null?void 0:P.format,Q=(H||a2)({...D4(v,{format:H}),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&&Fve({request:Q})&&!j)try{return await Uve(t,{...Q,blockNumber:i,blockTag:s})}catch(F){if(!(F instanceof HF)&&!(F instanceof y3))throw F}const Y=await t.request({method:"eth_call",params:j?[Q,L,j]:[Q,L]});return Y==="0x"?{data:void 0}:{data:Y}}catch(M){const L=zve(M),{offchainLookup:j,offchainLookupSignature:H}=await V4(()=>import("./ccip-BM2b4VbN.js"),__vite__mapDeps([]),import.meta.url);if((L==null?void 0:L.slice(0,10))===H&&h)return{data:await j(t,{data:L,to:h})};throw Bve(M,{...e,account:y,chain:t.chain})}}function Fve({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(jve)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function Uve(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 HF;l=nh({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?Me(i):void 0)||s,{schedule:d}=vU({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(v){return v.reduce((b,{data:E})=>b+(E.length-2),0)>r*2},fn:async v=>{const y=v.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),b=fl({abi:_3,args:[y],functionName:"aggregate3"}),E=await t.request({method:"eth_call",params:[{data:b,to:l},f]});return rh({abi:_3,args:[y],functionName:"aggregate3",data:E||"0x"})}}),[{returnData:h,success:p}]=await d({data:o,to:c});if(!p)throw new W4({data:h});return h==="0x"?{data:void 0}:{data:h}}function zve(t){if(!(t instanceof ye))return;const e=t.walk();return typeof e.data=="object"?e.data.data:e.data}function L_(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new g_({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new g_({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function qve(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=Me(e,{size:32})),r!==void 0&&(o.nonce=Me(r,{size:8})),n!==void 0&&(o.state=L_(n)),i!==void 0){if(o.state)throw new Ive;o.stateDiff=L_(i)}return o}function Wve(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!wa(r))throw new Ad({address:r});if(e[r])throw new Pve({address:r});e[r]=qve(n)}return e}async function Kc(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=fl({abi:r,args:i,functionName:s});try{const{data:c}=await Re(t,h2,"call")({...o,data:a,to:n});return rh({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw M1(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function Hve(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=nh({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l=fl({abi:k_,functionName:"addr",...n!=null?{args:[Ev(i),BigInt(n)]}:{args:[Ev(i)]}}),u={address:c,abi:nU,functionName:"resolve",args:[ja(d2(i)),l],blockNumber:e,blockTag:r},f=Re(t,Kc,"readContract"),d=s?await f({...u,args:[...u.args,s]}):await f(u);if(d[0]==="0x")return null;const h=rh({abi:k_,args:n!=null?[Ev(i),BigInt(n)]:void 0,functionName:"addr",data:d[0]});return h==="0x"||Oc(h)==="0x00"?null:h}catch(l){if(o)throw l;if(H4(l,"resolve"))return null;throw l}}class Vve extends ye{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 jh extends ye{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class G4 extends ye{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 Gve extends ye{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 Kve=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,Qve=/^(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\-.]+))?(?\/.*)?$/,Yve=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Jve=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Xve(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 j_(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function yU({uri:t,gatewayUrls:e}){const r=Yve.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=j_(e==null?void 0:e.ipfs,"https://ipfs.io"),i=j_(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(Kve),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||Qve.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(Jve,"");if(d.startsWith("i.json());return await K4({gatewayUrls:t,uri:gU(r)})}catch{throw new G4({uri:e})}}async function K4({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=yU({uri:e,gatewayUrls:t});if(n||await Xve(r))return r;throw new G4({uri:e})}function eye(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 jh({reason:"Only EIP-155 supported"});if(!o)throw new jh({reason:"Chain ID not found"});if(!c)throw new jh({reason:"Contract address not found"});if(!i)throw new jh({reason:"Token ID not found"});if(!a)throw new jh({reason:"ERC namespace not found"});return{chainID:parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function tye(t,{nft:e}){if(e.namespace==="erc721")return Kc(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 Kc(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 Gve({namespace:e.namespace})}async function rye(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?nye(t,{gatewayUrls:e,record:r}):K4({uri:r,gatewayUrls:e})}async function nye(t,{gatewayUrls:e,record:r}){const n=eye(r),i=await tye(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=yU({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 K4({uri:gU(u),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),Zve({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function bU(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=nh({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l={address:c,abi:nU,functionName:"resolve",args:[ja(d2(n)),fl({abi:S_,functionName:"text",args:[Ev(n),i]})],blockNumber:e,blockTag:r},u=Re(t,Kc,"readContract"),f=s?await u({...l,args:[...l.args,s]}):await u(l);if(f[0]==="0x")return null;const d=rh({abi:S_,functionName:"text",data:f[0]});return d===""?null:d}catch(l){if(o)throw l;if(H4(l,"resolve"))return null;throw l}}async function iye(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await Re(t,bU,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await rye(t,{record:c,gatewayUrls:n})}catch{return null}}async function sye(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=nh({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const l={address:a,abi:Nme,functionName:"reverse",args:[ja(d2(c))],blockNumber:r,blockTag:n},u=Re(t,Kc,"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(H4(l,"reverse"))return null;throw l}}async function oye(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=nh({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[o]=await Re(t,Kc,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ja(d2(n))],blockNumber:e,blockTag:r});return o}function p2(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 aye(t){const e=p2(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}class cye extends ye{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const B_="/docs/contract/encodeEventTopics";function kp(t){var c;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const l=Sp({abi:e,name:r});if(!l)throw new E_(r,{docsPath:B_});i=l}if(i.type!=="event")throw new E_(void 0,{docsPath:B_});const s=ba(i),o=z4(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)=>F_({param:f,value:u[d][p]})):u[d]?F_({param:f,value:u[d]}):null))??[])}return[o,...a]}function F_({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return ti(gu(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new cye(t.type);return wp([t],[e])}async function xU(t,e){const{address:r,abi:n,args:i,eventName:s,fromBlock:o,strict:a,toBlock:c}=e,l=p2(t,{method:"eth_newFilter"}),u=s?kp({abi:n,args:i,eventName:s}):void 0,f=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof o=="bigint"?Me(o):o,toBlock:typeof c=="bigint"?Me(c):c,topics:u}]});return{abi:n,args:i,eventName:s,id:f,request:l(f),strict:!!a,type:"event"}}async function wU(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){const c=i??(n?[n]:void 0),l=p2(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(d=>kp({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"?Me(s):s,toBlock:typeof a=="bigint"?Me(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 EU(t){const e=p2(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function lye(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=fl({abi:r,args:i,functionName:s});try{return await Re(t,c2,"estimateGas")({data:a,to:n,...o})}catch(c){const l=o.account?Mi(o.account):void 0;throw M1(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:l==null?void 0:l.address})}}async function uye(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?Me(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}const fye=new Map,dye=new Map;function hye(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,fye),n=e(t,dye);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function pye(t,{cacheKey:e,cacheTime:r=1/0}){const n=hye(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function Ap(t,{cacheTime:e=t.cacheTime}={}){const r=await pye(()=>t.request({method:"eth_blockNumber"}),{cacheKey:mye(t.uid),cacheTime:e});return BigInt(r)}async function vye(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?Me(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]}),ga(s)}async function yye(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?Me(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]});if(s!=="0x")return s}const U_="/docs/contract/decodeEventLog";function Q4(t){const{abi:e,data:r,strict:n,topics:i}=t,s=n??!0,[o,...a]=i;if(!o)throw new Ype({docsPath:U_});const c=e.find(m=>m.type==="event"&&o===z4(ba(m)));if(!(c&&"name"in c)||c.type!=="event")throw new FF(o,{docsPath:U_});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=f2(p,r);if(m)if(f)d=[...d,...m];else for(let v=0;v0?d:void 0}}function gye({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(f2([t],e)||[])[0]}async function CU(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=a.account?Mi(a.account):t.account,l=fl({abi:r,args:i,functionName:o});try{const{data:u}=await Re(t,h2,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:n,...a,account:c}),f=rh({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 M1(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}function Qc(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 kw=new Map,z_=new Map;let bye=0;function ih(t,e,r){const n=++bye,i=()=>kw.get(t)||[],s=()=>{const u=i();kw.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=z_.get(t);i().length===1&&u&&u(),s()},a=i();if(kw.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"&&z_.set(t,l),o}async function R3(t){return new Promise(e=>setTimeout(e,t))}function _p(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 R3(c);const l=async()=>{i&&(await t({unpoll:s}),await R3(n),l())};l()})(),s}async function m2(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=>Qc(s));return!("abi"in e)||!e.abi?i:J4({abi:e.abi,logs:i,strict:r})}async function v2(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function xye(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=ci(["watchContractEvent",n,i,s,t.uid,o,u]),v=f??!1;return ih(m,{onLogs:c,onError:a},y=>{let b,E,S=!1;const P=_p(async()=>{var M;if(!S){try{E=await Re(t,xU,"createContractEventFilter")({abi:r,address:n,args:i,eventName:o,strict:v})}catch{}S=!0;return}try{let L;if(E)L=await Re(t,m2,"getFilterChanges")({filter:E});else{const j=await Re(t,Ap,"getBlockNumber")({});b&&b!==j?L=await Re(t,jU,"getContractEvents")({abi:r,address:n,args:i,eventName:o,fromBlock:b+1n,toBlock:j,strict:v}):L=[],b=j}if(L.length===0)return;if(s)y.onLogs(L);else for(const j of L)y.onLogs([j])}catch(L){E&&L instanceof xu&&(S=!1),(M=y.onError)==null||M.call(y,L)}},{emitOnBegin:!0,interval:u});return async()=>{E&&await Re(t,v2,"uninstallFilter")({filter:E}),P()}})})():(()=>{let m=!0,v=()=>m=!1;return(async()=>{try{const y=o?kp({abi:r,eventName:o,args:i}):[],{unsubscribe:b}=await t.transport.subscribe({params:["logs",{address:n,topics:y}],onData(E){var P;if(!m)return;const S=E.result;try{const{eventName:M,args:L}=Q4({abi:r,data:S.data,topics:S.topics,strict:f}),j=Qc(S,{args:L,eventName:M});c([j])}catch(M){let L,j;if(M instanceof b1||M instanceof i2){if(f)return;L=M.abiItem.name,j=(P=M.abiItem.inputs)==null?void 0:P.some(K=>!("name"in K&&K.name))}const H=Qc(S,{args:j?[]:{},eventName:L});c([H])}},onError(E){a==null||a(E)}});v=b,m||v()}catch(y){a==null||a(y)}})(),v})()}async function SU(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=fl({abi:r,args:i,functionName:o});return Re(t,u2,"sendTransaction")({data:`${c}${s?s.replace("0x",""):""}`,to:n,...a})}const $3=256;let Am=$3,_m;function wye(t=11){if(!_m||Am+t>$3*2){_m="",Am=0;for(let e=0;e<$3;e++)_m+=(256+Math.random()*256|0).toString(16).substring(1)}return _m.substring(Am,Am+++t)}function kU(t){const{batch:e,cacheTime:r=t.pollingInterval??4e3,key:n="base",name:i="Base Client",pollingInterval:s=4e3,type:o="base"}=t,a=t.chain,c=t.account?Mi(t.account):void 0,{config:l,request:u,value:f}=t.transport({chain:a,pollingInterval:s}),d={...l,...f},h={account:c,batch:e,cacheTime:r,chain:a,key:n,name:i,pollingInterval:s,request:u,transport:d,type:o,uid:wye()};function p(m){return v=>{const y=v(m);for(const E in h)delete y[E];const b={...m,...y};return Object.assign(b,{extend:p(b)})}}return Object.assign(h,{extend:p(h)})}function og(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 R3(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 og(async()=>{try{return await t(r)}catch(o){const a=o;switch(a.code){case x1.code:throw new x1(a);case w1.code:throw new w1(a);case E1.code:throw new E1(a);case C1.code:throw new C1(a);case bu.code:throw new bu(a);case xu.code:throw new xu(a);case S1.code:throw new S1(a);case Rc.code:throw new Rc(a);case k1.code:throw new k1(a);case A1.code:throw new A1(a);case _d.code:throw new _d(a);case _1.code:throw new _1(a);case Ot.code:throw new Ot(a);case P1.code:throw new P1(a);case I1.code:throw new I1(a);case T1.code:throw new T1(a);case O1.code:throw new O1(a);case os.code:throw new os(a);case 5e3:throw new Ot(a);default:throw o instanceof ye?o:new Sme(a)}}},{delay:({count:o,error:a})=>{var c;if(a&&a instanceof I0){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<Cye(o)})}}function Cye(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===_d.code||t.code===bu.code:t instanceof I0&&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 AU({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:Eye(r,{retryCount:n,retryDelay:i}),value:a}}function _U(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>AU({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}class Sye extends ye{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function PU(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 kye(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const q_=kye();function IU(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 PU(async({signal:d})=>await fetch(t,{...i,body:Array.isArray(n)?ci(n.map(p=>({jsonrpc:"2.0",id:p.id??q_.take(),...p}))):ci({jsonrpc:"2.0",id:n.id??q_.take(),...n}),headers:{...o,"Content-Type":"application/json"},method:a||"POST",signal:c||(s>0?d:void 0)}),{errorInstance:new C_({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 I0({body:n,details:ci(f.error)||u.statusText,headers:u.headers,status:u.status,url:t});return f}catch(u){throw u instanceof I0||u instanceof C_?u:new I0({body:n,details:u.message,url:t})}}}}function Aye(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 Sye;const m=IU(p,{fetchOptions:n,timeout:h});return AU({key:i,name:s,async request({method:v,params:y}){const b={method:v,params:y},{schedule:E}=vU({id:`${t}`,wait:f,shouldSplitBatch(L){return L.length>u},fn:L=>m.request({body:L}),sort:(L,j)=>L.id-j.id}),S=async L=>r?E(L):[await m.request({body:L})],[{error:P,result:M}]=await S(b);if(P)throw new M4({body:b,error:P,url:p});return M},retryCount:d,retryDelay:o,timeout:h,type:"http"},{fetchOptions:n,url:p})}}function _ye(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 Pye(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=r?Me(r):void 0,o=await t.request({method:"eth_feeHistory",params:[Me(e),s||n,i]});return _ye(o)}async function Iye(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>Qc(s));return e.abi?J4({abi:e.abi,logs:i,strict:r}):i}function y2(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}const Tye=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Oye=/^(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 Rye(t,{body:e,onError:r,onResponse:n}){return t.request({body:e,onError:r,onResponse:n}),t}async function $ye(t,{body:e,timeout:r=1e4}){return t.requestAsync({body:e,timeout:r})}const Mye={http(t,e){return IU(t).request(e)},webSocket:Rye,webSocketAsync:$ye};function Nye(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:NU({domain:e}),...t.types};MU({domain:e,message:r,primaryType:n,types:i});const s=["0x1901"];return e&&s.push(Dye({domain:e,types:i})),n!=="EIP712Domain"&&s.push(TU({data:r,primaryType:n,types:i})),ti(xa(s))}function Dye({domain:t,types:e}){return TU({data:t,primaryType:"EIP712Domain",types:e})}function TU({data:t,primaryType:e,types:r}){const n=OU({data:t,primaryType:e,types:r});return ti(n)}function OU({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[Lye({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=$U({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return wp(n,i)}function Lye({primaryType:t,types:e}){const r=ja(jye({primaryType:t,types:e}));return ti(r)}function jye({primaryType:t,types:e}){let r="";const n=RU({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 RU({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])RU({primaryType:s.type,types:e},r);return r}function $U({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},ti(OU({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},ti(n)];if(r==="string")return[{type:"bytes32"},ti(ja(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>$U({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},ti(wp(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function MU(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(Oye);if(d&&(typeof f=="number"||typeof f=="bigint")){const[m,v,y]=d;Me(f,{signed:v==="int",size:parseInt(y)/8})}if(u==="address"&&typeof f=="string"&&!wa(f))throw new Ad({address:f});const h=u.match(Tye);if(h){const[m,v]=h;if(v&&Wr(f)!==parseInt(v))throw new Zpe({expectedSize:parseInt(v),givenSize:Wr(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 NU({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 Bye={"0x0":"reverted","0x1":"success"};function Fye(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=>Qc(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?ga(t.transactionIndex):null,status:t.status?Bye[t.status]:null,type:t.type?JF[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}const Uye=`Ethereum Signed Message: -`;function zye(t,e){const r=typeof t=="string"?sa(t):t.raw instanceof Uint8Array?t.raw:gu(t.raw),n=sa(`${Uye}${r.length}`);return ti(xa([n,r]),e)}function qye(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function Wye(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?ga(t.nonce):void 0,storageProof:t.storageProof?qye(t.storageProof):void 0}}async function Hye(t,{address:e,blockNumber:r,blockTag:n,storageKeys:i}){const s=n??"latest",o=r!==void 0?Me(r):void 0,a=await t.request({method:"eth_getProof",params:[e,i,o||s]});return Wye(a)}async function Vye(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const s=r!==void 0?Me(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||n]})}async function Y4(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var u,f,d;const o=n||"latest",a=r!==void 0?Me(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,Me(s)]}):(a||o)&&(c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,Me(s)]})),!c)throw new KF({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)||XF)(c)}async function Gye(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([Re(t,Ap,"getBlockNumber")({}),e?Re(t,Y4,"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 M3(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]});if(!r)throw new QF({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||Fye)(r)}async function Kye(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=nh({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=(M.length-2)/2,f[d]=[]),f[d]=[...f[d],{allowFailure:!0,callData:M,target:E}]}catch(M){const L=M1(M,{abi:b,address:E,args:S,docsPath:"/docs/contract/multicall",functionName:P});if(!r)throw L;f[d]=[...f[d],{allowFailure:!0,callData:"0x",target:E}]}}const p=await Promise.allSettled(f.map(y=>Re(t,Kc,"readContract")({abi:_3,address:u,args:[y],blockNumber:i,blockTag:s,functionName:"aggregate3",stateOverride:a}))),m=[];for(let y=0;y{const f=ci(["watchBlockNumber",t.uid,e,r,o]);return ih(f,{onBlockNumber:n,onError:i},d=>_p(async()=>{var h;try{const p=await Re(t,Ap,"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=xp((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 ege(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:s=6,retryDelay:o=({count:c})=>~~(1<{a&&setTimeout(()=>p(new Eme({hash:r})),a);const m=ih(c,{onReplaced:n,resolve:h,reject:p},v=>{const y=Re(t,LU,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(b){if(d)return;let E=b;const S=P=>{y(),P(),m()};try{if(f){if(e>1&&(!f.blockNumber||E-f.blockNumber+1nv.resolve(f));return}if(l||(d=!0,await og(async()=>{l=await Re(t,Y4,"getTransaction")({hash:r}),l.blockNumber&&(E=l.blockNumber)},{delay:o,retryCount:s}),d=!1),f=await Re(t,M3,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||E-f.blockNumber+1nv.resolve(f))}catch(P){if(P instanceof KF||P instanceof QF){if(!l){d=!1;return}try{u=l,d=!0;const M=await og(()=>Re(t,Gc,"getBlock")({blockNumber:E,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:H})=>H instanceof YF});d=!1;const L=M.transactions.find(({from:H,nonce:K})=>H===u.from&&K===u.nonce);if(!L||(f=await Re(t,M3,"getTransactionReceipt")({hash:L.hash}),e>1&&(!f.blockNumber||E-f.blockNumber+1n{var H;(H=v.onReplaced)==null||H.call(v,{reason:j,replacedTransaction:u,transaction:L,transactionReceipt:f}),v.resolve(f)})}catch(M){S(()=>v.reject(M))}}else S(()=>v.reject(P))}}})})})}function tge(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=ci(["watchBlocks",t.uid,r,n,u,c]);return ih(p,{onBlock:i,onError:s},m=>_p(async()=>{var v;try{const y=await Re(t,Gc,"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 b=(f==null?void 0:f.number)+1n;bf.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,P,M;if(!p)return;const E=(((M=(P=(S=t.chain)==null?void 0:S.formatters)==null?void 0:P.block)==null?void 0:M.format)||ZF)(y.result);i(E,f),f=E},onError(y){s==null||s(y)}});m=v,p||m()}catch(v){s==null||s(v)}})(),m})()}function rge(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=ci(["watchEvent",e,r,n,t.uid,i,l]);return ih(m,{onLogs:a,onError:o},v=>{let y,b,E=!1;const S=_p(async()=>{var P;if(!E){try{b=await Re(t,wU,"createEventFilter")({address:e,args:r,event:i,events:s,strict:d})}catch{}E=!0;return}try{let M;if(b)M=await Re(t,m2,"getFilterChanges")({filter:b});else{const L=await Re(t,Ap,"getBlockNumber")({});y&&y!==L?M=await Re(t,X4,"getLogs")({address:e,args:r,event:i,events:s,fromBlock:y+1n,toBlock:L}):M=[],y=L}if(M.length===0)return;if(n)v.onLogs(M);else for(const L of M)v.onLogs([L])}catch(M){b&&M instanceof xu&&(E=!1),(P=v.onError)==null||P.call(v,M)}},{emitOnBegin:!0,interval:l});return async()=>{b&&await Re(t,v2,"uninstallFilter")({filter:b}),S()}})})():(()=>{let m=!0,v=()=>m=!1;return(async()=>{try{const y=s??(i?[i]:void 0);let b=[];y&&(b=[y.flatMap(S=>kp({abi:[S],eventName:S.name,args:r}))],i&&(b=b[0]));const{unsubscribe:E}=await t.transport.subscribe({params:["logs",{address:e,topics:b}],onData(S){var M;if(!m)return;const P=S.result;try{const{eventName:L,args:j}=Q4({abi:y??[],data:P.data,topics:P.topics,strict:d}),H=Qc(P,{args:j,eventName:L});a([H])}catch(L){let j,H;if(L instanceof b1||L instanceof i2){if(u)return;j=L.abiItem.name,H=(M=L.abiItem.inputs)==null?void 0:M.some(Q=>!("name"in Q&&Q.name))}const K=Qc(P,{args:H?[]:{},eventName:j});a([K])}},onError(S){o==null||o(S)}});v=E,m||v()}catch(y){o==null||o(y)}})(),v})()}function nge(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=ci(["watchPendingTransactions",t.uid,e,s]);return ih(l,{onTransactions:n,onError:r},u=>{let f;const d=_p(async()=>{var h;try{if(!f)try{f=await Re(t,EU,"createPendingTransactionFilter")({});return}catch(m){throw d(),m}const p=await Re(t,m2,"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 Re(t,v2,"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 ige(t){return{call:e=>h2(t,e),createBlockFilter:()=>aye(t),createContractEventFilter:e=>xU(t,e),createEventFilter:e=>wU(t,e),createPendingTransactionFilter:()=>EU(t),estimateContractGas:e=>lye(t,e),estimateGas:e=>c2(t,e),getBalance:e=>uye(t,e),getBlock:e=>Gc(t,e),getBlockNumber:e=>Ap(t,e),getBlockTransactionCount:e=>vye(t,e),getBytecode:e=>yye(t,e),getChainId:()=>R1(t),getContractEvents:e=>jU(t,e),getEnsAddress:e=>Hve(t,e),getEnsAvatar:e=>iye(t,e),getEnsName:e=>sye(t,e),getEnsResolver:e=>oye(t,e),getEnsText:e=>bU(t,e),getFeeHistory:e=>Pye(t,e),estimateFeesPerGas:e=>Tme(t,e),getFilterChanges:e=>m2(t,e),getFilterLogs:e=>Iye(t,e),getGasPrice:()=>j4(t),getLogs:e=>X4(t,e),getProof:e=>Hye(t,e),estimateMaxPriorityFeePerGas:e=>Ime(t,e),getStorageAt:e=>Vye(t,e),getTransaction:e=>Y4(t,e),getTransactionConfirmations:e=>Gye(t,e),getTransactionCount:e=>tU(t,e),getTransactionReceipt:e=>M3(t,e),multicall:e=>Kye(t,e),prepareTransactionRequest:e=>l2(t,e),readContract:e=>Kc(t,e),sendRawTransaction:e=>B4(t,e),simulateContract:e=>CU(t,e),verifyMessage:e=>Xye(t,e),verifyTypedData:e=>Zye(t,e),uninstallFilter:e=>v2(t,e),waitForTransactionReceipt:e=>ege(t,e),watchBlocks:e=>tge(t,e),watchBlockNumber:e=>LU(t,e),watchContractEvent:e=>xye(t,e),watchEvent:e=>rge(t,e),watchPendingTransactions:e=>nge(t,e)}}async function sge(t){var r;return((r=t.account)==null?void 0:r.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"})).map(n=>U4(n))}async function oge(t){return await t.request({method:"wallet_getPermissions"})}async function age(t){return(await t.request({method:"eth_requestAccounts"},{retryCount:0})).map(r=>ri(r))}async function cge(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function lge(t,{account:e=t.account,message:r}){if(!e)throw new s2({docsPath:"/docs/actions/wallet/signMessage"});const n=Mi(e);if(n.type==="local")return n.signMessage({message:r});const i=typeof r=="string"?P4(r):r.raw instanceof Uint8Array?ja(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function uge(t,e){var l,u,f,d;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new s2({docsPath:"/docs/actions/wallet/signTransaction"});const s=Mi(r);Cp({account:s,...e});const o=await Re(t,R1,"getChainId")({});n!==null&&VF({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)||a2;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:Me(o),from:s.address}]},{retryCount:0})}async function fge(t,e){const{account:r=t.account,domain:n,message:i,primaryType:s}=e;if(!r)throw new s2({docsPath:"/docs/actions/wallet/signTypedData"});const o=Mi(r),a={EIP712Domain:NU({domain:n}),...e.types};if(MU({domain:n,message:i,primaryType:s,types:a}),o.type==="local")return o.signTypedData({domain:n,message:i,primaryType:s,types:a});const c=ci({domain:n??{},message:i,primaryType:s,types:a},(l,u)=>Io(u)?u.toLowerCase():u);return t.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function dge(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:Me(e)}]},{retryCount:0})}async function hge(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function W_(t){return{addChain:e=>Wpe(t,e),deployContract:e=>Mme(t,e),getAddresses:()=>sge(t),getChainId:()=>R1(t),getPermissions:()=>oge(t),prepareTransactionRequest:e=>l2(t,e),requestAddresses:()=>age(t),requestPermissions:e=>cge(t,e),sendRawTransaction:e=>B4(t,e),sendTransaction:e=>u2(t,e),signMessage:e=>lge(t,e),signTransaction:e=>uge(t,e),signTypedData:e=>fge(t,e),switchChain:e=>dge(t,e),watchAsset:e=>hge(t,e),writeContract:e=>SU(t,e)}}function J4({abi:t,eventName:e,logs:r,strict:n=!0}){return r.map(i=>{var s;try{const o=Q4({...i,abi:t,strict:n});return e&&!e.includes(o.eventName)?null:{...o,...i}}catch(o){let a,c;if(o instanceof FF)return null;if(o instanceof b1||o instanceof i2){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 X4(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=>kp({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"?Me(n):n,toBlock:typeof i=="bigint"?Me(i):i}]});const h=d.map(p=>Qc(p));return u?J4({abi:u,logs:h,strict:l}):h}async function jU(t,e){const{abi:r,address:n,args:i,blockHash:s,eventName:o,fromBlock:a,toBlock:c,strict:l}=e,u=o?Sp({abi:r,name:o}):void 0,f=u?void 0:r.filter(d=>d.type==="event");return Re(t,X4,"getLogs")({address:n,args:i,blockHash:s,event:u,events:f,fromBlock:a,toBlock:c,strict:l})}function pge(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 mge(){const t=new Set;let e=[];const r=()=>pge(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 vge={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const yge=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)},gge=yge;function bge(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 N1=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return N1(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return N1(n)(r)}}}},xge=(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=N1(s.serialize),f=()=>{const v=s.partialize({...n()});let y;const b=u({state:v,version:s.version}).then(E=>l.setItem(s.name,E)).catch(E=>{y=E});if(y)throw y;return b},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(b=>b(n()));const y=((v=s.onRehydrateStorage)==null?void 0:v.call(s,n()))||void 0;return N1(l.getItem.bind(l))(s.name).then(b=>{if(b)return s.deserialize(b)}).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var E;return p=s.merge(b,(E=n())!=null?E:h),r(p,!0),f()}).then(()=>{y==null||y(p,void 0),o=!0,c.forEach(b=>b(p))}).catch(b=>{y==null||y(void 0,b)})};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},wge=(t,e)=>(r,n,i)=>{let s={storage:bge(()=>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(b=>{var E;return b((E=n())!=null?E:d)});const y=((v=s.onRehydrateStorage)==null?void 0:v.call(s,(m=n())!=null?m:d))||void 0;return N1(l.getItem.bind(l))(s.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var E;return h=s.merge(b,(E=n())!=null?E:d),r(h,!0),u()}).then(()=>{y==null||y(h,void 0),h=n(),o=!0,c.forEach(b=>b(h))}).catch(b=>{y==null||y(void 0,b)})};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},Ege=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((vge?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),xge(t,e)):wge(t,e),Cge=Ege;var Sge={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const H_=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:()=>{(Sge?"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},Aw=t=>t?H_(t):H_;var BU={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 V_(t,e){return t.slice(0,e).join(".")||"."}function G_(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 Rge(t){const{deserialize:e=Ige,key:r="wagmi",serialize:n=Oge,storage:i=FU}=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 FU={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};const Cv="2.6.5",$ge=()=>`@wagmi/core@${Cv}`;var UU=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)},ag,zU;let dl=class N3 extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return $ge()}constructor(e,r={}){var s;super(),ag.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 N3?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof N3&&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 UU(this,ag,"m",zU).call(this,this,e)}};ag=new WeakSet,zU=function t(e,r){return r!=null&&r(e)?e:e.cause?UU(this,ag,"m",t).call(this,e.cause,r):e};class wu extends dl{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class Mge extends dl{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class qU extends dl{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class Nge extends dl{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 Rl extends dl{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class Dge extends dl{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 $c(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 Lge={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:Sv(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return Sv(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:Sv(t,"isPhantom")}}};g2.type="injected";function g2(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"?{...Lge[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:g2.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 Rl;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=>ri(y))}catch(v){const y=v;if(y.code===Ot.code)throw new Ot(y);if(y.code===Rc.code)throw y}try{c!=null&&c.length||(c=(await a.request({method:"eth_requestAccounts"})).map(y=>ri(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===Ot.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===Ot.code?new Ot(v):v.code===Rc.code?new Rc(v):v}},async disconnect(){var o,a;const s=await this.getProvider();if(!s)throw new Rl;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 Rl;return(await s.request({method:"eth_accounts"})).map(a=>ri(a))},async getChainId(){const s=await this.getProvider();if(!s)throw new Rl;const o=await s.request({method:"eth_chainId"});return $c(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=Sv(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 Rl}return!!(await og(()=>PU(()=>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 Rl;const a=i.chains.find(f=>f.id===s);if(!a)throw new os(new wu);try{return await Promise.all([o.request({method:"wallet_switchEthereumChain",params:[{chainId:Me(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:Me(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 Ot(new Error("User rejected switch after adding network."));return a}catch(h){throw new Ot(h)}throw d.code===Ot.code?new Ot(d):new os(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=>ri(a))})},onChainChanged(s){const o=$c(s);i.emitter.emit("change",{chainId:o})},async onConnect(s){const o=await this.getAccounts();if(o.length===0)return;const a=$c(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 Sv(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 D3=256;let Pm=D3,Im;function jge(t=11){if(!Im||Pm+t>D3*2){Im="",Pm=0;for(let e=0;es.chains),c=Aw(()=>[...s.connectors??[],...i?[]:(o==null?void 0:o.getProviders().map(u))??[]].map(l));function l(S){var L;const P=Pge(jge()),M={...S({emitter:P,chains:a.getState(),storage:r}),emitter:P,uid:P.uid};return P.on("connect",b),(L=M.setup)==null||L.call(M),M}function u(S){const{info:P}=S,M=S.provider;return g2({target:{...P,id:P.rdns,provider:M}})}const f=new Map;function d(S={}){const P=S.chainId??v.getState().chainId,M=a.getState().find(j=>j.id===P);if(S.chainId&&!M)throw new wu;{const j=f.get(v.getState().chainId);if(j&&!M)return j;if(!M)throw new wu}{const j=f.get(P);if(j)return j}let L;if(s.client)L=s.client({chain:M});else{const j=M.id,H=a.getState().map(Y=>Y.id),K={},Q=Object.entries(s);for(const[Y,F]of Q)if(!(Y==="chains"||Y==="client"||Y==="connectors"||Y==="transports"))if(typeof F=="object")if(j in F)K[Y]=F[j];else{if(H.some(k=>k in F))continue;K[Y]=F}else K[Y]=F;L=kU({...K,chain:M,batch:K.batch??{multicall:!0},transport:Y=>s.transports[j]({...Y,connectors:c})})}return f.set(P,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-";Cv.startsWith(m)?p=parseInt(Cv.replace(m,"")):p=parseInt(Cv.split(".")[0]??"0");const v=Aw(gge(r?Cge(h,{migrate(S,P){if(P===p)return S;const M=h(),L=S&&typeof S=="object"&&"chainId"in S&&typeof S.chainId=="number"?S.chainId:M.chainId;return{...M,chainId:L}},name:"store",partialize(S){return{connections:{__type:"Map",value:Array.from(S.connections.entries()).map(([P,M])=>{const{id:L,name:j,type:H,uid:K}=M.connector;return[P,{...M,connector:{id:L,name:j,type:H,uid:K}}]})},chainId:S.chainId,current:S.current}},skipHydration:i,storage:r,version:p}):h));n&&v.subscribe(({connections:S,current:P})=>{var M;return P?(M=S.get(P))==null?void 0:M.chainId:void 0},S=>{if(a.getState().some(M=>M.id===S))return v.setState(M=>({...M,chainId:S??M.chainId}))}),o==null||o.subscribe(S=>{const P=new Map;for(const L of c.getState())P.set(L.id,!0);const M=[];for(const L of S){const j=l(u(L));P.has(j.id)||M.push(j)}c.setState(L=>[...L,...M],!0)});function y(S){v.setState(P=>{const M=P.connections.get(S.uid);return M?{...P,connections:new Map(P.connections).set(S.uid,{accounts:S.accounts??M.accounts,chainId:S.chainId??M.chainId,connector:M.connector})}:P})}function b(S){v.getState().status==="connecting"||v.getState().status==="reconnecting"||v.setState(P=>{const M=c.getState().find(L=>L.uid===S.uid);return M?{...P,connections:new Map(P.connections).set(S.uid,{accounts:S.accounts,chainId:S.chainId,connector:M}),current:S.uid,status:"connected"}:P})}function E(S){v.setState(P=>{const M=P.connections.get(S.uid);if(M&&(M.connector.emitter.off("change",y),M.connector.emitter.off("disconnect",E),M.connector.emitter.on("connect",b)),P.connections.delete(S.uid),P.connections.size===0)return{...P,connections:new Map,current:void 0,status:"disconnected"};const L=P.connections.values().next().value;return{...P,connections:new Map(P.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 P;typeof S=="function"?P=S(v.getState()):P=S;const M=h();typeof P!="object"&&(P=M),Object.keys(M).some(j=>!(j in P))&&(P=M),v.setState(P,!0)},subscribe(S,P,M){return v.subscribe(S,P,M?{...M,fireImmediately:M.emitImmediately}:void 0)},_internal:{mipd:o,store:v,ssr:!!i,syncConnectedChain:n,transports:s.transports,chains:{setState(S){const P=typeof S=="function"?S(a.getState()):S;if(P.length!==0)return a.setState(P,!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:b,disconnect:E}}}}function cg(t,e,r){const n=t[e.name??r];return typeof n=="function"?n:i=>e(t,i)}async function Fge(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 Mge;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 Uge(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 b2(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 qU;const n=e.chainId??r.chainId,i=r.connector;if(i.getClient)return i.getClient({chainId:n});const s=Mi(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 Nge({address:s.address,connector:i});return kU({account:s,chain:o,name:"Connector Client",transport:c=>_U(a)({...c,retryCount:0})})}function Z4(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 K_(t){return t.state.chainId}function Ea(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(!Ea(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&&!Ea(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}let _w=[];function Q_(t){const e=t.chains;return Ea(_w,e)?_w:(_w=e,e)}function zge(t,e={}){let r;try{r=t.getClient(e)}catch{}return r}let Tm=[];function D1(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||Ea(Tm,e)?Tm:(Tm=e,e)}let Pw=[];function Y_(t){const e=t.connectors;return Ea(Pw,e)?Pw:(Pw=e,e)}function L3(t,e={}){const r=zge(t,e);return r==null?void 0:r.extend(ige)}async function qge(t,e={}){const r=await b2(t,e);return r.extend(W_),r.extend(W_)}let Iw=!1;async function Wge(t,e={}){var l,u;if(Iw)return[];Iw=!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"})),Iw=!1,a}async function Hge(t,e){const{account:r,chainId:n,connector:i,gas:s,...o}=e;let a;typeof r=="object"&&r.type==="local"?a=t.getClient({chainId:n}):a=await b2(t,{account:r,chainId:n,connector:i});const c=await(async()=>{if(s!==null)return s===void 0?cg(a,c2,"estimateGas")({...o,account:r,chain:n?{id:n}:null}):s})();return await cg(a,u2,"sendTransaction")({...o,...r?{account:r}:{},gas:c,chain:n?{id:n}:null})}async function Vge(t,e){const{abi:r,chainId:n,connector:i,...s}=e;let o;e.account?o=e.account:o=(await b2(t,{chainId:n,connector:i})).account;const a=t.getClient({chainId:n}),c=cg(a,CU,"simulateContract"),{result:l,request:u}=await c({...s,abi:r,account:o});return{chainId:a.chain.id,result:l,request:{__mode:"prepared",...u,chainId:n}}}async function Gge(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 Dge({connector:o});return await o.switchChain({chainId:r})}const i=t.chains.find(o=>o.id===r);if(!i)throw new wu;return t.setState(o=>({...o,chainId:r})),i}function WU(t,e){const{onChange:r}=e;return t.subscribe(()=>Z4(t),r,{equalityFn(n,i){const{connector:s,...o}=n,{connector:a,...c}=i;return Ea(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 Kge(t,e){const{onChange:r}=e;return t.subscribe(n=>n.chainId,r)}function HU(t,e){const{onChange:r}=e;return t.subscribe(()=>D1(t),r,{equalityFn:Ea})}function Qge(t,e){const{onChange:r}=e;return t._internal.connectors.subscribe((n,i)=>{r(Object.values(n),i)})}function Yge(t,e){const{onChange:r}=e;return t.subscribe(()=>L3(t),r,{equalityFn(n,i){return(n==null?void 0:n.uid)===(i==null?void 0:i.uid)}})}async function Jge(t,e){const{account:r,chainId:n,connector:i,__mode:s,...o}=e;let a;typeof r=="object"&&r.type==="local"?a=t.getClient({chainId:n}):a=await b2(t,{account:r,chainId:n,connector:i});let c;if(s==="prepared")c=o;else{const{request:f}=await Vge(t,{...o,account:r});c=f}return await cg(a,SU,"writeContract")({...c,...r?{account:r}:{},chain:n?{id:n}:null})}e9.type="mock";function e9(t){const e=t.features??{};let r=!1,n;return i=>({id:"mock",name:"Mock Connector",type:e9.type,async setup(){n=i.chains[0].id},async connect({chainId:s}={}){if(e.connectError)throw typeof e.connectError=="boolean"?new Ot(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 qU;return(await(await this.getProvider()).request({method:"eth_accounts"})).map(a=>ri(a))},async getChainId(){const o=await(await this.getProvider()).request({method:"eth_chainId"});return x_(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 os(new wu);return await o.request({method:"wallet_switchEthereumChain",params:[{chainId:Me(s)}]}),a},onAccountsChanged(s){s.length===0?this.onDisconnect():i.emitter.emit("change",{accounts:s.map(o=>ri(o))})},onChainChanged(s){const o=$c(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 _U({request:async({method:l,params:u})=>{if(l==="eth_chainId")return Me(n);if(l==="eth_requestAccounts")return t.accounts;if(l==="eth_signTypedData_v4"&&e.signTypedDataError)throw typeof e.signTypedDataError=="boolean"?new Ot(new Error("Failed to sign typed data.")):e.signTypedDataError;if(l==="wallet_switchEthereumChain"){if(e.switchChainError)throw typeof e.switchChainError=="boolean"?new Ot(new Error("Failed to switch chain.")):e.switchChainError;n=x_(u[0].chainId,"number"),this.onChainChanged(n.toString());return}if(l==="personal_sign"){if(e.signMessageError)throw typeof e.signMessageError=="boolean"?new Ot(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 Mye.http(a,{body:f});if(d)throw new M4({body:f,error:d,url:a});return h}})({retryCount:0})}})}function Xge(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?Wge(t):t.storage&&t.setState(s=>({...s,connections:new Map}))}}}const Zge=x.createContext(void 0),ebe="2.5.7",tbe=()=>`wagmi@${ebe}`;let rbe=class extends dl{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 tbe()}},nbe=class extends rbe{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"})}};var ibe=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};function J_(t){return JSON.stringify(t,(e,r)=>obe(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function sbe(t,e){if(t&&!e||e&&!t)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function obe(t){if(!X_(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!X_(r)||!r.hasOwnProperty("isPrototypeOf"))}function X_(t){return Object.prototype.toString.call(t)==="[object Object]"}function abe(){let t=[],e=0,r=d=>{d()},n=d=>{d()},i=d=>setTimeout(d,0);const s=d=>{i=d},o=d=>{let h;e++;try{h=d()}finally{e--,e||l()}return h},a=d=>{e?t.push(d):i(()=>{r(d)})},c=d=>(...h)=>{a(()=>{d(...h)})},l=()=>{const d=t;t=[],d.length&&i(()=>{n(()=>{d.forEach(h=>{r(h)})})})};return{batch:o,batchCalls:c,schedule:a,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{n=d},setScheduler:s}}var VU=abe();function cbe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lc,uc,pi,Ho,nd,kv,G1,j3,rT,lbe=(rT=class extends ibe{constructor(r,n){super();Cl(this,nd);Cl(this,G1);Cl(this,lc,void 0);Cl(this,uc,void 0);Cl(this,pi,void 0);Cl(this,Ho,void 0);Bu(this,lc,r),this.setOptions(n),this.bindMethods(),Fu(this,nd,kv).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var i;const n=this.options;this.options=pr(this,lc).defaultMutationOptions(r),sbe(n,this.options)||pr(this,lc).getMutationCache().notify({type:"observerOptionsUpdated",mutation:pr(this,pi),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&J_(n.mutationKey)!==J_(this.options.mutationKey)?this.reset():(i=pr(this,pi))==null||i.setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=pr(this,pi))==null||r.removeObserver(this)}onMutationUpdate(r){Fu(this,nd,kv).call(this),Fu(this,G1,j3).call(this,r)}getCurrentResult(){return pr(this,uc)}reset(){var r;(r=pr(this,pi))==null||r.removeObserver(this),Bu(this,pi,void 0),Fu(this,nd,kv).call(this),Fu(this,G1,j3).call(this)}mutate(r,n){var i;return Bu(this,Ho,n),(i=pr(this,pi))==null||i.removeObserver(this),Bu(this,pi,pr(this,lc).getMutationCache().build(pr(this,lc),this.options)),pr(this,pi).addObserver(this),pr(this,pi).execute(r)}},lc=new WeakMap,uc=new WeakMap,pi=new WeakMap,Ho=new WeakMap,nd=new WeakSet,kv=function(){var n;const r=((n=pr(this,pi))==null?void 0:n.state)??cbe();Bu(this,uc,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},G1=new WeakSet,j3=function(r){VU.batch(()=>{var n,i,s,o,a,c,l,u;if(pr(this,Ho)&&this.hasListeners()){const f=pr(this,uc).variables,d=pr(this,uc).context;(r==null?void 0:r.type)==="success"?((i=(n=pr(this,Ho)).onSuccess)==null||i.call(n,r.data,f,d),(o=(s=pr(this,Ho)).onSettled)==null||o.call(s,r.data,null,f,d)):(r==null?void 0:r.type)==="error"&&((c=(a=pr(this,Ho)).onError)==null||c.call(a,r.error,f,d),(u=(l=pr(this,Ho)).onSettled)==null||u.call(l,void 0,r.error,f,d))}this.listeners.forEach(f=>{f(pr(this,uc))})})},rT),ube=x.createContext(void 0),fbe=t=>{const e=x.useContext(ube);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e};function dbe(t,e){return typeof t=="function"?t(...e):!!t}function hbe(t,e){const r=fbe(e),[n]=x.useState(()=>new lbe(r,t));x.useEffect(()=>{n.setOptions(t)},[n,t]);const i=x.useSyncExternalStore(x.useCallback(o=>n.subscribe(VU.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=x.useCallback((o,a)=>{n.mutate(o,a).catch(pbe)},[n]);if(i.error&&dbe(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function pbe(){}function mbe(t,e){const{onChange:r}=e;return t._internal.chains.subscribe((n,i)=>{r(n,i)})}function sh(t={}){const e=t.config??x.useContext(Zge);if(!e)throw new nbe;return e}var GU={exports:{}},KU={},QU={exports:{}},YU={};/** +`,i+=b_(n.state)),n.stateDiff&&(i+=` stateDiff: +`,i+=b_(n.stateDiff)),i},` State Override: +`).slice(0,-1)}class QF extends ye{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?Ri(r):void 0;let m=up({from:p==null?void 0:p.address,to:f,value:typeof d<"u"&&`${b4(d)} ${((v=i==null?void 0:i.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${oi(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${oi(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${oi(l)} gwei`,nonce:u});h&&(m+=` +${ave(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 cve extends ye{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=dp({abi:r,args:n,name:o}),l=c?KF({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?va(c,{includeName:!0}):void 0,f=up({address:i&&ape(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 y3 extends ye{constructor({abi:e,data:r,functionName:n,message:i}){let s,o,a,c;if(r&&r!=="0x")try{o=ive({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=GF[h]}else{const h=u?va(u,{includeName:!0}):void 0,p=u&&d?KF({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 xF&&(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 lve extends ye{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 T4 extends ye{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 O4(t,e){var n,i,s,o,a,c;if(!(t instanceof ye))return!1;const r=t.walk(l=>l instanceof y3);return r instanceof y3?!!(((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===GF[50]):!1}function YF(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return _o(e)?e:null}function fv(t){let e=new Uint8Array(32).fill(0);if(!t)return Bs(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=YF(r[n]),s=i?fu(i):ei(ra(r[n]),"bytes");e=ei(ya([e,s]),"bytes")}return Bs(e)}function uve(t){return`[${t.slice(2)}]`}function fve(t){const e=new Uint8Array(32).fill(0);return t?YF(t)||ei(ra(t)):Bs(e)}function e2(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(ra(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=ra(uve(fve(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 dve=3;function S1(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:u}=t instanceof T4?t:t instanceof ye?t.walk(d=>"data"in d)||t.walk():{},f=t instanceof Hb?new lve({functionName:s}):[dve,du.code].includes(a)&&(c||l||u)?new y3({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:u??l}):t;return new cve(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}const hve="modulepreload",pve=function(t,e){return new URL(t,e).href},x_={},R4=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=pve(o,n),o in x_)return;x_[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":hve,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})},mve="0x82ad56cb";function vve(t,{docsPath:e,...r}){const n=(()=>{const i=w4(t,r);return i instanceof Kb?t:i})();return new QF(n,{docsPath:e,...r})}const fw=new Map;function JF({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;pfw.delete(e),a=()=>c().map(({args:u})=>u),c=()=>fw.get(e)||[],l=u=>fw.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 t2(t,e){var b,E,S,P;const{account:r=t.account,batch:n=!!((b=t.batch)!=null&&b.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?Ri(r):void 0;try{fp(e);const L=(i?Me(i):void 0)||s,j=wve(m),H=(P=(S=(E=t.chain)==null?void 0:E.formatters)==null?void 0:S.transactionRequest)==null?void 0:P.format,Q=(H||Qb)({...E4(v,{format:H}),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&&yve({request:Q})&&!j)try{return await gve(t,{...Q,blockNumber:i,blockTag:s})}catch(F){if(!(F instanceof AF)&&!(F instanceof n3))throw F}const Y=await t.request({method:"eth_call",params:j?[Q,L,j]:[Q,L]});return Y==="0x"?{data:void 0}:{data:Y}}catch(M){const L=bve(M),{offchainLookup:j,offchainLookupSignature:H}=await R4(()=>import("./ccip-BXjLXZcK.js"),__vite__mapDeps([]),import.meta.url);if((L==null?void 0:L.slice(0,10))===H&&h)return{data:await j(t,{data:L,to:h})};throw vve(M,{...e,account:y,chain:t.chain})}}function yve({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(mve)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function gve(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 AF;l=Kd({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?Me(i):void 0)||s,{schedule:d}=JF({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(v){return v.reduce((b,{data:E})=>b+(E.length-2),0)>r*2},fn:async v=>{const y=v.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),b=ol({abi:h3,args:[y],functionName:"aggregate3"}),E=await t.request({method:"eth_call",params:[{data:b,to:l},f]});return Gd({abi:h3,args:[y],functionName:"aggregate3",data:E||"0x"})}}),[{returnData:h,success:p}]=await d({data:o,to:c});if(!p)throw new T4({data:h});return h==="0x"?{data:void 0}:{data:h}}function bve(t){if(!(t instanceof ye))return;const e=t.walk();return typeof e.data=="object"?e.data.data:e.data}function w_(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new r_({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new r_({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function xve(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=Me(e,{size:32})),r!==void 0&&(o.nonce=Me(r,{size:8})),n!==void 0&&(o.state=w_(n)),i!==void 0){if(o.state)throw new ove;o.stateDiff=w_(i)}return o}function wve(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!ga(r))throw new yd({address:r});if(e[r])throw new sve({address:r});e[r]=xve(n)}return e}async function zc(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=ol({abi:r,args:i,functionName:s});try{const{data:c}=await Re(t,t2,"call")({...o,data:a,to:n});return Gd({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw S1(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function Eve(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=Kd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l=ol({abi:l_,functionName:"addr",...n!=null?{args:[fv(i),BigInt(n)]}:{args:[fv(i)]}}),u={address:c,abi:jF,functionName:"resolve",args:[Ma(e2(i)),l],blockNumber:e,blockTag:r},f=Re(t,zc,"readContract"),d=s?await f({...u,args:[...u.args,s]}):await f(u);if(d[0]==="0x")return null;const h=Gd({abi:l_,args:n!=null?[fv(i),BigInt(n)]:void 0,functionName:"addr",data:d[0]});return h==="0x"||kc(h)==="0x00"?null:h}catch(l){if(o)throw l;if(O4(l,"resolve"))return null;throw l}}class Cve extends ye{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 Ph extends ye{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class $4 extends ye{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 Sve extends ye{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 kve=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,Ave=/^(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\-.]+))?(?\/.*)?$/,_ve=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Pve=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Ive(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 E_(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function XF({uri:t,gatewayUrls:e}){const r=_ve.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=E_(e==null?void 0:e.ipfs,"https://ipfs.io"),i=E_(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(kve),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||Ave.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(Pve,"");if(d.startsWith("i.json());return await M4({gatewayUrls:t,uri:ZF(r)})}catch{throw new $4({uri:e})}}async function M4({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=XF({uri:e,gatewayUrls:t});if(n||await Ive(r))return r;throw new $4({uri:e})}function Ove(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 Ph({reason:"Only EIP-155 supported"});if(!o)throw new Ph({reason:"Chain ID not found"});if(!c)throw new Ph({reason:"Contract address not found"});if(!i)throw new Ph({reason:"Token ID not found"});if(!a)throw new Ph({reason:"ERC namespace not found"});return{chainID:parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function Rve(t,{nft:e}){if(e.namespace==="erc721")return zc(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 zc(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 Sve({namespace:e.namespace})}async function $ve(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?Mve(t,{gatewayUrls:e,record:r}):M4({uri:r,gatewayUrls:e})}async function Mve(t,{gatewayUrls:e,record:r}){const n=Ove(r),i=await Rve(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=XF({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 M4({uri:ZF(u),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),Tve({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function eU(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=Kd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l={address:c,abi:jF,functionName:"resolve",args:[Ma(e2(n)),ol({abi:c_,functionName:"text",args:[fv(n),i]})],blockNumber:e,blockTag:r},u=Re(t,zc,"readContract"),f=s?await u({...l,args:[...l.args,s]}):await u(l);if(f[0]==="0x")return null;const d=Gd({abi:c_,functionName:"text",data:f[0]});return d===""?null:d}catch(l){if(o)throw l;if(O4(l,"resolve"))return null;throw l}}async function Nve(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await Re(t,eU,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await $ve(t,{record:c,gatewayUrls:n})}catch{return null}}async function Dve(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=Kd({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const l={address:a,abi:dme,functionName:"reverse",args:[Ma(e2(c))],blockNumber:r,blockTag:n},u=Re(t,zc,"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(O4(l,"reverse"))return null;throw l}}async function Lve(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=Kd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[o]=await Re(t,zc,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Ma(e2(n))],blockNumber:e,blockTag:r});return o}function r2(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 jve(t){const e=r2(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}class Bve extends ye{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const C_="/docs/contract/encodeEventTopics";function hp(t){var c;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const l=dp({abi:e,name:r});if(!l)throw new o_(r,{docsPath:C_});i=l}if(i.type!=="event")throw new o_(void 0,{docsPath:C_});const s=va(i),o=P4(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)=>S_({param:f,value:u[d][p]})):u[d]?S_({param:f,value:u[d]}):null))??[])}return[o,...a]}function S_({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return ei(fu(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new Bve(t.type);return lp([t],[e])}async function tU(t,e){const{address:r,abi:n,args:i,eventName:s,fromBlock:o,strict:a,toBlock:c}=e,l=r2(t,{method:"eth_newFilter"}),u=s?hp({abi:n,args:i,eventName:s}):void 0,f=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof o=="bigint"?Me(o):o,toBlock:typeof c=="bigint"?Me(c):c,topics:u}]});return{abi:n,args:i,eventName:s,id:f,request:l(f),strict:!!a,type:"event"}}async function rU(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){const c=i??(n?[n]:void 0),l=r2(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(d=>hp({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"?Me(s):s,toBlock:typeof a=="bigint"?Me(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 nU(t){const e=r2(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function Fve(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=ol({abi:r,args:i,functionName:s});try{return await Re(t,Yb,"estimateGas")({data:a,to:n,...o})}catch(c){const l=o.account?Ri(o.account):void 0;throw S1(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:l==null?void 0:l.address})}}async function Uve(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?Me(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}const zve=new Map,qve=new Map;function Wve(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,zve),n=e(t,qve);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function Hve(t,{cacheKey:e,cacheTime:r=1/0}){const n=Wve(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function pp(t,{cacheTime:e=t.cacheTime}={}){const r=await Hve(()=>t.request({method:"eth_blockNumber"}),{cacheKey:Vve(t.uid),cacheTime:e});return BigInt(r)}async function Gve(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?Me(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]}),ma(s)}async function Kve(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?Me(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]});if(s!=="0x")return s}const k_="/docs/contract/decodeEventLog";function N4(t){const{abi:e,data:r,strict:n,topics:i}=t,s=n??!0,[o,...a]=i;if(!o)throw new _pe({docsPath:k_});const c=e.find(m=>m.type==="event"&&o===P4(va(m)));if(!(c&&"name"in c)||c.type!=="event")throw new wF(o,{docsPath:k_});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=Zb(p,r);if(m)if(f)d=[...d,...m];else for(let v=0;v0?d:void 0}}function Qve({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(Zb([t],e)||[])[0]}async function iU(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=a.account?Ri(a.account):t.account,l=ol({abi:r,args:i,functionName:o});try{const{data:u}=await Re(t,t2,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:n,...a,account:c}),f=Gd({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 S1(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}function qc(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 dw=new Map,A_=new Map;let Yve=0;function Qd(t,e,r){const n=++Yve,i=()=>dw.get(t)||[],s=()=>{const u=i();dw.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=A_.get(t);i().length===1&&u&&u(),s()},a=i();if(dw.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"&&A_.set(t,l),o}async function g3(t){return new Promise(e=>setTimeout(e,t))}function mp(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 g3(c);const l=async()=>{i&&(await t({unpoll:s}),await g3(n),l())};l()})(),s}async function n2(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=>qc(s));return!("abi"in e)||!e.abi?i:L4({abi:e.abi,logs:i,strict:r})}async function i2(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function Jve(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=ai(["watchContractEvent",n,i,s,t.uid,o,u]),v=f??!1;return Qd(m,{onLogs:c,onError:a},y=>{let b,E,S=!1;const P=mp(async()=>{var M;if(!S){try{E=await Re(t,tU,"createContractEventFilter")({abi:r,address:n,args:i,eventName:o,strict:v})}catch{}S=!0;return}try{let L;if(E)L=await Re(t,n2,"getFilterChanges")({filter:E});else{const j=await Re(t,pp,"getBlockNumber")({});b&&b!==j?L=await Re(t,bU,"getContractEvents")({abi:r,address:n,args:i,eventName:o,fromBlock:b+1n,toBlock:j,strict:v}):L=[],b=j}if(L.length===0)return;if(s)y.onLogs(L);else for(const j of L)y.onLogs([j])}catch(L){E&&L instanceof hu&&(S=!1),(M=y.onError)==null||M.call(y,L)}},{emitOnBegin:!0,interval:u});return async()=>{E&&await Re(t,i2,"uninstallFilter")({filter:E}),P()}})})():(()=>{let m=!0,v=()=>m=!1;return(async()=>{try{const y=o?hp({abi:r,eventName:o,args:i}):[],{unsubscribe:b}=await t.transport.subscribe({params:["logs",{address:n,topics:y}],onData(E){var P;if(!m)return;const S=E.result;try{const{eventName:M,args:L}=N4({abi:r,data:S.data,topics:S.topics,strict:f}),j=qc(S,{args:L,eventName:M});c([j])}catch(M){let L,j;if(M instanceof l1||M instanceof Vb){if(f)return;L=M.abiItem.name,j=(P=M.abiItem.inputs)==null?void 0:P.some(K=>!("name"in K&&K.name))}const H=qc(S,{args:j?[]:{},eventName:L});c([H])}},onError(E){a==null||a(E)}});v=b,m||v()}catch(y){a==null||a(y)}})(),v})()}async function sU(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=ol({abi:r,args:i,functionName:o});return Re(t,Xb,"sendTransaction")({data:`${c}${s?s.replace("0x",""):""}`,to:n,...a})}const b3=256;let mm=b3,vm;function Xve(t=11){if(!vm||mm+t>b3*2){vm="",mm=0;for(let e=0;e{const y=v(m);for(const E in h)delete y[E];const b={...m,...y};return Object.assign(b,{extend:p(b)})}}return Object.assign(h,{extend:p(h)})}function Ky(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 g3(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 Ky(async()=>{try{return await t(r)}catch(o){const a=o;switch(a.code){case u1.code:throw new u1(a);case f1.code:throw new f1(a);case d1.code:throw new d1(a);case h1.code:throw new h1(a);case du.code:throw new du(a);case hu.code:throw new hu(a);case p1.code:throw new p1(a);case Ac.code:throw new Ac(a);case m1.code:throw new m1(a);case v1.code:throw new v1(a);case gd.code:throw new gd(a);case y1.code:throw new y1(a);case Ot.code:throw new Ot(a);case g1.code:throw new g1(a);case b1.code:throw new b1(a);case x1.code:throw new x1(a);case w1.code:throw new w1(a);case is.code:throw new is(a);case 5e3:throw new Ot(a);default:throw o instanceof ye?o:new tme(a)}}},{delay:({count:o,error:a})=>{var c;if(a&&a instanceof b0){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<eye(o)})}}function eye(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===gd.code||t.code===du.code:t instanceof b0&&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 aU({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:Zve(r,{retryCount:n,retryDelay:i}),value:a}}function cU(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>aU({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}class tye extends ye{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function lU(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 rye(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const __=rye();function uU(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 lU(async({signal:d})=>await fetch(t,{...i,body:Array.isArray(n)?ai(n.map(p=>({jsonrpc:"2.0",id:p.id??__.take(),...p}))):ai({jsonrpc:"2.0",id:n.id??__.take(),...n}),headers:{...o,"Content-Type":"application/json"},method:a||"POST",signal:c||(s>0?d:void 0)}),{errorInstance:new a_({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 b0({body:n,details:ai(f.error)||u.statusText,headers:u.headers,status:u.status,url:t});return f}catch(u){throw u instanceof b0||u instanceof a_?u:new b0({body:n,details:u.message,url:t})}}}}function nye(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 tye;const m=uU(p,{fetchOptions:n,timeout:h});return aU({key:i,name:s,async request({method:v,params:y}){const b={method:v,params:y},{schedule:E}=JF({id:`${t}`,wait:f,shouldSplitBatch(L){return L.length>u},fn:L=>m.request({body:L}),sort:(L,j)=>L.id-j.id}),S=async L=>r?E(L):[await m.request({body:L})],[{error:P,result:M}]=await S(b);if(P)throw new x4({body:b,error:P,url:p});return M},retryCount:d,retryDelay:o,timeout:h,type:"http"},{fetchOptions:n,url:p})}}function iye(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 sye(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=r?Me(r):void 0,o=await t.request({method:"eth_feeHistory",params:[Me(e),s||n,i]});return iye(o)}async function oye(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>qc(s));return e.abi?L4({abi:e.abi,logs:i,strict:r}):i}function s2(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}const aye=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,cye=/^(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 lye(t,{body:e,onError:r,onResponse:n}){return t.request({body:e,onError:r,onResponse:n}),t}async function uye(t,{body:e,timeout:r=1e4}){return t.requestAsync({body:e,timeout:r})}const fye={http(t,e){return uU(t).request(e)},webSocket:lye,webSocketAsync:uye};function dye(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:vU({domain:e}),...t.types};mU({domain:e,message:r,primaryType:n,types:i});const s=["0x1901"];return e&&s.push(hye({domain:e,types:i})),n!=="EIP712Domain"&&s.push(fU({data:r,primaryType:n,types:i})),ei(ya(s))}function hye({domain:t,types:e}){return fU({data:t,primaryType:"EIP712Domain",types:e})}function fU({data:t,primaryType:e,types:r}){const n=dU({data:t,primaryType:e,types:r});return ei(n)}function dU({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[pye({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=pU({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return lp(n,i)}function pye({primaryType:t,types:e}){const r=Ma(mye({primaryType:t,types:e}));return ei(r)}function mye({primaryType:t,types:e}){let r="";const n=hU({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 hU({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])hU({primaryType:s.type,types:e},r);return r}function pU({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},ei(dU({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},ei(n)];if(r==="string")return[{type:"bytes32"},ei(Ma(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>pU({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},ei(lp(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function mU(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(cye);if(d&&(typeof f=="number"||typeof f=="bigint")){const[m,v,y]=d;Me(f,{signed:v==="int",size:parseInt(y)/8})}if(u==="address"&&typeof f=="string"&&!ga(f))throw new yd({address:f});const h=u.match(aye);if(h){const[m,v]=h;if(v&&qr(f)!==parseInt(v))throw new Tpe({expectedSize:parseInt(v),givenSize:qr(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 vU({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 vye={"0x0":"reverted","0x1":"success"};function yye(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=>qc(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?ma(t.transactionIndex):null,status:t.status?vye[t.status]:null,type:t.type?RF[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}const gye=`Ethereum Signed Message: +`;function bye(t,e){const r=typeof t=="string"?ra(t):t.raw instanceof Uint8Array?t.raw:fu(t.raw),n=ra(`${gye}${r.length}`);return ei(ya([n,r]),e)}function xye(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function wye(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?ma(t.nonce):void 0,storageProof:t.storageProof?xye(t.storageProof):void 0}}async function Eye(t,{address:e,blockNumber:r,blockTag:n,storageKeys:i}){const s=n??"latest",o=r!==void 0?Me(r):void 0,a=await t.request({method:"eth_getProof",params:[e,i,o||s]});return wye(a)}async function Cye(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const s=r!==void 0?Me(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||n]})}async function D4(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var u,f,d;const o=n||"latest",a=r!==void 0?Me(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,Me(s)]}):(a||o)&&(c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,Me(s)]})),!c)throw new IF({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)||$F)(c)}async function Sye(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([Re(t,pp,"getBlockNumber")({}),e?Re(t,D4,"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 x3(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]});if(!r)throw new TF({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||yye)(r)}async function kye(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=Kd({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=(M.length-2)/2,f[d]=[]),f[d]=[...f[d],{allowFailure:!0,callData:M,target:E}]}catch(M){const L=S1(M,{abi:b,address:E,args:S,docsPath:"/docs/contract/multicall",functionName:P});if(!r)throw L;f[d]=[...f[d],{allowFailure:!0,callData:"0x",target:E}]}}const p=await Promise.allSettled(f.map(y=>Re(t,zc,"readContract")({abi:h3,address:u,args:[y],blockNumber:i,blockTag:s,functionName:"aggregate3",stateOverride:a}))),m=[];for(let y=0;y{const f=ai(["watchBlockNumber",t.uid,e,r,o]);return Qd(f,{onBlockNumber:n,onError:i},d=>mp(async()=>{var h;try{const p=await Re(t,pp,"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=cp((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 Oye(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:s=6,retryDelay:o=({count:c})=>~~(1<{a&&setTimeout(()=>p(new Zpe({hash:r})),a);const m=Qd(c,{onReplaced:n,resolve:h,reject:p},v=>{const y=Re(t,gU,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(b){if(d)return;let E=b;const S=P=>{y(),P(),m()};try{if(f){if(e>1&&(!f.blockNumber||E-f.blockNumber+1nv.resolve(f));return}if(l||(d=!0,await Ky(async()=>{l=await Re(t,D4,"getTransaction")({hash:r}),l.blockNumber&&(E=l.blockNumber)},{delay:o,retryCount:s}),d=!1),f=await Re(t,x3,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||E-f.blockNumber+1nv.resolve(f))}catch(P){if(P instanceof IF||P instanceof TF){if(!l){d=!1;return}try{u=l,d=!0;const M=await Ky(()=>Re(t,Uc,"getBlock")({blockNumber:E,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:H})=>H instanceof OF});d=!1;const L=M.transactions.find(({from:H,nonce:K})=>H===u.from&&K===u.nonce);if(!L||(f=await Re(t,x3,"getTransactionReceipt")({hash:L.hash}),e>1&&(!f.blockNumber||E-f.blockNumber+1n{var H;(H=v.onReplaced)==null||H.call(v,{reason:j,replacedTransaction:u,transaction:L,transactionReceipt:f}),v.resolve(f)})}catch(M){S(()=>v.reject(M))}}else S(()=>v.reject(P))}}})})})}function Rye(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=ai(["watchBlocks",t.uid,r,n,u,c]);return Qd(p,{onBlock:i,onError:s},m=>mp(async()=>{var v;try{const y=await Re(t,Uc,"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 b=(f==null?void 0:f.number)+1n;bf.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,P,M;if(!p)return;const E=(((M=(P=(S=t.chain)==null?void 0:S.formatters)==null?void 0:P.block)==null?void 0:M.format)||MF)(y.result);i(E,f),f=E},onError(y){s==null||s(y)}});m=v,p||m()}catch(v){s==null||s(v)}})(),m})()}function $ye(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=ai(["watchEvent",e,r,n,t.uid,i,l]);return Qd(m,{onLogs:a,onError:o},v=>{let y,b,E=!1;const S=mp(async()=>{var P;if(!E){try{b=await Re(t,rU,"createEventFilter")({address:e,args:r,event:i,events:s,strict:d})}catch{}E=!0;return}try{let M;if(b)M=await Re(t,n2,"getFilterChanges")({filter:b});else{const L=await Re(t,pp,"getBlockNumber")({});y&&y!==L?M=await Re(t,j4,"getLogs")({address:e,args:r,event:i,events:s,fromBlock:y+1n,toBlock:L}):M=[],y=L}if(M.length===0)return;if(n)v.onLogs(M);else for(const L of M)v.onLogs([L])}catch(M){b&&M instanceof hu&&(E=!1),(P=v.onError)==null||P.call(v,M)}},{emitOnBegin:!0,interval:l});return async()=>{b&&await Re(t,i2,"uninstallFilter")({filter:b}),S()}})})():(()=>{let m=!0,v=()=>m=!1;return(async()=>{try{const y=s??(i?[i]:void 0);let b=[];y&&(b=[y.flatMap(S=>hp({abi:[S],eventName:S.name,args:r}))],i&&(b=b[0]));const{unsubscribe:E}=await t.transport.subscribe({params:["logs",{address:e,topics:b}],onData(S){var M;if(!m)return;const P=S.result;try{const{eventName:L,args:j}=N4({abi:y??[],data:P.data,topics:P.topics,strict:d}),H=qc(P,{args:j,eventName:L});a([H])}catch(L){let j,H;if(L instanceof l1||L instanceof Vb){if(u)return;j=L.abiItem.name,H=(M=L.abiItem.inputs)==null?void 0:M.some(Q=>!("name"in Q&&Q.name))}const K=qc(P,{args:H?[]:{},eventName:j});a([K])}},onError(S){o==null||o(S)}});v=E,m||v()}catch(y){o==null||o(y)}})(),v})()}function Mye(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=ai(["watchPendingTransactions",t.uid,e,s]);return Qd(l,{onTransactions:n,onError:r},u=>{let f;const d=mp(async()=>{var h;try{if(!f)try{f=await Re(t,nU,"createPendingTransactionFilter")({});return}catch(m){throw d(),m}const p=await Re(t,n2,"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 Re(t,i2,"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 Nye(t){return{call:e=>t2(t,e),createBlockFilter:()=>jve(t),createContractEventFilter:e=>tU(t,e),createEventFilter:e=>rU(t,e),createPendingTransactionFilter:()=>nU(t),estimateContractGas:e=>Fve(t,e),estimateGas:e=>Yb(t,e),getBalance:e=>Uve(t,e),getBlock:e=>Uc(t,e),getBlockNumber:e=>pp(t,e),getBlockTransactionCount:e=>Gve(t,e),getBytecode:e=>Kve(t,e),getChainId:()=>E1(t),getContractEvents:e=>bU(t,e),getEnsAddress:e=>Eve(t,e),getEnsAvatar:e=>Nve(t,e),getEnsName:e=>Dve(t,e),getEnsResolver:e=>Lve(t,e),getEnsText:e=>eU(t,e),getFeeHistory:e=>sye(t,e),estimateFeesPerGas:e=>ame(t,e),getFilterChanges:e=>n2(t,e),getFilterLogs:e=>oye(t,e),getGasPrice:()=>S4(t),getLogs:e=>j4(t,e),getProof:e=>Eye(t,e),estimateMaxPriorityFeePerGas:e=>ome(t,e),getStorageAt:e=>Cye(t,e),getTransaction:e=>D4(t,e),getTransactionConfirmations:e=>Sye(t,e),getTransactionCount:e=>DF(t,e),getTransactionReceipt:e=>x3(t,e),multicall:e=>kye(t,e),prepareTransactionRequest:e=>Jb(t,e),readContract:e=>zc(t,e),sendRawTransaction:e=>k4(t,e),simulateContract:e=>iU(t,e),verifyMessage:e=>Iye(t,e),verifyTypedData:e=>Tye(t,e),uninstallFilter:e=>i2(t,e),waitForTransactionReceipt:e=>Oye(t,e),watchBlocks:e=>Rye(t,e),watchBlockNumber:e=>gU(t,e),watchContractEvent:e=>Jve(t,e),watchEvent:e=>$ye(t,e),watchPendingTransactions:e=>Mye(t,e)}}async function Dye(t){var r;return((r=t.account)==null?void 0:r.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"})).map(n=>_4(n))}async function Lye(t){return await t.request({method:"wallet_getPermissions"})}async function jye(t){return(await t.request({method:"eth_requestAccounts"},{retryCount:0})).map(r=>ti(r))}async function Bye(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function Fye(t,{account:e=t.account,message:r}){if(!e)throw new Gb({docsPath:"/docs/actions/wallet/signMessage"});const n=Ri(e);if(n.type==="local")return n.signMessage({message:r});const i=typeof r=="string"?p4(r):r.raw instanceof Uint8Array?Ma(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function Uye(t,e){var l,u,f,d;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new Gb({docsPath:"/docs/actions/wallet/signTransaction"});const s=Ri(r);fp({account:s,...e});const o=await Re(t,E1,"getChainId")({});n!==null&&_F({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)||Qb;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:Me(o),from:s.address}]},{retryCount:0})}async function zye(t,e){const{account:r=t.account,domain:n,message:i,primaryType:s}=e;if(!r)throw new Gb({docsPath:"/docs/actions/wallet/signTypedData"});const o=Ri(r),a={EIP712Domain:vU({domain:n}),...e.types};if(mU({domain:n,message:i,primaryType:s,types:a}),o.type==="local")return o.signTypedData({domain:n,message:i,primaryType:s,types:a});const c=ai({domain:n??{},message:i,primaryType:s,types:a},(l,u)=>_o(u)?u.toLowerCase():u);return t.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function qye(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:Me(e)}]},{retryCount:0})}async function Wye(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function P_(t){return{addChain:e=>wpe(t,e),deployContract:e=>fme(t,e),getAddresses:()=>Dye(t),getChainId:()=>E1(t),getPermissions:()=>Lye(t),prepareTransactionRequest:e=>Jb(t,e),requestAddresses:()=>jye(t),requestPermissions:e=>Bye(t,e),sendRawTransaction:e=>k4(t,e),sendTransaction:e=>Xb(t,e),signMessage:e=>Fye(t,e),signTransaction:e=>Uye(t,e),signTypedData:e=>zye(t,e),switchChain:e=>qye(t,e),watchAsset:e=>Wye(t,e),writeContract:e=>sU(t,e)}}function L4({abi:t,eventName:e,logs:r,strict:n=!0}){return r.map(i=>{var s;try{const o=N4({...i,abi:t,strict:n});return e&&!e.includes(o.eventName)?null:{...o,...i}}catch(o){let a,c;if(o instanceof wF)return null;if(o instanceof l1||o instanceof Vb){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 j4(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=>hp({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"?Me(n):n,toBlock:typeof i=="bigint"?Me(i):i}]});const h=d.map(p=>qc(p));return u?L4({abi:u,logs:h,strict:l}):h}async function bU(t,e){const{abi:r,address:n,args:i,blockHash:s,eventName:o,fromBlock:a,toBlock:c,strict:l}=e,u=o?dp({abi:r,name:o}):void 0,f=u?void 0:r.filter(d=>d.type==="event");return Re(t,j4,"getLogs")({address:n,args:i,blockHash:s,event:u,events:f,fromBlock:a,toBlock:c,strict:l})}function Hye(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 Vye(){const t=new Set;let e=[];const r=()=>Hye(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 Gye={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Kye=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)},Qye=Kye;function Yye(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 k1=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return k1(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return k1(n)(r)}}}},Jye=(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=k1(s.serialize),f=()=>{const v=s.partialize({...n()});let y;const b=u({state:v,version:s.version}).then(E=>l.setItem(s.name,E)).catch(E=>{y=E});if(y)throw y;return b},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(b=>b(n()));const y=((v=s.onRehydrateStorage)==null?void 0:v.call(s,n()))||void 0;return k1(l.getItem.bind(l))(s.name).then(b=>{if(b)return s.deserialize(b)}).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var E;return p=s.merge(b,(E=n())!=null?E:h),r(p,!0),f()}).then(()=>{y==null||y(p,void 0),o=!0,c.forEach(b=>b(p))}).catch(b=>{y==null||y(void 0,b)})};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},Xye=(t,e)=>(r,n,i)=>{let s={storage:Yye(()=>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(b=>{var E;return b((E=n())!=null?E:d)});const y=((v=s.onRehydrateStorage)==null?void 0:v.call(s,(m=n())!=null?m:d))||void 0;return k1(l.getItem.bind(l))(s.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var E;return h=s.merge(b,(E=n())!=null?E:d),r(h,!0),u()}).then(()=>{y==null||y(h,void 0),h=n(),o=!0,c.forEach(b=>b(h))}).catch(b=>{y==null||y(void 0,b)})};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},Zye=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((Gye?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Jye(t,e)):Xye(t,e),ege=Zye;var tge={BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const I_=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:()=>{(tge?"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},hw=t=>t?I_(t):I_;var xU={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 T_(t,e){return t.slice(0,e).join(".")||"."}function O_(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 lge(t){const{deserialize:e=oge,key:r="wagmi",serialize:n=cge,storage:i=wU}=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 wU={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};const dv="2.6.5",uge=()=>`@wagmi/core@${dv}`;var EU=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)},Qy,CU;let _u=class w3 extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return uge()}constructor(e,r={}){var s;super(),Qy.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 w3?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof w3&&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 EU(this,Qy,"m",CU).call(this,this,e)}};Qy=new WeakSet,CU=function t(e,r){return r!=null&&r(e)?e:e.cause?EU(this,Qy,"m",t).call(this,e.cause,r):e};class pu extends _u{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class fge extends _u{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class SU extends _u{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class dge extends _u{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 kl extends _u{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class hge extends _u{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 _c(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 pge={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:hv(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return hv(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:hv(t,"isPhantom")}}};o2.type="injected";function o2(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"?{...pge[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:o2.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 kl;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=>ti(y))}catch(v){const y=v;if(y.code===Ot.code)throw new Ot(y);if(y.code===Ac.code)throw y}try{c!=null&&c.length||(c=(await a.request({method:"eth_requestAccounts"})).map(y=>ti(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===Ot.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===Ot.code?new Ot(v):v.code===Ac.code?new Ac(v):v}},async disconnect(){var o,a;const s=await this.getProvider();if(!s)throw new kl;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 kl;return(await s.request({method:"eth_accounts"})).map(a=>ti(a))},async getChainId(){const s=await this.getProvider();if(!s)throw new kl;const o=await s.request({method:"eth_chainId"});return _c(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=hv(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 kl}return!!(await Ky(()=>lU(()=>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 kl;const a=i.chains.find(f=>f.id===s);if(!a)throw new is(new pu);try{return await Promise.all([o.request({method:"wallet_switchEthereumChain",params:[{chainId:Me(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:Me(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 Ot(new Error("User rejected switch after adding network."));return a}catch(h){throw new Ot(h)}throw d.code===Ot.code?new Ot(d):new is(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=>ti(a))})},onChainChanged(s){const o=_c(s);i.emitter.emit("change",{chainId:o})},async onConnect(s){const o=await this.getAccounts();if(o.length===0)return;const a=_c(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 hv(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 E3=256;let ym=E3,gm;function mge(t=11){if(!gm||ym+t>E3*2){gm="",ym=0;for(let e=0;es.chains),c=hw(()=>[...s.connectors??[],...i?[]:(o==null?void 0:o.getProviders().map(u))??[]].map(l));function l(S){var L;const P=sge(mge()),M={...S({emitter:P,chains:a.getState(),storage:r}),emitter:P,uid:P.uid};return P.on("connect",b),(L=M.setup)==null||L.call(M),M}function u(S){const{info:P}=S,M=S.provider;return o2({target:{...P,id:P.rdns,provider:M}})}const f=new Map;function d(S={}){const P=S.chainId??v.getState().chainId,M=a.getState().find(j=>j.id===P);if(S.chainId&&!M)throw new pu;{const j=f.get(v.getState().chainId);if(j&&!M)return j;if(!M)throw new pu}{const j=f.get(P);if(j)return j}let L;if(s.client)L=s.client({chain:M});else{const j=M.id,H=a.getState().map(Y=>Y.id),K={},Q=Object.entries(s);for(const[Y,F]of Q)if(!(Y==="chains"||Y==="client"||Y==="connectors"||Y==="transports"))if(typeof F=="object")if(j in F)K[Y]=F[j];else{if(H.some(k=>k in F))continue;K[Y]=F}else K[Y]=F;L=oU({...K,chain:M,batch:K.batch??{multicall:!0},transport:Y=>s.transports[j]({...Y,connectors:c})})}return f.set(P,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-";dv.startsWith(m)?p=parseInt(dv.replace(m,"")):p=parseInt(dv.split(".")[0]??"0");const v=hw(Qye(r?ege(h,{migrate(S,P){if(P===p)return S;const M=h(),L=S&&typeof S=="object"&&"chainId"in S&&typeof S.chainId=="number"?S.chainId:M.chainId;return{...M,chainId:L}},name:"store",partialize(S){return{connections:{__type:"Map",value:Array.from(S.connections.entries()).map(([P,M])=>{const{id:L,name:j,type:H,uid:K}=M.connector;return[P,{...M,connector:{id:L,name:j,type:H,uid:K}}]})},chainId:S.chainId,current:S.current}},skipHydration:i,storage:r,version:p}):h));n&&v.subscribe(({connections:S,current:P})=>{var M;return P?(M=S.get(P))==null?void 0:M.chainId:void 0},S=>{if(a.getState().some(M=>M.id===S))return v.setState(M=>({...M,chainId:S??M.chainId}))}),o==null||o.subscribe(S=>{const P=new Map;for(const L of c.getState())P.set(L.id,!0);const M=[];for(const L of S){const j=l(u(L));P.has(j.id)||M.push(j)}c.setState(L=>[...L,...M],!0)});function y(S){v.setState(P=>{const M=P.connections.get(S.uid);return M?{...P,connections:new Map(P.connections).set(S.uid,{accounts:S.accounts??M.accounts,chainId:S.chainId??M.chainId,connector:M.connector})}:P})}function b(S){v.getState().status==="connecting"||v.getState().status==="reconnecting"||v.setState(P=>{const M=c.getState().find(L=>L.uid===S.uid);return M?{...P,connections:new Map(P.connections).set(S.uid,{accounts:S.accounts,chainId:S.chainId,connector:M}),current:S.uid,status:"connected"}:P})}function E(S){v.setState(P=>{const M=P.connections.get(S.uid);if(M&&(M.connector.emitter.off("change",y),M.connector.emitter.off("disconnect",E),M.connector.emitter.on("connect",b)),P.connections.delete(S.uid),P.connections.size===0)return{...P,connections:new Map,current:void 0,status:"disconnected"};const L=P.connections.values().next().value;return{...P,connections:new Map(P.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 P;typeof S=="function"?P=S(v.getState()):P=S;const M=h();typeof P!="object"&&(P=M),Object.keys(M).some(j=>!(j in P))&&(P=M),v.setState(P,!0)},subscribe(S,P,M){return v.subscribe(S,P,M?{...M,fireImmediately:M.emitImmediately}:void 0)},_internal:{mipd:o,store:v,ssr:!!i,syncConnectedChain:n,transports:s.transports,chains:{setState(S){const P=typeof S=="function"?S(a.getState()):S;if(P.length!==0)return a.setState(P,!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:b,disconnect:E}}}}function Yy(t,e,r){const n=t[e.name??r];return typeof n=="function"?n:i=>e(t,i)}async function yge(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 fge;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 gge(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 a2(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 SU;const n=e.chainId??r.chainId,i=r.connector;if(i.getClient)return i.getClient({chainId:n});const s=Ri(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 dge({address:s.address,connector:i});return oU({account:s,chain:o,name:"Connector Client",transport:c=>cU(a)({...c,retryCount:0})})}function kU(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 R_(t){return t.state.chainId}function Wc(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(!Wc(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&&!Wc(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}let pw=[];function $_(t){const e=t.chains;return Wc(pw,e)?pw:(pw=e,e)}function bge(t,e={}){let r;try{r=t.getClient(e)}catch{}return r}let bm=[];function C3(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||Wc(bm,e)?bm:(bm=e,e)}let mw=[];function M_(t){const e=t.connectors;return Wc(mw,e)?mw:(mw=e,e)}function S3(t,e={}){const r=bge(t,e);return r==null?void 0:r.extend(Nye)}async function xge(t,e={}){const r=await a2(t,e);return r.extend(P_),r.extend(P_)}let vw=!1;async function wge(t,e={}){var l,u;if(vw)return[];vw=!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"})),vw=!1,a}async function Ege(t,e){const{account:r,chainId:n,connector:i,gas:s,...o}=e;let a;typeof r=="object"&&r.type==="local"?a=t.getClient({chainId:n}):a=await a2(t,{account:r,chainId:n,connector:i});const c=await(async()=>{if(s!==null)return s===void 0?Yy(a,Yb,"estimateGas")({...o,account:r,chain:n?{id:n}:null}):s})();return await Yy(a,Xb,"sendTransaction")({...o,...r?{account:r}:{},gas:c,chain:n?{id:n}:null})}async function Cge(t,e){const{abi:r,chainId:n,connector:i,...s}=e;let o;e.account?o=e.account:o=(await a2(t,{chainId:n,connector:i})).account;const a=t.getClient({chainId:n}),c=Yy(a,iU,"simulateContract"),{result:l,request:u}=await c({...s,abi:r,account:o});return{chainId:a.chain.id,result:l,request:{__mode:"prepared",...u,chainId:n}}}async function Sge(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 hge({connector:o});return await o.switchChain({chainId:r})}const i=t.chains.find(o=>o.id===r);if(!i)throw new pu;return t.setState(o=>({...o,chainId:r})),i}function kge(t,e){const{onChange:r}=e;return t.subscribe(()=>kU(t),r,{equalityFn(n,i){const{connector:s,...o}=n,{connector:a,...c}=i;return Wc(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 Age(t,e){const{onChange:r}=e;return t.subscribe(n=>n.chainId,r)}function _ge(t,e){const{onChange:r}=e;return t.subscribe(()=>C3(t),r,{equalityFn:Wc})}function Pge(t,e){const{onChange:r}=e;return t._internal.connectors.subscribe((n,i)=>{r(Object.values(n),i)})}function Ige(t,e){const{onChange:r}=e;return t.subscribe(()=>S3(t),r,{equalityFn(n,i){return(n==null?void 0:n.uid)===(i==null?void 0:i.uid)}})}async function Tge(t,e){const{account:r,chainId:n,connector:i,__mode:s,...o}=e;let a;typeof r=="object"&&r.type==="local"?a=t.getClient({chainId:n}):a=await a2(t,{account:r,chainId:n,connector:i});let c;if(s==="prepared")c=o;else{const{request:f}=await Cge(t,{...o,account:r});c=f}return await Yy(a,sU,"writeContract")({...c,...r?{account:r}:{},chain:n?{id:n}:null})}B4.type="mock";function B4(t){const e=t.features??{};let r=!1,n;return i=>({id:"mock",name:"Mock Connector",type:B4.type,async setup(){n=i.chains[0].id},async connect({chainId:s}={}){if(e.connectError)throw typeof e.connectError=="boolean"?new Ot(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 SU;return(await(await this.getProvider()).request({method:"eth_accounts"})).map(a=>ti(a))},async getChainId(){const o=await(await this.getProvider()).request({method:"eth_chainId"});return i_(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 is(new pu);return await o.request({method:"wallet_switchEthereumChain",params:[{chainId:Me(s)}]}),a},onAccountsChanged(s){s.length===0?this.onDisconnect():i.emitter.emit("change",{accounts:s.map(o=>ti(o))})},onChainChanged(s){const o=_c(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 cU({request:async({method:l,params:u})=>{if(l==="eth_chainId")return Me(n);if(l==="eth_requestAccounts")return t.accounts;if(l==="eth_signTypedData_v4"&&e.signTypedDataError)throw typeof e.signTypedDataError=="boolean"?new Ot(new Error("Failed to sign typed data.")):e.signTypedDataError;if(l==="wallet_switchEthereumChain"){if(e.switchChainError)throw typeof e.switchChainError=="boolean"?new Ot(new Error("Failed to switch chain.")):e.switchChainError;n=i_(u[0].chainId,"number"),this.onChainChanged(n.toString());return}if(l==="personal_sign"){if(e.signMessageError)throw typeof e.signMessageError=="boolean"?new Ot(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 fye.http(a,{body:f});if(d)throw new x4({body:f,error:d,url:a});return h}})({retryCount:0})}})}function Oge(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?wge(t):t.storage&&t.setState(s=>({...s,connections:new Map}))}}}function Rge(t){const{children:e,config:r,initialState:n,reconnectOnMount:i=!0}=t,{onMount:s}=Oge(r,{initialState:n,reconnectOnMount:i});r._internal.ssr||s();const o=w.useRef(!0);return w.useEffect(()=>{if(o.current&&r._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const AU=w.createContext(void 0);function $ge(t){const{children:e,config:r}=t,n={value:r};return w.createElement(Rge,t,w.createElement(AU.Provider,n,e))}const Mge="2.5.7",Nge=()=>`wagmi@${Mge}`;class Dge extends _u{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 Nge()}}class Lge extends Dge{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 Yd{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 A1=typeof window>"u"||"Deno"in window;function Fi(){}function jge(t,e){return typeof t=="function"?t(e):t}function k3(t){return typeof t=="number"&&t>=0&&t!==1/0}function _U(t,e){return Math.max(t+(e||0)-Date.now(),0)}function kf(t,e,r){return vp(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function Bge(t,e,r){return vp(t)?typeof e=="function"?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:typeof t=="function"?{...e,mutationFn:t}:{...t}}function rc(t,e,r){return vp(t)?[{...e,queryKey:t},r]:[t||{},e]}function N_(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(vp(o)){if(n){if(e.queryHash!==F4(o,e.options))return!1}else if(!Jy(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 D_(t,e){const{exact:r,fetching:n,predicate:i,mutationKey:s}=t;if(vp(s)){if(!e.options.mutationKey)return!1;if(r){if(jl(e.options.mutationKey)!==jl(s))return!1}else if(!Jy(e.options.mutationKey,s))return!1}return!(typeof n=="boolean"&&e.state.status==="loading"!==n||i&&!i(e))}function F4(t,e){return((e==null?void 0:e.queryKeyHashFn)||jl)(t)}function jl(t){return JSON.stringify(t,(e,r)=>A3(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Jy(t,e){return PU(t,e)}function PU(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!PU(t[r],e[r])):!1}function IU(t,e){if(t===e)return t;const r=L_(t)&&L_(e);if(r||A3(t)&&A3(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!(!j_(r)||!r.hasOwnProperty("isPrototypeOf"))}function j_(t){return Object.prototype.toString.call(t)==="[object Object]"}function vp(t){return Array.isArray(t)}function TU(t){return new Promise(e=>{setTimeout(e,t)})}function B_(t){TU(0).then(t)}function Fge(){if(typeof AbortController=="function")return new AbortController}function _3(t,e,r){return r.isDataEqual!=null&&r.isDataEqual(t,e)?t:typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?IU(t,e):e}class Uge extends Yd{constructor(){super(),this.setup=e=>{if(!A1&&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 Zy=new Uge,F_=["online","offline"];class zge extends Yd{constructor(){super(),this.setup=e=>{if(!A1&&window.addEventListener){const r=()=>e();return F_.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{F_.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 eg=new zge;function qge(t){return Math.min(1e3*2**t,3e4)}function c2(t){return(t??"online")==="online"?eg.isOnline():!0}class OU{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function pv(t){return t instanceof OU}function RU(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 OU(v)),t.abort==null||t.abort())},l=()=>{e=!0},u=()=>{e=!1},f=()=>!Zy.isFocused()||t.networkMode!=="always"&&!eg.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 b=n||!f();return b&&v(y),b},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 b,E;if(n)return;const S=(b=t.retry)!=null?b:3,P=(E=t.retryDelay)!=null?E:qge,M=typeof P=="function"?P(r,y):P,L=S===!0||typeof S=="number"&&r{if(f())return p()}).then(()=>{e?h(y):m()})})};return c2(t.networkMode)?m():p().then(m),{promise:a,cancel:c,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:l,continueRetry:u}}const U4=console;function Wge(){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):B_(()=>{r(u)})},o=u=>(...f)=>{s(()=>{u(...f)})},a=()=>{const u=t;t=[],u.length&&B_(()=>{n(()=>{u.forEach(f=>{r(f)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}const yr=Wge();class $U{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),k3(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e??(A1?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Hge extends $U{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||U4,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||Vge(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=_3(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(Fi).catch(Fi):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||!_U(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=Fge(),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(pv(h)&&h.silent||this.dispatch({type:"error",error:h}),!pv(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=RU({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:c2(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 pv(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),yr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function Vge(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 Gge extends Yd{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:F4(s,r);let a=this.get(o);return a||(a=new Hge({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(){yr.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,r){const[n]=rc(e,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>N_(n,i))}findAll(e,r){const[n]=rc(e,r);return Object.keys(n).length>0?this.queries.filter(i=>N_(n,i)):this.queries}notify(e){yr.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}onFocus(){yr.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){yr.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class Kge extends $U{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||U4,this.observers=[],this.state=e.state||MU(),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=RU({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(j,H)=>{this.dispatch({type:"failed",failureCount:j,error:H})},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 j=await((h=(p=this.options).onMutate)==null?void 0:h.call(p,this.state.variables));j!==this.state.context&&this.dispatch({type:"loading",context:j,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,b,E,S,P,M;throw await((m=(v=this.mutationCache.config).onError)==null?void 0:m.call(v,L,this.state.variables,this.state.context,this)),await((y=(b=this.options).onError)==null?void 0:y.call(b,L,this.state.variables,this.state.context)),await((E=(S=this.mutationCache.config).onSettled)==null?void 0:E.call(S,void 0,L,this.state.variables,this.state.context,this)),await((P=(M=this.options).onSettled)==null?void 0:P.call(M,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:!c2(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),yr.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function MU(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class Qge extends Yd{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,r,n){const i=new Kge({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(){yr.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=>D_(e,r))}findAll(e){return this.mutations.filter(r=>D_(e,r))}notify(e){yr.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 yr.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(Fi)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function P3(){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=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>{var L;if((L=t.signal)!=null&&L.aborted)m=!0;else{var j;(j=t.signal)==null||j.addEventListener("abort",()=>{m=!0})}return t.signal}})},y=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),b=(M,L,j,H)=>(p=H?[L,...p]:[...p,L],H?[j,...M]:[...M,j]),E=(M,L,j,H)=>{if(m)return Promise.reject("Cancelled");if(typeof j>"u"&&!L&&M.length)return Promise.resolve(M);const K={queryKey:t.queryKey,pageParam:j,meta:t.options.meta};v(K);const Q=y(K);return Promise.resolve(Q).then(F=>b(M,j,F,H))};let S;if(!d.length)S=E([]);else if(u){const M=typeof l<"u",L=M?l:I3(t.options,d);S=E(d,M,L)}else if(f){const M=typeof l<"u",L=M?l:NU(t.options,d);S=E(d,M,L,!0)}else{p=[];const M=typeof t.options.getNextPageParam>"u";S=(a&&d[0]?a(d[0],0,d):!0)?E([],M,h[0]):Promise.resolve(b([],h[0],d[0]));for(let j=1;j{if(a&&d[j]?a(d[j],j,d):!0){const Q=M?h[j]:I3(t.options,H);return E(H,M,Q)}return Promise.resolve(b(H,h[j],d[j]))})}return S.then(M=>({pages:M,pageParams:p}))}}}}function I3(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function NU(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}function Yge(t,e){if(t.getNextPageParam&&Array.isArray(e)){const r=I3(t,e);return typeof r<"u"&&r!==null&&r!==!1}}function Jge(t,e){if(t.getPreviousPageParam&&Array.isArray(e)){const r=NU(t,e);return typeof r<"u"&&r!==null&&r!==!1}}class z4{constructor(e={}){this.queryCache=e.queryCache||new Gge,this.mutationCache=e.mutationCache||new Qge,this.logger=e.logger||U4,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Zy.subscribe(()=>{Zy.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=eg.subscribe(()=>{eg.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]=rc(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=kf(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=jge(r,s);if(typeof o>"u")return;const a=kf(e),c=this.defaultQueryOptions(a);return this.queryCache.build(this,c).setData(o,{...n,manual:!0})}setQueriesData(e,r,n){return yr.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]=rc(e,r),i=this.queryCache;yr.batch(()=>{i.findAll(n).forEach(s=>{i.remove(s)})})}resetQueries(e,r,n){const[i,s]=rc(e,r,n),o=this.queryCache,a={type:"active",...i};return yr.batch(()=>(o.findAll(i).forEach(c=>{c.reset()}),this.refetchQueries(a,s)))}cancelQueries(e,r,n){const[i,s={}]=rc(e,r,n);typeof s.revert>"u"&&(s.revert=!0);const o=yr.batch(()=>this.queryCache.findAll(i).map(a=>a.cancel(s)));return Promise.all(o).then(Fi).catch(Fi)}invalidateQueries(e,r,n){const[i,s]=rc(e,r,n);return yr.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]=rc(e,r,n),o=yr.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(Fi);return s!=null&&s.throwOnError||(a=a.catch(Fi)),a}fetchQuery(e,r,n){const i=kf(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(Fi).catch(Fi)}fetchInfiniteQuery(e,r,n){const i=kf(e,r,n);return i.behavior=P3(),this.fetchQuery(i)}prefetchInfiniteQuery(e,r,n){return this.fetchInfiniteQuery(e,r,n).then(Fi).catch(Fi)}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=>jl(e)===jl(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:e,defaultOptions:r})}getQueryDefaults(e){if(!e)return;const r=this.queryDefaults.find(n=>Jy(e,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(e,r){const n=this.mutationDefaults.find(i=>jl(e)===jl(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:e,defaultOptions:r})}getMutationDefaults(e){if(!e)return;const r=this.mutationDefaults.find(n=>Jy(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=F4(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 DU extends Yd{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),U_(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return T3(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return T3(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),Xy(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&&z_(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 Zge(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(Fi)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),A1||this.currentResult.isStale||!k3(this.options.staleTime))return;const r=_U(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,!(A1||this.options.enabled===!1||!k3(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Zy.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,b=!1,E;if(r._optimisticResults){const j=this.hasListeners(),H=!j&&U_(e,r),K=j&&z_(e,n,r,i);(H||K)&&(m=c2(e.options.networkMode)?"fetching":"paused",d||(v="loading")),r._optimisticResults==="isRestoring"&&(m="idle")}if(r.keepPreviousData&&!f.dataUpdatedAt&&u!=null&&u.isSuccess&&v!=="error")E=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)E=this.selectResult;else try{this.selectFn=r.select,E=r.select(f.data),E=_3(s==null?void 0:s.data,E,r),this.selectResult=E,this.selectError=null}catch(j){this.selectError=j}else E=f.data;if(typeof r.placeholderData<"u"&&typeof E>"u"&&v==="loading"){let j;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))j=s.data;else if(j=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof j<"u")try{j=r.select(j),this.selectError=null}catch(H){this.selectError=H}typeof j<"u"&&(v="success",E=_3(s==null?void 0:s.data,j,r),b=!0)}this.selectError&&(h=this.selectError,E=this.selectResult,p=Date.now(),v="error");const S=m==="fetching",P=v==="loading",M=v==="error";return{status:v,fetchStatus:m,isLoading:P,isSuccess:v==="success",isError:M,isInitialLoading:P&&S,data:E,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&&!P,isLoadingError:M&&f.dataUpdatedAt===0,isPaused:m==="paused",isPlaceholderData:b,isPreviousData:y,isRefetchError:M&&f.dataUpdatedAt!==0,isStale:q4(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,Xy(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"&&!pv(e.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(e){yr.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 Xge(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function U_(t,e){return Xge(t,e)||t.state.dataUpdatedAt>0&&T3(t,e,e.refetchOnMount)}function T3(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&q4(t,e)}return!1}function z_(t,e,r,n){return r.enabled!==!1&&(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&q4(t,r)}function q4(t,e){return t.isStaleByTime(e.staleTime)}function Zge(t,e,r){return r.keepPreviousData?!1:r.placeholderData!==void 0?e.isPlaceholderData:!Xy(t.getCurrentResult(),e)}class ebe extends DU{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:P3()},r)}getOptimisticResult(e){return e.behavior=P3(),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:Yge(r,(a=l.data)==null?void 0:a.pages),hasPreviousPage:Jge(r,(c=l.data)==null?void 0:c.pages),isFetchingNextPage:h,isFetchingPreviousPage:p,isRefetching:d&&!h&&!p}}}let tbe=class extends Yd{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),Xy(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:MU(),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){yr.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 LU={exports:{}},jU={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -175,7 +175,7 @@ ${Tve(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 Pd=x;function vbe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ybe=typeof Object.is=="function"?Object.is:vbe,gbe=Pd.useState,bbe=Pd.useEffect,xbe=Pd.useLayoutEffect,wbe=Pd.useDebugValue;function Ebe(t,e){var r=e(),n=gbe({inst:{value:r,getSnapshot:e}}),i=n[0].inst,s=n[1];return xbe(function(){i.value=r,i.getSnapshot=e,Tw(i)&&s({inst:i})},[t,r,e]),bbe(function(){return Tw(i)&&s({inst:i}),t(function(){Tw(i)&&s({inst:i})})},[t]),wbe(r),r}function Tw(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!ybe(t,r)}catch{return!0}}function Cbe(t,e){return e()}var Sbe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Cbe:Ebe;YU.useSyncExternalStore=Pd.useSyncExternalStore!==void 0?Pd.useSyncExternalStore:Sbe;QU.exports=YU;var JU=QU.exports;/** + */var bd=w;function rbe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var nbe=typeof Object.is=="function"?Object.is:rbe,ibe=bd.useState,sbe=bd.useEffect,obe=bd.useLayoutEffect,abe=bd.useDebugValue;function cbe(t,e){var r=e(),n=ibe({inst:{value:r,getSnapshot:e}}),i=n[0].inst,s=n[1];return obe(function(){i.value=r,i.getSnapshot=e,yw(i)&&s({inst:i})},[t,r,e]),sbe(function(){return yw(i)&&s({inst:i}),t(function(){yw(i)&&s({inst:i})})},[t]),abe(r),r}function yw(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!nbe(t,r)}catch{return!0}}function lbe(t,e){return e()}var ube=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?lbe:cbe;jU.useSyncExternalStore=bd.useSyncExternalStore!==void 0?bd.useSyncExternalStore:ube;LU.exports=jU;var BU=LU.exports;const FU=BU.useSyncExternalStore,q_=w.createContext(void 0),UU=w.createContext(!1);function zU(t,e){return t||(e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=q_),window.ReactQueryClientContext):q_)}const W4=({context:t}={})=>{const e=w.useContext(zU(t,w.useContext(UU)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},H4=({client:t,children:e,context:r,contextSharing:n=!1})=>{w.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);const i=zU(r,n);return w.createElement(UU.Provider,{value:!r&&n},w.createElement(i.Provider,{value:t},e))},qU=w.createContext(!1),fbe=()=>w.useContext(qU);qU.Provider;function dbe(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const hbe=w.createContext(dbe()),pbe=()=>w.useContext(hbe);function WU(t,e){return typeof t=="function"?t(...e):!!t}const mbe=(t,e)=>{(t.suspense||t.useErrorBoundary)&&(e.isReset()||(t.retryOnMount=!1))},vbe=t=>{w.useEffect(()=>{t.clearReset()},[t])},ybe=({result:t,errorResetBoundary:e,useErrorBoundary:r,query:n})=>t.isError&&!e.isReset()&&!t.isFetching&&WU(r,[t.error,n]),gbe=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},bbe=(t,e)=>t.isLoading&&t.isFetching&&!e,xbe=(t,e,r)=>(t==null?void 0:t.suspense)&&bbe(e,r),wbe=(t,e,r)=>e.fetchOptimistic(t).then(({data:n})=>{t.onSuccess==null||t.onSuccess(n),t.onSettled==null||t.onSettled(n,null)}).catch(n=>{r.clearReset(),t.onError==null||t.onError(n),t.onSettled==null||t.onSettled(void 0,n)});function HU(t,e){const r=W4({context:t.context}),n=fbe(),i=pbe(),s=r.defaultQueryOptions(t);s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=yr.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=yr.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=yr.batchCalls(s.onSettled)),gbe(s),mbe(s,i),vbe(i);const[o]=w.useState(()=>new e(r,s)),a=o.getOptimisticResult(s);if(FU(w.useCallback(c=>{const l=n?()=>{}:o.subscribe(yr.batchCalls(c));return o.updateResult(),l},[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),w.useEffect(()=>{o.setOptions(s,{listeners:!1})},[s,o]),xbe(s,a,n))throw wbe(s,o,i);if(ybe({result:a,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:o.getCurrentQuery()}))throw a.error;return s.notifyOnChangeProps?a:o.trackResult(a)}function qn(t,e,r){const n=kf(t,e,r);return HU(n,DU)}function yp(t,e,r){const n=Bge(t,e,r),i=W4({context:n.context}),[s]=w.useState(()=>new tbe(i,n));w.useEffect(()=>{s.setOptions(n)},[s,n]);const o=FU(w.useCallback(c=>s.subscribe(yr.batchCalls(c)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=w.useCallback((c,l)=>{s.mutate(c,l).catch(Ebe)},[s]);if(o.error&&WU(s.options.useErrorBoundary,[o.error]))throw o.error;return{...o,mutate:a,mutateAsync:o.mutate}}function Ebe(){}function Cbe(t,e,r){const n=kf(t,e,r);return HU(n,ebe)}function Sbe(t,e){const{onChange:r}=e;return t._internal.chains.subscribe((n,i)=>{r(n,i)})}function vt(t={}){const e=t.config??w.useContext(AU);if(!e)throw new Lge;return e}var VU={exports:{}},GU={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -183,7 +183,7 @@ ${Tve(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 x2=x,kbe=JU;function Abe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var _be=typeof Object.is=="function"?Object.is:Abe,Pbe=kbe.useSyncExternalStore,Ibe=x2.useRef,Tbe=x2.useEffect,Obe=x2.useMemo,Rbe=x2.useDebugValue;KU.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var s=Ibe(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=Obe(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,_be(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=Pbe(t,s[0],s[1]);return Tbe(function(){o.hasValue=!0,o.value=a},[a]),Rbe(a),a};GU.exports=KU;var t9=GU.exports;const Ow=t=>typeof t=="object"&&!Array.isArray(t);function $be(t,e,r=e,n=Ea){const i=x.useRef([]),s=t9.useSyncExternalStoreWithSelector(t,e,r,o=>o,(o,a)=>{if(Ow(o)&&Ow(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(Ow(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 XU(t={}){const e=sh(t);return $be(r=>WU(e,{onChange:r}),()=>Z4(e))}class oh{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 zi(){}function Mbe(t,e){return typeof t=="function"?t(e):t}function B3(t){return typeof t=="number"&&t>=0&&t!==1/0}function ZU(t,e){return Math.max(t+(e||0)-Date.now(),0)}function $f(t,e,r){return Pp(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function Nbe(t,e,r){return Pp(t)?typeof e=="function"?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:typeof t=="function"?{...e,mutationFn:t}:{...t}}function oc(t,e,r){return Pp(t)?[{...e,queryKey:t},r]:[t||{},e]}function Z_(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(Pp(o)){if(n){if(e.queryHash!==r9(o,e.options))return!1}else if(!lg(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 eP(t,e){const{exact:r,fetching:n,predicate:i,mutationKey:s}=t;if(Pp(s)){if(!e.options.mutationKey)return!1;if(r){if(Hl(e.options.mutationKey)!==Hl(s))return!1}else if(!lg(e.options.mutationKey,s))return!1}return!(typeof n=="boolean"&&e.state.status==="loading"!==n||i&&!i(e))}function r9(t,e){return((e==null?void 0:e.queryKeyHashFn)||Hl)(t)}function Hl(t){return JSON.stringify(t,(e,r)=>F3(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function lg(t,e){return ez(t,e)}function ez(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!ez(t[r],e[r])):!1}function tz(t,e){if(t===e)return t;const r=tP(t)&&tP(e);if(r||F3(t)&&F3(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!(!rP(r)||!r.hasOwnProperty("isPrototypeOf"))}function rP(t){return Object.prototype.toString.call(t)==="[object Object]"}function Pp(t){return Array.isArray(t)}function rz(t){return new Promise(e=>{setTimeout(e,t)})}function nP(t){rz(0).then(t)}function Dbe(){if(typeof AbortController=="function")return new AbortController}function U3(t,e,r){return r.isDataEqual!=null&&r.isDataEqual(t,e)?t:typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?tz(t,e):e}class Lbe extends oh{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 fg=new Lbe,iP=["online","offline"];class jbe extends oh{constructor(){super(),this.setup=e=>{if(!L1&&window.addEventListener){const r=()=>e();return iP.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{iP.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 dg=new jbe;function Bbe(t){return Math.min(1e3*2**t,3e4)}function w2(t){return(t??"online")==="online"?dg.isOnline():!0}class nz{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function Av(t){return t instanceof nz}function iz(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 nz(v)),t.abort==null||t.abort())},l=()=>{e=!0},u=()=>{e=!1},f=()=>!fg.isFocused()||t.networkMode!=="always"&&!dg.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 b=n||!f();return b&&v(y),b},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 b,E;if(n)return;const S=(b=t.retry)!=null?b:3,P=(E=t.retryDelay)!=null?E:Bbe,M=typeof P=="function"?P(r,y):P,L=S===!0||typeof S=="number"&&r{if(f())return p()}).then(()=>{e?h(y):m()})})};return w2(t.networkMode)?m():p().then(m),{promise:a,cancel:c,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:l,continueRetry:u}}const n9=console;function Fbe(){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):nP(()=>{r(u)})},o=u=>(...f)=>{s(()=>{u(...f)})},a=()=>{const u=t;t=[],u.length&&nP(()=>{n(()=>{u.forEach(f=>{r(f)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}const gr=Fbe();class sz{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),B3(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 Ube extends sz{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||n9,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||zbe(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=U3(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(zi).catch(zi):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||!ZU(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=Dbe(),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(Av(h)&&h.silent||this.dispatch({type:"error",error:h}),!Av(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=iz({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:w2(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 Av(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),gr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function zbe(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 qbe extends oh{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:r9(s,r);let a=this.get(o);return a||(a=new Ube({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(){gr.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,r){const[n]=oc(e,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>Z_(n,i))}findAll(e,r){const[n]=oc(e,r);return Object.keys(n).length>0?this.queries.filter(i=>Z_(n,i)):this.queries}notify(e){gr.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}onFocus(){gr.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){gr.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class Wbe extends sz{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||n9,this.observers=[],this.state=e.state||oz(),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=iz({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(j,H)=>{this.dispatch({type:"failed",failureCount:j,error:H})},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 j=await((h=(p=this.options).onMutate)==null?void 0:h.call(p,this.state.variables));j!==this.state.context&&this.dispatch({type:"loading",context:j,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,b,E,S,P,M;throw await((m=(v=this.mutationCache.config).onError)==null?void 0:m.call(v,L,this.state.variables,this.state.context,this)),await((y=(b=this.options).onError)==null?void 0:y.call(b,L,this.state.variables,this.state.context)),await((E=(S=this.mutationCache.config).onSettled)==null?void 0:E.call(S,void 0,L,this.state.variables,this.state.context,this)),await((P=(M=this.options).onSettled)==null?void 0:P.call(M,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:!w2(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),gr.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function oz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class Hbe extends oh{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,r,n){const i=new Wbe({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(){gr.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=>eP(e,r))}findAll(e){return this.mutations.filter(r=>eP(e,r))}notify(e){gr.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 gr.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(zi)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function z3(){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=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>{var L;if((L=t.signal)!=null&&L.aborted)m=!0;else{var j;(j=t.signal)==null||j.addEventListener("abort",()=>{m=!0})}return t.signal}})},y=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),b=(M,L,j,H)=>(p=H?[L,...p]:[...p,L],H?[j,...M]:[...M,j]),E=(M,L,j,H)=>{if(m)return Promise.reject("Cancelled");if(typeof j>"u"&&!L&&M.length)return Promise.resolve(M);const K={queryKey:t.queryKey,pageParam:j,meta:t.options.meta};v(K);const Q=y(K);return Promise.resolve(Q).then(F=>b(M,j,F,H))};let S;if(!d.length)S=E([]);else if(u){const M=typeof l<"u",L=M?l:q3(t.options,d);S=E(d,M,L)}else if(f){const M=typeof l<"u",L=M?l:az(t.options,d);S=E(d,M,L,!0)}else{p=[];const M=typeof t.options.getNextPageParam>"u";S=(a&&d[0]?a(d[0],0,d):!0)?E([],M,h[0]):Promise.resolve(b([],h[0],d[0]));for(let j=1;j{if(a&&d[j]?a(d[j],j,d):!0){const Q=M?h[j]:q3(t.options,H);return E(H,M,Q)}return Promise.resolve(b(H,h[j],d[j]))})}return S.then(M=>({pages:M,pageParams:p}))}}}}function q3(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function az(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}function Vbe(t,e){if(t.getNextPageParam&&Array.isArray(e)){const r=q3(t,e);return typeof r<"u"&&r!==null&&r!==!1}}function Gbe(t,e){if(t.getPreviousPageParam&&Array.isArray(e)){const r=az(t,e);return typeof r<"u"&&r!==null&&r!==!1}}class i9{constructor(e={}){this.queryCache=e.queryCache||new qbe,this.mutationCache=e.mutationCache||new Hbe,this.logger=e.logger||n9,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=fg.subscribe(()=>{fg.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=dg.subscribe(()=>{dg.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]=oc(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=$f(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=Mbe(r,s);if(typeof o>"u")return;const a=$f(e),c=this.defaultQueryOptions(a);return this.queryCache.build(this,c).setData(o,{...n,manual:!0})}setQueriesData(e,r,n){return gr.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]=oc(e,r),i=this.queryCache;gr.batch(()=>{i.findAll(n).forEach(s=>{i.remove(s)})})}resetQueries(e,r,n){const[i,s]=oc(e,r,n),o=this.queryCache,a={type:"active",...i};return gr.batch(()=>(o.findAll(i).forEach(c=>{c.reset()}),this.refetchQueries(a,s)))}cancelQueries(e,r,n){const[i,s={}]=oc(e,r,n);typeof s.revert>"u"&&(s.revert=!0);const o=gr.batch(()=>this.queryCache.findAll(i).map(a=>a.cancel(s)));return Promise.all(o).then(zi).catch(zi)}invalidateQueries(e,r,n){const[i,s]=oc(e,r,n);return gr.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]=oc(e,r,n),o=gr.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(zi);return s!=null&&s.throwOnError||(a=a.catch(zi)),a}fetchQuery(e,r,n){const i=$f(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(zi).catch(zi)}fetchInfiniteQuery(e,r,n){const i=$f(e,r,n);return i.behavior=z3(),this.fetchQuery(i)}prefetchInfiniteQuery(e,r,n){return this.fetchInfiniteQuery(e,r,n).then(zi).catch(zi)}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=>Hl(e)===Hl(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:e,defaultOptions:r})}getQueryDefaults(e){if(!e)return;const r=this.queryDefaults.find(n=>lg(e,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(e,r){const n=this.mutationDefaults.find(i=>Hl(e)===Hl(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:e,defaultOptions:r})}getMutationDefaults(e){if(!e)return;const r=this.mutationDefaults.find(n=>lg(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=r9(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 cz extends oh{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),sP(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return W3(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return W3(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),ug(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&&oP(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 Qbe(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(zi)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),L1||this.currentResult.isStale||!B3(this.options.staleTime))return;const r=ZU(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||!B3(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||fg.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,b=!1,E;if(r._optimisticResults){const j=this.hasListeners(),H=!j&&sP(e,r),K=j&&oP(e,n,r,i);(H||K)&&(m=w2(e.options.networkMode)?"fetching":"paused",d||(v="loading")),r._optimisticResults==="isRestoring"&&(m="idle")}if(r.keepPreviousData&&!f.dataUpdatedAt&&u!=null&&u.isSuccess&&v!=="error")E=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)E=this.selectResult;else try{this.selectFn=r.select,E=r.select(f.data),E=U3(s==null?void 0:s.data,E,r),this.selectResult=E,this.selectError=null}catch(j){this.selectError=j}else E=f.data;if(typeof r.placeholderData<"u"&&typeof E>"u"&&v==="loading"){let j;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))j=s.data;else if(j=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof j<"u")try{j=r.select(j),this.selectError=null}catch(H){this.selectError=H}typeof j<"u"&&(v="success",E=U3(s==null?void 0:s.data,j,r),b=!0)}this.selectError&&(h=this.selectError,E=this.selectResult,p=Date.now(),v="error");const S=m==="fetching",P=v==="loading",M=v==="error";return{status:v,fetchStatus:m,isLoading:P,isSuccess:v==="success",isError:M,isInitialLoading:P&&S,data:E,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&&!P,isLoadingError:M&&f.dataUpdatedAt===0,isPaused:m==="paused",isPlaceholderData:b,isPreviousData:y,isRefetchError:M&&f.dataUpdatedAt!==0,isStale:s9(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,ug(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"&&!Av(e.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(e){gr.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 Kbe(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function sP(t,e){return Kbe(t,e)||t.state.dataUpdatedAt>0&&W3(t,e,e.refetchOnMount)}function W3(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&s9(t,e)}return!1}function oP(t,e,r,n){return r.enabled!==!1&&(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&s9(t,r)}function s9(t,e){return t.isStaleByTime(e.staleTime)}function Qbe(t,e,r){return r.keepPreviousData?!1:r.placeholderData!==void 0?e.isPlaceholderData:!ug(t.getCurrentResult(),e)}class Ybe extends cz{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:z3()},r)}getOptimisticResult(e){return e.behavior=z3(),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:Vbe(r,(a=l.data)==null?void 0:a.pages),hasPreviousPage:Gbe(r,(c=l.data)==null?void 0:c.pages),isFetchingNextPage:h,isFetchingPreviousPage:p,isRefetching:d&&!h&&!p}}}let Jbe=class extends oh{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),ug(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:oz(),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){gr.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)})})}};function Xbe(t){return JSON.stringify(t,(e,r)=>Zbe(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):typeof r=="bigint"?r.toString():r)}function Zbe(t){if(!aP(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!aP(r)||!r.hasOwnProperty("isPrototypeOf"))}function aP(t){return Object.prototype.toString.call(t)==="[object Object]"}function e2e(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:b,_optimisticResults:E,enabled:S,notifyOnChangeProps:P,placeholderData:M,refetchInterval:L,refetchIntervalInBackground:j,refetchOnMount:H,refetchOnReconnect:K,refetchOnWindowFocus:Q,retryOnMount:Y,select:F,staleTime:w,suspense:k,throwOnError:R,config:N,connector:A,query:O,...B}=t;return B}function t2e(t){return{mutationFn(e){return Fge(t,e)},mutationKey:["connect"]}}function r2e(t){return{mutationFn(e){return Uge(t,e)},mutationKey:["disconnect"]}}function n2e(t,e={}){return{gcTime:0,async queryFn({queryKey:r}){const{connector:n}=e,{connectorUid:i,scopeKey:s,...o}=r[1];return qge(t,{...o,connector:n})},queryKey:i2e(e)}}function i2e(t={}){const{connector:e,...r}=t;return["walletClient",{...e2e(r),connectorUid:e==null?void 0:e.uid}]}function s2e(t){return{mutationFn(e){return Hge(t,e)},mutationKey:["sendTransaction"]}}function o2e(t){return{mutationFn(e){return Gge(t,e)},mutationKey:["switchChain"]}}function a2e(t){return{mutationFn(e){return Jge(t,e)},mutationKey:["writeContract"]}}function c2e(t={}){const e=sh(t);return x.useSyncExternalStore(r=>Qge(e,{onChange:r}),()=>Y_(e),()=>Y_(e))}function lz(t={}){const{mutation:e}=t,r=sh(t),n=c2e({config:r}),i=t2e(r),{mutate:s,mutateAsync:o,...a}=hbe({...e,...i});return x.useEffect(()=>r.subscribe(({status:c})=>c,(c,l)=>{l==="connected"&&c==="disconnected"&&a.reset()}),[r,a]),{...a,connect:s,connectAsync:o,connectors:n}}function uz(t={}){const e=sh(t);return x.useSyncExternalStore(r=>HU(e,{onChange:r}),()=>D1(e),()=>D1(e))}class l2e extends Error{}l2e.prototype.name="InvalidTokenError";const u2e=Object.entries(lt).reduce((t,[e,r])=>(t[r.name]=r.chainId,t),{});Object.entries(u2e).reduce((t,[e,r])=>(t[r]=e,t),{});o9.type="coinbaseWallet";function o9(t){let r,n;return i=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:o9.type,async connect({chainId:s}={}){try{const o=await this.getProvider(),a=(await o.request({method:"eth_requestAccounts"})).map(l=>ri(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===Ot.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 Ot(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=>ri(o))},async getChainId(){const o=await(await this.getProvider()).request({method:"eth_chainId"});return $c(o)},async getProvider(){var s;if(!n){const{default:o}=await V4(()=>import("./index-B4v1t5IB.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 os(new wu);const a=await this.getProvider(),c=Me(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 Ot(d)}throw new os(f)}},onAccountsChanged(s){s.length===0?i.emitter.emit("disconnect"):i.emitter.emit("change",{accounts:s.map(o=>ri(o))})},onChainChanged(s){const o=$c(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))}})}a9.type="walletConnect";function a9(t){const e=t.isNewChainsStale??!0;let r,n;const i="eip155";return s=>({id:"walletConnect",name:"WalletConnect",type:a9.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 Rl;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=>ri(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 Ot(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=>ri(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 V4(()=>import("./index.es-DEIq-t2i.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 os(new wu);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:Me(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:Me(o)}]}),a}catch(l){const u=typeof l=="string"?l:l==null?void 0:l.message;throw/user rejected request/i.test(u)?new Ot(l):new os(l)}},onAccountsChanged(o){o.length===0?this.onDisconnect():s.emitter.emit("change",{accounts:o.map(a=>ri(a))})},onChainChanged(o){const a=$c(o);s.emitter.emit("change",{chainId:a})},async onConnect(o){const a=$c(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 Le(){return Le=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const e=t?"white":"black";return n=>{let i=Le({},(ds(n),n));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 29 34",fill:"none"},i),g.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})))}},lP=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=Le({},(ds(n),n));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),g.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}),g.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})))}};hl.type="sequence";function hl(t){var e,r,n;const{defaultNetwork:i,connect:s,walletAppURL:o}=t;let a="sequence";const c=(t==null||(e=t.connect)==null||(e=e.settings)==null?void 0:e.signInOptions)||[],l=t==null||(r=t.connect)==null||(r=r.settings)==null?void 0:r.signInWith;if(t==null||(n=t.connect)==null||(n=n.settings)==null?void 0:n.signInWithEmail)a="email";else if(l)a=l,`${l[0].toUpperCase()}${l.slice(1)}`;else if(c.length>0){const f=c[0];`${a[0].toUpperCase()}${a.slice(1)}`,a=f}return f=>({id:"sequence",name:"Sequence",type:hl.type,async setup(){const d=await this.getProvider();d.on("chainChanged",h=>{f.emitter.emit("change",{chainId:df(h)})}),d.on("disconnect",()=>{this.onDisconnect()})},async connect(){const d=await this.getProvider();if(!d.isConnected()){var h,p;const v=localStorage.getItem(nr.Theme),y=localStorage.getItem(nr.EthAuthSettings),b=y?JSON.parse(y):{},E=Le({authorize:!0},b,s,{settings:Le({theme:v||"dark"},s==null?void 0:s.settings)}),S=await d.connect(E);if(S.error)throw new Ot(new Error(S.error));if(!S.connected)throw new Ot(new Error("Wallet connection rejected"));const P=(h=S.proof)==null?void 0:h.proofString,M=(p=S.proof)==null?void 0:p.typedData;if(P){const L=JSON.stringify({proofString:P,typedData:M});localStorage.setItem(nr.EthAuthProof,L)}}return{accounts:[...await this.getAccounts()],chainId:d.getChainId()}},async disconnect(){(await this.getProvider()).disconnect()},async getAccounts(){const d=await this.getProvider();return[ri(await d.getSigner().getAddress())]},async getProvider(){try{return vu.getWallet()}catch{const h=localStorage.getItem(nr.ProjectAccessKey);if(!h)throw"projectAccessKey not found";const p=vu.initWallet(h,{defaultNetwork:i,transports:{walletAppURL:o||"https://sequence.app"},defaultEIP6492:!0,analytics:!1}),m=await p.getChainId();return f.emitter.emit("change",{chainId:df(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(df(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:df(d)}),h.setDefaultChainId(df(d))},async onConnect(d){},async onDisconnect(){localStorage.removeItem(nr.EthAuthProof),f.emitter.emit("disconnect")}})}function df(t){return typeof t=="object"?df(t.chainId):typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t}const f2e=t=>({id:"apple",isSequenceBased:!0,logoDark:cP({isDarkMode:!0}),logoLight:cP({isDarkMode:!1}),monochromeLogoDark:lP({isDarkMode:!0}),monochromeLogoLight:lP({isDarkMode:!1}),name:"Apple",createConnector:()=>{var e;return hl(Le({},t,{connect:Le({},t==null?void 0:t.connect,{settings:Le({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"apple"})})}))}}),uP=t=>{let e=Le({},(ds(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),g.createElement("rect",{width:"28",height:"28",fill:"#2C5FF6"}),g.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"})))},d2e=t=>({id:"coinbase-wallet",logoDark:uP,logoLight:uP,name:"Coinbase Wallet",createConnector:()=>o9(Le({},t))}),fP=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=Le({},(ds(n),n));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35 34",fill:"none"},i),g.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}),g.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})))}},H3="@sequence.kit.connector.email",h2e=t=>({id:"email",isSequenceBased:!0,logoDark:fP({isDarkMode:!0}),logoLight:fP({isDarkMode:!1}),name:"Email",createConnector:()=>{var e;const r=localStorage.getItem(H3);return hl(Le({},t,{connect:Le({},t==null?void 0:t.connect,{settings:Le({},t==null||(e=t.connect)==null?void 0:e.settings,{signInOptions:["email"],signInWithEmail:r||""})})}))}}),dP=t=>{let e=Le({},(ds(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},e),g.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)"}),g.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"}),g.createElement("defs",null,g.createElement("linearGradient",{id:"paint0_linear_193_14528",x1:"20.2508",y1:"35.9507",x2:"20.2508",y2:"2.85086",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{"stop-color":"#0062E0"}),g.createElement("stop",{offset:"1","stop-color":"#19AFFF"})))))},hP=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=Le({},(ds(n),n));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),g.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})))}},p2e=t=>({id:"facebook",isSequenceBased:!0,logoDark:dP,logoLight:dP,monochromeLogoDark:hP({isDarkMode:!0}),monochromeLogoLight:hP({isDarkMode:!1}),name:"Facebook",createConnector:()=>{var e;return hl(Le({},t,{connect:Le({},t==null?void 0:t.connect,{settings:Le({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"facebook"})})}))}}),pP=t=>{let e=Le({},(ds(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({viewBox:"0 0 41 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),g.createElement("g",{id:"Frame 2114"},g.createElement("g",{id:"Group"},g.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"}),g.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"}),g.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"}),g.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"})))))},mP=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=Le({},(ds(n),n));return g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),g.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}))}},m2e=t=>({id:"google",isSequenceBased:!0,logoDark:pP,logoLight:pP,monochromeLogoDark:mP({isDarkMode:!0}),monochromeLogoLight:mP({isDarkMode:!1}),name:"Google",createConnector:()=>{var e;return hl(Le({},t,{connect:Le({},t==null?void 0:t.connect,{settings:Le({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"google"})})}))}}),vP=t=>{let e=Le({},(ds(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),g.createElement("rect",{width:"28",height:"28"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"})))},v2e=()=>({id:"metamask",logoDark:vP,logoLight:vP,name:"Metamask",createConnector:()=>g2({target:"metaMask"})}),hg=t=>{let e=Le({},(ds(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),g.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},g.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}))),g.createElement("defs",{id:"defs1314"},g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},g.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),g.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},g.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),g.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},g.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),g.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},g.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),g.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},g.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),g.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},g.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),g.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},g.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),g.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},g.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),g.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},g.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),g.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},g.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),g.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),g.createElement("clipPath",{id:"clip0_5_131"},g.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),g.createElement("clipPath",{id:"clip1_5_131"},g.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))},y2e=t=>({id:"mock",isSequenceBased:!0,logoDark:hg,logoLight:hg,name:"Mock",createConnector:()=>e9(t)}),g2e=t=>({id:"sequence",isSequenceBased:!0,logoDark:hg,logoLight:hg,name:"Sequence",createConnector:()=>hl(Le({},t))}),Om=({isDarkMode:t})=>{let e;return t===void 0?e="#9146FF":e=t?"white":"black",n=>(Le({},(ds(n),n)),g.createElement(g.Fragment,null,g.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)"},g.createElement("g",null,g.createElement("g",{id:"Layer_1-2"},g.createElement("path",{fill:e,d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600 V1300z"}),g.createElement("rect",{x:"1700",y:"550",fill:e,width:"200",height:"600"}),g.createElement("rect",{x:"1150",y:"550",fill:e,width:"200",height:"600"}))))))},b2e=t=>({id:"twitch",isSequenceBased:!0,logoDark:Om({}),logoLight:Om({}),monochromeLogoDark:Om({isDarkMode:!0}),monochromeLogoLight:Om({isDarkMode:!1}),name:"Twitch",createConnector:()=>{var e;return hl(Le({},t,{connect:Le({},t==null?void 0:t.connect,{settings:Le({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"twitch"})})}))}}),yP=t=>{let e=Le({},(ds(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({fill:"none",viewBox:"0 0 480 332",xmlns:"http://www.w3.org/2000/svg"},e),g.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"})))},x2e=t=>({id:"wallet-connect",logoDark:yP,logoLight:yP,name:"Walletconnect",createConnector:()=>a9(Le({},t))}),w2e=({walletConnectProjectId:t,defaultChainId:e,projectAccessKey:r,appName:n})=>bW(r,[d2e({appName:n}),h2e({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),m2e({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),p2e({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),b2e({defaultNetwork:e,connect:{app:n}}),f2e({defaultNetwork:e,connect:{app:n}}),v2e(),x2e({projectId:t}),g2e({defaultNetwork:e,connect:{app:n,projectAccessKey:r}})]);var _v={},E2={},Ip={};Object.defineProperty(Ip,"__esModule",{value:!0});Ip.default=void 0;var E2e=x;function C2e(t){(0,E2e.useEffect)(function(){if(t){var e=document.querySelectorAll('script[src="'.concat(t,'"]'))[0];e||(e=document.createElement("script"),e.src=t,e.async=!0,document.body.appendChild(e))}},[t])}var S2e=C2e;Ip.default=S2e;var Tp={},C2={};Object.defineProperty(C2,"__esModule",{value:!0});C2.default=void 0;var k2e=function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{pollFrequency:1e3,retries:100,parent:window},n=r.pollFrequency,i=n===void 0?1e3:n,s=r.retries,o=s===void 0?100:s,a=r.parent,c=a===void 0?window:a;if(c&&c.hasOwnProperty(e))return Promise.resolve(c[e]);if(!o)return Promise.resolve(void 0);var l=o-1;return new Promise(function(u){return setTimeout(u,typeof i=="function"?i({retries:l}):i)}).then(function(){return t(e,{pollFrequency:i,parent:c,retries:l})})},A2e=k2e;C2.default=A2e;Object.defineProperty(Tp,"__esModule",{value:!0});Tp.default=void 0;var _2e=P2e(C2);function P2e(t){return t&&t.__esModule?t:{default:t}}var I2e="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js",T2e=function(e){var r=e.authOptions,n=e.onSuccess,i=e.onError;return(0,_2e.default)("AppleID").then(function(){return window.AppleID||console.error(new Error("Error loading apple script")),window.AppleID.auth.init(r),window.AppleID.auth.signIn().then(function(s){return n&&n(s),s}).catch(function(s){return i?i(s):console.error(s),null})}).catch(function(s){return i?i(s):console.error(s),null})},O2e={APPLE_SCRIPT_SRC:I2e,signIn:T2e};Tp.default=O2e;Object.defineProperty(E2,"__esModule",{value:!0});E2.default=void 0;var Gs=c9(x),R2e=c9(Ip),gP=c9(Tp),$2e=["onSuccess","onError","skipScript","authOptions","iconProps","render","uiType","className","noDefaultStyle","buttonExtraChildren"];function c9(t){return t&&t.__esModule?t:{default:t}}function pg(){return pg=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function L2e(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}var j2e=` + */var l2=w,kbe=BU;function Abe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var _be=typeof Object.is=="function"?Object.is:Abe,Pbe=kbe.useSyncExternalStore,Ibe=l2.useRef,Tbe=l2.useEffect,Obe=l2.useMemo,Rbe=l2.useDebugValue;GU.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var s=Ibe(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=Obe(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,_be(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=Pbe(t,s[0],s[1]);return Tbe(function(){o.hasValue=!0,o.value=a},[a]),Rbe(a),a};VU.exports=GU;var KU=VU.exports;const gw=t=>typeof t=="object"&&!Array.isArray(t);function $be(t,e,r=e,n=Wc){const i=w.useRef([]),s=KU.useSyncExternalStoreWithSelector(t,e,r,o=>o,(o,a)=>{if(gw(o)&&gw(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(gw(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 fn(t={}){const e=vt(t);return $be(r=>kge(e,{onChange:r}),()=>kU(e))}function Mbe(t){return JSON.stringify(t,(e,r)=>Nbe(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):typeof r=="bigint"?r.toString():r)}function Nbe(t){if(!W_(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!W_(r)||!r.hasOwnProperty("isPrototypeOf"))}function W_(t){return Object.prototype.toString.call(t)==="[object Object]"}function Dbe(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:b,_optimisticResults:E,enabled:S,notifyOnChangeProps:P,placeholderData:M,refetchInterval:L,refetchIntervalInBackground:j,refetchOnMount:H,refetchOnReconnect:K,refetchOnWindowFocus:Q,retryOnMount:Y,select:F,staleTime:x,suspense:k,throwOnError:R,config:N,connector:A,query:O,...B}=t;return B}function Lbe(t){return{mutationFn(e){return yge(t,e)},mutationKey:["connect"]}}function jbe(t){return{mutationFn(e){return gge(t,e)},mutationKey:["disconnect"]}}function Bbe(t,e={}){return{gcTime:0,async queryFn({queryKey:r}){const{connector:n}=e,{connectorUid:i,scopeKey:s,...o}=r[1];return xge(t,{...o,connector:n})},queryKey:Fbe(e)}}function Fbe(t={}){const{connector:e,...r}=t;return["walletClient",{...Dbe(r),connectorUid:e==null?void 0:e.uid}]}function Ube(t){return{mutationFn(e){return Ege(t,e)},mutationKey:["sendTransaction"]}}function zbe(t){return{mutationFn(e){return Sge(t,e)},mutationKey:["switchChain"]}}function qbe(t){return{mutationFn(e){return Tge(t,e)},mutationKey:["writeContract"]}}function Wbe(t){const e=qn({...t,queryKeyHashFn:Mbe});return e.queryKey=t.queryKey,e}function u2(t={}){const e=vt(t);return w.useSyncExternalStore(r=>Age(e,{onChange:r}),()=>R_(e),()=>R_(e))}function Hbe(t={}){const e=vt(t);return w.useSyncExternalStore(r=>Sbe(e,{onChange:r}),()=>$_(e),()=>$_(e))}function Vbe(t={}){const e=vt(t);return w.useSyncExternalStore(r=>Pge(e,{onChange:r}),()=>M_(e),()=>M_(e))}function QU(t={}){const{mutation:e}=t,r=vt(t),n=Vbe({config:r}),i=Lbe(r),{mutate:s,mutateAsync:o,...a}=yp({...e,...i});return w.useEffect(()=>r.subscribe(({status:c})=>c,(c,l)=>{l==="connected"&&c==="disconnected"&&a.reset()}),[r,a]),{...a,connect:s,connectAsync:o,connectors:n}}function f2(t={}){const e=vt(t);return w.useSyncExternalStore(r=>_ge(e,{onChange:r}),()=>C3(e),()=>C3(e))}function YU(t={}){const{mutation:e}=t,r=vt(t),n=jbe(r),{mutate:i,mutateAsync:s,...o}=yp({...e,...n});return{...o,connectors:f2({config:r}).map(a=>a.connector),disconnect:i,disconnectAsync:s}}function Gbe(t={}){const e=vt(t);return KU.useSyncExternalStoreWithSelector(r=>Ige(e,{onChange:r}),()=>S3(e,t),()=>S3(e,t),r=>r,(r,n)=>(r==null?void 0:r.uid)===(n==null?void 0:n.uid))}function V4(t={}){const{mutation:e}=t,r=vt(t),n=Ube(r),{mutate:i,mutateAsync:s,...o}=yp({...e,...n});return{...o,sendTransaction:i,sendTransactionAsync:s}}function G4(t={}){const{mutation:e}=t,r=vt(t),n=zbe(r),{mutate:i,mutateAsync:s,...o}=yp({...e,...n});return{...o,chains:Hbe({config:r}),switchChain:i,switchChainAsync:s}}function Kbe(t={}){const{query:e={},...r}=t,n=vt(r),i=W4(),{address:s,connector:o,status:a}=fn(),c=u2(),{queryKey:l,...u}=Bbe(n,{...t,chainId:t.chainId??c,connector:t.connector??o}),f=!!(a!=="disconnected"&&(e.enabled??!0));return w.useEffect(()=>{s?i.invalidateQueries({queryKey:l}):i.removeQueries({queryKey:l})},[s,i]),Wbe({...e,...u,queryKey:l,enabled:f,staleTime:1/0})}function Qbe(t={}){const{mutation:e}=t,r=vt(t),n=qbe(r),{mutate:i,mutateAsync:s,...o}=yp({...e,...n});return{...o,writeContract:i,writeContractAsync:s}}class Ybe extends Error{}Ybe.prototype.name="InvalidTokenError";const Jbe=Object.entries(lt).reduce((t,[e,r])=>(t[r.name]=r.chainId,t),{});Object.entries(Jbe).reduce((t,[e,r])=>(t[r]=e,t),{});K4.type="coinbaseWallet";function K4(t){let r,n;return i=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:K4.type,async connect({chainId:s}={}){try{const o=await this.getProvider(),a=(await o.request({method:"eth_requestAccounts"})).map(l=>ti(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===Ot.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 Ot(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=>ti(o))},async getChainId(){const o=await(await this.getProvider()).request({method:"eth_chainId"});return _c(o)},async getProvider(){var s;if(!n){const{default:o}=await R4(()=>import("./index-CDfblNjf.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 is(new pu);const a=await this.getProvider(),c=Me(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 Ot(d)}throw new is(f)}},onAccountsChanged(s){s.length===0?i.emitter.emit("disconnect"):i.emitter.emit("change",{accounts:s.map(o=>ti(o))})},onChainChanged(s){const o=_c(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))}})}Q4.type="walletConnect";function Q4(t){const e=t.isNewChainsStale??!0;let r,n;const i="eip155";return s=>({id:"walletConnect",name:"WalletConnect",type:Q4.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 kl;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=>ti(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 Ot(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=>ti(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 R4(()=>import("./index.es-BzNvGBBU.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 is(new pu);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:Me(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:Me(o)}]}),a}catch(l){const u=typeof l=="string"?l:l==null?void 0:l.message;throw/user rejected request/i.test(u)?new Ot(l):new is(l)}},onAccountsChanged(o){o.length===0?this.onDisconnect():s.emitter.emit("change",{accounts:o.map(a=>ti(a))})},onChainChanged(o){const a=_c(o);s.emitter.emit("change",{chainId:a})},async onConnect(o){const a=_c(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 Le(){return Le=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const e=t?"white":"black";return n=>{let i=Le({},(us(n),n));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 29 34",fill:"none"},i),g.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})))}},V_=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=Le({},(us(n),n));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),g.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}),g.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})))}};al.type="sequence";function al(t){var e,r,n;const{defaultNetwork:i,connect:s,walletAppURL:o}=t;let a="sequence";const c=(t==null||(e=t.connect)==null||(e=e.settings)==null?void 0:e.signInOptions)||[],l=t==null||(r=t.connect)==null||(r=r.settings)==null?void 0:r.signInWith;if(t==null||(n=t.connect)==null||(n=n.settings)==null?void 0:n.signInWithEmail)a="email";else if(l)a=l,`${l[0].toUpperCase()}${l.slice(1)}`;else if(c.length>0){const f=c[0];`${a[0].toUpperCase()}${a.slice(1)}`,a=f}return f=>({id:"sequence",name:"Sequence",type:al.type,async setup(){const d=await this.getProvider();d.on("chainChanged",h=>{f.emitter.emit("change",{chainId:nf(h)})}),d.on("disconnect",()=>{this.onDisconnect()})},async connect(){const d=await this.getProvider();if(!d.isConnected()){var h,p;const v=localStorage.getItem(nr.Theme),y=localStorage.getItem(nr.EthAuthSettings),b=y?JSON.parse(y):{},E=Le({authorize:!0},b,s,{settings:Le({theme:v||"dark"},s==null?void 0:s.settings)}),S=await d.connect(E);if(S.error)throw new Ot(new Error(S.error));if(!S.connected)throw new Ot(new Error("Wallet connection rejected"));const P=(h=S.proof)==null?void 0:h.proofString,M=(p=S.proof)==null?void 0:p.typedData;if(P){const L=JSON.stringify({proofString:P,typedData:M});localStorage.setItem(nr.EthAuthProof,L)}}return{accounts:[...await this.getAccounts()],chainId:d.getChainId()}},async disconnect(){(await this.getProvider()).disconnect()},async getAccounts(){const d=await this.getProvider();return[ti(await d.getSigner().getAddress())]},async getProvider(){try{return lu.getWallet()}catch{const h=localStorage.getItem(nr.ProjectAccessKey);if(!h)throw"projectAccessKey not found";const p=lu.initWallet(h,{defaultNetwork:i,transports:{walletAppURL:o||"https://sequence.app"},defaultEIP6492:!0,analytics:!1}),m=await p.getChainId();return f.emitter.emit("change",{chainId:nf(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(nf(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:nf(d)}),h.setDefaultChainId(nf(d))},async onConnect(d){},async onDisconnect(){localStorage.removeItem(nr.EthAuthProof),f.emitter.emit("disconnect")}})}function nf(t){return typeof t=="object"?nf(t.chainId):typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t}const Xbe=t=>({id:"apple",isSequenceBased:!0,logoDark:H_({isDarkMode:!0}),logoLight:H_({isDarkMode:!1}),monochromeLogoDark:V_({isDarkMode:!0}),monochromeLogoLight:V_({isDarkMode:!1}),name:"Apple",createConnector:()=>{var e;return al(Le({},t,{connect:Le({},t==null?void 0:t.connect,{settings:Le({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"apple"})})}))}}),G_=t=>{let e=Le({},(us(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),g.createElement("rect",{width:"28",height:"28",fill:"#2C5FF6"}),g.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"})))},Zbe=t=>({id:"coinbase-wallet",logoDark:G_,logoLight:G_,name:"Coinbase Wallet",createConnector:()=>K4(Le({},t))}),K_=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=Le({},(us(n),n));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35 34",fill:"none"},i),g.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}),g.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})))}},O3="@sequence.kit.connector.email",e2e=t=>({id:"email",isSequenceBased:!0,logoDark:K_({isDarkMode:!0}),logoLight:K_({isDarkMode:!1}),name:"Email",createConnector:()=>{var e;const r=localStorage.getItem(O3);return al(Le({},t,{connect:Le({},t==null?void 0:t.connect,{settings:Le({},t==null||(e=t.connect)==null?void 0:e.settings,{signInOptions:["email"],signInWithEmail:r||""})})}))}}),Q_=t=>{let e=Le({},(us(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},e),g.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)"}),g.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"}),g.createElement("defs",null,g.createElement("linearGradient",{id:"paint0_linear_193_14528",x1:"20.2508",y1:"35.9507",x2:"20.2508",y2:"2.85086",gradientUnits:"userSpaceOnUse"},g.createElement("stop",{"stop-color":"#0062E0"}),g.createElement("stop",{offset:"1","stop-color":"#19AFFF"})))))},Y_=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=Le({},(us(n),n));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),g.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})))}},t2e=t=>({id:"facebook",isSequenceBased:!0,logoDark:Q_,logoLight:Q_,monochromeLogoDark:Y_({isDarkMode:!0}),monochromeLogoLight:Y_({isDarkMode:!1}),name:"Facebook",createConnector:()=>{var e;return al(Le({},t,{connect:Le({},t==null?void 0:t.connect,{settings:Le({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"facebook"})})}))}}),J_=t=>{let e=Le({},(us(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({viewBox:"0 0 41 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),g.createElement("g",{id:"Frame 2114"},g.createElement("g",{id:"Group"},g.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"}),g.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"}),g.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"}),g.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"})))))},X_=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=Le({},(us(n),n));return g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),g.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}))}},r2e=t=>({id:"google",isSequenceBased:!0,logoDark:J_,logoLight:J_,monochromeLogoDark:X_({isDarkMode:!0}),monochromeLogoLight:X_({isDarkMode:!1}),name:"Google",createConnector:()=>{var e;return al(Le({},t,{connect:Le({},t==null?void 0:t.connect,{settings:Le({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"google"})})}))}}),Z_=t=>{let e=Le({},(us(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),g.createElement("rect",{width:"28",height:"28"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"})))},n2e=()=>({id:"metamask",logoDark:Z_,logoLight:Z_,name:"Metamask",createConnector:()=>o2({target:"metaMask"})}),tg=t=>{let e=Le({},(us(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),g.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},g.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}))),g.createElement("defs",{id:"defs1314"},g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},g.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),g.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},g.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),g.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},g.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),g.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},g.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),g.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},g.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),g.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},g.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),g.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},g.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),g.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},g.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),g.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},g.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),g.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},g.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),g.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),g.createElement("clipPath",{id:"clip0_5_131"},g.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),g.createElement("clipPath",{id:"clip1_5_131"},g.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))},i2e=t=>({id:"mock",isSequenceBased:!0,logoDark:tg,logoLight:tg,name:"Mock",createConnector:()=>B4(t)}),s2e=t=>({id:"sequence",isSequenceBased:!0,logoDark:tg,logoLight:tg,name:"Sequence",createConnector:()=>al(Le({},t))}),xm=({isDarkMode:t})=>{let e;return t===void 0?e="#9146FF":e=t?"white":"black",n=>(Le({},(us(n),n)),g.createElement(g.Fragment,null,g.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)"},g.createElement("g",null,g.createElement("g",{id:"Layer_1-2"},g.createElement("path",{fill:e,d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600 V1300z"}),g.createElement("rect",{x:"1700",y:"550",fill:e,width:"200",height:"600"}),g.createElement("rect",{x:"1150",y:"550",fill:e,width:"200",height:"600"}))))))},o2e=t=>({id:"twitch",isSequenceBased:!0,logoDark:xm({}),logoLight:xm({}),monochromeLogoDark:xm({isDarkMode:!0}),monochromeLogoLight:xm({isDarkMode:!1}),name:"Twitch",createConnector:()=>{var e;return al(Le({},t,{connect:Le({},t==null?void 0:t.connect,{settings:Le({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"twitch"})})}))}}),eP=t=>{let e=Le({},(us(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Le({fill:"none",viewBox:"0 0 480 332",xmlns:"http://www.w3.org/2000/svg"},e),g.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"})))},a2e=t=>({id:"wallet-connect",logoDark:eP,logoLight:eP,name:"Walletconnect",createConnector:()=>Q4(Le({},t))}),c2e=({walletConnectProjectId:t,defaultChainId:e,projectAccessKey:r,appName:n})=>Yq(r,[Zbe({appName:n}),e2e({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),r2e({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),t2e({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),o2e({defaultNetwork:e,connect:{app:n}}),Xbe({defaultNetwork:e,connect:{app:n}}),n2e(),a2e({projectId:t}),s2e({defaultNetwork:e,connect:{app:n,projectAccessKey:r}})]);var mv={},d2={},gp={};Object.defineProperty(gp,"__esModule",{value:!0});gp.default=void 0;var l2e=w;function u2e(t){(0,l2e.useEffect)(function(){if(t){var e=document.querySelectorAll('script[src="'.concat(t,'"]'))[0];e||(e=document.createElement("script"),e.src=t,e.async=!0,document.body.appendChild(e))}},[t])}var f2e=u2e;gp.default=f2e;var bp={},h2={};Object.defineProperty(h2,"__esModule",{value:!0});h2.default=void 0;var d2e=function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{pollFrequency:1e3,retries:100,parent:window},n=r.pollFrequency,i=n===void 0?1e3:n,s=r.retries,o=s===void 0?100:s,a=r.parent,c=a===void 0?window:a;if(c&&c.hasOwnProperty(e))return Promise.resolve(c[e]);if(!o)return Promise.resolve(void 0);var l=o-1;return new Promise(function(u){return setTimeout(u,typeof i=="function"?i({retries:l}):i)}).then(function(){return t(e,{pollFrequency:i,parent:c,retries:l})})},h2e=d2e;h2.default=h2e;Object.defineProperty(bp,"__esModule",{value:!0});bp.default=void 0;var p2e=m2e(h2);function m2e(t){return t&&t.__esModule?t:{default:t}}var v2e="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js",y2e=function(e){var r=e.authOptions,n=e.onSuccess,i=e.onError;return(0,p2e.default)("AppleID").then(function(){return window.AppleID||console.error(new Error("Error loading apple script")),window.AppleID.auth.init(r),window.AppleID.auth.signIn().then(function(s){return n&&n(s),s}).catch(function(s){return i?i(s):console.error(s),null})}).catch(function(s){return i?i(s):console.error(s),null})},g2e={APPLE_SCRIPT_SRC:v2e,signIn:y2e};bp.default=g2e;Object.defineProperty(d2,"__esModule",{value:!0});d2.default=void 0;var Hs=Y4(w),b2e=Y4(gp),tP=Y4(bp),x2e=["onSuccess","onError","skipScript","authOptions","iconProps","render","uiType","className","noDefaultStyle","buttonExtraChildren"];function Y4(t){return t&&t.__esModule?t:{default:t}}function rg(){return rg=Object.assign||function(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function S2e(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}var k2e=` .react-apple-signin-auth-btn { background-color: transparent; border: none; @@ -209,12 +209,12 @@ ${Tve(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMess background-color: #000; color: #FFF; border-color: #FFF; -}`.replace(/ {2}|\n/g,""),B2e=function(e){var r=e.onSuccess,n=e.onError,i=e.skipScript,s=i===void 0?!1:i,o=e.authOptions,a=e.iconProps,c=e.render,l=e.uiType,u=l===void 0?"dark":l,f=e.className,d=e.noDefaultStyle,h=d===void 0?!1:d,p=e.buttonExtraChildren,m=p===void 0?"Continue with Apple":p,v=D2e(e,$2e);(0,R2e.default)(s?null:gP.default.APPLE_SCRIPT_SRC);var y=function(S){S&&(S.preventDefault(),S.stopPropagation()),gP.default.signIn({authOptions:o,onSuccess:r,onError:n})},b=M2e({children:Gs.default.createElement(Gs.default.Fragment,null,Gs.default.createElement("svg",pg({width:"24px",height:"44px",viewBox:"0 0 24 44"},a),Gs.default.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},Gs.default.createElement("rect",{fill:u==="light"?"#FFF":"#000",x:"0",y:"0",width:"24",height:"44"}),Gs.default.createElement("path",{d:"M12.2337427,16.9879688 C12.8896607,16.9879688 13.7118677,16.5445313 14.2014966,15.9532812 C14.6449341,15.4174609 14.968274,14.6691602 14.968274,13.9208594 C14.968274,13.8192383 14.9590357,13.7176172 14.9405591,13.6344727 C14.2107349,13.6621875 13.3330982,14.1241016 12.8065162,14.7430664 C12.3907935,15.2142188 12.012024,15.9532812 12.012024,16.7108203 C12.012024,16.8216797 12.0305005,16.9325391 12.0397388,16.9694922 C12.0859302,16.9787305 12.1598365,16.9879688 12.2337427,16.9879688 Z M9.92417241,28.1662891 C10.8202857,28.1662891 11.2175318,27.5658008 12.3353638,27.5658008 C13.4716724,27.5658008 13.721106,28.1478125 14.7188404,28.1478125 C15.6980982,28.1478125 16.3540162,27.2424609 16.972981,26.3555859 C17.6658521,25.339375 17.9522388,24.3416406 17.9707154,24.2954492 C17.9060474,24.2769727 16.0306763,23.5101953 16.0306763,21.3576758 C16.0306763,19.491543 17.5088013,18.6508594 17.5919459,18.5861914 C16.612688,17.1819727 15.1253248,17.1450195 14.7188404,17.1450195 C13.6194849,17.1450195 12.7233716,17.8101758 12.1598365,17.8101758 C11.5501099,17.8101758 10.7463794,17.1819727 9.79483648,17.1819727 C7.98413335,17.1819727 6.14571538,18.6785742 6.14571538,21.5054883 C6.14571538,23.2607617 6.8293482,25.1176563 7.67003179,26.3186328 C8.39061773,27.3348438 9.01882085,28.1662891 9.92417241,28.1662891 Z",fill:u==="light"?"#000":"#FFF",fillRule:"nonzero"}))),m),onClick:y},v);return c?c(b):Gs.default.createElement(Gs.default.Fragment,null,Gs.default.createElement("button",pg({className:"".concat(h?"":"react-apple-signin-auth-btn react-apple-signin-auth-btn-".concat(u)).concat(f?" ".concat(f):""),type:"button","aria-label":"Signin with apple ID"},b)),h?null:Gs.default.createElement("style",null,j2e))},F2e=B2e;E2.default=F2e;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"appleAuthHelpers",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"useScript",{enumerable:!0,get:function(){return n.default}}),t.default=void 0;var e=i(E2),r=i(Tp),n=i(Ip);function i(o){return o&&o.__esModule?o:{default:o}}var s=e.default;t.default=s})(_v);function l9(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function Rm(){}function xP(){return typeof WeakMap<"u"?new WeakMap:U2e()}function U2e(){return{add:Rm,delete:Rm,get:Rm,set:Rm,has:function(t){return!1}}}var z2e=Object.prototype.hasOwnProperty,V3=function(t,e){return z2e.call(t,e)};function Rw(t,e){for(var r in e)V3(e,r)&&(t[r]=e[r]);return t}var q2e=/^[ \t]*(?:\r\n|\r|\n)/,W2e=/(?:\r\n|\r|\n)[ \t]*$/,H2e=/^(?:[\r\n]|$)/,V2e=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,G2e=/^[ \t]*[\r\n][ \t\r\n]*$/;function wP(t,e,r){var n=0,i=t[0].match(V2e);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(q2e,"")),p===f-1&&l&&(h=h.replace(W2e,"")),u&&(h=h.replace(/\r\n|\n|\r/g,function(m){return a})),h});return d}function K2e(t,e){for(var r="",n=0,i=t.length;n{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>"short"},Pv=[Y2e],Mu=()=>{if(Pv.length<1)throw new Error("No adapter configured");return Pv[Pv.length-1]},dz=!1,J2e=t=>{dz||X2e(t)},X2e=t=>{if(!t)throw new Error('No adapter provided when calling "setAdapter"');dz=!0,Pv.push(t)},S2=function(){return Mu().appendCss(...arguments)},hz=function(){return Mu().registerClassName(...arguments)},Z2e=function(){return Mu().registerComposition(...arguments)},pz=function(){return Mu().markCompositionUsed(...arguments)},exe=function(){for(var e,r,n=arguments.length,i=new Array(n),s=0;s{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>"short"},vv=[L2e],Pu=()=>{if(vv.length<1)throw new Error("No adapter configured");return vv[vv.length-1]},XU=!1,j2e=t=>{XU||B2e(t)},B2e=t=>{if(!t)throw new Error('No adapter provided when calling "setAdapter"');XU=!0,vv.push(t)},p2=function(){return Pu().appendCss(...arguments)},ZU=function(){return Pu().registerClassName(...arguments)},F2e=function(){return Pu().registerComposition(...arguments)},ez=function(){return Pu().markCompositionUsed(...arguments)},U2e=function(){for(var e,r,n=arguments.length,i=new Array(n),s=0;s{var{fileScope:e,css:r}=t,n=e.packageName?[e.packageName,e.filePath].join("/"):e.filePath,i=CP[n];if(!i){var s=document.createElement("style");e.packageName&&s.setAttribute("data-package",e.packageName),s.setAttribute("data-file",e.filePath),s.setAttribute("type","text/css"),i=CP[n]=s,document.head.appendChild(s)}i.innerHTML=r};function sxe(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}/*! https://mths.be/cssesc v3.0.0 by @mathias */var oxe={},axe=oxe.hasOwnProperty,cxe=function(e,r){if(!e)return r;var n={};for(var i in r)n[i]=axe.call(e,i)?e[i]:r[i];return n},lxe=/[ -,\.\/:-@\[-\^`\{-~]/,uxe=/[ -,\.\/:-@\[\]\^`\{-~]/,fxe=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,f9=function t(e,r){r=cxe(r,t.options),r.quotes!="single"&&r.quotes!="double"&&(r.quotes="single");for(var n=r.quotes=="double"?'"':"'",i=r.isIdentifier,s=e.charAt(0),o="",a=0,c=e.length;a126){if(u>=55296&&u<=56319&&a0;){const a=o.shift();if(a!==void 0)for(const c in r[a]){const l=r[a][c];o.push(l);let u=s[a];for(;u>0&&!(c in r[u]);)u=s[u];if(c in r[u]){const f=r[u][c];s[l]=f,n[l]=[...n[l],...n[f]]}else s[l]=0}}return{gotoFn:r,output:n,failure:s}}search(e){let r=0;const n=[];for(let i=0;i0&&!(s in this.gotoFn[r]);)r=this.failure[r];if(s in this.gotoFn[r]&&(r=this.gotoFn[r][s],this.output[r].length>0)){const o=this.output[r];n.push([i,o])}}return n}}var lr;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(lr||(lr={}));var Hi;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(Hi||(Hi={}));const SP=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,pxe=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,mxe=new Map([[126,Hi.Element],[94,Hi.Start],[36,Hi.End],[42,Hi.Any],[33,Hi.Not],[124,Hi.Hyphen]]),vxe=new Set(["has","not","matches","is","where","host","host-context"]);function yxe(t){switch(t.type){case lr.Adjacent:case lr.Child:case lr.Descendant:case lr.Parent:case lr.Sibling:case lr.ColumnCombinator:return!0;default:return!1}}const gxe=new Set(["contains","icontains"]);function bxe(t,e,r){const n=parseInt(e,16)-65536;return n!==n||r?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)}function Fh(t){return t.replace(pxe,bxe)}function $w(t){return t===39||t===34}function kP(t){return t===32||t===9||t===10||t===12||t===13}function xxe(t){const e=[],r=mz(e,`${t}`,0);if(r0&&r0&&yxe(n[n.length-1]))throw new Error("Did not expect successive traversals.")}function l(d){if(n.length>0&&n[n.length-1].type===lr.Descendant){n[n.length-1].type=d;return}c(),n.push({type:d})}function u(d,h){n.push({type:lr.Attribute,name:d,action:h,value:i(1),namespace:null,ignoreCase:"quirks"})}function f(){if(n.length&&n[n.length-1].type===lr.Descendant&&n.pop(),n.length===0)throw new Error("Empty sub-selector");t.push(n)}if(s(0),e.length===r)return r;e:for(;r{var{fileScope:e,css:r}=t,n=e.packageName?[e.packageName,e.filePath].join("/"):e.filePath,i=oP[n];if(!i){var s=document.createElement("style");e.packageName&&s.setAttribute("data-package",e.packageName),s.setAttribute("data-file",e.filePath),s.setAttribute("type","text/css"),i=oP[n]=s,document.head.appendChild(s)}i.innerHTML=r};function V2e(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}/*! https://mths.be/cssesc v3.0.0 by @mathias */var G2e={},K2e=G2e.hasOwnProperty,Q2e=function(e,r){if(!e)return r;var n={};for(var i in r)n[i]=K2e.call(e,i)?e[i]:r[i];return n},Y2e=/[ -,\.\/:-@\[-\^`\{-~]/,J2e=/[ -,\.\/:-@\[\]\^`\{-~]/,X2e=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,Z4=function t(e,r){r=Q2e(r,t.options),r.quotes!="single"&&r.quotes!="double"&&(r.quotes="single");for(var n=r.quotes=="double"?'"':"'",i=r.isIdentifier,s=e.charAt(0),o="",a=0,c=e.length;a126){if(u>=55296&&u<=56319&&a0;){const a=o.shift();if(a!==void 0)for(const c in r[a]){const l=r[a][c];o.push(l);let u=s[a];for(;u>0&&!(c in r[u]);)u=s[u];if(c in r[u]){const f=r[u][c];s[l]=f,n[l]=[...n[l],...n[f]]}else s[l]=0}}return{gotoFn:r,output:n,failure:s}}search(e){let r=0;const n=[];for(let i=0;i0&&!(s in this.gotoFn[r]);)r=this.failure[r];if(s in this.gotoFn[r]&&(r=this.gotoFn[r][s],this.output[r].length>0)){const o=this.output[r];n.push([i,o])}}return n}}var lr;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(lr||(lr={}));var qi;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(qi||(qi={}));const aP=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,txe=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,rxe=new Map([[126,qi.Element],[94,qi.Start],[36,qi.End],[42,qi.Any],[33,qi.Not],[124,qi.Hyphen]]),nxe=new Set(["has","not","matches","is","where","host","host-context"]);function ixe(t){switch(t.type){case lr.Adjacent:case lr.Child:case lr.Descendant:case lr.Parent:case lr.Sibling:case lr.ColumnCombinator:return!0;default:return!1}}const sxe=new Set(["contains","icontains"]);function oxe(t,e,r){const n=parseInt(e,16)-65536;return n!==n||r?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)}function Th(t){return t.replace(txe,oxe)}function xw(t){return t===39||t===34}function cP(t){return t===32||t===9||t===10||t===12||t===13}function axe(t){const e=[],r=tz(e,`${t}`,0);if(r0&&r0&&ixe(n[n.length-1]))throw new Error("Did not expect successive traversals.")}function l(d){if(n.length>0&&n[n.length-1].type===lr.Descendant){n[n.length-1].type=d;return}c(),n.push({type:d})}function u(d,h){n.push({type:lr.Attribute,name:d,action:h,value:i(1),namespace:null,ignoreCase:"quirks"})}function f(){if(n.length&&n[n.length-1].type===lr.Descendant&&n.pop(),n.length===0)throw new Error("Empty sub-selector");t.push(n)}if(s(0),e.length===r)return r;e:for(;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ur(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}var Exe=/(\u000D|\u000C|\u000D\u000A)/g,Cxe=/[\u0000\uD800-\uDFFF]/g,Sxe=/(\/\*)[\s\S]*?(\*\/)/g,kxe=function(e,r){r===void 0&&(r=0),e=e.replace(Exe,` -`).replace(Cxe,"�"),e=e.replace(Sxe,"");for(var n=[];r"})}else if(i===34){var o=AP(e,r);if(o===null)return null;var a=Ur(o,2),c=a[0],l=a[1];n.push({type:"",value:l}),r=c}else if(i===35){if(r+1=65&&u<=90||u>=97&&u<=122||u>=128||u>=48&&u<=57||u===92&&r+2",value:l.toLowerCase(),flag:f}),r=c;continue}}}n.push({type:"",value:i})}else if(i===39){var o=AP(e,r);if(o===null)return null;var h=Ur(o,2),c=h[0],l=h[1];n.push({type:"",value:l}),r=c}else if(i===40)n.push({type:"<(-token>"});else if(i===41)n.push({type:"<)-token>"});else if(i===43){var p=$m(e,r);if(p===null)n.push({type:"",value:i});else{var m=Ur(p,2),c=m[0],v=m[1];v[0]===""?n.push({type:"",value:v[1],unit:v[2].toLowerCase(),flag:"number"}):v[0]===""?n.push({type:v[0],value:v[1],flag:v[2]}):n.push({type:v[0],value:v[1],flag:"number"}),r=c}}else if(i===44)n.push({type:""});else if(i===45){var y=$m(e,r);if(y!==null){var b=Ur(y,2),c=b[0],v=b[1];v[0]===""?n.push({type:"",value:v[1],unit:v[2].toLowerCase(),flag:"number"}):v[0]===""?n.push({type:v[0],value:v[1],flag:v[2]}):n.push({type:v[0],value:v[1],flag:"number"}),r=c;continue}if(r+2"}),r+=2;continue}}var o=_P(e,r);if(o!==null){var S=Ur(o,3),c=S[0],l=S[1],P=S[2];n.push({type:P,value:l}),r=c;continue}n.push({type:"",value:i})}else if(i===46){var y=$m(e,r);if(y===null)n.push({type:"",value:i});else{var M=Ur(y,2),c=M[0],v=M[1];v[0]===""?n.push({type:"",value:v[1],unit:v[2].toLowerCase(),flag:"number"}):v[0]===""?n.push({type:v[0],value:v[1],flag:v[2]}):n.push({type:v[0],value:v[1],flag:"number"}),r=c;continue}}else if(i===58)n.push({type:""});else if(i===59)n.push({type:""});else if(i===60){if(r+3"}),r+=3;continue}}n.push({type:"",value:i})}else if(i===64){var o=h9(e,r+1);if(o!==null){var j=Ur(o,2),c=j[0],l=j[1];n.push({type:"",value:l.toLowerCase()}),r=c;continue}n.push({type:"",value:i})}else if(i===91)n.push({type:"<[-token>"});else if(i===92){var o=Op(e,r);if(o===null)return null;var H=Ur(o,2),c=H[0],l=H[1];e=e.slice(0,r)+l+e.slice(c+1),r-=1}else if(i===93)n.push({type:"<]-token>"});else if(i===123)n.push({type:"<{-token>"});else if(i===125)n.push({type:"<}-token>"});else if(i>=48&&i<=57){var o=$m(e,r),K=Ur(o,2),c=K[0],v=K[1];v[0]===""?n.push({type:"",value:v[1],unit:v[2].toLowerCase(),flag:"number"}):v[0]===""?n.push({type:v[0],value:v[1],flag:v[2]}):n.push({type:v[0],value:v[1],flag:"number"}),r=c}else if(i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128){var o=_P(e,r);if(o===null)return null;var Q=Ur(o,3),c=Q[0],l=Q[1],P=Q[2];n.push({type:P,value:l}),r=c}else n.push({type:"",value:i})}return n.push({type:""}),n},AP=function(e,r){if(e.length<=r+1)return null;for(var n=e.charCodeAt(r),i=[],s=r+1;s=65&&i<=90||i>=97&&i<=122||i>=128)return!0;if(i===92){if(e.length<=r+2)return!1;var s=e.charCodeAt(r+2);return s!==10}else return!1}else{if(n===95||n>=65&&n<=90||n>=97&&n<=122||n>=128)return!0;if(n===92){if(e.length<=r+1)return!1;var i=e.charCodeAt(r+1);return i!==10}else return!1}},Op=function(e,r){if(e.length<=r+1||e.charCodeAt(r)!==92)return null;var n=e.charCodeAt(r+1);if(n===10)return null;if(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102){for(var i=[n],s=Math.min(r+7,e.length),o=r+2;o=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102)i.push(a);else break}if(o",o,f]]}return s+1",o]]:[s,["",o,a]]},Axe=function(e,r){if(e.length<=r)return null;var n="integer",i=[],s=e.charCodeAt(r);for((s===43||s===45)&&(r+=1,s===45&&i.push(45));r=48&&o<=57)i.push(o),r+=1;else break}if(r+1=48&&c<=57)for(i.push(a,c),n="number",r+=2;r=48&&o<=57)i.push(o),r+=1;else break}}if(r+1=48&&c<=57;if(u||(c===43||c===45)&&l>=48&&l<=57)for(n="number",u?(i.push(69,c),r+=2):c===45?(i.push(69,45,l),r+=3):(i.push(69,l),r+=3);r=48&&o<=57)i.push(o),r+=1;else break}}}var f=String.fromCharCode.apply(null,i),d=n==="number"?parseFloat(f):parseInt(f);return d===-0&&(d=0),Number.isNaN(d)?null:[r-1,d,n]},_xe=function(e,r){if(e.length<=r)return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=Op(e,r);if(s!==null){var o=Ur(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return r===0?null:[r-1,String.fromCharCode.apply(null,n)]},h9=function(e,r){if(e.length<=r||!vz(e,r))return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=Op(e,r);if(s!==null){var o=Ur(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return[r-1,String.fromCharCode.apply(null,n)]},Pxe=function(e,r){for(var n=e.charCodeAt(r);n===9||n===32||n===10;)n=e.charCodeAt(++r);for(var i=[],s=!1;rs+1){var a=e.charCodeAt(s+1);if(a===40){for(var c=2;s+c"];if(l!==9&&l!==32&&l!==10){var u=Pxe(e,s+c);if(u===null)return null;var f=Ur(u,2),d=f[0],h=f[1];return[d,h,""]}}return[s+1,o.toLowerCase(),""]}}}else if(e.length>s+1){var a=e.charCodeAt(s+1);if(a===40)return[s+1,o.toLowerCase(),""]}return[s,o.toLowerCase(),""]},Ixe=function(e){for(var r=e.length-1;r>=0;r--)e[r]=Txe(e[r]);return e},Txe=function(e){if(e.mediaCondition===null)return e;var r=Oxe(e.mediaCondition);return r.operator===null&&r.children.length===1&&"children"in r.children[0]&&(r=r.children[0]),{mediaPrefix:e.mediaPrefix,mediaType:e.mediaType,mediaCondition:r}},Oxe=function t(e){for(var r=e.children.length-1;r>=0;r--){var n=e.children[r];if(!("context"in n)){var i=t(n);if(i.operator===null&&i.children.length===1)e.children[r]=i.children[0];else if(i.operator===e.operator&&(i.operator==="and"||i.operator==="or")){for(var s=[r,1],o=0;o"&&r[0].value==="media"){if(r[1].type!=="")throw Qn("Expected whitespace after media");n=2;for(var s=2;s"){i=s;break}else if(o.type==="")throw Qn("Expected '{' in media query but found ';'")}}return r=r.slice(n,i),Nxe(r)},Mxe=function(e){for(var r=[],n=!1,i=0;i"?(n=!0,r.length>0&&(r[r.length-1].wsAfter=!0)):(r.push(vg(vg({},e[i]),{wsBefore:n,wsAfter:!1})),n=!1);return r},Nxe=function(e){for(var r,n,i=[[]],s=0;s"?i.push([]):i[i.length-1].push(o)}var a=i.map(Mxe);if(a.length===1&&a[0].length===0)return[{mediaCondition:null,mediaPrefix:null,mediaType:"all"}];var c=a.map(function(h){return h.length===0?null:Dxe(h)}),l=[];try{for(var u=wxe(c),f=u.next();!f.done;f=u.next()){var d=f.value;d!==null&&l.push(d)}}catch(h){r={error:h}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(l.length===0)throw Qn("No valid media queries");return l},Dxe=function(e){var r=e[0];if(r.type==="<(-token>")try{return{mediaPrefix:null,mediaType:"all",mediaCondition:Mw(e,!0)}}catch(f){throw Qn("Expected media condition after '('",f)}else if(r.type===""){var n=null,i=void 0,s=r.value;(s==="only"||s==="not")&&(n=s);var o=n===null?0:1;if(e.length<=o)throw Qn("Expected extra token in media query");var a=e[o];if(a.type===""){var c=a.value;if(c==="all")i="all";else if(c==="print"||c==="screen")i=c;else if(c==="tty"||c==="tv"||c==="projection"||c==="handheld"||c==="braille"||c==="embossed"||c==="aural"||c==="speech")n=n==="not"?null:"not",i="all";else throw Qn("Unknown ident '".concat(c,"' in media query"))}else if(n==="not"&&a.type==="<(-token>"){var l=[{type:"<(-token>",wsBefore:!1,wsAfter:!1}];l.push.apply(l,e),l.push({type:"<)-token>",wsBefore:!1,wsAfter:!1});try{return{mediaPrefix:null,mediaType:"all",mediaCondition:Mw(l,!0)}}catch(f){throw Qn("Expected media condition after '('",f)}}else throw Qn("Invalid media query");if(o+1===e.length)return{mediaPrefix:n,mediaType:i,mediaCondition:null};if(o+4"&&u.value==="and")try{return{mediaPrefix:n,mediaType:i,mediaCondition:Mw(e.slice(o+2),!1)}}catch(f){throw Qn("Expected media condition after 'and'",f)}else throw Qn("Expected 'and' after media prefix")}else throw Qn("Expected media condition after media prefix")}else throw Qn("Expected media condition or media prefix")},Mw=function t(e,r,n){if(n===void 0&&(n=null),e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media condition");for(var i=e.length-1,s=0,o=0,a=0;a"?(o+=1,s=Math.max(s,o)):c.type==="<)-token>"&&(o-=1),o===0){i=a;break}}if(o!==0)throw new Error(`Mismatched parens -Invalid media condition`);var l,u=e.slice(0,i+1);if(s===1?l=Lxe(u):u[1].type===""&&u[1].value==="not"?l=t(u.slice(2,-1),!0,"not"):l=t(u.slice(1,-1),!0),i===e.length-1)return{operator:n,children:[l]};var f=e[i+1];if(f.type!=="")throw new Error(`Invalid operator +***************************************************************************** */var ig=function(){return ig=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fr(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}var lxe=/(\u000D|\u000C|\u000D\u000A)/g,uxe=/[\u0000\uD800-\uDFFF]/g,fxe=/(\/\*)[\s\S]*?(\*\/)/g,dxe=function(e,r){r===void 0&&(r=0),e=e.replace(lxe,` +`).replace(uxe,"�"),e=e.replace(fxe,"");for(var n=[];r"})}else if(i===34){var o=lP(e,r);if(o===null)return null;var a=Fr(o,2),c=a[0],l=a[1];n.push({type:"",value:l}),r=c}else if(i===35){if(r+1=65&&u<=90||u>=97&&u<=122||u>=128||u>=48&&u<=57||u===92&&r+2",value:l.toLowerCase(),flag:f}),r=c;continue}}}n.push({type:"",value:i})}else if(i===39){var o=lP(e,r);if(o===null)return null;var h=Fr(o,2),c=h[0],l=h[1];n.push({type:"",value:l}),r=c}else if(i===40)n.push({type:"<(-token>"});else if(i===41)n.push({type:"<)-token>"});else if(i===43){var p=Em(e,r);if(p===null)n.push({type:"",value:i});else{var m=Fr(p,2),c=m[0],v=m[1];v[0]===""?n.push({type:"",value:v[1],unit:v[2].toLowerCase(),flag:"number"}):v[0]===""?n.push({type:v[0],value:v[1],flag:v[2]}):n.push({type:v[0],value:v[1],flag:"number"}),r=c}}else if(i===44)n.push({type:""});else if(i===45){var y=Em(e,r);if(y!==null){var b=Fr(y,2),c=b[0],v=b[1];v[0]===""?n.push({type:"",value:v[1],unit:v[2].toLowerCase(),flag:"number"}):v[0]===""?n.push({type:v[0],value:v[1],flag:v[2]}):n.push({type:v[0],value:v[1],flag:"number"}),r=c;continue}if(r+2"}),r+=2;continue}}var o=uP(e,r);if(o!==null){var S=Fr(o,3),c=S[0],l=S[1],P=S[2];n.push({type:P,value:l}),r=c;continue}n.push({type:"",value:i})}else if(i===46){var y=Em(e,r);if(y===null)n.push({type:"",value:i});else{var M=Fr(y,2),c=M[0],v=M[1];v[0]===""?n.push({type:"",value:v[1],unit:v[2].toLowerCase(),flag:"number"}):v[0]===""?n.push({type:v[0],value:v[1],flag:v[2]}):n.push({type:v[0],value:v[1],flag:"number"}),r=c;continue}}else if(i===58)n.push({type:""});else if(i===59)n.push({type:""});else if(i===60){if(r+3"}),r+=3;continue}}n.push({type:"",value:i})}else if(i===64){var o=t9(e,r+1);if(o!==null){var j=Fr(o,2),c=j[0],l=j[1];n.push({type:"",value:l.toLowerCase()}),r=c;continue}n.push({type:"",value:i})}else if(i===91)n.push({type:"<[-token>"});else if(i===92){var o=xp(e,r);if(o===null)return null;var H=Fr(o,2),c=H[0],l=H[1];e=e.slice(0,r)+l+e.slice(c+1),r-=1}else if(i===93)n.push({type:"<]-token>"});else if(i===123)n.push({type:"<{-token>"});else if(i===125)n.push({type:"<}-token>"});else if(i>=48&&i<=57){var o=Em(e,r),K=Fr(o,2),c=K[0],v=K[1];v[0]===""?n.push({type:"",value:v[1],unit:v[2].toLowerCase(),flag:"number"}):v[0]===""?n.push({type:v[0],value:v[1],flag:v[2]}):n.push({type:v[0],value:v[1],flag:"number"}),r=c}else if(i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128){var o=uP(e,r);if(o===null)return null;var Q=Fr(o,3),c=Q[0],l=Q[1],P=Q[2];n.push({type:P,value:l}),r=c}else n.push({type:"",value:i})}return n.push({type:""}),n},lP=function(e,r){if(e.length<=r+1)return null;for(var n=e.charCodeAt(r),i=[],s=r+1;s=65&&i<=90||i>=97&&i<=122||i>=128)return!0;if(i===92){if(e.length<=r+2)return!1;var s=e.charCodeAt(r+2);return s!==10}else return!1}else{if(n===95||n>=65&&n<=90||n>=97&&n<=122||n>=128)return!0;if(n===92){if(e.length<=r+1)return!1;var i=e.charCodeAt(r+1);return i!==10}else return!1}},xp=function(e,r){if(e.length<=r+1||e.charCodeAt(r)!==92)return null;var n=e.charCodeAt(r+1);if(n===10)return null;if(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102){for(var i=[n],s=Math.min(r+7,e.length),o=r+2;o=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102)i.push(a);else break}if(o",o,f]]}return s+1",o]]:[s,["",o,a]]},hxe=function(e,r){if(e.length<=r)return null;var n="integer",i=[],s=e.charCodeAt(r);for((s===43||s===45)&&(r+=1,s===45&&i.push(45));r=48&&o<=57)i.push(o),r+=1;else break}if(r+1=48&&c<=57)for(i.push(a,c),n="number",r+=2;r=48&&o<=57)i.push(o),r+=1;else break}}if(r+1=48&&c<=57;if(u||(c===43||c===45)&&l>=48&&l<=57)for(n="number",u?(i.push(69,c),r+=2):c===45?(i.push(69,45,l),r+=3):(i.push(69,l),r+=3);r=48&&o<=57)i.push(o),r+=1;else break}}}var f=String.fromCharCode.apply(null,i),d=n==="number"?parseFloat(f):parseInt(f);return d===-0&&(d=0),Number.isNaN(d)?null:[r-1,d,n]},pxe=function(e,r){if(e.length<=r)return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=xp(e,r);if(s!==null){var o=Fr(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return r===0?null:[r-1,String.fromCharCode.apply(null,n)]},t9=function(e,r){if(e.length<=r||!rz(e,r))return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=xp(e,r);if(s!==null){var o=Fr(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return[r-1,String.fromCharCode.apply(null,n)]},mxe=function(e,r){for(var n=e.charCodeAt(r);n===9||n===32||n===10;)n=e.charCodeAt(++r);for(var i=[],s=!1;rs+1){var a=e.charCodeAt(s+1);if(a===40){for(var c=2;s+c"];if(l!==9&&l!==32&&l!==10){var u=mxe(e,s+c);if(u===null)return null;var f=Fr(u,2),d=f[0],h=f[1];return[d,h,""]}}return[s+1,o.toLowerCase(),""]}}}else if(e.length>s+1){var a=e.charCodeAt(s+1);if(a===40)return[s+1,o.toLowerCase(),""]}return[s,o.toLowerCase(),""]},vxe=function(e){for(var r=e.length-1;r>=0;r--)e[r]=yxe(e[r]);return e},yxe=function(e){if(e.mediaCondition===null)return e;var r=gxe(e.mediaCondition);return r.operator===null&&r.children.length===1&&"children"in r.children[0]&&(r=r.children[0]),{mediaPrefix:e.mediaPrefix,mediaType:e.mediaType,mediaCondition:r}},gxe=function t(e){for(var r=e.children.length-1;r>=0;r--){var n=e.children[r];if(!("context"in n)){var i=t(n);if(i.operator===null&&i.children.length===1)e.children[r]=i.children[0];else if(i.operator===e.operator&&(i.operator==="and"||i.operator==="or")){for(var s=[r,1],o=0;o"&&r[0].value==="media"){if(r[1].type!=="")throw Kn("Expected whitespace after media");n=2;for(var s=2;s"){i=s;break}else if(o.type==="")throw Kn("Expected '{' in media query but found ';'")}}return r=r.slice(n,i),Exe(r)},wxe=function(e){for(var r=[],n=!1,i=0;i"?(n=!0,r.length>0&&(r[r.length-1].wsAfter=!0)):(r.push(ig(ig({},e[i]),{wsBefore:n,wsAfter:!1})),n=!1);return r},Exe=function(e){for(var r,n,i=[[]],s=0;s"?i.push([]):i[i.length-1].push(o)}var a=i.map(wxe);if(a.length===1&&a[0].length===0)return[{mediaCondition:null,mediaPrefix:null,mediaType:"all"}];var c=a.map(function(h){return h.length===0?null:Cxe(h)}),l=[];try{for(var u=cxe(c),f=u.next();!f.done;f=u.next()){var d=f.value;d!==null&&l.push(d)}}catch(h){r={error:h}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(l.length===0)throw Kn("No valid media queries");return l},Cxe=function(e){var r=e[0];if(r.type==="<(-token>")try{return{mediaPrefix:null,mediaType:"all",mediaCondition:ww(e,!0)}}catch(f){throw Kn("Expected media condition after '('",f)}else if(r.type===""){var n=null,i=void 0,s=r.value;(s==="only"||s==="not")&&(n=s);var o=n===null?0:1;if(e.length<=o)throw Kn("Expected extra token in media query");var a=e[o];if(a.type===""){var c=a.value;if(c==="all")i="all";else if(c==="print"||c==="screen")i=c;else if(c==="tty"||c==="tv"||c==="projection"||c==="handheld"||c==="braille"||c==="embossed"||c==="aural"||c==="speech")n=n==="not"?null:"not",i="all";else throw Kn("Unknown ident '".concat(c,"' in media query"))}else if(n==="not"&&a.type==="<(-token>"){var l=[{type:"<(-token>",wsBefore:!1,wsAfter:!1}];l.push.apply(l,e),l.push({type:"<)-token>",wsBefore:!1,wsAfter:!1});try{return{mediaPrefix:null,mediaType:"all",mediaCondition:ww(l,!0)}}catch(f){throw Kn("Expected media condition after '('",f)}}else throw Kn("Invalid media query");if(o+1===e.length)return{mediaPrefix:n,mediaType:i,mediaCondition:null};if(o+4"&&u.value==="and")try{return{mediaPrefix:n,mediaType:i,mediaCondition:ww(e.slice(o+2),!1)}}catch(f){throw Kn("Expected media condition after 'and'",f)}else throw Kn("Expected 'and' after media prefix")}else throw Kn("Expected media condition after media prefix")}else throw Kn("Expected media condition or media prefix")},ww=function t(e,r,n){if(n===void 0&&(n=null),e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media condition");for(var i=e.length-1,s=0,o=0,a=0;a"?(o+=1,s=Math.max(s,o)):c.type==="<)-token>"&&(o-=1),o===0){i=a;break}}if(o!==0)throw new Error(`Mismatched parens +Invalid media condition`);var l,u=e.slice(0,i+1);if(s===1?l=Sxe(u):u[1].type===""&&u[1].value==="not"?l=t(u.slice(2,-1),!0,"not"):l=t(u.slice(1,-1),!0),i===e.length-1)return{operator:n,children:[l]};var f=e[i+1];if(f.type!=="")throw new Error(`Invalid operator Invalid media condition`);if(n!==null&&n!==f.value)throw new Error("'".concat(f.value,"' and '").concat(n,`' must not be at same level Invalid media condition`));if(f.value==="or"&&!r)throw new Error(`Cannot use 'or' at top level of a media query Invalid media condition`);if(f.value!=="and"&&f.value!=="or")throw new Error("Invalid operator: '".concat(f.value,`' -Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.value,children:[l].concat(d.children)}},Lxe=function(e){if(e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media feature");for(var r=[e[0]],n=1;n"&&i.value>0&&s.type===""&&s.value===47&&o.type===""&&o.value>0){r.push({type:"",numerator:i.value,denominator:o.value,wsBefore:i.wsBefore,wsAfter:o.wsAfter}),n+=2;continue}}r.push(e[n])}var a=r[1];if(a.type===""&&r.length===3)return{context:"boolean",feature:a.value};if(r.length===5&&r[1].type===""&&r[2].type===""){var c=r[3];if(c.type===""||c.type===""||c.type===""||c.type===""){var l=r[1].value,u=null,f=l.slice(0,4);f==="min-"?(u="min",l=l.slice(4)):f==="max-"&&(u="max",l=l.slice(4)),c.wsBefore,c.wsAfter;var d=G3(c,["wsBefore","wsAfter"]);return{context:"value",prefix:u,feature:l,value:d}}}else if(r.length>=5)try{var h=jxe(r);return{context:"range",feature:h.featureName,range:h}}catch(p){throw Qn("Invalid media feature",p)}throw new Error("Invalid media feature")},jxe=function(e){var r,n,i,s;if(e.length<5||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid range");var o={leftToken:null,leftOp:null,featureName:"",rightOp:null,rightToken:null},a=e[1].type===""||e[1].type===""||e[1].type===""||e[1].type===""&&e[1].value==="infinite";if(e[2].type===""){if(e[2].value===60)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]="<=":o[a?"leftOp":"rightOp"]="<";else if(e[2].value===62)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]=">=":o[a?"leftOp":"rightOp"]=">";else if(e[2].value===61)o[a?"leftOp":"rightOp"]="=";else throw new Error("Invalid range");if(a)o.leftToken=e[1];else if(e[1].type==="")o.featureName=e[1].value;else throw new Error("Invalid range");var c=2+((n=(r=o[a?"leftOp":"rightOp"])===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0),l=e[c];if(a)if(l.type===""){if(o.featureName=l.value,e.length>=7){var u=e[c+1],f=e[c+2];if(u.type===""){var d=u.value;if(d===60)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp="<=":o.rightOp="<";else if(d===62)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp=">=":o.rightOp=">";else throw new Error("Invalid range");var h=e[c+1+((s=(i=o.rightOp)===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)];o.rightToken=h}else throw new Error("Invalid range")}else if(c+2!==e.length)throw new Error("Invalid range")}else throw new Error("Invalid range");else o.rightToken=l;var p=null,m=o.leftToken,v=o.leftOp,y=o.featureName,b=o.rightOp,E=o.rightToken,S=null;if(m!==null){if(m.type===""){var P=m.type,M=m.value;M==="infinite"&&(S={type:P,value:M})}else if(m.type===""||m.type===""||m.type===""){m.wsBefore,m.wsAfter;var L=G3(m,["wsBefore","wsAfter"]);S=L}}var j=null;if(E!==null){if(E.type===""){var P=E.type,M=E.value;M==="infinite"&&(j={type:P,value:M})}else if(E.type===""||E.type===""||E.type===""){E.wsBefore,E.wsAfter;var H=G3(E,["wsBefore","wsAfter"]);j=H}}if(S!==null&&j!==null)if((v==="<"||v==="<=")&&(b==="<"||b==="<="))p={leftToken:S,leftOp:v,featureName:y,rightOp:b,rightToken:j};else if((v===">"||v===">=")&&(b===">"||b===">="))p={leftToken:S,leftOp:v,featureName:y,rightOp:b,rightToken:j};else throw new Error("Invalid range");else S===null&&v===null&&b!==null&&j!==null?p={leftToken:S,leftOp:v,featureName:y,rightOp:b,rightToken:j}:S!==null&&v!==null&&b===null&&j===null&&(p={leftToken:S,leftOp:v,featureName:y,rightOp:b,rightToken:j});return p}else throw new Error("Invalid range")};function Bxe(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fxe(t){var e=Bxe(t,"string");return typeof e=="symbol"?e:String(e)}function Uxe(t,e,r){return e=Fxe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function PP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function T0(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function IP(t,e){if(t==null)return{};var r=zxe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Uh(t,e){for(var r in t)e(t[r],r)}function Xu(t,e){var r={};for(var n in t)e.indexOf(n)===-1&&(r[n]=t[n]);return r}function qxe(t,e){var r={};for(var n in t)r[e(t[n],n)]=t[n];return r}function K3(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n{var r=()=>{var i=new RegExp(".".concat(Hxe(d9(e,{isIdentifier:!0}))),"g");return t.replace(i,"&")},n;try{n=xxe(t)}catch{throw new Error("Invalid selector: ".concat(r()))}n.forEach(i=>{try{for(var s=i.length-1;s>=-1;s--){if(!i[s])throw new Error;var o=i[s];if(o.type==="child"||o.type==="parent"||o.type==="sibling"||o.type==="adjacent"||o.type==="descendant")throw new Error;if(o.type==="attribute"&&o.name==="class"&&o.value===e)return}}catch{throw new Error(ro(TP||(TP=l9([` +Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.value,children:[l].concat(d.children)}},Sxe=function(e){if(e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media feature");for(var r=[e[0]],n=1;n"&&i.value>0&&s.type===""&&s.value===47&&o.type===""&&o.value>0){r.push({type:"",numerator:i.value,denominator:o.value,wsBefore:i.wsBefore,wsAfter:o.wsAfter}),n+=2;continue}}r.push(e[n])}var a=r[1];if(a.type===""&&r.length===3)return{context:"boolean",feature:a.value};if(r.length===5&&r[1].type===""&&r[2].type===""){var c=r[3];if(c.type===""||c.type===""||c.type===""||c.type===""){var l=r[1].value,u=null,f=l.slice(0,4);f==="min-"?(u="min",l=l.slice(4)):f==="max-"&&(u="max",l=l.slice(4)),c.wsBefore,c.wsAfter;var d=$3(c,["wsBefore","wsAfter"]);return{context:"value",prefix:u,feature:l,value:d}}}else if(r.length>=5)try{var h=kxe(r);return{context:"range",feature:h.featureName,range:h}}catch(p){throw Kn("Invalid media feature",p)}throw new Error("Invalid media feature")},kxe=function(e){var r,n,i,s;if(e.length<5||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid range");var o={leftToken:null,leftOp:null,featureName:"",rightOp:null,rightToken:null},a=e[1].type===""||e[1].type===""||e[1].type===""||e[1].type===""&&e[1].value==="infinite";if(e[2].type===""){if(e[2].value===60)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]="<=":o[a?"leftOp":"rightOp"]="<";else if(e[2].value===62)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]=">=":o[a?"leftOp":"rightOp"]=">";else if(e[2].value===61)o[a?"leftOp":"rightOp"]="=";else throw new Error("Invalid range");if(a)o.leftToken=e[1];else if(e[1].type==="")o.featureName=e[1].value;else throw new Error("Invalid range");var c=2+((n=(r=o[a?"leftOp":"rightOp"])===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0),l=e[c];if(a)if(l.type===""){if(o.featureName=l.value,e.length>=7){var u=e[c+1],f=e[c+2];if(u.type===""){var d=u.value;if(d===60)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp="<=":o.rightOp="<";else if(d===62)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp=">=":o.rightOp=">";else throw new Error("Invalid range");var h=e[c+1+((s=(i=o.rightOp)===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)];o.rightToken=h}else throw new Error("Invalid range")}else if(c+2!==e.length)throw new Error("Invalid range")}else throw new Error("Invalid range");else o.rightToken=l;var p=null,m=o.leftToken,v=o.leftOp,y=o.featureName,b=o.rightOp,E=o.rightToken,S=null;if(m!==null){if(m.type===""){var P=m.type,M=m.value;M==="infinite"&&(S={type:P,value:M})}else if(m.type===""||m.type===""||m.type===""){m.wsBefore,m.wsAfter;var L=$3(m,["wsBefore","wsAfter"]);S=L}}var j=null;if(E!==null){if(E.type===""){var P=E.type,M=E.value;M==="infinite"&&(j={type:P,value:M})}else if(E.type===""||E.type===""||E.type===""){E.wsBefore,E.wsAfter;var H=$3(E,["wsBefore","wsAfter"]);j=H}}if(S!==null&&j!==null)if((v==="<"||v==="<=")&&(b==="<"||b==="<="))p={leftToken:S,leftOp:v,featureName:y,rightOp:b,rightToken:j};else if((v===">"||v===">=")&&(b===">"||b===">="))p={leftToken:S,leftOp:v,featureName:y,rightOp:b,rightToken:j};else throw new Error("Invalid range");else S===null&&v===null&&b!==null&&j!==null?p={leftToken:S,leftOp:v,featureName:y,rightOp:b,rightToken:j}:S!==null&&v!==null&&b===null&&j===null&&(p={leftToken:S,leftOp:v,featureName:y,rightOp:b,rightToken:j});return p}else throw new Error("Invalid range")};function Axe(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _xe(t){var e=Axe(t,"string");return typeof e=="symbol"?e:String(e)}function Pxe(t,e,r){return e=_xe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function x0(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function dP(t,e){if(t==null)return{};var r=Ixe(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Oh(t,e){for(var r in t)e(t[r],r)}function Wu(t,e){var r={};for(var n in t)e.indexOf(n)===-1&&(r[n]=t[n]);return r}function Txe(t,e){var r={};for(var n in t)r[e(t[n],n)]=t[n];return r}function M3(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n{var r=()=>{var i=new RegExp(".".concat(Rxe(e9(e,{isIdentifier:!0}))),"g");return t.replace(i,"&")},n;try{n=axe(t)}catch{throw new Error("Invalid selector: ".concat(r()))}n.forEach(i=>{try{for(var s=i.length-1;s>=-1;s--){if(!i[s])throw new Error;var o=i[s];if(o.type==="child"||o.type==="parent"||o.type==="sibling"||o.type==="adjacent"||o.type==="descendant")throw new Error;if(o.type==="attribute"&&o.name==="class"&&o.value===e)return}}catch{throw new Error(eo(hP||(hP=J4([` Invalid selector: `,` Style selectors must target the '&' character (along with any modifiers), e.g. `," or ",`. @@ -244,31 +244,31 @@ Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.val If your selector is targeting another class, you should move it to the style definition for that class, e.g. given we have styles for 'parent' and 'child' elements, instead of adding a selector of `,") to 'parent', you should add ",` to 'child'). If your selector is targeting something global, use the 'globalStyle' function instead, e.g. if you wanted to write `,", you should instead write 'globalStyle(",`, { ... })' - `])),r(),"`${parent} &`","`${parent} &:hover`","`& ${child}`","`${parent} &`","`& h1`","`${parent} h1`"))}})};class yg{constructor(){this.ruleset=new Map,this.precedenceLookup=new Map}findOrCreateCondition(e){var r=this.ruleset.get(e);return r||(r={query:e,rules:[],children:new yg},this.ruleset.set(e,r)),r}getConditionalRulesetByPath(e){var r=this;for(var n of e){var i=r.findOrCreateCondition(n);r=i.children}return r}addRule(e,r,n){var i=this.getConditionalRulesetByPath(n),s=i.findOrCreateCondition(r);if(!s)throw new Error("Failed to add conditional rule");s.rules.push(e)}addConditionPrecedence(e,r){for(var n=this.getConditionalRulesetByPath(e),i=0;ia.has(u.query));l>-1?r.splice(l,0,c):r.push(c)};for(var[i,s]of this.precedenceLookup.entries())n(s);return r}renderToArray(){var e=[];for(var{query:r,rules:n,children:i}of this.getSortedRuleset()){var s={};for(var o of n)s[o.selector]=o.rule;Object.assign(s,...i.renderToArray()),e.push({[r]:s})}return e}}var yz={":-moz-any-link":!0,":-moz-full-screen":!0,":-moz-placeholder":!0,":-moz-read-only":!0,":-moz-read-write":!0,":-ms-fullscreen":!0,":-ms-input-placeholder":!0,":-webkit-any-link":!0,":-webkit-full-screen":!0,"::-moz-color-swatch":!0,"::-moz-list-bullet":!0,"::-moz-list-number":!0,"::-moz-page-sequence":!0,"::-moz-page":!0,"::-moz-placeholder":!0,"::-moz-progress-bar":!0,"::-moz-range-progress":!0,"::-moz-range-thumb":!0,"::-moz-range-track":!0,"::-moz-scrolled-page-sequence":!0,"::-moz-selection":!0,"::-ms-backdrop":!0,"::-ms-browse":!0,"::-ms-check":!0,"::-ms-clear":!0,"::-ms-fill-lower":!0,"::-ms-fill-upper":!0,"::-ms-fill":!0,"::-ms-reveal":!0,"::-ms-thumb":!0,"::-ms-ticks-after":!0,"::-ms-ticks-before":!0,"::-ms-tooltip":!0,"::-ms-track":!0,"::-ms-value":!0,"::-webkit-backdrop":!0,"::-webkit-inner-spin-button":!0,"::-webkit-input-placeholder":!0,"::-webkit-meter-bar":!0,"::-webkit-meter-even-less-good-value":!0,"::-webkit-meter-inner-element":!0,"::-webkit-meter-optimum-value":!0,"::-webkit-meter-suboptimum-value":!0,"::-webkit-outer-spin-button":!0,"::-webkit-progress-bar":!0,"::-webkit-progress-inner-element":!0,"::-webkit-progress-inner-value":!0,"::-webkit-progress-value":!0,"::-webkit-resizer":!0,"::-webkit-scrollbar-button":!0,"::-webkit-scrollbar-corner":!0,"::-webkit-scrollbar-thumb":!0,"::-webkit-scrollbar-track-piece":!0,"::-webkit-scrollbar-track":!0,"::-webkit-scrollbar":!0,"::-webkit-search-cancel-button":!0,"::-webkit-search-results-button":!0,"::-webkit-slider-runnable-track":!0,"::-webkit-slider-thumb":!0,"::after":!0,"::backdrop":!0,"::before":!0,"::cue":!0,"::file-selector-button":!0,"::first-letter":!0,"::first-line":!0,"::grammar-error":!0,"::marker":!0,"::placeholder":!0,"::selection":!0,"::spelling-error":!0,"::target-text":!0,"::view-transition-group":!0,"::view-transition-image-pair":!0,"::view-transition-new":!0,"::view-transition-old":!0,"::view-transition":!0,":active":!0,":after":!0,":any-link":!0,":before":!0,":blank":!0,":checked":!0,":default":!0,":defined":!0,":disabled":!0,":empty":!0,":enabled":!0,":first-child":!0,":first-letter":!0,":first-line":!0,":first-of-type":!0,":first":!0,":focus-visible":!0,":focus-within":!0,":focus":!0,":fullscreen":!0,":hover":!0,":in-range":!0,":indeterminate":!0,":invalid":!0,":last-child":!0,":last-of-type":!0,":left":!0,":link":!0,":only-child":!0,":only-of-type":!0,":optional":!0,":out-of-range":!0,":placeholder-shown":!0,":read-only":!0,":read-write":!0,":required":!0,":right":!0,":root":!0,":scope":!0,":target":!0,":valid":!0,":visited":!0},Gxe=Object.keys(yz),Kxe=yz,OP,RP=(t,e)=>new Error(ro(OP||(OP=l9([` + `])),r(),"`${parent} &`","`${parent} &:hover`","`& ${child}`","`${parent} &`","`& h1`","`${parent} h1`"))}})};class sg{constructor(){this.ruleset=new Map,this.precedenceLookup=new Map}findOrCreateCondition(e){var r=this.ruleset.get(e);return r||(r={query:e,rules:[],children:new sg},this.ruleset.set(e,r)),r}getConditionalRulesetByPath(e){var r=this;for(var n of e){var i=r.findOrCreateCondition(n);r=i.children}return r}addRule(e,r,n){var i=this.getConditionalRulesetByPath(n),s=i.findOrCreateCondition(r);if(!s)throw new Error("Failed to add conditional rule");s.rules.push(e)}addConditionPrecedence(e,r){for(var n=this.getConditionalRulesetByPath(e),i=0;ia.has(u.query));l>-1?r.splice(l,0,c):r.push(c)};for(var[i,s]of this.precedenceLookup.entries())n(s);return r}renderToArray(){var e=[];for(var{query:r,rules:n,children:i}of this.getSortedRuleset()){var s={};for(var o of n)s[o.selector]=o.rule;Object.assign(s,...i.renderToArray()),e.push({[r]:s})}return e}}var nz={":-moz-any-link":!0,":-moz-full-screen":!0,":-moz-placeholder":!0,":-moz-read-only":!0,":-moz-read-write":!0,":-ms-fullscreen":!0,":-ms-input-placeholder":!0,":-webkit-any-link":!0,":-webkit-full-screen":!0,"::-moz-color-swatch":!0,"::-moz-list-bullet":!0,"::-moz-list-number":!0,"::-moz-page-sequence":!0,"::-moz-page":!0,"::-moz-placeholder":!0,"::-moz-progress-bar":!0,"::-moz-range-progress":!0,"::-moz-range-thumb":!0,"::-moz-range-track":!0,"::-moz-scrolled-page-sequence":!0,"::-moz-selection":!0,"::-ms-backdrop":!0,"::-ms-browse":!0,"::-ms-check":!0,"::-ms-clear":!0,"::-ms-fill-lower":!0,"::-ms-fill-upper":!0,"::-ms-fill":!0,"::-ms-reveal":!0,"::-ms-thumb":!0,"::-ms-ticks-after":!0,"::-ms-ticks-before":!0,"::-ms-tooltip":!0,"::-ms-track":!0,"::-ms-value":!0,"::-webkit-backdrop":!0,"::-webkit-inner-spin-button":!0,"::-webkit-input-placeholder":!0,"::-webkit-meter-bar":!0,"::-webkit-meter-even-less-good-value":!0,"::-webkit-meter-inner-element":!0,"::-webkit-meter-optimum-value":!0,"::-webkit-meter-suboptimum-value":!0,"::-webkit-outer-spin-button":!0,"::-webkit-progress-bar":!0,"::-webkit-progress-inner-element":!0,"::-webkit-progress-inner-value":!0,"::-webkit-progress-value":!0,"::-webkit-resizer":!0,"::-webkit-scrollbar-button":!0,"::-webkit-scrollbar-corner":!0,"::-webkit-scrollbar-thumb":!0,"::-webkit-scrollbar-track-piece":!0,"::-webkit-scrollbar-track":!0,"::-webkit-scrollbar":!0,"::-webkit-search-cancel-button":!0,"::-webkit-search-results-button":!0,"::-webkit-slider-runnable-track":!0,"::-webkit-slider-thumb":!0,"::after":!0,"::backdrop":!0,"::before":!0,"::cue":!0,"::file-selector-button":!0,"::first-letter":!0,"::first-line":!0,"::grammar-error":!0,"::marker":!0,"::placeholder":!0,"::selection":!0,"::spelling-error":!0,"::target-text":!0,"::view-transition-group":!0,"::view-transition-image-pair":!0,"::view-transition-new":!0,"::view-transition-old":!0,"::view-transition":!0,":active":!0,":after":!0,":any-link":!0,":before":!0,":blank":!0,":checked":!0,":default":!0,":defined":!0,":disabled":!0,":empty":!0,":enabled":!0,":first-child":!0,":first-letter":!0,":first-line":!0,":first-of-type":!0,":first":!0,":focus-visible":!0,":focus-within":!0,":focus":!0,":fullscreen":!0,":hover":!0,":in-range":!0,":indeterminate":!0,":invalid":!0,":last-child":!0,":last-of-type":!0,":left":!0,":link":!0,":only-child":!0,":only-of-type":!0,":optional":!0,":out-of-range":!0,":placeholder-shown":!0,":read-only":!0,":read-write":!0,":required":!0,":right":!0,":root":!0,":scope":!0,":target":!0,":valid":!0,":visited":!0},Mxe=Object.keys(nz),Nxe=nz,pP,mP=(t,e)=>new Error(eo(pP||(pP=J4([` Invalid media query: "`,`" `,` Read more on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries - `])),t,e)),Qxe=t=>{if(t==="@media ")throw RP(t,"Query is empty");try{Rxe(t)}catch(e){throw RP(t,e.message)}},Yxe=["vars"],Jxe=["content"],gz="__DECLARATION",Xxe={animationIterationCount:!0,borderImage:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,initialLetter:!0,lineClamp:!0,lineHeight:!0,maxLines:!0,opacity:!0,order:!0,orphans:!0,scale:!0,tabSize:!0,WebkitLineClamp:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,maskBorder:!0,maskBorderOutset:!0,maskBorderSlice:!0,maskBorderWidth:!0,shapeImageThreshold:!0,stopOpacity:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function Zxe(t){return t.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function ewe(t,e,r,n){var i=t.slice(0,e),s=t.slice(r);return"".concat(i).concat(n).concat(s)}var twe=" ",Zu=[...Gxe,"@layer","@media","@supports","@container","selectors"];class rwe{constructor(e,r){this.rules=[],this.conditionalRulesets=[new yg],this.fontFaceRules=[],this.keyframesRules=[],this.localClassNamesMap=new Map(e.map(n=>[n,n])),this.localClassNamesSearch=new hxe(e),this.layers=new Map,this.composedClassLists=r.map(n=>{var{identifier:i,classList:s}=n;return{identifier:i,regex:RegExp("(".concat(s,")"),"g")}}).reverse()}processCssObj(e){if(e.type==="fontFace"){this.fontFaceRules.push(e.rule);return}if(e.type==="keyframes"){e.rule=Object.fromEntries(Object.entries(e.rule).map(s=>{var[o,a]=s;return[o,this.transformProperties(a)]})),this.keyframesRules.push(e);return}if(this.currConditionalRuleset=new yg,e.type==="layer"){var r="@layer ".concat(e.name);this.addLayer([r])}else{var n=Xu(e.rule,Zu);this.addRule({selector:e.selector,rule:n}),this.transformLayer(e,e.rule["@layer"]),this.transformMedia(e,e.rule["@media"]),this.transformSupports(e,e.rule["@supports"]),this.transformContainer(e,e.rule["@container"]),this.transformSimplePseudos(e,e.rule),this.transformSelectors(e,e.rule)}var i=this.conditionalRulesets[this.conditionalRulesets.length-1];i.mergeIfCompatible(this.currConditionalRuleset)||this.conditionalRulesets.push(this.currConditionalRuleset)}addConditionalRule(e,r){var n=this.transformVars(this.transformProperties(e.rule)),i=this.transformSelector(e.selector);if(!this.currConditionalRuleset)throw new Error("Couldn't add conditional rule");var s=r[r.length-1],o=r.slice(0,r.length-1);this.currConditionalRuleset.addRule({selector:i,rule:n},s,o)}addRule(e){var r=this.transformVars(this.transformProperties(e.rule)),n=this.transformSelector(e.selector);this.rules.push({selector:n,rule:r})}addLayer(e){var r=e.join(" - ");this.layers.set(r,e)}transformProperties(e){return this.transformContent(this.pixelifyProperties(e))}pixelifyProperties(e){return Uh(e,(r,n)=>{typeof r=="number"&&r!==0&&!Xxe[n]&&(e[n]="".concat(r,"px"))}),e}transformVars(e){var{vars:r}=e,n=IP(e,Yxe);return r?T0(T0({},qxe(r,(i,s)=>sxe(s))),n):n}transformContent(e){var{content:r}=e,n=IP(e,Jxe);if(typeof r>"u")return n;var i=Array.isArray(r)?r:[r];return T0({content:i.map(s=>s&&(s.includes('"')||s.includes("'")||/^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(s))?s:'"'.concat(s,'"'))},n)}transformClassname(e){return".".concat(d9(e,{isIdentifier:!0}))}transformSelector(e){var r=e,n=function(h){r=r.replace(s,()=>(pz(h),h))};for(var{identifier:i,regex:s}of this.composedClassLists)n(i);if(this.localClassNamesMap.has(r))return this.transformClassname(r);for(var o=this.localClassNamesSearch.search(r),a=r.length,c=o.length-1;c>=0;c--){var[l,[u]]=o[c],f=l-u.length+1;f>=a||(a=f,r[f-1]!=="."&&(r=ewe(r,f,l+1,this.transformClassname(u))))}return r}transformSelectors(e,r,n){Uh(r.selectors,(i,s)=>{if(e.type!=="local")throw new Error("Selectors are not allowed within ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));var o=this.transformSelector(s.replace(RegExp("&","g"),e.selector));Vxe(o,e.selector);var a={selector:o,rule:Xu(i,Zu)};n?this.addConditionalRule(a,n):this.addRule(a);var c={type:"selector",selector:o,rule:i};this.transformLayer(c,i["@layer"],n),this.transformSupports(c,i["@supports"],n),this.transformMedia(c,i["@media"],n)})}transformMedia(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(l=>"@media ".concat(l)));for(var[s,o]of Object.entries(r)){var a="@media ".concat(s);Qxe(a);var c=[...n,a];this.addConditionalRule({selector:e.selector,rule:Xu(o,Zu)},c),e.type==="local"&&(this.transformSimplePseudos(e,o,c),this.transformSelectors(e,o,c)),this.transformLayer(e,o["@layer"],c),this.transformSupports(e,o["@supports"],c),this.transformContainer(e,o["@container"],c)}}}transformContainer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@container ".concat(s))),Uh(r,(s,o)=>{var a="@container ".concat(o),c=[...n,a];this.addConditionalRule({selector:e.selector,rule:Xu(s,Zu)},c),e.type==="local"&&(this.transformSimplePseudos(e,s,c),this.transformSelectors(e,s,c)),this.transformLayer(e,s["@layer"],c),this.transformSupports(e,s["@supports"],c),this.transformMedia(e,s["@media"],c)})}}transformLayer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@layer ".concat(s))),Uh(r,(s,o)=>{var a=[...n,"@layer ".concat(o)];this.addLayer(a),this.addConditionalRule({selector:e.selector,rule:Xu(s,Zu)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformMedia(e,s["@media"],a),this.transformSupports(e,s["@supports"],a),this.transformContainer(e,s["@container"],a)})}}transformSupports(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@supports ".concat(s))),Uh(r,(s,o)=>{var a=[...n,"@supports ".concat(o)];this.addConditionalRule({selector:e.selector,rule:Xu(s,Zu)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformLayer(e,s["@layer"],a),this.transformMedia(e,s["@media"],a),this.transformContainer(e,s["@container"],a)})}}transformSimplePseudos(e,r,n){for(var i of Object.keys(r))if(Kxe[i]){if(e.type!=="local")throw new Error("Simple pseudos are not valid in ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));n?this.addConditionalRule({selector:"".concat(e.selector).concat(i),rule:r[i]},n):this.addRule({conditions:n,selector:"".concat(e.selector).concat(i),rule:r[i]})}}toCss(){var e=[];for(var r of this.fontFaceRules)e.push(Ll({"@font-face":r}));for(var n of this.keyframesRules)e.push(Ll({["@keyframes ".concat(n.name)]:n.rule}));for(var i of this.layers.values()){var[s,...o]=i.reverse(),a={[s]:gz};for(var c of o)a={[c]:a};e.push(Ll(a))}for(var l of this.rules)e.push(Ll({[l.selector]:l.rule}));for(var u of this.conditionalRulesets)for(var f of u.renderToArray())e.push(Ll(f));return e.filter(Boolean)}}function Ll(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=[],n=function(o){var a=t[o];if(a&&Array.isArray(a))r.push(...a.map(l=>Ll({[o]:l},e)));else if(a&&typeof a=="object"){var c=Object.keys(a).length===0;c||r.push("".concat(e).concat(o,` { -`).concat(Ll(a,e+twe),` -`).concat(e,"}"))}else a===gz?r.push("".concat(e).concat(o,";")):r.push("".concat(e).concat(o.startsWith("--")?o:Zxe(o),": ").concat(a,";"))};for(var i of Object.keys(t))n(i);return r.join(` -`)}function nwe(t){var{localClassNames:e,cssObjs:r,composedClassLists:n}=t,i=new rwe(e,n);for(var s of r)i.processCssObj(s);return i.toCss()}function bz(t){for(var e=0,r,n=0,i=t.length;i>=4;++n,i-=4)r=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var p9={exports:{}},Nw,$P;function iwe(){return $P||($P=1,Nw={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),Nw}var Dw,MP;function xz(){if(MP)return Dw;MP=1;const t=iwe(),e={};for(const i of Object.keys(t))e[t[i]]=i;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Dw=r;for(const i of Object.keys(r)){if(!("channels"in r[i]))throw new Error("missing channels property: "+i);if(!("labels"in r[i]))throw new Error("missing channel labels property: "+i);if(r[i].labels.length!==r[i].channels)throw new Error("channel and label counts mismatch: "+i);const{channels:s,labels:o}=r[i];delete r[i].channels,delete r[i].labels,Object.defineProperty(r[i],"channels",{value:s}),Object.defineProperty(r[i],"labels",{value:o})}r.rgb.hsl=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(s,o,a),l=Math.max(s,o,a),u=l-c;let f,d;l===c?f=0:s===l?f=(o-a)/u:o===l?f=2+(a-s)/u:a===l&&(f=4+(s-o)/u),f=Math.min(f*60,360),f<0&&(f+=360);const h=(c+l)/2;return l===c?d=0:h<=.5?d=u/(l+c):d=u/(2-l-c),[f,d*100,h*100]},r.rgb.hsv=function(i){let s,o,a,c,l;const u=i[0]/255,f=i[1]/255,d=i[2]/255,h=Math.max(u,f,d),p=h-Math.min(u,f,d),m=function(v){return(h-v)/6/p+1/2};return p===0?(c=0,l=0):(l=p/h,s=m(u),o=m(f),a=m(d),u===h?c=a-o:f===h?c=1/3+s-a:d===h&&(c=2/3+o-s),c<0?c+=1:c>1&&(c-=1)),[c*360,l*100,h*100]},r.rgb.hwb=function(i){const s=i[0],o=i[1];let a=i[2];const c=r.rgb.hsl(i)[0],l=1/255*Math.min(s,Math.min(o,a));return a=1-1/255*Math.max(s,Math.max(o,a)),[c,l*100,a*100]},r.rgb.cmyk=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(1-s,1-o,1-a),l=(1-s-c)/(1-c)||0,u=(1-o-c)/(1-c)||0,f=(1-a-c)/(1-c)||0;return[l*100,u*100,f*100,c*100]};function n(i,s){return(i[0]-s[0])**2+(i[1]-s[1])**2+(i[2]-s[2])**2}return r.rgb.keyword=function(i){const s=e[i];if(s)return s;let o=1/0,a;for(const c of Object.keys(t)){const l=t[c],u=n(i,l);u.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;const c=s*.4124+o*.3576+a*.1805,l=s*.2126+o*.7152+a*.0722,u=s*.0193+o*.1192+a*.9505;return[c*100,l*100,u*100]},r.rgb.lab=function(i){const s=r.rgb.xyz(i);let o=s[0],a=s[1],c=s[2];o/=95.047,a/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const l=116*a-16,u=500*(o-a),f=200*(a-c);return[l,u,f]},r.hsl.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;let c,l,u;if(o===0)return u=a*255,[u,u,u];a<.5?c=a*(1+o):c=a+o-a*o;const f=2*a-c,d=[0,0,0];for(let h=0;h<3;h++)l=s+1/3*-(h-1),l<0&&l++,l>1&&l--,6*l<1?u=f+(c-f)*6*l:2*l<1?u=c:3*l<2?u=f+(c-f)*(2/3-l)*6:u=f,d[h]=u*255;return d},r.hsl.hsv=function(i){const s=i[0];let o=i[1]/100,a=i[2]/100,c=o;const l=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,c*=l<=1?l:2-l;const u=(a+o)/2,f=a===0?2*c/(l+c):2*o/(a+o);return[s,f*100,u*100]},r.hsv.rgb=function(i){const s=i[0]/60,o=i[1]/100;let a=i[2]/100;const c=Math.floor(s)%6,l=s-Math.floor(s),u=255*a*(1-o),f=255*a*(1-o*l),d=255*a*(1-o*(1-l));switch(a*=255,c){case 0:return[a,d,u];case 1:return[f,a,u];case 2:return[u,a,d];case 3:return[u,f,a];case 4:return[d,u,a];case 5:return[a,u,f]}},r.hsv.hsl=function(i){const s=i[0],o=i[1]/100,a=i[2]/100,c=Math.max(a,.01);let l,u;u=(2-o)*a;const f=(2-o)*c;return l=o*c,l/=f<=1?f:2-f,l=l||0,u/=2,[s,l*100,u*100]},r.hwb.rgb=function(i){const s=i[0]/360;let o=i[1]/100,a=i[2]/100;const c=o+a;let l;c>1&&(o/=c,a/=c);const u=Math.floor(6*s),f=1-a;l=6*s-u,u&1&&(l=1-l);const d=o+l*(f-o);let h,p,m;switch(u){default:case 6:case 0:h=f,p=d,m=o;break;case 1:h=d,p=f,m=o;break;case 2:h=o,p=f,m=d;break;case 3:h=o,p=d,m=f;break;case 4:h=d,p=o,m=f;break;case 5:h=f,p=o,m=d;break}return[h*255,p*255,m*255]},r.cmyk.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100,c=i[3]/100,l=1-Math.min(1,s*(1-c)+c),u=1-Math.min(1,o*(1-c)+c),f=1-Math.min(1,a*(1-c)+c);return[l*255,u*255,f*255]},r.xyz.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100;let c,l,u;return c=s*3.2406+o*-1.5372+a*-.4986,l=s*-.9689+o*1.8758+a*.0415,u=s*.0557+o*-.204+a*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,c=Math.min(Math.max(0,c),1),l=Math.min(Math.max(0,l),1),u=Math.min(Math.max(0,u),1),[c*255,l*255,u*255]},r.xyz.lab=function(i){let s=i[0],o=i[1],a=i[2];s/=95.047,o/=100,a/=108.883,s=s>.008856?s**(1/3):7.787*s+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const c=116*o-16,l=500*(s-o),u=200*(o-a);return[c,l,u]},r.lab.xyz=function(i){const s=i[0],o=i[1],a=i[2];let c,l,u;l=(s+16)/116,c=o/500+l,u=l-a/200;const f=l**3,d=c**3,h=u**3;return l=f>.008856?f:(l-16/116)/7.787,c=d>.008856?d:(c-16/116)/7.787,u=h>.008856?h:(u-16/116)/7.787,c*=95.047,l*=100,u*=108.883,[c,l,u]},r.lab.lch=function(i){const s=i[0],o=i[1],a=i[2];let c;c=Math.atan2(a,o)*360/2/Math.PI,c<0&&(c+=360);const u=Math.sqrt(o*o+a*a);return[s,u,c]},r.lch.lab=function(i){const s=i[0],o=i[1],c=i[2]/360*2*Math.PI,l=o*Math.cos(c),u=o*Math.sin(c);return[s,l,u]},r.rgb.ansi16=function(i,s=null){const[o,a,c]=i;let l=s===null?r.rgb.hsv(i)[2]:s;if(l=Math.round(l/50),l===0)return 30;let u=30+(Math.round(c/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return l===2&&(u+=60),u},r.hsv.ansi16=function(i){return r.rgb.ansi16(r.hsv.rgb(i),i[2])},r.rgb.ansi256=function(i){const s=i[0],o=i[1],a=i[2];return s===o&&o===a?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)},r.ansi16.rgb=function(i){let s=i%10;if(s===0||s===7)return i>50&&(s+=3.5),s=s/10.5*255,[s,s,s];const o=(~~(i>50)+1)*.5,a=(s&1)*o*255,c=(s>>1&1)*o*255,l=(s>>2&1)*o*255;return[a,c,l]},r.ansi256.rgb=function(i){if(i>=232){const l=(i-232)*10+8;return[l,l,l]}i-=16;let s;const o=Math.floor(i/36)/5*255,a=Math.floor((s=i%36)/6)/5*255,c=s%6/5*255;return[o,a,c]},r.rgb.hex=function(i){const o=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},r.hex.rgb=function(i){const s=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!s)return[0,0,0];let o=s[0];s[0].length===3&&(o=o.split("").map(f=>f+f).join(""));const a=parseInt(o,16),c=a>>16&255,l=a>>8&255,u=a&255;return[c,l,u]},r.rgb.hcg=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.max(Math.max(s,o),a),l=Math.min(Math.min(s,o),a),u=c-l;let f,d;return u<1?f=l/(1-u):f=0,u<=0?d=0:c===s?d=(o-a)/u%6:c===o?d=2+(a-s)/u:d=4+(s-o)/u,d/=6,d%=1,[d*360,u*100,f*100]},r.hsl.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=o<.5?2*s*o:2*s*(1-o);let c=0;return a<1&&(c=(o-.5*a)/(1-a)),[i[0],a*100,c*100]},r.hsv.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=s*o;let c=0;return a<1&&(c=(o-a)/(1-a)),[i[0],a*100,c*100]},r.hcg.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;if(o===0)return[a*255,a*255,a*255];const c=[0,0,0],l=s%1*6,u=l%1,f=1-u;let d=0;switch(Math.floor(l)){case 0:c[0]=1,c[1]=u,c[2]=0;break;case 1:c[0]=f,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=u;break;case 3:c[0]=0,c[1]=f,c[2]=1;break;case 4:c[0]=u,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=f}return d=(1-o)*a,[(o*c[0]+d)*255,(o*c[1]+d)*255,(o*c[2]+d)*255]},r.hcg.hsv=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);let c=0;return a>0&&(c=s/a),[i[0],c*100,a*100]},r.hcg.hsl=function(i){const s=i[1]/100,a=i[2]/100*(1-s)+.5*s;let c=0;return a>0&&a<.5?c=s/(2*a):a>=.5&&a<1&&(c=s/(2*(1-a))),[i[0],c*100,a*100]},r.hcg.hwb=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);return[i[0],(a-s)*100,(1-a)*100]},r.hwb.hcg=function(i){const s=i[1]/100,a=1-i[2]/100,c=a-s;let l=0;return c<1&&(l=(a-c)/(1-c)),[i[0],c*100,l*100]},r.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},r.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},r.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},r.gray.hsl=function(i){return[0,0,i[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(i){return[0,100,i[0]]},r.gray.cmyk=function(i){return[0,0,0,i[0]]},r.gray.lab=function(i){return[i[0],0,0]},r.gray.hex=function(i){const s=Math.round(i[0]/100*255)&255,a=((s<<16)+(s<<8)+s).toString(16).toUpperCase();return"000000".substring(a.length)+a},r.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]},Dw}var Lw,NP;function swe(){if(NP)return Lw;NP=1;const t=xz();function e(){const s={},o=Object.keys(t);for(let a=o.length,c=0;c1&&(c=l),o(c))};return"conversion"in o&&(a.conversion=o.conversion),a}function s(o){const a=function(...c){const l=c[0];if(l==null)return l;l.length>1&&(c=l);const u=o(c);if(typeof u=="object")for(let f=u.length,d=0;d{r[o]={},Object.defineProperty(r[o],"channels",{value:t[o].channels}),Object.defineProperty(r[o],"labels",{value:t[o].labels});const a=e(o);Object.keys(a).forEach(l=>{const u=a[l];r[o][l]=s(u),r[o][l].raw=i(u)})}),jw=r,jw}p9.exports;(function(t){const e=(u,f)=>(...d)=>`\x1B[${u(...d)+f}m`,r=(u,f)=>(...d)=>{const h=u(...d);return`\x1B[${38+f};5;${h}m`},n=(u,f)=>(...d)=>{const h=u(...d);return`\x1B[${38+f};2;${h[0]};${h[1]};${h[2]}m`},i=u=>u,s=(u,f,d)=>[u,f,d],o=(u,f,d)=>{Object.defineProperty(u,f,{get:()=>{const h=d();return Object.defineProperty(u,f,{value:h,enumerable:!0,configurable:!0}),h},enumerable:!0,configurable:!0})};let a;const c=(u,f,d,h)=>{a===void 0&&(a=owe());const p=h?10:0,m={};for(const[v,y]of Object.entries(a)){const b=v==="ansi16"?"ansi":v;v===f?m[b]=u(d,p):typeof y=="object"&&(m[b]=u(y[f],p))}return m};function l(){const u=new Map,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};f.color.gray=f.color.blackBright,f.bgColor.bgGray=f.bgColor.bgBlackBright,f.color.grey=f.color.blackBright,f.bgColor.bgGrey=f.bgColor.bgBlackBright;for(const[d,h]of Object.entries(f)){for(const[p,m]of Object.entries(h))f[p]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},h[p]=f[p],u.set(m[0],m[1]);Object.defineProperty(f,d,{value:h,enumerable:!1})}return Object.defineProperty(f,"codes",{value:u,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",o(f.color,"ansi",()=>c(e,"ansi16",i,!1)),o(f.color,"ansi256",()=>c(r,"ansi256",i,!1)),o(f.color,"ansi16m",()=>c(n,"rgb",s,!1)),o(f.bgColor,"ansi",()=>c(e,"ansi16",i,!0)),o(f.bgColor,"ansi256",()=>c(r,"ansi256",i,!0)),o(f.bgColor,"ansi16m",()=>c(n,"rgb",s,!0)),f}Object.defineProperty(t,"exports",{enumerable:!0,get:l})})(p9);var awe=p9.exports,cwe={stdout:!1,stderr:!1};const lwe=(t,e,r)=>{let n=t.indexOf(e);if(n===-1)return t;const i=e.length;let s=0,o="";do o+=t.substr(s,n-s)+e+r,s=n+i,n=t.indexOf(e,s);while(n!==-1);return o+=t.substr(s),o},uwe=(t,e,r,n)=>{let i=0,s="";do{const o=t[n-1]==="\r";s+=t.substr(i,(o?n-1:n)-i)+e+(o?`\r + `])),t,e)),Dxe=t=>{if(t==="@media ")throw mP(t,"Query is empty");try{bxe(t)}catch(e){throw mP(t,e.message)}},Lxe=["vars"],jxe=["content"],iz="__DECLARATION",Bxe={animationIterationCount:!0,borderImage:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,initialLetter:!0,lineClamp:!0,lineHeight:!0,maxLines:!0,opacity:!0,order:!0,orphans:!0,scale:!0,tabSize:!0,WebkitLineClamp:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,maskBorder:!0,maskBorderOutset:!0,maskBorderSlice:!0,maskBorderWidth:!0,shapeImageThreshold:!0,stopOpacity:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function Fxe(t){return t.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function Uxe(t,e,r,n){var i=t.slice(0,e),s=t.slice(r);return"".concat(i).concat(n).concat(s)}var zxe=" ",Hu=[...Mxe,"@layer","@media","@supports","@container","selectors"];class qxe{constructor(e,r){this.rules=[],this.conditionalRulesets=[new sg],this.fontFaceRules=[],this.keyframesRules=[],this.localClassNamesMap=new Map(e.map(n=>[n,n])),this.localClassNamesSearch=new exe(e),this.layers=new Map,this.composedClassLists=r.map(n=>{var{identifier:i,classList:s}=n;return{identifier:i,regex:RegExp("(".concat(s,")"),"g")}}).reverse()}processCssObj(e){if(e.type==="fontFace"){this.fontFaceRules.push(e.rule);return}if(e.type==="keyframes"){e.rule=Object.fromEntries(Object.entries(e.rule).map(s=>{var[o,a]=s;return[o,this.transformProperties(a)]})),this.keyframesRules.push(e);return}if(this.currConditionalRuleset=new sg,e.type==="layer"){var r="@layer ".concat(e.name);this.addLayer([r])}else{var n=Wu(e.rule,Hu);this.addRule({selector:e.selector,rule:n}),this.transformLayer(e,e.rule["@layer"]),this.transformMedia(e,e.rule["@media"]),this.transformSupports(e,e.rule["@supports"]),this.transformContainer(e,e.rule["@container"]),this.transformSimplePseudos(e,e.rule),this.transformSelectors(e,e.rule)}var i=this.conditionalRulesets[this.conditionalRulesets.length-1];i.mergeIfCompatible(this.currConditionalRuleset)||this.conditionalRulesets.push(this.currConditionalRuleset)}addConditionalRule(e,r){var n=this.transformVars(this.transformProperties(e.rule)),i=this.transformSelector(e.selector);if(!this.currConditionalRuleset)throw new Error("Couldn't add conditional rule");var s=r[r.length-1],o=r.slice(0,r.length-1);this.currConditionalRuleset.addRule({selector:i,rule:n},s,o)}addRule(e){var r=this.transformVars(this.transformProperties(e.rule)),n=this.transformSelector(e.selector);this.rules.push({selector:n,rule:r})}addLayer(e){var r=e.join(" - ");this.layers.set(r,e)}transformProperties(e){return this.transformContent(this.pixelifyProperties(e))}pixelifyProperties(e){return Oh(e,(r,n)=>{typeof r=="number"&&r!==0&&!Bxe[n]&&(e[n]="".concat(r,"px"))}),e}transformVars(e){var{vars:r}=e,n=dP(e,Lxe);return r?x0(x0({},Txe(r,(i,s)=>V2e(s))),n):n}transformContent(e){var{content:r}=e,n=dP(e,jxe);if(typeof r>"u")return n;var i=Array.isArray(r)?r:[r];return x0({content:i.map(s=>s&&(s.includes('"')||s.includes("'")||/^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(s))?s:'"'.concat(s,'"'))},n)}transformClassname(e){return".".concat(e9(e,{isIdentifier:!0}))}transformSelector(e){var r=e,n=function(h){r=r.replace(s,()=>(ez(h),h))};for(var{identifier:i,regex:s}of this.composedClassLists)n(i);if(this.localClassNamesMap.has(r))return this.transformClassname(r);for(var o=this.localClassNamesSearch.search(r),a=r.length,c=o.length-1;c>=0;c--){var[l,[u]]=o[c],f=l-u.length+1;f>=a||(a=f,r[f-1]!=="."&&(r=Uxe(r,f,l+1,this.transformClassname(u))))}return r}transformSelectors(e,r,n){Oh(r.selectors,(i,s)=>{if(e.type!=="local")throw new Error("Selectors are not allowed within ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));var o=this.transformSelector(s.replace(RegExp("&","g"),e.selector));$xe(o,e.selector);var a={selector:o,rule:Wu(i,Hu)};n?this.addConditionalRule(a,n):this.addRule(a);var c={type:"selector",selector:o,rule:i};this.transformLayer(c,i["@layer"],n),this.transformSupports(c,i["@supports"],n),this.transformMedia(c,i["@media"],n)})}transformMedia(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(l=>"@media ".concat(l)));for(var[s,o]of Object.entries(r)){var a="@media ".concat(s);Dxe(a);var c=[...n,a];this.addConditionalRule({selector:e.selector,rule:Wu(o,Hu)},c),e.type==="local"&&(this.transformSimplePseudos(e,o,c),this.transformSelectors(e,o,c)),this.transformLayer(e,o["@layer"],c),this.transformSupports(e,o["@supports"],c),this.transformContainer(e,o["@container"],c)}}}transformContainer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@container ".concat(s))),Oh(r,(s,o)=>{var a="@container ".concat(o),c=[...n,a];this.addConditionalRule({selector:e.selector,rule:Wu(s,Hu)},c),e.type==="local"&&(this.transformSimplePseudos(e,s,c),this.transformSelectors(e,s,c)),this.transformLayer(e,s["@layer"],c),this.transformSupports(e,s["@supports"],c),this.transformMedia(e,s["@media"],c)})}}transformLayer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@layer ".concat(s))),Oh(r,(s,o)=>{var a=[...n,"@layer ".concat(o)];this.addLayer(a),this.addConditionalRule({selector:e.selector,rule:Wu(s,Hu)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformMedia(e,s["@media"],a),this.transformSupports(e,s["@supports"],a),this.transformContainer(e,s["@container"],a)})}}transformSupports(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@supports ".concat(s))),Oh(r,(s,o)=>{var a=[...n,"@supports ".concat(o)];this.addConditionalRule({selector:e.selector,rule:Wu(s,Hu)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformLayer(e,s["@layer"],a),this.transformMedia(e,s["@media"],a),this.transformContainer(e,s["@container"],a)})}}transformSimplePseudos(e,r,n){for(var i of Object.keys(r))if(Nxe[i]){if(e.type!=="local")throw new Error("Simple pseudos are not valid in ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));n?this.addConditionalRule({selector:"".concat(e.selector).concat(i),rule:r[i]},n):this.addRule({conditions:n,selector:"".concat(e.selector).concat(i),rule:r[i]})}}toCss(){var e=[];for(var r of this.fontFaceRules)e.push(Tl({"@font-face":r}));for(var n of this.keyframesRules)e.push(Tl({["@keyframes ".concat(n.name)]:n.rule}));for(var i of this.layers.values()){var[s,...o]=i.reverse(),a={[s]:iz};for(var c of o)a={[c]:a};e.push(Tl(a))}for(var l of this.rules)e.push(Tl({[l.selector]:l.rule}));for(var u of this.conditionalRulesets)for(var f of u.renderToArray())e.push(Tl(f));return e.filter(Boolean)}}function Tl(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=[],n=function(o){var a=t[o];if(a&&Array.isArray(a))r.push(...a.map(l=>Tl({[o]:l},e)));else if(a&&typeof a=="object"){var c=Object.keys(a).length===0;c||r.push("".concat(e).concat(o,` { +`).concat(Tl(a,e+zxe),` +`).concat(e,"}"))}else a===iz?r.push("".concat(e).concat(o,";")):r.push("".concat(e).concat(o.startsWith("--")?o:Fxe(o),": ").concat(a,";"))};for(var i of Object.keys(t))n(i);return r.join(` +`)}function Wxe(t){var{localClassNames:e,cssObjs:r,composedClassLists:n}=t,i=new qxe(e,n);for(var s of r)i.processCssObj(s);return i.toCss()}function sz(t){for(var e=0,r,n=0,i=t.length;i>=4;++n,i-=4)r=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var r9={exports:{}},Ew,vP;function Hxe(){return vP||(vP=1,Ew={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),Ew}var Cw,yP;function oz(){if(yP)return Cw;yP=1;const t=Hxe(),e={};for(const i of Object.keys(t))e[t[i]]=i;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Cw=r;for(const i of Object.keys(r)){if(!("channels"in r[i]))throw new Error("missing channels property: "+i);if(!("labels"in r[i]))throw new Error("missing channel labels property: "+i);if(r[i].labels.length!==r[i].channels)throw new Error("channel and label counts mismatch: "+i);const{channels:s,labels:o}=r[i];delete r[i].channels,delete r[i].labels,Object.defineProperty(r[i],"channels",{value:s}),Object.defineProperty(r[i],"labels",{value:o})}r.rgb.hsl=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(s,o,a),l=Math.max(s,o,a),u=l-c;let f,d;l===c?f=0:s===l?f=(o-a)/u:o===l?f=2+(a-s)/u:a===l&&(f=4+(s-o)/u),f=Math.min(f*60,360),f<0&&(f+=360);const h=(c+l)/2;return l===c?d=0:h<=.5?d=u/(l+c):d=u/(2-l-c),[f,d*100,h*100]},r.rgb.hsv=function(i){let s,o,a,c,l;const u=i[0]/255,f=i[1]/255,d=i[2]/255,h=Math.max(u,f,d),p=h-Math.min(u,f,d),m=function(v){return(h-v)/6/p+1/2};return p===0?(c=0,l=0):(l=p/h,s=m(u),o=m(f),a=m(d),u===h?c=a-o:f===h?c=1/3+s-a:d===h&&(c=2/3+o-s),c<0?c+=1:c>1&&(c-=1)),[c*360,l*100,h*100]},r.rgb.hwb=function(i){const s=i[0],o=i[1];let a=i[2];const c=r.rgb.hsl(i)[0],l=1/255*Math.min(s,Math.min(o,a));return a=1-1/255*Math.max(s,Math.max(o,a)),[c,l*100,a*100]},r.rgb.cmyk=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(1-s,1-o,1-a),l=(1-s-c)/(1-c)||0,u=(1-o-c)/(1-c)||0,f=(1-a-c)/(1-c)||0;return[l*100,u*100,f*100,c*100]};function n(i,s){return(i[0]-s[0])**2+(i[1]-s[1])**2+(i[2]-s[2])**2}return r.rgb.keyword=function(i){const s=e[i];if(s)return s;let o=1/0,a;for(const c of Object.keys(t)){const l=t[c],u=n(i,l);u.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;const c=s*.4124+o*.3576+a*.1805,l=s*.2126+o*.7152+a*.0722,u=s*.0193+o*.1192+a*.9505;return[c*100,l*100,u*100]},r.rgb.lab=function(i){const s=r.rgb.xyz(i);let o=s[0],a=s[1],c=s[2];o/=95.047,a/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const l=116*a-16,u=500*(o-a),f=200*(a-c);return[l,u,f]},r.hsl.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;let c,l,u;if(o===0)return u=a*255,[u,u,u];a<.5?c=a*(1+o):c=a+o-a*o;const f=2*a-c,d=[0,0,0];for(let h=0;h<3;h++)l=s+1/3*-(h-1),l<0&&l++,l>1&&l--,6*l<1?u=f+(c-f)*6*l:2*l<1?u=c:3*l<2?u=f+(c-f)*(2/3-l)*6:u=f,d[h]=u*255;return d},r.hsl.hsv=function(i){const s=i[0];let o=i[1]/100,a=i[2]/100,c=o;const l=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,c*=l<=1?l:2-l;const u=(a+o)/2,f=a===0?2*c/(l+c):2*o/(a+o);return[s,f*100,u*100]},r.hsv.rgb=function(i){const s=i[0]/60,o=i[1]/100;let a=i[2]/100;const c=Math.floor(s)%6,l=s-Math.floor(s),u=255*a*(1-o),f=255*a*(1-o*l),d=255*a*(1-o*(1-l));switch(a*=255,c){case 0:return[a,d,u];case 1:return[f,a,u];case 2:return[u,a,d];case 3:return[u,f,a];case 4:return[d,u,a];case 5:return[a,u,f]}},r.hsv.hsl=function(i){const s=i[0],o=i[1]/100,a=i[2]/100,c=Math.max(a,.01);let l,u;u=(2-o)*a;const f=(2-o)*c;return l=o*c,l/=f<=1?f:2-f,l=l||0,u/=2,[s,l*100,u*100]},r.hwb.rgb=function(i){const s=i[0]/360;let o=i[1]/100,a=i[2]/100;const c=o+a;let l;c>1&&(o/=c,a/=c);const u=Math.floor(6*s),f=1-a;l=6*s-u,u&1&&(l=1-l);const d=o+l*(f-o);let h,p,m;switch(u){default:case 6:case 0:h=f,p=d,m=o;break;case 1:h=d,p=f,m=o;break;case 2:h=o,p=f,m=d;break;case 3:h=o,p=d,m=f;break;case 4:h=d,p=o,m=f;break;case 5:h=f,p=o,m=d;break}return[h*255,p*255,m*255]},r.cmyk.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100,c=i[3]/100,l=1-Math.min(1,s*(1-c)+c),u=1-Math.min(1,o*(1-c)+c),f=1-Math.min(1,a*(1-c)+c);return[l*255,u*255,f*255]},r.xyz.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100;let c,l,u;return c=s*3.2406+o*-1.5372+a*-.4986,l=s*-.9689+o*1.8758+a*.0415,u=s*.0557+o*-.204+a*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,c=Math.min(Math.max(0,c),1),l=Math.min(Math.max(0,l),1),u=Math.min(Math.max(0,u),1),[c*255,l*255,u*255]},r.xyz.lab=function(i){let s=i[0],o=i[1],a=i[2];s/=95.047,o/=100,a/=108.883,s=s>.008856?s**(1/3):7.787*s+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const c=116*o-16,l=500*(s-o),u=200*(o-a);return[c,l,u]},r.lab.xyz=function(i){const s=i[0],o=i[1],a=i[2];let c,l,u;l=(s+16)/116,c=o/500+l,u=l-a/200;const f=l**3,d=c**3,h=u**3;return l=f>.008856?f:(l-16/116)/7.787,c=d>.008856?d:(c-16/116)/7.787,u=h>.008856?h:(u-16/116)/7.787,c*=95.047,l*=100,u*=108.883,[c,l,u]},r.lab.lch=function(i){const s=i[0],o=i[1],a=i[2];let c;c=Math.atan2(a,o)*360/2/Math.PI,c<0&&(c+=360);const u=Math.sqrt(o*o+a*a);return[s,u,c]},r.lch.lab=function(i){const s=i[0],o=i[1],c=i[2]/360*2*Math.PI,l=o*Math.cos(c),u=o*Math.sin(c);return[s,l,u]},r.rgb.ansi16=function(i,s=null){const[o,a,c]=i;let l=s===null?r.rgb.hsv(i)[2]:s;if(l=Math.round(l/50),l===0)return 30;let u=30+(Math.round(c/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return l===2&&(u+=60),u},r.hsv.ansi16=function(i){return r.rgb.ansi16(r.hsv.rgb(i),i[2])},r.rgb.ansi256=function(i){const s=i[0],o=i[1],a=i[2];return s===o&&o===a?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)},r.ansi16.rgb=function(i){let s=i%10;if(s===0||s===7)return i>50&&(s+=3.5),s=s/10.5*255,[s,s,s];const o=(~~(i>50)+1)*.5,a=(s&1)*o*255,c=(s>>1&1)*o*255,l=(s>>2&1)*o*255;return[a,c,l]},r.ansi256.rgb=function(i){if(i>=232){const l=(i-232)*10+8;return[l,l,l]}i-=16;let s;const o=Math.floor(i/36)/5*255,a=Math.floor((s=i%36)/6)/5*255,c=s%6/5*255;return[o,a,c]},r.rgb.hex=function(i){const o=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},r.hex.rgb=function(i){const s=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!s)return[0,0,0];let o=s[0];s[0].length===3&&(o=o.split("").map(f=>f+f).join(""));const a=parseInt(o,16),c=a>>16&255,l=a>>8&255,u=a&255;return[c,l,u]},r.rgb.hcg=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.max(Math.max(s,o),a),l=Math.min(Math.min(s,o),a),u=c-l;let f,d;return u<1?f=l/(1-u):f=0,u<=0?d=0:c===s?d=(o-a)/u%6:c===o?d=2+(a-s)/u:d=4+(s-o)/u,d/=6,d%=1,[d*360,u*100,f*100]},r.hsl.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=o<.5?2*s*o:2*s*(1-o);let c=0;return a<1&&(c=(o-.5*a)/(1-a)),[i[0],a*100,c*100]},r.hsv.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=s*o;let c=0;return a<1&&(c=(o-a)/(1-a)),[i[0],a*100,c*100]},r.hcg.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;if(o===0)return[a*255,a*255,a*255];const c=[0,0,0],l=s%1*6,u=l%1,f=1-u;let d=0;switch(Math.floor(l)){case 0:c[0]=1,c[1]=u,c[2]=0;break;case 1:c[0]=f,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=u;break;case 3:c[0]=0,c[1]=f,c[2]=1;break;case 4:c[0]=u,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=f}return d=(1-o)*a,[(o*c[0]+d)*255,(o*c[1]+d)*255,(o*c[2]+d)*255]},r.hcg.hsv=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);let c=0;return a>0&&(c=s/a),[i[0],c*100,a*100]},r.hcg.hsl=function(i){const s=i[1]/100,a=i[2]/100*(1-s)+.5*s;let c=0;return a>0&&a<.5?c=s/(2*a):a>=.5&&a<1&&(c=s/(2*(1-a))),[i[0],c*100,a*100]},r.hcg.hwb=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);return[i[0],(a-s)*100,(1-a)*100]},r.hwb.hcg=function(i){const s=i[1]/100,a=1-i[2]/100,c=a-s;let l=0;return c<1&&(l=(a-c)/(1-c)),[i[0],c*100,l*100]},r.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},r.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},r.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},r.gray.hsl=function(i){return[0,0,i[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(i){return[0,100,i[0]]},r.gray.cmyk=function(i){return[0,0,0,i[0]]},r.gray.lab=function(i){return[i[0],0,0]},r.gray.hex=function(i){const s=Math.round(i[0]/100*255)&255,a=((s<<16)+(s<<8)+s).toString(16).toUpperCase();return"000000".substring(a.length)+a},r.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]},Cw}var Sw,gP;function Vxe(){if(gP)return Sw;gP=1;const t=oz();function e(){const s={},o=Object.keys(t);for(let a=o.length,c=0;c1&&(c=l),o(c))};return"conversion"in o&&(a.conversion=o.conversion),a}function s(o){const a=function(...c){const l=c[0];if(l==null)return l;l.length>1&&(c=l);const u=o(c);if(typeof u=="object")for(let f=u.length,d=0;d{r[o]={},Object.defineProperty(r[o],"channels",{value:t[o].channels}),Object.defineProperty(r[o],"labels",{value:t[o].labels});const a=e(o);Object.keys(a).forEach(l=>{const u=a[l];r[o][l]=s(u),r[o][l].raw=i(u)})}),kw=r,kw}r9.exports;(function(t){const e=(u,f)=>(...d)=>`\x1B[${u(...d)+f}m`,r=(u,f)=>(...d)=>{const h=u(...d);return`\x1B[${38+f};5;${h}m`},n=(u,f)=>(...d)=>{const h=u(...d);return`\x1B[${38+f};2;${h[0]};${h[1]};${h[2]}m`},i=u=>u,s=(u,f,d)=>[u,f,d],o=(u,f,d)=>{Object.defineProperty(u,f,{get:()=>{const h=d();return Object.defineProperty(u,f,{value:h,enumerable:!0,configurable:!0}),h},enumerable:!0,configurable:!0})};let a;const c=(u,f,d,h)=>{a===void 0&&(a=Gxe());const p=h?10:0,m={};for(const[v,y]of Object.entries(a)){const b=v==="ansi16"?"ansi":v;v===f?m[b]=u(d,p):typeof y=="object"&&(m[b]=u(y[f],p))}return m};function l(){const u=new Map,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};f.color.gray=f.color.blackBright,f.bgColor.bgGray=f.bgColor.bgBlackBright,f.color.grey=f.color.blackBright,f.bgColor.bgGrey=f.bgColor.bgBlackBright;for(const[d,h]of Object.entries(f)){for(const[p,m]of Object.entries(h))f[p]={open:`\x1B[${m[0]}m`,close:`\x1B[${m[1]}m`},h[p]=f[p],u.set(m[0],m[1]);Object.defineProperty(f,d,{value:h,enumerable:!1})}return Object.defineProperty(f,"codes",{value:u,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",o(f.color,"ansi",()=>c(e,"ansi16",i,!1)),o(f.color,"ansi256",()=>c(r,"ansi256",i,!1)),o(f.color,"ansi16m",()=>c(n,"rgb",s,!1)),o(f.bgColor,"ansi",()=>c(e,"ansi16",i,!0)),o(f.bgColor,"ansi256",()=>c(r,"ansi256",i,!0)),o(f.bgColor,"ansi16m",()=>c(n,"rgb",s,!0)),f}Object.defineProperty(t,"exports",{enumerable:!0,get:l})})(r9);var Kxe=r9.exports,Qxe={stdout:!1,stderr:!1};const Yxe=(t,e,r)=>{let n=t.indexOf(e);if(n===-1)return t;const i=e.length;let s=0,o="";do o+=t.substr(s,n-s)+e+r,s=n+i,n=t.indexOf(e,s);while(n!==-1);return o+=t.substr(s),o},Jxe=(t,e,r,n)=>{let i=0,s="";do{const o=t[n-1]==="\r";s+=t.substr(i,(o?n-1:n)-i)+e+(o?`\r `:` `)+r,i=n+1,n=t.indexOf(` -`,i)}while(n!==-1);return s+=t.substr(i),s};var fwe={stringReplaceAll:lwe,stringEncaseCRLFWithFirstIndex:uwe},Bw,LP;function dwe(){if(LP)return Bw;LP=1;const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,e=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,n=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,i=new Map([["n",` -`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function s(l){const u=l[0]==="u",f=l[1]==="{";return u&&!f&&l.length===5||l[0]==="x"&&l.length===3?String.fromCharCode(parseInt(l.slice(1),16)):u&&f?String.fromCodePoint(parseInt(l.slice(2,-1),16)):i.get(l)||l}function o(l,u){const f=[],d=u.trim().split(/\s*,\s*/g);let h;for(const p of d){const m=Number(p);if(!Number.isNaN(m))f.push(m);else if(h=p.match(r))f.push(h[2].replace(n,(v,y,b)=>y?s(y):b));else throw new Error(`Invalid Chalk template style argument: ${p} (in style '${l}')`)}return f}function a(l){e.lastIndex=0;const u=[];let f;for(;(f=e.exec(l))!==null;){const d=f[1];if(f[2]){const h=o(d,f[2]);u.push([d].concat(h))}else u.push([d])}return u}function c(l,u){const f={};for(const h of u)for(const p of h.styles)f[p[0]]=h.inverse?null:p.slice(1);let d=l;for(const[h,p]of Object.entries(f))if(Array.isArray(p)){if(!(h in d))throw new Error(`Unknown Chalk style: ${h}`);d=p.length>0?d[h](...p):d[h]}return d}return Bw=(l,u)=>{const f=[],d=[];let h=[];if(u.replace(t,(p,m,v,y,b,E)=>{if(m)h.push(s(m));else if(y){const S=h.join("");h=[],d.push(f.length===0?S:c(l,f)(S)),f.push({inverse:v,styles:a(y)})}else if(b){if(f.length===0)throw new Error("Found extraneous } in Chalk template literal");d.push(c(l,f)(h.join(""))),h=[],f.pop()}else h.push(E)}),d.push(h.join("")),f.length>0){const p=`Chalk template literal is missing ${f.length} closing bracket${f.length===1?"":"s"} (\`}\`)`;throw new Error(p)}return d.join("")},Bw}const j1=awe,{stdout:Q3,stderr:Y3}=cwe,{stringReplaceAll:hwe,stringEncaseCRLFWithFirstIndex:pwe}=fwe,{isArray:gg}=Array,wz=["ansi","ansi","ansi256","ansi16m"],ah=Object.create(null),mwe=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=Q3?Q3.level:0;t.level=e.level===void 0?r:e.level};class vwe{constructor(e){return Ez(e)}}const Ez=t=>{const e={};return mwe(e,t),e.template=(...r)=>Sz(e.template,...r),Object.setPrototypeOf(e,k2.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=vwe,e.template};function k2(t){return Ez(t)}for(const[t,e]of Object.entries(j1))ah[t]={get(){const r=A2(this,m9(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};ah.visible={get(){const t=A2(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};const Cz=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of Cz)ah[t]={get(){const{level:e}=this;return function(...r){const n=m9(j1.color[wz[e]][t](...r),j1.color.close,this._styler);return A2(this,n,this._isEmpty)}}};for(const t of Cz){const e="bg"+t[0].toUpperCase()+t.slice(1);ah[e]={get(){const{level:r}=this;return function(...n){const i=m9(j1.bgColor[wz[r]][t](...n),j1.bgColor.close,this._styler);return A2(this,i,this._isEmpty)}}}}const ywe=Object.defineProperties(()=>{},{...ah,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),m9=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},A2=(t,e,r)=>{const n=(...i)=>gg(i[0])&&gg(i[0].raw)?jP(n,Sz(n,...i)):jP(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,ywe),n._generator=t,n._styler=e,n._isEmpty=r,n},jP=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;const{openAll:n,closeAll:i}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=hwe(e,r.close,r.open),r=r.parent;const s=e.indexOf(` -`);return s!==-1&&(e=pwe(e,i,n,s)),n+e+i};let Fw;const Sz=(t,...e)=>{const[r]=e;if(!gg(r)||!gg(r.raw))return e.join(" ");const n=e.slice(1),i=[r.raw[0]];for(let s=1;s{Uw.push(t)},registerClassName:t=>{FP.add(t)},registerComposition:t=>{UP.push(t)},markCompositionUsed:()=>{},onEndFileScope:t=>{var e=nwe({localClassNames:Array.from(FP),composedClassLists:UP,cssObjs:Uw}).join(` -`);ixe({fileScope:t,css:e}),Uw=[]},getIdentOption:()=>"short"};J2e($we);function bg(t,e){return bg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},bg(t,e)}function Mwe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bg(t,e)}function J3(){J3=function(i,s){return new r(i,void 0,s)};var t=RegExp.prototype,e=new WeakMap;function r(i,s,o){var a=new RegExp(i,s);return e.set(a,o||e.get(i)),bg(a,r.prototype)}function n(i,s){var o=e.get(s);return Object.keys(o).reduce(function(a,c){var l=o[c];if(typeof l=="number")a[c]=i[l];else{for(var u=0;i[l[u]]===void 0&&u+1]+)>/g,function(c,l){var u=o[l];return"$"+(Array.isArray(u)?u.join("$"):u)}))}if(typeof s=="function"){var a=this;return t[Symbol.replace].call(this,i,function(){var c=arguments;return typeof c[c.length-1]!="object"&&(c=[].slice.call(c)).push(n(c,a)),s.apply(this,c)})}return t[Symbol.replace].call(this,i,s)},J3.apply(this,arguments)}function Nwe(t){var{debugId:e,debugFileName:r}=t,n=e?[e.replace(/\s/g,"_")]:[];if(r){var{filePath:i}=xo(),s=i.match(J3(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/,{dir:1,file:2}));if(s&&s.groups){var{dir:o,file:a}=s.groups;n.unshift(a&&a!=="index"?a:o)}}return n.join("_")}function zP(t){return t.match(/^[0-9]/)?"_".concat(t):t}function y9(t){var e=rxe(),{debugId:r,debugFileName:n=!0}=T0(T0({},typeof t=="string"?{debugId:t}:null),typeof t=="object"?t:null),i=nxe().toString(36),{filePath:s,packageName:o}=xo(),a=bz(o?"".concat(o).concat(s):s),c="".concat(a).concat(i);if(e==="debug"){var l=Nwe({debugId:r,debugFileName:n});return l&&(c="".concat(l,"__").concat(c)),zP(c)}if(typeof e=="function"){if(c=e({hash:c,debugId:r,filePath:s,packageName:o}),!c.match(/^[A-Z_][0-9A-Z_-]+$/i))throw new Error('Identifier function returned invalid indentifier: "'.concat(c,'"'));return c}return zP(c)}function Dwe(t,e){var r=y9(e);hz(r,xo());var n=[],i=[];for(var s of t)typeof s=="string"?n.push(s):i.push(s);var o=r;if(n.length>0&&(o="".concat(r," ").concat(Wxe(n)),Z2e({identifier:r,classList:o},xo()),i.length>0&&pz(r)),i.length>0){var a=Rwe.all(i,{arrayMerge:(c,l)=>l});S2({type:"local",selector:r,rule:a},xo())}return o}function qn(t,e){if(Array.isArray(t))return Dwe(t,e);var r=y9(e);return hz(r,xo()),S2({type:"local",selector:r,rule:t},xo()),r}function hs(t,e){S2({type:"global",selector:t,rule:e},xo())}function Az(t,e){var r=d9(y9(e),{isIdentifier:!0});return S2({type:"keyframes",name:r,rule:t},xo()),r}const _z=JU.useSyncExternalStore,qP=x.createContext(void 0),Pz=x.createContext(!1);function Iz(t,e){return t||(e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=qP),window.ReactQueryClientContext):qP)}const g9=({context:t}={})=>{const e=x.useContext(Iz(t,x.useContext(Pz)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},b9=({client:t,children:e,context:r,contextSharing:n=!1})=>{x.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);const i=Iz(r,n);return x.createElement(Pz.Provider,{value:!r&&n},x.createElement(i.Provider,{value:t},e))},Tz=x.createContext(!1),Lwe=()=>x.useContext(Tz);Tz.Provider;function jwe(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const Bwe=x.createContext(jwe()),Fwe=()=>x.useContext(Bwe);function Oz(t,e){return typeof t=="function"?t(...e):!!t}const Uwe=(t,e)=>{(t.suspense||t.useErrorBoundary)&&(e.isReset()||(t.retryOnMount=!1))},zwe=t=>{x.useEffect(()=>{t.clearReset()},[t])},qwe=({result:t,errorResetBoundary:e,useErrorBoundary:r,query:n})=>t.isError&&!e.isReset()&&!t.isFetching&&Oz(r,[t.error,n]),Wwe=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},Hwe=(t,e)=>t.isLoading&&t.isFetching&&!e,Vwe=(t,e,r)=>(t==null?void 0:t.suspense)&&Hwe(e,r),Gwe=(t,e,r)=>e.fetchOptimistic(t).then(({data:n})=>{t.onSuccess==null||t.onSuccess(n),t.onSettled==null||t.onSettled(n,null)}).catch(n=>{r.clearReset(),t.onError==null||t.onError(n),t.onSettled==null||t.onSettled(void 0,n)});function Rz(t,e){const r=g9({context:t.context}),n=Lwe(),i=Fwe(),s=r.defaultQueryOptions(t);s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=gr.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=gr.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=gr.batchCalls(s.onSettled)),Wwe(s),Uwe(s,i),zwe(i);const[o]=x.useState(()=>new e(r,s)),a=o.getOptimisticResult(s);if(_z(x.useCallback(c=>{const l=n?()=>{}:o.subscribe(gr.batchCalls(c));return o.updateResult(),l},[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),x.useEffect(()=>{o.setOptions(s,{listeners:!1})},[s,o]),Vwe(s,a,n))throw Gwe(s,o,i);if(qwe({result:a,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:o.getCurrentQuery()}))throw a.error;return s.notifyOnChangeProps?a:o.trackResult(a)}function Wn(t,e,r){const n=$f(t,e,r);return Rz(n,cz)}function _2(t,e,r){const n=Nbe(t,e,r),i=g9({context:n.context}),[s]=x.useState(()=>new Jbe(i,n));x.useEffect(()=>{s.setOptions(n)},[s,n]);const o=_z(x.useCallback(c=>s.subscribe(gr.batchCalls(c)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=x.useCallback((c,l)=>{s.mutate(c,l).catch(Kwe)},[s]);if(o.error&&Oz(s.options.useErrorBoundary,[o.error]))throw o.error;return{...o,mutate:a,mutateAsync:o.mutate}}function Kwe(){}function Qwe(t,e,r){const n=$f(t,e,r);return Rz(n,Ybe)}function Ywe(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}var $z=Ywe;function Jwe(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r-1&&t%1==0&&t-1&&t%1==0&&t<=e6e}var zz=t6e,r6e=P2,n6e=zz,i6e=I2,s6e="[object Arguments]",o6e="[object Array]",a6e="[object Boolean]",c6e="[object Date]",l6e="[object Error]",u6e="[object Function]",f6e="[object Map]",d6e="[object Number]",h6e="[object Object]",p6e="[object RegExp]",m6e="[object Set]",v6e="[object String]",y6e="[object WeakMap]",g6e="[object ArrayBuffer]",b6e="[object DataView]",x6e="[object Float32Array]",w6e="[object Float64Array]",E6e="[object Int8Array]",C6e="[object Int16Array]",S6e="[object Int32Array]",k6e="[object Uint8Array]",A6e="[object Uint8ClampedArray]",_6e="[object Uint16Array]",P6e="[object Uint32Array]",er={};er[x6e]=er[w6e]=er[E6e]=er[C6e]=er[S6e]=er[k6e]=er[A6e]=er[_6e]=er[P6e]=!0;er[s6e]=er[o6e]=er[g6e]=er[a6e]=er[b6e]=er[c6e]=er[l6e]=er[u6e]=er[f6e]=er[d6e]=er[h6e]=er[p6e]=er[m6e]=er[v6e]=er[y6e]=!1;function I6e(t){return i6e(t)&&n6e(t.length)&&!!er[r6e(t)]}var T6e=I6e;function O6e(t){return function(e){return t(e)}}var R6e=O6e,wg={exports:{}};wg.exports;(function(t,e){var r=Nz,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===n,o=s&&r.process,a=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();t.exports=a})(wg,wg.exports);var $6e=wg.exports,M6e=T6e,N6e=R6e,KP=$6e,QP=KP&&KP.isTypedArray,D6e=QP?N6e(QP):M6e,L6e=D6e,j6e=v5e,B6e=V5e,F6e=Fz,U6e=Y5e,z6e=Uz,q6e=L6e,W6e=Object.prototype,H6e=W6e.hasOwnProperty;function V6e(t,e){var r=F6e(t),n=!r&&B6e(t),i=!r&&!n&&U6e(t),s=!r&&!n&&!i&&q6e(t),o=r||n||i||s,a=o?j6e(t.length,String):[],c=a.length;for(var l in t)(e||H6e.call(t,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||z6e(l,c)))&&a.push(l);return a}var G6e=V6e,K6e=Object.prototype;function Q6e(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||K6e;return t===r}var Y6e=Q6e;function J6e(t,e){return function(r){return t(e(r))}}var X6e=J6e,Z6e=X6e,e3e=Z6e(Object.keys,Object),t3e=e3e,r3e=Y6e,n3e=t3e,i3e=Object.prototype,s3e=i3e.hasOwnProperty;function o3e(t){if(!r3e(t))return n3e(t);var e=[];for(var r in Object(t))s3e.call(t,r)&&r!="constructor"&&e.push(r);return e}var a3e=o3e;function c3e(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var x9=c3e,l3e=P2,u3e=x9,f3e="[object AsyncFunction]",d3e="[object Function]",h3e="[object GeneratorFunction]",p3e="[object Proxy]";function m3e(t){if(!u3e(t))return!1;var e=l3e(t);return e==d3e||e==h3e||e==f3e||e==p3e}var v3e=m3e,y3e=v3e,g3e=zz;function b3e(t){return t!=null&&g3e(t.length)&&!y3e(t)}var qz=b3e,x3e=G6e,w3e=a3e,E3e=qz;function C3e(t){return E3e(t)?x3e(t):w3e(t)}var S3e=C3e,k3e=p5e,A3e=S3e;function _3e(t){return t==null?[]:k3e(t,A3e(t))}var P3e=_3e,I3e=$z,T3e=Mz,O3e=P3e;function R3e(t,e){var r=O3e(t);return T3e(r,I3e(e,0,r.length))}var $3e=R3e;function M3e(t,e){return t===e||t!==t&&e!==e}var N3e=M3e,D3e=N3e,L3e=qz,j3e=Uz,B3e=x9;function F3e(t,e,r){if(!B3e(r))return!1;var n=typeof e;return(n=="number"?L3e(r)&&j3e(e,r.length):n=="string"&&e in r)?D3e(r[e],t):!1}var U3e=F3e,z3e=/\s/;function q3e(t){for(var e=t.length;e--&&z3e.test(t.charAt(e)););return e}var W3e=q3e,H3e=W3e,V3e=/^\s+/;function G3e(t){return t&&t.slice(0,H3e(t)+1).replace(V3e,"")}var K3e=G3e,Q3e=P2,Y3e=I2,J3e="[object Symbol]";function X3e(t){return typeof t=="symbol"||Y3e(t)&&Q3e(t)==J3e}var Z3e=X3e,e8e=K3e,YP=x9,t8e=Z3e,JP=NaN,r8e=/^[-+]0x[0-9a-f]+$/i,n8e=/^0b[01]+$/i,i8e=/^0o[0-7]+$/i,s8e=parseInt;function o8e(t){if(typeof t=="number")return t;if(t8e(t))return JP;if(YP(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=YP(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=e8e(t);var r=n8e.test(t);return r||i8e.test(t)?s8e(t.slice(2),r?2:8):r8e.test(t)?JP:+t}var a8e=o8e,c8e=a8e,XP=1/0,l8e=17976931348623157e292;function u8e(t){if(!t)return t===0?t:0;if(t=c8e(t),t===XP||t===-XP){var e=t<0?-1:1;return e*l8e}return t===t?t:0}var f8e=u8e,d8e=f8e;function h8e(t){var e=d8e(t),r=e%1;return e===e?r?e-r:e:0}var p8e=h8e,m8e=l5e,v8e=$3e,y8e=Fz,g8e=U3e,b8e=p8e;function x8e(t,e,r){(r?g8e(t,e,r):e===void 0)?e=1:e=b8e(e);var n=y8e(t)?m8e:v8e;return n(t,e)}var w8e=x8e;const E8e=Ti(w8e);function C8e(t){const{children:e,config:r,initialState:n,reconnectOnMount:i=!0}=t,{onMount:s}=Xge(r,{initialState:n,reconnectOnMount:i});r._internal.ssr||s();const o=x.useRef(!0);return x.useEffect(()=>{if(o.current&&r._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const Wz=x.createContext(void 0);function S8e(t){const{children:e,config:r}=t,n={value:r};return x.createElement(C8e,t,x.createElement(Wz.Provider,n,e))}const k8e="2.5.7",A8e=()=>`wagmi@${k8e}`;class _8e extends dl{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 A8e()}}class P8e extends _8e{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"})}}function Tt(t={}){const e=t.config??x.useContext(Wz);if(!e)throw new P8e;return e}const zw=t=>typeof t=="object"&&!Array.isArray(t);function I8e(t,e,r=e,n=Ea){const i=x.useRef([]),s=t9.useSyncExternalStoreWithSelector(t,e,r,o=>o,(o,a)=>{if(zw(o)&&zw(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(zw(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 Hn(t={}){const e=Tt(t);return I8e(r=>WU(e,{onChange:r}),()=>Z4(e))}function T8e(t){const e=Wn({...t,queryKeyHashFn:Xbe});return e.queryKey=t.queryKey,e}function T2(t={}){const e=Tt(t);return x.useSyncExternalStore(r=>Kge(e,{onChange:r}),()=>K_(e),()=>K_(e))}function O8e(t={}){const e=Tt(t);return x.useSyncExternalStore(r=>mbe(e,{onChange:r}),()=>Q_(e),()=>Q_(e))}function Hz(t={}){const e=Tt(t);return x.useSyncExternalStore(r=>HU(e,{onChange:r}),()=>D1(e),()=>D1(e))}function Vz(t={}){const{mutation:e}=t,r=Tt(t),n=r2e(r),{mutate:i,mutateAsync:s,...o}=_2({...e,...n});return{...o,connectors:Hz({config:r}).map(a=>a.connector),disconnect:i,disconnectAsync:s}}function R8e(t={}){const e=Tt(t);return t9.useSyncExternalStoreWithSelector(r=>Yge(e,{onChange:r}),()=>L3(e,t),()=>L3(e,t),r=>r,(r,n)=>(r==null?void 0:r.uid)===(n==null?void 0:n.uid))}function w9(t={}){const{mutation:e}=t,r=Tt(t),n=s2e(r),{mutate:i,mutateAsync:s,...o}=_2({...e,...n});return{...o,sendTransaction:i,sendTransactionAsync:s}}function E9(t={}){const{mutation:e}=t,r=Tt(t),n=o2e(r),{mutate:i,mutateAsync:s,...o}=_2({...e,...n});return{...o,chains:O8e({config:r}),switchChain:i,switchChainAsync:s}}function $8e(t={}){const{query:e={},...r}=t,n=Tt(r),i=g9(),{address:s,connector:o,status:a}=Hn(),c=T2(),{queryKey:l,...u}=n2e(n,{...t,chainId:t.chainId??c,connector:t.connector??o}),f=!!(a!=="disconnected"&&(e.enabled??!0));return x.useEffect(()=>{s?i.invalidateQueries({queryKey:l}):i.removeQueries({queryKey:l})},[s,i]),T8e({...e,...u,queryKey:l,enabled:f,staleTime:1/0})}function M8e(t={}){const{mutation:e}=t,r=Tt(t),n=a2e(r),{mutate:i,mutateAsync:s,...o}=_2({...e,...n});return{...o,writeContract:i,writeContractAsync:s}}var O2={},N8e=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],n=0;n"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=ZP[e.format]||ZP.default;window.clipboardData.setData(f,t)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,t);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){r&&console.error("unable to copy using execCommand: ",u),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(f){r&&console.error("unable to copy using clipboardData: ",f),r&&console.error("falling back to prompt"),n=j8e("message"in e?e.message:L8e),window.prompt(n,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var F8e=B8e;function X3(t){"@babel/helpers - typeof";return X3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X3(t)}Object.defineProperty(O2,"__esModule",{value:!0});O2.CopyToClipboard=void 0;var Mm=Gz(x),U8e=Gz(F8e),z8e=["text","onCopy","options","children"];function Gz(t){return t&&t.__esModule?t:{default:t}}function eI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function tI(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function W8e(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}function H8e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rI(t,e){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Eg(t){return Eg=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Eg(t)}function C9(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Qz=function(t){G8e(r,t);var e=K8e(r);function r(){var n;H8e(this,r);for(var i=arguments.length,s=new Array(i),o=0;oe in t?X8e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F1=(t,e)=>{for(var r in e||(e={}))Jz.call(e,r)&&nI(t,r,e[r]);if(Cg)for(var r of Cg(e))Xz.call(e,r)&&nI(t,r,e[r]);return t},S9=(t,e)=>{var r={};for(var n in t)Jz.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Cg)for(var n of Cg(t))e.indexOf(n)<0&&Xz.call(t,n)&&(r[n]=t[n]);return r};/** +`,i)}while(n!==-1);return s+=t.substr(i),s};var Xxe={stringReplaceAll:Yxe,stringEncaseCRLFWithFirstIndex:Jxe},Aw,xP;function Zxe(){if(xP)return Aw;xP=1;const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,e=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,n=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,i=new Map([["n",` +`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function s(l){const u=l[0]==="u",f=l[1]==="{";return u&&!f&&l.length===5||l[0]==="x"&&l.length===3?String.fromCharCode(parseInt(l.slice(1),16)):u&&f?String.fromCodePoint(parseInt(l.slice(2,-1),16)):i.get(l)||l}function o(l,u){const f=[],d=u.trim().split(/\s*,\s*/g);let h;for(const p of d){const m=Number(p);if(!Number.isNaN(m))f.push(m);else if(h=p.match(r))f.push(h[2].replace(n,(v,y,b)=>y?s(y):b));else throw new Error(`Invalid Chalk template style argument: ${p} (in style '${l}')`)}return f}function a(l){e.lastIndex=0;const u=[];let f;for(;(f=e.exec(l))!==null;){const d=f[1];if(f[2]){const h=o(d,f[2]);u.push([d].concat(h))}else u.push([d])}return u}function c(l,u){const f={};for(const h of u)for(const p of h.styles)f[p[0]]=h.inverse?null:p.slice(1);let d=l;for(const[h,p]of Object.entries(f))if(Array.isArray(p)){if(!(h in d))throw new Error(`Unknown Chalk style: ${h}`);d=p.length>0?d[h](...p):d[h]}return d}return Aw=(l,u)=>{const f=[],d=[];let h=[];if(u.replace(t,(p,m,v,y,b,E)=>{if(m)h.push(s(m));else if(y){const S=h.join("");h=[],d.push(f.length===0?S:c(l,f)(S)),f.push({inverse:v,styles:a(y)})}else if(b){if(f.length===0)throw new Error("Found extraneous } in Chalk template literal");d.push(c(l,f)(h.join(""))),h=[],f.pop()}else h.push(E)}),d.push(h.join("")),f.length>0){const p=`Chalk template literal is missing ${f.length} closing bracket${f.length===1?"":"s"} (\`}\`)`;throw new Error(p)}return d.join("")},Aw}const _1=Kxe,{stdout:N3,stderr:D3}=Qxe,{stringReplaceAll:ewe,stringEncaseCRLFWithFirstIndex:twe}=Xxe,{isArray:og}=Array,az=["ansi","ansi","ansi256","ansi16m"],Jd=Object.create(null),rwe=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=N3?N3.level:0;t.level=e.level===void 0?r:e.level};class nwe{constructor(e){return cz(e)}}const cz=t=>{const e={};return rwe(e,t),e.template=(...r)=>uz(e.template,...r),Object.setPrototypeOf(e,m2.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=nwe,e.template};function m2(t){return cz(t)}for(const[t,e]of Object.entries(_1))Jd[t]={get(){const r=v2(this,n9(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};Jd.visible={get(){const t=v2(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};const lz=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of lz)Jd[t]={get(){const{level:e}=this;return function(...r){const n=n9(_1.color[az[e]][t](...r),_1.color.close,this._styler);return v2(this,n,this._isEmpty)}}};for(const t of lz){const e="bg"+t[0].toUpperCase()+t.slice(1);Jd[e]={get(){const{level:r}=this;return function(...n){const i=n9(_1.bgColor[az[r]][t](...n),_1.bgColor.close,this._styler);return v2(this,i,this._isEmpty)}}}}const iwe=Object.defineProperties(()=>{},{...Jd,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),n9=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},v2=(t,e,r)=>{const n=(...i)=>og(i[0])&&og(i[0].raw)?wP(n,uz(n,...i)):wP(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,iwe),n._generator=t,n._styler=e,n._isEmpty=r,n},wP=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;const{openAll:n,closeAll:i}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=ewe(e,r.close,r.open),r=r.parent;const s=e.indexOf(` +`);return s!==-1&&(e=twe(e,i,n,s)),n+e+i};let _w;const uz=(t,...e)=>{const[r]=e;if(!og(r)||!og(r.raw))return e.join(" ");const n=e.slice(1),i=[r.raw[0]];for(let s=1;s{Pw.push(t)},registerClassName:t=>{CP.add(t)},registerComposition:t=>{SP.push(t)},markCompositionUsed:()=>{},onEndFileScope:t=>{var e=Wxe({localClassNames:Array.from(CP),composedClassLists:SP,cssObjs:Pw}).join(` +`);H2e({fileScope:t,css:e}),Pw=[]},getIdentOption:()=>"short"};j2e(xwe);function ag(t,e){return ag=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ag(t,e)}function wwe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ag(t,e)}function L3(){L3=function(i,s){return new r(i,void 0,s)};var t=RegExp.prototype,e=new WeakMap;function r(i,s,o){var a=new RegExp(i,s);return e.set(a,o||e.get(i)),ag(a,r.prototype)}function n(i,s){var o=e.get(s);return Object.keys(o).reduce(function(a,c){var l=o[c];if(typeof l=="number")a[c]=i[l];else{for(var u=0;i[l[u]]===void 0&&u+1]+)>/g,function(c,l){var u=o[l];return"$"+(Array.isArray(u)?u.join("$"):u)}))}if(typeof s=="function"){var a=this;return t[Symbol.replace].call(this,i,function(){var c=arguments;return typeof c[c.length-1]!="object"&&(c=[].slice.call(c)).push(n(c,a)),s.apply(this,c)})}return t[Symbol.replace].call(this,i,s)},L3.apply(this,arguments)}function Ewe(t){var{debugId:e,debugFileName:r}=t,n=e?[e.replace(/\s/g,"_")]:[];if(r){var{filePath:i}=go(),s=i.match(L3(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/,{dir:1,file:2}));if(s&&s.groups){var{dir:o,file:a}=s.groups;n.unshift(a&&a!=="index"?a:o)}}return n.join("_")}function kP(t){return t.match(/^[0-9]/)?"_".concat(t):t}function s9(t){var e=q2e(),{debugId:r,debugFileName:n=!0}=x0(x0({},typeof t=="string"?{debugId:t}:null),typeof t=="object"?t:null),i=W2e().toString(36),{filePath:s,packageName:o}=go(),a=sz(o?"".concat(o).concat(s):s),c="".concat(a).concat(i);if(e==="debug"){var l=Ewe({debugId:r,debugFileName:n});return l&&(c="".concat(l,"__").concat(c)),kP(c)}if(typeof e=="function"){if(c=e({hash:c,debugId:r,filePath:s,packageName:o}),!c.match(/^[A-Z_][0-9A-Z_-]+$/i))throw new Error('Identifier function returned invalid indentifier: "'.concat(c,'"'));return c}return kP(c)}function Cwe(t,e){var r=s9(e);ZU(r,go());var n=[],i=[];for(var s of t)typeof s=="string"?n.push(s):i.push(s);var o=r;if(n.length>0&&(o="".concat(r," ").concat(Oxe(n)),F2e({identifier:r,classList:o},go()),i.length>0&&ez(r)),i.length>0){var a=bwe.all(i,{arrayMerge:(c,l)=>l});p2({type:"local",selector:r,rule:a},go())}return o}function Wn(t,e){if(Array.isArray(t))return Cwe(t,e);var r=s9(e);return ZU(r,go()),p2({type:"local",selector:r,rule:t},go()),r}function fs(t,e){p2({type:"global",selector:t,rule:e},go())}function dz(t,e){var r=e9(s9(e),{isIdentifier:!0});return p2({type:"keyframes",name:r,rule:t},go()),r}function Swe(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}var hz=Swe;function kwe(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r-1&&t%1==0&&t-1&&t%1==0&&t<=P5e}var Ez=I5e,T5e=y2,O5e=Ez,R5e=g2,$5e="[object Arguments]",M5e="[object Array]",N5e="[object Boolean]",D5e="[object Date]",L5e="[object Error]",j5e="[object Function]",B5e="[object Map]",F5e="[object Number]",U5e="[object Object]",z5e="[object RegExp]",q5e="[object Set]",W5e="[object String]",H5e="[object WeakMap]",V5e="[object ArrayBuffer]",G5e="[object DataView]",K5e="[object Float32Array]",Q5e="[object Float64Array]",Y5e="[object Int8Array]",J5e="[object Int16Array]",X5e="[object Int32Array]",Z5e="[object Uint8Array]",e6e="[object Uint8ClampedArray]",t6e="[object Uint16Array]",r6e="[object Uint32Array]",er={};er[K5e]=er[Q5e]=er[Y5e]=er[J5e]=er[X5e]=er[Z5e]=er[e6e]=er[t6e]=er[r6e]=!0;er[$5e]=er[M5e]=er[V5e]=er[N5e]=er[G5e]=er[D5e]=er[L5e]=er[j5e]=er[B5e]=er[F5e]=er[U5e]=er[z5e]=er[q5e]=er[W5e]=er[H5e]=!1;function n6e(t){return R5e(t)&&O5e(t.length)&&!!er[T5e(t)]}var i6e=n6e;function s6e(t){return function(e){return t(e)}}var o6e=s6e,lg={exports:{}};lg.exports;(function(t,e){var r=mz,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===n,o=s&&r.process,a=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();t.exports=a})(lg,lg.exports);var a6e=lg.exports,c6e=i6e,l6e=o6e,TP=a6e,OP=TP&&TP.isTypedArray,u6e=OP?l6e(OP):c6e,f6e=u6e,d6e=Wwe,h6e=x5e,p6e=xz,m6e=S5e,v6e=wz,y6e=f6e,g6e=Object.prototype,b6e=g6e.hasOwnProperty;function x6e(t,e){var r=p6e(t),n=!r&&h6e(t),i=!r&&!n&&m6e(t),s=!r&&!n&&!i&&y6e(t),o=r||n||i||s,a=o?d6e(t.length,String):[],c=a.length;for(var l in t)(e||b6e.call(t,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||v6e(l,c)))&&a.push(l);return a}var w6e=x6e,E6e=Object.prototype;function C6e(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||E6e;return t===r}var S6e=C6e;function k6e(t,e){return function(r){return t(e(r))}}var A6e=k6e,_6e=A6e,P6e=_6e(Object.keys,Object),I6e=P6e,T6e=S6e,O6e=I6e,R6e=Object.prototype,$6e=R6e.hasOwnProperty;function M6e(t){if(!T6e(t))return O6e(t);var e=[];for(var r in Object(t))$6e.call(t,r)&&r!="constructor"&&e.push(r);return e}var N6e=M6e;function D6e(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var o9=D6e,L6e=y2,j6e=o9,B6e="[object AsyncFunction]",F6e="[object Function]",U6e="[object GeneratorFunction]",z6e="[object Proxy]";function q6e(t){if(!j6e(t))return!1;var e=L6e(t);return e==F6e||e==U6e||e==B6e||e==z6e}var W6e=q6e,H6e=W6e,V6e=Ez;function G6e(t){return t!=null&&V6e(t.length)&&!H6e(t)}var Cz=G6e,K6e=w6e,Q6e=N6e,Y6e=Cz;function J6e(t){return Y6e(t)?K6e(t):Q6e(t)}var X6e=J6e,Z6e=zwe,e3e=X6e;function t3e(t){return t==null?[]:Z6e(t,e3e(t))}var r3e=t3e,n3e=hz,i3e=pz,s3e=r3e;function o3e(t,e){var r=s3e(t);return i3e(r,n3e(e,0,r.length))}var a3e=o3e;function c3e(t,e){return t===e||t!==t&&e!==e}var l3e=c3e,u3e=l3e,f3e=Cz,d3e=wz,h3e=o9;function p3e(t,e,r){if(!h3e(r))return!1;var n=typeof e;return(n=="number"?f3e(r)&&d3e(e,r.length):n=="string"&&e in r)?u3e(r[e],t):!1}var m3e=p3e,v3e=/\s/;function y3e(t){for(var e=t.length;e--&&v3e.test(t.charAt(e)););return e}var g3e=y3e,b3e=g3e,x3e=/^\s+/;function w3e(t){return t&&t.slice(0,b3e(t)+1).replace(x3e,"")}var E3e=w3e,C3e=y2,S3e=g2,k3e="[object Symbol]";function A3e(t){return typeof t=="symbol"||S3e(t)&&C3e(t)==k3e}var _3e=A3e,P3e=E3e,RP=o9,I3e=_3e,$P=NaN,T3e=/^[-+]0x[0-9a-f]+$/i,O3e=/^0b[01]+$/i,R3e=/^0o[0-7]+$/i,$3e=parseInt;function M3e(t){if(typeof t=="number")return t;if(I3e(t))return $P;if(RP(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=RP(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=P3e(t);var r=O3e.test(t);return r||R3e.test(t)?$3e(t.slice(2),r?2:8):T3e.test(t)?$P:+t}var N3e=M3e,D3e=N3e,MP=1/0,L3e=17976931348623157e292;function j3e(t){if(!t)return t===0?t:0;if(t=D3e(t),t===MP||t===-MP){var e=t<0?-1:1;return e*L3e}return t===t?t:0}var B3e=j3e,F3e=B3e;function U3e(t){var e=F3e(t),r=e%1;return e===e?r?e-r:e:0}var z3e=U3e,q3e=Lwe,W3e=a3e,H3e=xz,V3e=m3e,G3e=z3e;function K3e(t,e,r){(r?V3e(t,e,r):e===void 0)?e=1:e=G3e(e);var n=H3e(t)?q3e:W3e;return n(t,e)}var Q3e=K3e;const Y3e=Pi(Q3e);var b2={},J3e=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],n=0;n"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=NP[e.format]||NP.default;window.clipboardData.setData(f,t)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,t);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){r&&console.error("unable to copy using execCommand: ",u),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(f){r&&console.error("unable to copy using clipboardData: ",f),r&&console.error("falling back to prompt"),n=e8e("message"in e?e.message:Z3e),window.prompt(n,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var r8e=t8e;function j3(t){"@babel/helpers - typeof";return j3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j3(t)}Object.defineProperty(b2,"__esModule",{value:!0});b2.CopyToClipboard=void 0;var Cm=Sz(w),n8e=Sz(r8e),i8e=["text","onCopy","options","children"];function Sz(t){return t&&t.__esModule?t:{default:t}}function DP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function LP(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function o8e(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}function a8e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jP(t,e){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ug(t){return ug=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ug(t)}function a9(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Az=function(t){l8e(r,t);var e=u8e(r);function r(){var n;a8e(this,r);for(var i=arguments.length,s=new Array(i),o=0;oe in t?p8e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,I1=(t,e)=>{for(var r in e||(e={}))Pz.call(e,r)&&BP(t,r,e[r]);if(fg)for(var r of fg(e))Iz.call(e,r)&&BP(t,r,e[r]);return t},c9=(t,e)=>{var r={};for(var n in t)Pz.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&fg)for(var n of fg(t))e.indexOf(n)<0&&Iz.call(t,n)&&(r[n]=t[n]);return r};/** * @license QR Code generator library (TypeScript) * Copyright (c) Project Nayuki. * SPDX-License-Identifier: MIT - */var Eu;(t=>{const e=class{constructor(c,l,u,f){if(this.version=c,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],ce.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let d=[];for(let p=0;p7)throw new RangeError("Invalid value");let p,m;for(p=u;;p++){const E=e.getNumDataCodewords(p,l)*8,S=a.getTotalBits(c,p);if(S<=E){m=S;break}if(p>=f)throw new RangeError("Data too long")}for(const E of[e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])h&&m<=e.getNumDataCodewords(p,E)*8&&(l=E);let v=[];for(const E of c){n(E.mode.modeBits,4,v),n(E.numChars,E.mode.numCharCountBits(p),v);for(const S of E.getData())v.push(S)}s(v.length==m);const y=e.getNumDataCodewords(p,l)*8;s(v.length<=y),n(0,Math.min(4,y-v.length),v),n(0,(8-v.length%8)%8,v),s(v.length%8==0);for(let E=236;v.lengthb[S>>>3]|=E<<7-(S&7)),new e(p,l,b,d)}getModule(c,l){return 0<=c&&c>>9)*1335;const f=(l<<10|u)^21522;s(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,i(f,d));this.setFunctionModule(8,7,i(f,6)),this.setFunctionModule(8,8,i(f,7)),this.setFunctionModule(7,8,i(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,i(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,i(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,i(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let u=0;u<12;u++)c=c<<1^(c>>>11)*7973;const l=this.version<<12|c;s(l>>>18==0);for(let u=0;u<18;u++){const f=i(l,u),d=this.size-11+u%3,h=Math.floor(u/3);this.setFunctionModule(d,h,f),this.setFunctionModule(h,d,f)}}drawFinderPattern(c,l){for(let u=-4;u<=4;u++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(u)),h=c+f,p=l+u;0<=h&&h{(E!=m-d||P>=p)&&b.push(S[E])});return s(b.length==h),b}drawCodewords(c){if(c.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let f=0;f>>3],7-(l&7)),l++)}}s(l==c.length*8)}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let l=0;l5&&c++):(this.finderPenaltyAddHistory(p,m),h||(c+=this.finderPenaltyCountPatterns(m)*e.PENALTY_N3),h=this.modules[d][v],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,m)*e.PENALTY_N3}for(let d=0;d5&&c++):(this.finderPenaltyAddHistory(p,m),h||(c+=this.finderPenaltyCountPatterns(m)*e.PENALTY_N3),h=this.modules[v][d],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,m)*e.PENALTY_N3}for(let d=0;dh+(p?1:0),l);const u=this.size*this.size,f=Math.ceil(Math.abs(l*20-u*10)/u)-1;return s(0<=f&&f<=9),c+=f*e.PENALTY_N4,s(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let u=[6];for(let f=this.size-7;u.lengthe.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*c+128)*c+64;if(c>=2){const u=Math.floor(c/7)+2;l-=(25*u-10)*u-55,c>=7&&(l-=36)}return s(208<=l&&l<=29648),l}static getNumDataCodewords(c,l){return Math.floor(e.getNumRawDataModules(c)/8)-e.ECC_CODEWORDS_PER_BLOCK[l.ordinal][c]*e.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let l=[];for(let f=0;f0);for(const f of c){const d=f^u.shift();u.push(0),l.forEach((h,p)=>u[p]^=e.reedSolomonMultiply(h,d))}return u}static reedSolomonMultiply(c,l){if(c>>>8||l>>>8)throw new RangeError("Byte out of range");let u=0;for(let f=7;f>=0;f--)u=u<<1^(u>>>7)*285,u^=(l>>>f&1)*c;return s(u>>>8==0),u}finderPenaltyCountPatterns(c){const l=c[1];s(l<=this.size*3);const u=l>0&&c[2]==l&&c[3]==l*3&&c[4]==l&&c[5]==l;return(u&&c[0]>=l*4&&c[6]>=l?1:0)+(u&&c[6]>=l*4&&c[0]>=l?1:0)}finderPenaltyTerminateAndCount(c,l,u){return c&&(this.finderPenaltyAddHistory(l,u),l=0),l+=this.size,this.finderPenaltyAddHistory(l,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(c,l){l[0]==0&&(c+=this.size),l.pop(),l.unshift(c)}};let r=e;r.MIN_VERSION=1,r.MAX_VERSION=40,r.PENALTY_N1=3,r.PENALTY_N2=3,r.PENALTY_N3=40,r.PENALTY_N4=10,r.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],r.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],t.QrCode=r;function n(c,l,u){if(l<0||l>31||c>>>l)throw new RangeError("Value out of range");for(let f=l-1;f>=0;f--)u.push(c>>>f&1)}function i(c,l){return(c>>>l&1)!=0}function s(c){if(!c)throw new Error("Assertion error")}const o=class{constructor(c,l,u){if(this.mode=c,this.numChars=l,this.bitData=u,l<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(c){let l=[];for(const u of c)n(u,8,l);return new o(o.Mode.BYTE,c.length,l)}static makeNumeric(c){if(!o.isNumeric(c))throw new RangeError("String contains non-numeric characters");let l=[];for(let u=0;u=1<{(e=>{const r=class{constructor(i,s){this.ordinal=i,this.formatBits=s}};let n=r;n.LOW=new r(0,1),n.MEDIUM=new r(1,0),n.QUARTILE=new r(2,3),n.HIGH=new r(3,2),e.Ecc=n})(t.QrCode||(t.QrCode={}))})(Eu||(Eu={}));(t=>{(e=>{const r=class{constructor(i,s){this.modeBits=i,this.numBitsCharCount=s}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};let n=r;n.NUMERIC=new r(1,[10,12,14]),n.ALPHANUMERIC=new r(2,[9,11,13]),n.BYTE=new r(4,[8,16,16]),n.KANJI=new r(8,[8,10,12]),n.ECI=new r(7,[0,0,0]),e.Mode=n})(t.QrSegment||(t.QrSegment={}))})(Eu||(Eu={}));var Mf=Eu;/** + */var mu;(t=>{const e=class{constructor(c,l,u,f){if(this.version=c,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],ce.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let d=[];for(let p=0;p7)throw new RangeError("Invalid value");let p,m;for(p=u;;p++){const E=e.getNumDataCodewords(p,l)*8,S=a.getTotalBits(c,p);if(S<=E){m=S;break}if(p>=f)throw new RangeError("Data too long")}for(const E of[e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])h&&m<=e.getNumDataCodewords(p,E)*8&&(l=E);let v=[];for(const E of c){n(E.mode.modeBits,4,v),n(E.numChars,E.mode.numCharCountBits(p),v);for(const S of E.getData())v.push(S)}s(v.length==m);const y=e.getNumDataCodewords(p,l)*8;s(v.length<=y),n(0,Math.min(4,y-v.length),v),n(0,(8-v.length%8)%8,v),s(v.length%8==0);for(let E=236;v.lengthb[S>>>3]|=E<<7-(S&7)),new e(p,l,b,d)}getModule(c,l){return 0<=c&&c>>9)*1335;const f=(l<<10|u)^21522;s(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,i(f,d));this.setFunctionModule(8,7,i(f,6)),this.setFunctionModule(8,8,i(f,7)),this.setFunctionModule(7,8,i(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,i(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,i(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,i(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let u=0;u<12;u++)c=c<<1^(c>>>11)*7973;const l=this.version<<12|c;s(l>>>18==0);for(let u=0;u<18;u++){const f=i(l,u),d=this.size-11+u%3,h=Math.floor(u/3);this.setFunctionModule(d,h,f),this.setFunctionModule(h,d,f)}}drawFinderPattern(c,l){for(let u=-4;u<=4;u++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(u)),h=c+f,p=l+u;0<=h&&h{(E!=m-d||P>=p)&&b.push(S[E])});return s(b.length==h),b}drawCodewords(c){if(c.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let f=0;f>>3],7-(l&7)),l++)}}s(l==c.length*8)}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let l=0;l5&&c++):(this.finderPenaltyAddHistory(p,m),h||(c+=this.finderPenaltyCountPatterns(m)*e.PENALTY_N3),h=this.modules[d][v],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,m)*e.PENALTY_N3}for(let d=0;d5&&c++):(this.finderPenaltyAddHistory(p,m),h||(c+=this.finderPenaltyCountPatterns(m)*e.PENALTY_N3),h=this.modules[v][d],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,m)*e.PENALTY_N3}for(let d=0;dh+(p?1:0),l);const u=this.size*this.size,f=Math.ceil(Math.abs(l*20-u*10)/u)-1;return s(0<=f&&f<=9),c+=f*e.PENALTY_N4,s(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let u=[6];for(let f=this.size-7;u.lengthe.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*c+128)*c+64;if(c>=2){const u=Math.floor(c/7)+2;l-=(25*u-10)*u-55,c>=7&&(l-=36)}return s(208<=l&&l<=29648),l}static getNumDataCodewords(c,l){return Math.floor(e.getNumRawDataModules(c)/8)-e.ECC_CODEWORDS_PER_BLOCK[l.ordinal][c]*e.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let l=[];for(let f=0;f0);for(const f of c){const d=f^u.shift();u.push(0),l.forEach((h,p)=>u[p]^=e.reedSolomonMultiply(h,d))}return u}static reedSolomonMultiply(c,l){if(c>>>8||l>>>8)throw new RangeError("Byte out of range");let u=0;for(let f=7;f>=0;f--)u=u<<1^(u>>>7)*285,u^=(l>>>f&1)*c;return s(u>>>8==0),u}finderPenaltyCountPatterns(c){const l=c[1];s(l<=this.size*3);const u=l>0&&c[2]==l&&c[3]==l*3&&c[4]==l&&c[5]==l;return(u&&c[0]>=l*4&&c[6]>=l?1:0)+(u&&c[6]>=l*4&&c[0]>=l?1:0)}finderPenaltyTerminateAndCount(c,l,u){return c&&(this.finderPenaltyAddHistory(l,u),l=0),l+=this.size,this.finderPenaltyAddHistory(l,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(c,l){l[0]==0&&(c+=this.size),l.pop(),l.unshift(c)}};let r=e;r.MIN_VERSION=1,r.MAX_VERSION=40,r.PENALTY_N1=3,r.PENALTY_N2=3,r.PENALTY_N3=40,r.PENALTY_N4=10,r.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],r.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],t.QrCode=r;function n(c,l,u){if(l<0||l>31||c>>>l)throw new RangeError("Value out of range");for(let f=l-1;f>=0;f--)u.push(c>>>f&1)}function i(c,l){return(c>>>l&1)!=0}function s(c){if(!c)throw new Error("Assertion error")}const o=class{constructor(c,l,u){if(this.mode=c,this.numChars=l,this.bitData=u,l<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(c){let l=[];for(const u of c)n(u,8,l);return new o(o.Mode.BYTE,c.length,l)}static makeNumeric(c){if(!o.isNumeric(c))throw new RangeError("String contains non-numeric characters");let l=[];for(let u=0;u=1<{(e=>{const r=class{constructor(i,s){this.ordinal=i,this.formatBits=s}};let n=r;n.LOW=new r(0,1),n.MEDIUM=new r(1,0),n.QUARTILE=new r(2,3),n.HIGH=new r(3,2),e.Ecc=n})(t.QrCode||(t.QrCode={}))})(mu||(mu={}));(t=>{(e=>{const r=class{constructor(i,s){this.modeBits=i,this.numBitsCharCount=s}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};let n=r;n.NUMERIC=new r(1,[10,12,14]),n.ALPHANUMERIC=new r(2,[9,11,13]),n.BYTE=new r(4,[8,16,16]),n.KANJI=new r(8,[8,10,12]),n.ECI=new r(7,[0,0,0]),e.Mode=n})(t.QrSegment||(t.QrSegment={}))})(mu||(mu={}));var Af=mu;/** * @license qrcode.react * Copyright (c) Paul O'Shannessy * SPDX-License-Identifier: ISC - */var Zz={L:Mf.QrCode.Ecc.LOW,M:Mf.QrCode.Ecc.MEDIUM,Q:Mf.QrCode.Ecc.QUARTILE,H:Mf.QrCode.Ecc.HIGH},eq=128,tq="L",rq="#FFFFFF",nq="#000000",iq=!1,k9=4,Z8e=.1;function sq(t,e=0){const r=[];return t.forEach(function(n,i){let s=null;n.forEach(function(o,a){if(!o&&s!==null){r.push(`M${s+e} ${i+e}h${a-s}v1H${s+e}z`),s=null;return}if(a===n.length-1){if(!o)return;s===null?r.push(`M${a+e},${i+e} h1v1H${a+e}z`):r.push(`M${s+e},${i+e} h${a+1-s}v1H${s+e}z`);return}o&&s===null&&(s=a)})}),r.join("")}function oq(t,e){return t.slice().map((r,n)=>n=e.y+e.h?r:r.map((i,s)=>s=e.x+e.w?i:!1))}function aq(t,e,r,n){if(n==null)return null;const i=r?k9:0,s=t.length+i*2,o=Math.floor(e*Z8e),a=s/e,c=(n.width||o)*a,l=(n.height||o)*a,u=n.x==null?t.length/2-c/2:n.x*a,f=n.y==null?t.length/2-l/2:n.y*a;let d=null;if(n.excavate){let h=Math.floor(u),p=Math.floor(f),m=Math.ceil(c+u-h),v=Math.ceil(l+f-p);d={x:h,y:p,w:m,h:v}}return{x:u,y:f,h:l,w:c,excavation:d}}var eEe=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function tEe(t){const e=t,{value:r,size:n=eq,level:i=tq,bgColor:s=rq,fgColor:o=nq,includeMargin:a=iq,style:c,imageSettings:l}=e,u=S9(e,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),f=l==null?void 0:l.src,d=x.useRef(null),h=x.useRef(null),[p,m]=x.useState(!1);x.useEffect(()=>{if(d.current!=null){const b=d.current,E=b.getContext("2d");if(!E)return;let S=Mf.QrCode.encodeText(r,Zz[i]).getModules();const P=a?k9:0,M=S.length+P*2,L=aq(S,n,a,l),j=h.current,H=L!=null&&j!==null&&j.complete&&j.naturalHeight!==0&&j.naturalWidth!==0;H&&L.excavation!=null&&(S=oq(S,L.excavation));const K=window.devicePixelRatio||1;b.height=b.width=n*K;const Q=n/M*K;E.scale(Q,Q),E.fillStyle=s,E.fillRect(0,0,M,M),E.fillStyle=o,eEe?E.fill(new Path2D(sq(S,P))):S.forEach(function(Y,F){Y.forEach(function(w,k){w&&E.fillRect(k+P,F+P,1,1)})}),H&&E.drawImage(j,L.x+P,L.y+P,L.w,L.h)}}),x.useEffect(()=>{m(!1)},[f]);const v=F1({height:n,width:n},c);let y=null;return f!=null&&(y=g.createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{m(!0)},ref:h})),g.createElement(g.Fragment,null,g.createElement("canvas",F1({style:v,height:n,width:n,ref:d},u)),y)}function rEe(t){const e=t,{value:r,size:n=eq,level:i=tq,bgColor:s=rq,fgColor:o=nq,includeMargin:a=iq,imageSettings:c}=e,l=S9(e,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let u=Mf.QrCode.encodeText(r,Zz[i]).getModules();const f=a?k9:0,d=u.length+f*2,h=aq(u,n,a,c);let p=null;c!=null&&h!=null&&(h.excavation!=null&&(u=oq(u,h.excavation)),p=g.createElement("image",{xlinkHref:c.src,height:h.h,width:h.w,x:h.x+f,y:h.y+f,preserveAspectRatio:"none"}));const m=sq(u,f);return g.createElement("svg",F1({height:n,width:n,viewBox:`0 0 ${d} ${d}`},l),g.createElement("path",{fill:s,d:`M0,0 h${d}v${d}H0z`,shapeRendering:"crispEdges"}),g.createElement("path",{fill:o,d:m,shapeRendering:"crispEdges"}),p)}var nEe=t=>{const e=t,{renderAs:r}=e,n=S9(e,["renderAs"]);return r==="svg"?g.createElement(rEe,F1({},n)):g.createElement(tEe,F1({},n))},cq={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(yi,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",u="week",f="month",d="quarter",h="year",p="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(w){var k=["th","st","nd","rd"],R=w%100;return"["+w+(k[(R-20)%10]||k[R]||k[0])+"]"}},E=function(w,k,R){var N=String(w);return!N||N.length>=k?w:""+Array(k+1-N.length).join(R)+w},S={s:E,z:function(w){var k=-w.utcOffset(),R=Math.abs(k),N=Math.floor(R/60),A=R%60;return(k<=0?"+":"-")+E(N,2,"0")+":"+E(A,2,"0")},m:function w(k,R){if(k.date()1)return w(B[0])}else{var I=k.name;M[I]=k,A=I}return!N&&A&&(P=A),A||!N&&P},K=function(w,k){if(j(w))return w.clone();var R=typeof k=="object"?k:{};return R.date=w,R.args=arguments,new Y(R)},Q=S;Q.l=H,Q.i=j,Q.w=function(w,k){return K(w,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var Y=function(){function w(R){this.$L=H(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[L]=!0}var k=w.prototype;return k.parse=function(R){this.$d=function(N){var A=N.date,O=N.utc;if(A===null)return new Date(NaN);if(Q.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var B=A.match(v);if(B){var I=B[2]-1||0,C=(B[7]||"0").substring(0,3);return O?new Date(Date.UTC(B[1],I,B[3]||1,B[4]||0,B[5]||0,B[6]||0,C)):new Date(B[1],I,B[3]||1,B[4]||0,B[5]||0,B[6]||0,C)}}return new Date(A)}(R),this.init()},k.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},k.$utils=function(){return Q},k.isValid=function(){return this.$d.toString()!==m},k.isSame=function(R,N){var A=K(R);return this.startOf(N)<=A&&A<=this.endOf(N)},k.isAfter=function(R,N){return K(R)`Invalid value for key ${t}`,dEe=t=>`Pattern length exceeds max of ${t}.`,hEe=t=>`Missing ${t} property in key`,pEe=t=>`Property 'weight' in key '${t}' must be a positive integer`,iI=Object.prototype.hasOwnProperty;class mEe{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(n=>{let i=hq(n);r+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,r+=i.weight}),this._keys.forEach(n=>{n.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function hq(t){let e=null,r=null,n=null,i=1,s=null;if(fo(t)||Ca(t))n=t,e=sI(t),r=t8(t);else{if(!iI.call(t,"name"))throw new Error(hEe("name"));const o=t.name;if(n=o,iI.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(pEe(o));e=sI(o),r=t8(o),s=t.getFn}return{path:e,id:r,weight:i,src:n,getFn:s}}function sI(t){return Ca(t)?t:t.split(".")}function t8(t){return Ca(t)?t.join("."):t}function vEe(t,e){let r=[],n=!1;const i=(s,o,a)=>{if(bi(s))if(!o[a])r.push(s);else{let c=o[a];const l=s[c];if(!bi(l))return;if(a===o.length-1&&(fo(l)||uq(l)||cEe(l)))r.push(aEe(l));else if(Ca(l)){n=!0;for(let u=0,f=l.length;ut.score===e.score?t.idx{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,fo(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){const r=this.size();fo(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,n=this.size();r{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(bi(o)){if(Ca(o)){let a=[];const c=[{nestedArrIndex:-1,value:o}];for(;c.length;){const{nestedArrIndex:l,value:u}=c.pop();if(bi(u))if(fo(u)&&!qw(u)){let f={v:u,i:l,n:this.norm.get(u)};a.push(f)}else Ca(u)&&u.forEach((f,d)=>{c.push({nestedArrIndex:d,value:f})})}n.$[s]=a}else if(fo(o)&&!qw(o)){let a={v:o,n:this.norm.get(o)};n.$[s]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function pq(t,e,{getFn:r=De.getFn,fieldNormWeight:n=De.fieldNormWeight}={}){const i=new A9({getFn:r,fieldNormWeight:n});return i.setKeys(t.map(hq)),i.setSources(e),i.create(),i}function CEe(t,{getFn:e=De.getFn,fieldNormWeight:r=De.fieldNormWeight}={}){const{keys:n,records:i}=t,s=new A9({getFn:e,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(i),s}function Nm(t,{errors:e=0,currentLocation:r=0,expectedLocation:n=0,distance:i=De.distance,ignoreLocation:s=De.ignoreLocation}={}){const o=e/t.length;if(s)return o;const a=Math.abs(n-r);return i?o+a/i:a?1:o}function SEe(t=[],e=De.minMatchCharLength){let r=[],n=-1,i=-1,s=0;for(let o=t.length;s=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}const jl=32;function kEe(t,e,r,{location:n=De.location,distance:i=De.distance,threshold:s=De.threshold,findAllMatches:o=De.findAllMatches,minMatchCharLength:a=De.minMatchCharLength,includeMatches:c=De.includeMatches,ignoreLocation:l=De.ignoreLocation}={}){if(e.length>jl)throw new Error(dEe(jl));const u=e.length,f=t.length,d=Math.max(0,Math.min(n,f));let h=s,p=d;const m=a>1||c,v=m?Array(f):[];let y;for(;(y=t.indexOf(e,p))>-1;){let L=Nm(e,{currentLocation:y,expectedLocation:d,distance:i,ignoreLocation:l});if(h=Math.min(L,h),p=y+u,m){let j=0;for(;j=K;w-=1){let k=w-1,R=r[t.charAt(k)];if(m&&(v[k]=+!!R),Y[w]=(Y[w+1]<<1|1)&R,L&&(Y[w]|=(b[w+1]|b[w])<<1|1|b[w+1]),Y[w]&P&&(E=Nm(e,{errors:L,currentLocation:k,expectedLocation:d,distance:i,ignoreLocation:l}),E<=h)){if(h=E,p=k,p<=d)break;K=Math.max(1,2*d-p)}}if(Nm(e,{errors:L+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:l})>h)break;b=Y}const M={isMatch:p>=0,score:Math.max(.001,E)};if(m){const L=SEe(v,a);L.length?c&&(M.indices=L):M.isMatch=!1}return M}function AEe(t){let e={};for(let r=0,n=t.length;r{this.chunks.push({pattern:d,alphabet:AEe(d),startIndex:h})},f=this.pattern.length;if(f>jl){let d=0;const h=f%jl,p=f-h;for(;d{const{isMatch:y,score:b,indices:E}=kEe(e,p,m,{location:i+v,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:c,includeMatches:n,ignoreLocation:l});y&&(d=!0),f+=b,y&&E&&(u=[...u,...E])});let h={isMatch:d,score:d?f/this.chunks.length:1};return d&&n&&(h.indices=u),h}}class pl{constructor(e){this.pattern=e}static isMultiMatch(e){return oI(e,this.multiRegex)}static isSingleMatch(e){return oI(e,this.singleRegex)}search(){}}function oI(t,e){const r=t.match(e);return r?r[1]:null}class _Ee extends pl{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class PEe extends pl{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class IEe extends pl{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class TEe extends pl{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class OEe extends pl{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class REe extends pl{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class vq extends pl{constructor(e,{location:r=De.location,threshold:n=De.threshold,distance:i=De.distance,includeMatches:s=De.includeMatches,findAllMatches:o=De.findAllMatches,minMatchCharLength:a=De.minMatchCharLength,isCaseSensitive:c=De.isCaseSensitive,ignoreLocation:l=De.ignoreLocation}={}){super(e),this._bitapSearch=new mq(e,{location:r,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class yq extends pl{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,n;const i=[],s=this.pattern.length;for(;(n=e.indexOf(this.pattern,r))>-1;)r=n+s,i.push([n,r-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const r8=[_Ee,yq,IEe,TEe,REe,OEe,PEe,vq],aI=r8.length,$Ee=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,MEe="|";function NEe(t,e={}){return t.split(MEe).map(r=>{let n=r.trim().split($Ee).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=n.length;s!!(t[Sg.AND]||t[Sg.OR]),BEe=t=>!!t[s8.PATH],FEe=t=>!Ca(t)&&fq(t)&&!o8(t),cI=t=>({[Sg.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function gq(t,e,{auto:r=!0}={}){const n=i=>{let s=Object.keys(i);const o=BEe(i);if(!o&&s.length>1&&!o8(i))return n(cI(i));if(FEe(i)){const c=o?i[s8.PATH]:s[0],l=o?i[s8.PATTERN]:i[c];if(!fo(l))throw new Error(fEe(c));const u={keyId:t8(c),pattern:l};return r&&(u.searcher=i8(l,e)),u}let a={children:[],operator:s[0]};return s.forEach(c=>{const l=i[c];Ca(l)&&l.forEach(u=>{a.children.push(n(u))})}),a};return o8(t)||(t=cI(t)),n(t)}function UEe(t,{ignoreFieldNorm:e=De.ignoreFieldNorm}){t.forEach(r=>{let n=1;r.matches.forEach(({key:i,norm:s,score:o})=>{const a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:s))}),r.score=n})}function zEe(t,e){const r=t.matches;e.matches=[],bi(r)&&r.forEach(n=>{if(!bi(n.indices)||!n.indices.length)return;const{indices:i,value:s}=n;let o={indices:i,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function qEe(t,e){e.score=t.score}function WEe(t,e,{includeMatches:r=De.includeMatches,includeScore:n=De.includeScore}={}){const i=[];return r&&i.push(zEe),n&&i.push(qEe),t.map(s=>{const{idx:o}=s,a={item:e[o],refIndex:o};return i.length&&i.forEach(c=>{c(s,a)}),a})}class Sa{constructor(e,r={},n){this.options={...De,...r},this.options.useExtendedSearch,this._keyStore=new mEe(this.options.keys),this.setCollection(e,n)}setCollection(e,r){if(this._docs=e,r&&!(r instanceof A9))throw new Error(uEe);this._myIndex=r||pq(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){bi(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const r=[];for(let n=0,i=this._docs.length;n-1&&(c=c.slice(0,r)),WEe(c,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){const r=i8(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:s,i:o,n:a})=>{if(!bi(s))return;const{isMatch:c,score:l,indices:u}=r.searchIn(s);c&&i.push({item:s,idx:o,matches:[{score:l,value:s,norm:a,indices:u}]})}),i}_searchLogical(e){const r=gq(e,this.options),n=(a,c,l)=>{if(!a.children){const{keyId:f,searcher:d}=a,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(c,f),searcher:d});return h&&h.length?[{idx:l,item:c,matches:h}]:[]}const u=[];for(let f=0,d=a.children.length;f{if(bi(a)){let l=n(r,a,c);l.length&&(s[c]||(s[c]={idx:c,item:a,matches:[]},o.push(s[c])),l.forEach(({matches:u})=>{s[c].matches.push(...u)}))}}),o}_searchObjectList(e){const r=i8(e,this.options),{keys:n,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!bi(o))return;let c=[];n.forEach((l,u)=>{c.push(...this._findMatches({key:l,value:o[u],searcher:r}))}),c.length&&s.push({idx:a,item:o,matches:c})}),s}_findMatches({key:e,value:r,searcher:n}){if(!bi(r))return[];let i=[];if(Ca(r))r.forEach(({v:s,i:o,n:a})=>{if(!bi(s))return;const{isMatch:c,score:l,indices:u}=n.searchIn(s);c&&i.push({score:l,key:e,value:s,idx:o,norm:a,indices:u})});else{const{v:s,n:o}=r,{isMatch:a,score:c,indices:l}=n.searchIn(s);a&&i.push({score:c,key:e,value:s,norm:o,indices:l})}return i}}Sa.version="6.6.2";Sa.createIndex=pq;Sa.parseIndex=CEe;Sa.config=De;Sa.parseQuery=gq;jEe(LEe);function bq(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;et.forEach(r=>VEe(r,e))}function Lu(...t){return x.useCallback(xq(...t),t)}function wq(t,e=[]){let r=[];function n(s,o){const a=x.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:h,...p}=f,m=(d==null?void 0:d[t][c])||a,v=x.useMemo(()=>p,Object.values(p));return x.createElement(m.Provider,{value:v},h)}function u(f,d){const h=(d==null?void 0:d[t][c])||a,p=x.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>x.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return x.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,GEe(i,...e)]}function GEe(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}const _9=x.forwardRef((t,e)=>{const{children:r,...n}=t,i=x.Children.toArray(r),s=i.find(QEe);if(s){const o=s.props.children,a=i.map(c=>c===s?x.Children.count(o)>1?x.Children.only(null):x.isValidElement(o)?o.props.children:null:c);return x.createElement(a8,un({},n,{ref:e}),x.isValidElement(o)?x.cloneElement(o,void 0,a):null)}return x.createElement(a8,un({},n,{ref:e}),r)});_9.displayName="Slot";const a8=x.forwardRef((t,e)=>{const{children:r,...n}=t;return x.isValidElement(r)?x.cloneElement(r,{...YEe(n,r.props),ref:e?xq(e,r.ref):r.ref}):x.Children.count(r)>1?x.Children.only(null):null});a8.displayName="SlotClone";const KEe=({children:t})=>x.createElement(x.Fragment,null,t);function QEe(t){return x.isValidElement(t)&&t.type===KEe}function YEe(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const JEe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Rp=JEe.reduce((t,e)=>{const r=x.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?_9:e;return x.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),x.createElement(a,un({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function XEe(t,e){t&&zs.flushSync(()=>t.dispatchEvent(e))}function Yc(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function ZEe(t,e=globalThis==null?void 0:globalThis.document){const r=Yc(t);x.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const c8="dismissableLayer.update",eCe="dismissableLayer.pointerDownOutside",tCe="dismissableLayer.focusOutside";let lI;const rCe=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),nCe=x.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=x.useContext(rCe),[f,d]=x.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,p]=x.useState({}),m=Lu(e,j=>d(j)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),E=f?v.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,P=E>=b,M=iCe(j=>{const H=j.target,K=[...u.branches].some(Q=>Q.contains(H));!P||K||(s==null||s(j),a==null||a(j),j.defaultPrevented||c==null||c())},h),L=sCe(j=>{const H=j.target;[...u.branches].some(Q=>Q.contains(H))||(o==null||o(j),a==null||a(j),j.defaultPrevented||c==null||c())},h);return ZEe(j=>{E===u.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&c&&(j.preventDefault(),c()))},h),x.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(lI=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),uI(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=lI)}},[f,h,n,u]),x.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),uI())},[f,u]),x.useEffect(()=>{const j=()=>p({});return document.addEventListener(c8,j),()=>document.removeEventListener(c8,j)},[]),x.createElement(Rp.div,un({},l,{ref:m,style:{pointerEvents:S?P?"auto":"none":void 0,...t.style},onFocusCapture:eu(t.onFocusCapture,L.onFocusCapture),onBlurCapture:eu(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:eu(t.onPointerDownCapture,M.onPointerDownCapture)}))});function iCe(t,e=globalThis==null?void 0:globalThis.document){const r=Yc(t),n=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){Eq(eCe,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function sCe(t,e=globalThis==null?void 0:globalThis.document){const r=Yc(t),n=x.useRef(!1);return x.useEffect(()=>{const i=s=>{s.target&&!n.current&&Eq(tCe,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function uI(){const t=new CustomEvent(c8);document.dispatchEvent(t)}function Eq(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?XEe(i,s):i.dispatchEvent(s)}let Ww=0;function oCe(){x.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:fI()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:fI()),Ww++,()=>{Ww===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Ww--}},[])}function fI(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const Hw="focusScope.autoFocusOnMount",Vw="focusScope.autoFocusOnUnmount",dI={bubbles:!1,cancelable:!0},aCe=x.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=x.useState(null),l=Yc(i),u=Yc(s),f=x.useRef(null),d=Lu(e,m=>c(m)),h=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let m=function(E){if(h.paused||!a)return;const S=E.target;a.contains(S)?f.current=S:Xa(f.current,{select:!0})},v=function(E){if(h.paused||!a)return;const S=E.relatedTarget;S!==null&&(a.contains(S)||Xa(f.current,{select:!0}))},y=function(E){if(document.activeElement===document.body)for(const P of E)P.removedNodes.length>0&&Xa(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[n,a,h.paused]),x.useEffect(()=>{if(a){pI.add(h);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(Hw,dI);a.addEventListener(Hw,l),a.dispatchEvent(y),y.defaultPrevented||(cCe(hCe(Cq(a)),{select:!0}),document.activeElement===m&&Xa(a))}return()=>{a.removeEventListener(Hw,l),setTimeout(()=>{const y=new CustomEvent(Vw,dI);a.addEventListener(Vw,u),a.dispatchEvent(y),y.defaultPrevented||Xa(m??document.body,{select:!0}),a.removeEventListener(Vw,u),pI.remove(h)},0)}}},[a,l,u,h]);const p=x.useCallback(m=>{if(!r&&!n||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const b=m.currentTarget,[E,S]=lCe(b);E&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&Xa(E,{select:!0})):m.shiftKey&&y===E&&(m.preventDefault(),r&&Xa(S,{select:!0})):y===b&&m.preventDefault()}},[r,n,h.paused]);return x.createElement(Rp.div,un({tabIndex:-1},o,{ref:d,onKeyDown:p}))});function cCe(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Xa(n,{select:e}),document.activeElement!==r)return}function lCe(t){const e=Cq(t),r=hI(e,t),n=hI(e.reverse(),t);return[r,n]}function Cq(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function hI(t,e){for(const r of t)if(!uCe(r,{upTo:e}))return r}function uCe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function fCe(t){return t instanceof HTMLInputElement&&"select"in t}function Xa(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&fCe(t)&&e&&t.select()}}const pI=dCe();function dCe(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=mI(t,e),t.unshift(e)},remove(e){var r;t=mI(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function mI(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function hCe(t){return t.filter(e=>e.tagName!=="A")}const Td=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},pCe=dT.useId||(()=>{});let mCe=0;function vCe(t){const[e,r]=x.useState(pCe());return Td(()=>{t||r(n=>n??String(mCe++))},[t]),t||(e?`radix-${e}`:"")}const yCe=["top","right","bottom","left"],Jc=Math.min,xi=Math.max,kg=Math.round,Dm=Math.floor,Xc=t=>({x:t,y:t}),gCe={left:"right",right:"left",bottom:"top",top:"bottom"},bCe={start:"end",end:"start"};function l8(t,e,r){return xi(t,Jc(e,r))}function ka(t,e){return typeof t=="function"?t(e):t}function Aa(t){return t.split("-")[0]}function ch(t){return t.split("-")[1]}function P9(t){return t==="x"?"y":"x"}function I9(t){return t==="y"?"height":"width"}function lh(t){return["top","bottom"].includes(Aa(t))?"y":"x"}function T9(t){return P9(lh(t))}function xCe(t,e,r){r===void 0&&(r=!1);const n=ch(t),i=T9(t),s=I9(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Ag(o)),[o,Ag(o)]}function wCe(t){const e=Ag(t);return[u8(t),e,u8(e)]}function u8(t){return t.replace(/start|end/g,e=>bCe[e])}function ECe(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function CCe(t,e,r,n){const i=ch(t);let s=ECe(Aa(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(u8)))),s}function Ag(t){return t.replace(/left|right|bottom|top/g,e=>gCe[e])}function SCe(t){return{top:0,right:0,bottom:0,left:0,...t}}function Sq(t){return typeof t!="number"?SCe(t):{top:t,right:t,bottom:t,left:t}}function _g(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function vI(t,e,r){let{reference:n,floating:i}=t;const s=lh(e),o=T9(e),a=I9(o),c=Aa(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(ch(e)){case"start":h[o]-=d*(r&&l?-1:1);break;case"end":h[o]+=d*(r&&l?-1:1);break}return h}const kCe=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=vI(l,n,c),d=n,h={},p=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=ka(t,e)||{};if(l==null)return{};const f=Sq(u),d={x:r,y:n},h=T9(i),p=I9(h),m=await o.getDimensions(l),v=h==="y",y=v?"top":"left",b=v?"bottom":"right",E=v?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[h]-d[h]-s.floating[p],P=d[h]-s.reference[h],M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let L=M?M[E]:0;(!L||!await(o.isElement==null?void 0:o.isElement(M)))&&(L=a.floating[E]||s.floating[p]);const j=S/2-P/2,H=L/2-m[p]/2-1,K=Jc(f[y],H),Q=Jc(f[b],H),Y=K,F=L-m[p]-Q,w=L/2-m[p]/2+j,k=l8(Y,w,F),R=!c.arrow&&ch(i)!=null&&w!==k&&s.reference[p]/2-(wY<=0)){var H,K;const Y=(((H=s.flip)==null?void 0:H.index)||0)+1,F=P[Y];if(F)return{data:{index:Y,overflows:j},reset:{placement:F}};let w=(K=j.filter(k=>k.overflows[0]<=0).sort((k,R)=>k.overflows[1]-R.overflows[1])[0])==null?void 0:K.placement;if(!w)switch(h){case"bestFit":{var Q;const k=(Q=j.map(R=>[R.placement,R.overflows.filter(N=>N>0).reduce((N,A)=>N+A,0)]).sort((R,N)=>R[1]-N[1])[0])==null?void 0:Q[0];k&&(w=k);break}case"initialPlacement":w=a;break}if(i!==w)return{reset:{placement:w}}}return{}}}};function yI(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function gI(t){return yCe.some(e=>t[e]>=0)}const PCe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=ka(t,e);switch(n){case"referenceHidden":{const s=await U1(e,{...i,elementContext:"reference"}),o=yI(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:gI(o)}}}case"escaped":{const s=await U1(e,{...i,altBoundary:!0}),o=yI(s,r.floating);return{data:{escapedOffsets:o,escaped:gI(o)}}}default:return{}}}}};async function ICe(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Aa(r),a=ch(r),c=lh(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=ka(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const TCe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await ICe(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},OCe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:v=>{let{x:y,y:b}=v;return{x:y,y:b}}},...c}=ka(t,e),l={x:r,y:n},u=await U1(e,c),f=lh(Aa(i)),d=P9(f);let h=l[d],p=l[f];if(s){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=h+u[v],E=h-u[y];h=l8(b,h,E)}if(o){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=p+u[v],E=p-u[y];p=l8(b,p,E)}const m=a.fn({...e,[d]:h,[f]:p});return{...m,data:{x:m.x-r,y:m.y-n}}}}},RCe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=ka(t,e),u={x:r,y:n},f=lh(i),d=P9(f);let h=u[d],p=u[f];const m=ka(a,e),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const E=d==="y"?"height":"width",S=s.reference[d]-s.floating[E]+v.mainAxis,P=s.reference[d]+s.reference[E]-v.mainAxis;hP&&(h=P)}if(l){var y,b;const E=d==="y"?"width":"height",S=["top","left"].includes(Aa(i)),P=s.reference[f]-s.floating[E]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),M=s.reference[f]+s.reference[E]+(S?0:((b=o.offset)==null?void 0:b[f])||0)-(S?v.crossAxis:0);pM&&(p=M)}return{[d]:h,[f]:p}}}},$Ce=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=ka(t,e),c=await U1(e,a),l=Aa(r),u=ch(r),f=lh(r)==="y",{width:d,height:h}=n.floating;let p,m;l==="top"||l==="bottom"?(p=l,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=l,p=u==="end"?"top":"bottom");const v=h-c[p],y=d-c[m],b=!e.middlewareData.shift;let E=v,S=y;if(f){const M=d-c.left-c.right;S=u||b?Jc(y,M):M}else{const M=h-c.top-c.bottom;E=u||b?Jc(v,M):M}if(b&&!u){const M=xi(c.left,0),L=xi(c.right,0),j=xi(c.top,0),H=xi(c.bottom,0);f?S=d-2*(M!==0||L!==0?M+L:xi(c.left,c.right)):E=h-2*(j!==0||H!==0?j+H:xi(c.top,c.bottom))}await o({...e,availableWidth:S,availableHeight:E});const P=await i.getDimensions(s.floating);return d!==P.width||h!==P.height?{reset:{rects:!0}}:{}}}};function Zc(t){return kq(t)?(t.nodeName||"").toLowerCase():"#document"}function Si(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ba(t){var e;return(e=(kq(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function kq(t){return t instanceof Node||t instanceof Si(t).Node}function _a(t){return t instanceof Element||t instanceof Si(t).Element}function To(t){return t instanceof HTMLElement||t instanceof Si(t).HTMLElement}function bI(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Si(t).ShadowRoot}function $p(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=as(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function MCe(t){return["table","td","th"].includes(Zc(t))}function O9(t){const e=R9(),r=as(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function NCe(t){let e=Od(t);for(;To(e)&&!R2(e);){if(O9(e))return e;e=Od(e)}return null}function R9(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function R2(t){return["html","body","#document"].includes(Zc(t))}function as(t){return Si(t).getComputedStyle(t)}function $2(t){return _a(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Od(t){if(Zc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||bI(t)&&t.host||Ba(t);return bI(e)?e.host:e}function Aq(t){const e=Od(t);return R2(e)?t.ownerDocument?t.ownerDocument.body:t.body:To(e)&&$p(e)?e:Aq(e)}function z1(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=Aq(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=Si(i);return s?e.concat(o,o.visualViewport||[],$p(i)?i:[],o.frameElement&&r?z1(o.frameElement):[]):e.concat(i,z1(i,[],r))}function _q(t){const e=as(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=To(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=kg(r)!==s||kg(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function $9(t){return _a(t)?t:t.contextElement}function td(t){const e=$9(t);if(!To(e))return Xc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=_q(e);let o=(s?kg(r.width):r.width)/n,a=(s?kg(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const DCe=Xc(0);function Pq(t){const e=Si(t);return!R9()||!e.visualViewport?DCe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function LCe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Si(t)?!1:e}function Cu(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=$9(t);let o=Xc(1);e&&(n?_a(n)&&(o=td(n)):o=td(t));const a=LCe(s,r,n)?Pq(s):Xc(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=Si(s),h=n&&_a(n)?Si(n):n;let p=d,m=p.frameElement;for(;m&&n&&h!==p;){const v=td(m),y=m.getBoundingClientRect(),b=as(m),E=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,S=y.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=E,l+=S,p=Si(m),m=p.frameElement}}return _g({width:u,height:f,x:c,y:l})}const jCe=[":popover-open",":modal"];function Iq(t){return jCe.some(e=>{try{return t.matches(e)}catch{return!1}})}function BCe(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const s=i==="fixed",o=Ba(n),a=e?Iq(e.floating):!1;if(n===o||a&&s)return r;let c={scrollLeft:0,scrollTop:0},l=Xc(1);const u=Xc(0),f=To(n);if((f||!f&&!s)&&((Zc(n)!=="body"||$p(o))&&(c=$2(n)),To(n))){const d=Cu(n);l=td(n),u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop}return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x,y:r.y*l.y-c.scrollTop*l.y+u.y}}function FCe(t){return Array.from(t.getClientRects())}function Tq(t){return Cu(Ba(t)).left+$2(t).scrollLeft}function UCe(t){const e=Ba(t),r=$2(t),n=t.ownerDocument.body,i=xi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=xi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Tq(t);const a=-r.scrollTop;return as(n).direction==="rtl"&&(o+=xi(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function zCe(t,e){const r=Si(t),n=Ba(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=R9();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function qCe(t,e){const r=Cu(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=To(t)?td(t):Xc(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function xI(t,e,r){let n;if(e==="viewport")n=zCe(t,r);else if(e==="document")n=UCe(Ba(t));else if(_a(e))n=qCe(e,r);else{const i=Pq(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return _g(n)}function Oq(t,e){const r=Od(t);return r===e||!_a(r)||R2(r)?!1:as(r).position==="fixed"||Oq(r,e)}function WCe(t,e){const r=e.get(t);if(r)return r;let n=z1(t,[],!1).filter(a=>_a(a)&&Zc(a)!=="body"),i=null;const s=as(t).position==="fixed";let o=s?Od(t):t;for(;_a(o)&&!R2(o);){const a=as(o),c=O9(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||$p(o)&&!c&&Oq(t,o))?n=n.filter(u=>u!==o):i=a,o=Od(o)}return e.set(t,n),n}function HCe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?WCe(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=xI(e,u,i);return l.top=xi(f.top,l.top),l.right=Jc(f.right,l.right),l.bottom=Jc(f.bottom,l.bottom),l.left=xi(f.left,l.left),l},xI(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function VCe(t){const{width:e,height:r}=_q(t);return{width:e,height:r}}function GCe(t,e,r){const n=To(e),i=Ba(e),s=r==="fixed",o=Cu(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=Xc(0);if(n||!n&&!s)if((Zc(e)!=="body"||$p(i))&&(a=$2(e)),n){const f=Cu(e,!0,s,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=Tq(i));const l=o.left+a.scrollLeft-c.x,u=o.top+a.scrollTop-c.y;return{x:l,y:u,width:o.width,height:o.height}}function wI(t,e){return!To(t)||as(t).position==="fixed"?null:e?e(t):t.offsetParent}function Rq(t,e){const r=Si(t);if(!To(t)||Iq(t))return r;let n=wI(t,e);for(;n&&MCe(n)&&as(n).position==="static";)n=wI(n,e);return n&&(Zc(n)==="html"||Zc(n)==="body"&&as(n).position==="static"&&!O9(n))?r:n||NCe(t)||r}const KCe=async function(t){const e=this.getOffsetParent||Rq,r=this.getDimensions;return{reference:GCe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await r(t.floating)}}};function QCe(t){return as(t).direction==="rtl"}const YCe={convertOffsetParentRelativeRectToViewportRelativeRect:BCe,getDocumentElement:Ba,getClippingRect:HCe,getOffsetParent:Rq,getElementRects:KCe,getClientRects:FCe,getDimensions:VCe,getScale:td,isElement:_a,isRTL:QCe};function JCe(t,e){let r=null,n;const i=Ba(t);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=Dm(u),p=Dm(i.clientWidth-(l+f)),m=Dm(i.clientHeight-(u+d)),v=Dm(l),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:xi(0,Jc(1,c))||1};let E=!0;function S(P){const M=P[0].intersectionRatio;if(M!==c){if(!E)return o();M?o(!1,M):n=setTimeout(()=>{o(!1,1e-7)},100)}E=!1}try{r=new IntersectionObserver(S,{...b,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,b)}r.observe(t)}return o(!0),s}function XCe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=$9(t),u=i||s?[...l?z1(l):[],...z1(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const f=l&&a?JCe(l,r):null;let d=-1,h=null;o&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var E;(E=h)==null||E.observe(e)})),r()}),l&&!c&&h.observe(l),h.observe(e));let p,m=c?Cu(t):null;c&&v();function v(){const y=Cu(t);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&r(),m=y,p=requestAnimationFrame(v)}return r(),()=>{var y;u.forEach(b=>{i&&b.removeEventListener("scroll",r),s&&b.removeEventListener("resize",r)}),f==null||f(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const ZCe=OCe,e4e=_Ce,t4e=$Ce,r4e=PCe,EI=ACe,n4e=RCe,i4e=(t,e,r)=>{const n=new Map,i={platform:YCe,...r},s={...i.platform,_c:n};return kCe(t,e,{...i,platform:s})},s4e=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?EI({element:n.current,padding:i}).fn(r):{}:n?EI({element:n,padding:i}).fn(r):{}}}};var Iv=typeof document<"u"?x.useLayoutEffect:x.useEffect;function Pg(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Pg(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!Pg(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function $q(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function CI(t,e){const r=$q(t);return Math.round(e*r)/r}function SI(t){const e=x.useRef(t);return Iv(()=>{e.current=t}),e}function o4e(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=x.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=x.useState(n);Pg(d,n)||h(n);const[p,m]=x.useState(null),[v,y]=x.useState(null),b=x.useCallback(N=>{N!==M.current&&(M.current=N,m(N))},[]),E=x.useCallback(N=>{N!==L.current&&(L.current=N,y(N))},[]),S=s||p,P=o||v,M=x.useRef(null),L=x.useRef(null),j=x.useRef(u),H=c!=null,K=SI(c),Q=SI(i),Y=x.useCallback(()=>{if(!M.current||!L.current)return;const N={placement:e,strategy:r,middleware:d};Q.current&&(N.platform=Q.current),i4e(M.current,L.current,N).then(A=>{const O={...A,isPositioned:!0};F.current&&!Pg(j.current,O)&&(j.current=O,zs.flushSync(()=>{f(O)}))})},[d,e,r,Q]);Iv(()=>{l===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[l]);const F=x.useRef(!1);Iv(()=>(F.current=!0,()=>{F.current=!1}),[]),Iv(()=>{if(S&&(M.current=S),P&&(L.current=P),S&&P){if(K.current)return K.current(S,P,Y);Y()}},[S,P,Y,K,H]);const w=x.useMemo(()=>({reference:M,floating:L,setReference:b,setFloating:E}),[b,E]),k=x.useMemo(()=>({reference:S,floating:P}),[S,P]),R=x.useMemo(()=>{const N={position:r,left:0,top:0};if(!k.floating)return N;const A=CI(k.floating,u.x),O=CI(k.floating,u.y);return a?{...N,transform:"translate("+A+"px, "+O+"px)",...$q(k.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:A,top:O}},[r,a,k.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:Y,refs:w,elements:k,floatingStyles:R}),[u,Y,w,k,R])}function a4e(t){const[e,r]=x.useState(void 0);return Td(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}const Mq="Popper",[Nq,Dq]=wq(Mq),[c4e,Lq]=Nq(Mq),l4e=t=>{const{__scopePopper:e,children:r}=t,[n,i]=x.useState(null);return x.createElement(c4e,{scope:e,anchor:n,onAnchorChange:i},r)},u4e="PopperAnchor",f4e=x.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=Lq(u4e,r),o=x.useRef(null),a=Lu(e,o);return x.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:x.createElement(Rp.div,un({},i,{ref:a}))}),jq="PopperContent",[d4e,R_e]=Nq(jq),h4e=x.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:m=0,avoidCollisions:v=!0,collisionBoundary:y=[],collisionPadding:b=0,sticky:E="partial",hideWhenDetached:S=!1,updatePositionStrategy:P="optimized",onPlaced:M,...L}=t,j=Lq(jq,u),[H,K]=x.useState(null),Q=Lu(e,ve=>K(ve)),[Y,F]=x.useState(null),w=a4e(Y),k=(r=w==null?void 0:w.width)!==null&&r!==void 0?r:0,R=(n=w==null?void 0:w.height)!==null&&n!==void 0?n:0,N=f+(h!=="center"?"-"+h:""),A=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},O=Array.isArray(y)?y:[y],B=O.length>0,I={padding:A,boundary:O.filter(p4e),altBoundary:B},{refs:C,floatingStyles:D,placement:z,isPositioned:_,middlewareData:W}=o4e({strategy:"fixed",placement:N,whileElementsMounted:(...ve)=>XCe(...ve,{animationFrame:P==="always"}),elements:{reference:j.anchor},middleware:[TCe({mainAxis:d+R,alignmentAxis:p}),v&&ZCe({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?n4e():void 0,...I}),v&&e4e({...I}),t4e({...I,apply:({elements:ve,rects:$e,availableWidth:ge,availableHeight:Ee})=>{const{width:Ue,height:Ke}=$e.reference,Ye=ve.floating.style;Ye.setProperty("--radix-popper-available-width",`${ge}px`),Ye.setProperty("--radix-popper-available-height",`${Ee}px`),Ye.setProperty("--radix-popper-anchor-width",`${Ue}px`),Ye.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),Y&&s4e({element:Y,padding:m}),m4e({arrowWidth:k,arrowHeight:R}),S&&r4e({strategy:"referenceHidden",...I})]}),[G,J]=Bq(z),ee=Yc(M);Td(()=>{_&&(ee==null||ee())},[_,ee]);const se=(i=W.arrow)===null||i===void 0?void 0:i.x,ie=(s=W.arrow)===null||s===void 0?void 0:s.y,oe=((o=W.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[be,he]=x.useState();return Td(()=>{H&&he(window.getComputedStyle(H).zIndex)},[H]),x.createElement("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:_?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(a=W.transformOrigin)===null||a===void 0?void 0:a.x,(c=W.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},x.createElement(d4e,{scope:u,placedSide:G,onArrowChange:F,arrowX:se,arrowY:ie,shouldHideArrow:oe},x.createElement(Rp.div,un({"data-side":G,"data-align":J},L,{ref:Q,style:{...L.style,animation:_?void 0:"none",opacity:(l=W.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function p4e(t){return t!==null}const m4e=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,h=f?0:t.arrowHeight,[p,m]=Bq(a),v={start:"0%",center:"50%",end:"100%"}[m],y=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,b=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+h/2;let E="",S="";return p==="bottom"?(E=f?v:`${y}px`,S=`${-h}px`):p==="top"?(E=f?v:`${y}px`,S=`${c.floating.height+h}px`):p==="right"?(E=`${-h}px`,S=f?v:`${b}px`):p==="left"&&(E=`${c.floating.width+h}px`,S=f?v:`${b}px`),{data:{x:E,y:S}}}});function Bq(t){const[e,r="center"]=t.split("-");return[e,r]}const v4e=l4e,Fq=f4e,y4e=h4e;function g4e(t,e){return x.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const Uq=t=>{const{present:e,children:r}=t,n=b4e(e),i=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),s=Lu(n.ref,i.ref);return typeof r=="function"||n.isPresent?x.cloneElement(i,{ref:s}):null};Uq.displayName="Presence";function b4e(t){const[e,r]=x.useState(),n=x.useRef({}),i=x.useRef(t),s=x.useRef("none"),o=t?"mounted":"unmounted",[a,c]=g4e(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const l=Lm(n.current);s.current=a==="mounted"?l:"none"},[a]),Td(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,h=Lm(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Td(()=>{if(e){const l=f=>{const h=Lm(n.current).includes(f.animationName);f.target===e&&h&&zs.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=Lm(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:x.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function Lm(t){return(t==null?void 0:t.animationName)||"none"}function x4e({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=w4e({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Yc(r),c=x.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function w4e({defaultProp:t,onChange:e}){const r=x.useState(t),[n]=r,i=x.useRef(n),s=Yc(e);return x.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}var E4e=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ef=new WeakMap,jm=new WeakMap,Bm={},Gw=0,zq=function(t){return t&&(t.host||zq(t.parentNode))},C4e=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=zq(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},S4e=function(t,e,r,n){var i=C4e(e,Array.isArray(t)?t:[t]);Bm[r]||(Bm[r]=new WeakMap);var s=Bm[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var h=d.getAttribute(n),p=h!==null&&h!=="false",m=(ef.get(d)||0)+1,v=(s.get(d)||0)+1;ef.set(d,m),s.set(d,v),o.push(d),m===1&&p&&jm.set(d,!0),v===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}})};return u(e),a.clear(),Gw++,function(){o.forEach(function(f){var d=ef.get(f)-1,h=s.get(f)-1;ef.set(f,d),s.set(f,h),d||(jm.has(f)||f.removeAttribute(n),jm.delete(f)),h||f.removeAttribute(r)}),Gw--,Gw||(ef=new WeakMap,ef=new WeakMap,jm=new WeakMap,Bm={})}},k4e=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||E4e(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),S4e(n,i,r,"aria-hidden")):function(){return null}},Tv="right-scroll-bar-position",Ov="width-before-scroll-bar",A4e="with-scroll-bars-hidden",_4e="--removed-body-scroll-bar-size";function Kw(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function P4e(t,e){var r=x.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=e,r.facade}var kI=new WeakMap;function I4e(t,e){var r=P4e(e||null,function(n){return t.forEach(function(i){return Kw(i,n)})});return x.useLayoutEffect(function(){var n=kI.get(r);if(n){var i=new Set(n),s=new Set(t),o=r.current;i.forEach(function(a){s.has(a)||Kw(a,null)}),s.forEach(function(a){i.has(a)||Kw(a,o)})}kI.set(r,t)},[t]),r}function T4e(t){return t}function O4e(t,e){e===void 0&&(e=T4e);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(s){var o=e(s,n);return r.push(o),function(){r=r.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(n=!0;r.length;){var o=r;r=[],o.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var o=[];if(r.length){var a=r;r=[],a.forEach(s),o=r}var c=function(){var u=o;o=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),r}}}};return i}function R4e(t){t===void 0&&(t={});var e=O4e(null);return e.options=Qi({async:!0,ssr:!1},t),e}var qq=function(t){var e=t.sideCar,r=Nb(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Qi({},r))};qq.isSideCarExport=!0;function $4e(t,e){return t.useMedium(e),qq}var Wq=R4e(),Qw=function(){},M2=x.forwardRef(function(t,e){var r=x.useRef(null),n=x.useState({onScrollCapture:Qw,onWheelCapture:Qw,onTouchMoveCapture:Qw}),i=n[0],s=n[1],o=t.forwardProps,a=t.children,c=t.className,l=t.removeScrollBar,u=t.enabled,f=t.shards,d=t.sideCar,h=t.noIsolation,p=t.inert,m=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,b=Nb(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),E=d,S=I4e([r,e]),P=Qi(Qi({},b),i);return x.createElement(x.Fragment,null,u&&x.createElement(E,{sideCar:Wq,removeScrollBar:l,shards:f,noIsolation:h,inert:p,setCallbacks:s,allowPinchZoom:!!m,lockRef:r}),o?x.cloneElement(x.Children.only(a),Qi(Qi({},P),{ref:S})):x.createElement(y,Qi({},P,{className:c,ref:S}),a))});M2.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};M2.classNames={fullWidth:Ov,zeroRight:Tv};var M4e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function N4e(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=M4e();return e&&t.setAttribute("nonce",e),t}function D4e(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function L4e(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var j4e=function(){var t=0,e=null;return{add:function(r){t==0&&(e=N4e())&&(D4e(e,r),L4e(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},B4e=function(){var t=j4e();return function(e,r){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Hq=function(){var t=B4e(),e=function(r){var n=r.styles,i=r.dynamic;return t(n,i),null};return e},F4e={left:0,top:0,right:0,gap:0},Yw=function(t){return parseInt(t||"",10)||0},U4e=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Yw(r),Yw(n),Yw(i)]},z4e=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return F4e;var e=U4e(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},q4e=Hq(),W4e=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` - .`.concat(A4e,` { + */var Tz={L:Af.QrCode.Ecc.LOW,M:Af.QrCode.Ecc.MEDIUM,Q:Af.QrCode.Ecc.QUARTILE,H:Af.QrCode.Ecc.HIGH},Oz=128,Rz="L",$z="#FFFFFF",Mz="#000000",Nz=!1,l9=4,m8e=.1;function Dz(t,e=0){const r=[];return t.forEach(function(n,i){let s=null;n.forEach(function(o,a){if(!o&&s!==null){r.push(`M${s+e} ${i+e}h${a-s}v1H${s+e}z`),s=null;return}if(a===n.length-1){if(!o)return;s===null?r.push(`M${a+e},${i+e} h1v1H${a+e}z`):r.push(`M${s+e},${i+e} h${a+1-s}v1H${s+e}z`);return}o&&s===null&&(s=a)})}),r.join("")}function Lz(t,e){return t.slice().map((r,n)=>n=e.y+e.h?r:r.map((i,s)=>s=e.x+e.w?i:!1))}function jz(t,e,r,n){if(n==null)return null;const i=r?l9:0,s=t.length+i*2,o=Math.floor(e*m8e),a=s/e,c=(n.width||o)*a,l=(n.height||o)*a,u=n.x==null?t.length/2-c/2:n.x*a,f=n.y==null?t.length/2-l/2:n.y*a;let d=null;if(n.excavate){let h=Math.floor(u),p=Math.floor(f),m=Math.ceil(c+u-h),v=Math.ceil(l+f-p);d={x:h,y:p,w:m,h:v}}return{x:u,y:f,h:l,w:c,excavation:d}}var v8e=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function y8e(t){const e=t,{value:r,size:n=Oz,level:i=Rz,bgColor:s=$z,fgColor:o=Mz,includeMargin:a=Nz,style:c,imageSettings:l}=e,u=c9(e,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),f=l==null?void 0:l.src,d=w.useRef(null),h=w.useRef(null),[p,m]=w.useState(!1);w.useEffect(()=>{if(d.current!=null){const b=d.current,E=b.getContext("2d");if(!E)return;let S=Af.QrCode.encodeText(r,Tz[i]).getModules();const P=a?l9:0,M=S.length+P*2,L=jz(S,n,a,l),j=h.current,H=L!=null&&j!==null&&j.complete&&j.naturalHeight!==0&&j.naturalWidth!==0;H&&L.excavation!=null&&(S=Lz(S,L.excavation));const K=window.devicePixelRatio||1;b.height=b.width=n*K;const Q=n/M*K;E.scale(Q,Q),E.fillStyle=s,E.fillRect(0,0,M,M),E.fillStyle=o,v8e?E.fill(new Path2D(Dz(S,P))):S.forEach(function(Y,F){Y.forEach(function(x,k){x&&E.fillRect(k+P,F+P,1,1)})}),H&&E.drawImage(j,L.x+P,L.y+P,L.w,L.h)}}),w.useEffect(()=>{m(!1)},[f]);const v=I1({height:n,width:n},c);let y=null;return f!=null&&(y=g.createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{m(!0)},ref:h})),g.createElement(g.Fragment,null,g.createElement("canvas",I1({style:v,height:n,width:n,ref:d},u)),y)}function g8e(t){const e=t,{value:r,size:n=Oz,level:i=Rz,bgColor:s=$z,fgColor:o=Mz,includeMargin:a=Nz,imageSettings:c}=e,l=c9(e,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let u=Af.QrCode.encodeText(r,Tz[i]).getModules();const f=a?l9:0,d=u.length+f*2,h=jz(u,n,a,c);let p=null;c!=null&&h!=null&&(h.excavation!=null&&(u=Lz(u,h.excavation)),p=g.createElement("image",{xlinkHref:c.src,height:h.h,width:h.w,x:h.x+f,y:h.y+f,preserveAspectRatio:"none"}));const m=Dz(u,f);return g.createElement("svg",I1({height:n,width:n,viewBox:`0 0 ${d} ${d}`},l),g.createElement("path",{fill:s,d:`M0,0 h${d}v${d}H0z`,shapeRendering:"crispEdges"}),g.createElement("path",{fill:o,d:m,shapeRendering:"crispEdges"}),p)}var b8e=t=>{const e=t,{renderAs:r}=e,n=c9(e,["renderAs"]);return r==="svg"?g.createElement(g8e,I1({},n)):g.createElement(y8e,I1({},n))},Bz={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(mi,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",u="week",f="month",d="quarter",h="year",p="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(x){var k=["th","st","nd","rd"],R=x%100;return"["+x+(k[(R-20)%10]||k[R]||k[0])+"]"}},E=function(x,k,R){var N=String(x);return!N||N.length>=k?x:""+Array(k+1-N.length).join(R)+x},S={s:E,z:function(x){var k=-x.utcOffset(),R=Math.abs(k),N=Math.floor(R/60),A=R%60;return(k<=0?"+":"-")+E(N,2,"0")+":"+E(A,2,"0")},m:function x(k,R){if(k.date()1)return x(B[0])}else{var I=k.name;M[I]=k,A=I}return!N&&A&&(P=A),A||!N&&P},K=function(x,k){if(j(x))return x.clone();var R=typeof k=="object"?k:{};return R.date=x,R.args=arguments,new Y(R)},Q=S;Q.l=H,Q.i=j,Q.w=function(x,k){return K(x,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var Y=function(){function x(R){this.$L=H(R.locale,null,!0),this.parse(R),this.$x=this.$x||R.x||{},this[L]=!0}var k=x.prototype;return k.parse=function(R){this.$d=function(N){var A=N.date,O=N.utc;if(A===null)return new Date(NaN);if(Q.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var B=A.match(v);if(B){var I=B[2]-1||0,C=(B[7]||"0").substring(0,3);return O?new Date(Date.UTC(B[1],I,B[3]||1,B[4]||0,B[5]||0,B[6]||0,C)):new Date(B[1],I,B[3]||1,B[4]||0,B[5]||0,B[6]||0,C)}}return new Date(A)}(R),this.init()},k.init=function(){var R=this.$d;this.$y=R.getFullYear(),this.$M=R.getMonth(),this.$D=R.getDate(),this.$W=R.getDay(),this.$H=R.getHours(),this.$m=R.getMinutes(),this.$s=R.getSeconds(),this.$ms=R.getMilliseconds()},k.$utils=function(){return Q},k.isValid=function(){return this.$d.toString()!==m},k.isSame=function(R,N){var A=K(R);return this.startOf(N)<=A&&A<=this.endOf(N)},k.isAfter=function(R,N){return K(R)`Invalid value for key ${t}`,P8e=t=>`Pattern length exceeds max of ${t}.`,I8e=t=>`Missing ${t} property in key`,T8e=t=>`Property 'weight' in key '${t}' must be a positive integer`,FP=Object.prototype.hasOwnProperty;class O8e{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(n=>{let i=Wz(n);r+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,r+=i.weight}),this._keys.forEach(n=>{n.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Wz(t){let e=null,r=null,n=null,i=1,s=null;if(lo(t)||ba(t))n=t,e=UP(t),r=U3(t);else{if(!FP.call(t,"name"))throw new Error(I8e("name"));const o=t.name;if(n=o,FP.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(T8e(o));e=UP(o),r=U3(o),s=t.getFn}return{path:e,id:r,weight:i,src:n,getFn:s}}function UP(t){return ba(t)?t:t.split(".")}function U3(t){return ba(t)?t.join("."):t}function R8e(t,e){let r=[],n=!1;const i=(s,o,a)=>{if(yi(s))if(!o[a])r.push(s);else{let c=o[a];const l=s[c];if(!yi(l))return;if(a===o.length-1&&(lo(l)||Uz(l)||S8e(l)))r.push(C8e(l));else if(ba(l)){n=!0;for(let u=0,f=l.length;ut.score===e.score?t.idx{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,lo(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){const r=this.size();lo(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,n=this.size();r{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(yi(o)){if(ba(o)){let a=[];const c=[{nestedArrIndex:-1,value:o}];for(;c.length;){const{nestedArrIndex:l,value:u}=c.pop();if(yi(u))if(lo(u)&&!Iw(u)){let f={v:u,i:l,n:this.norm.get(u)};a.push(f)}else ba(u)&&u.forEach((f,d)=>{c.push({nestedArrIndex:d,value:f})})}n.$[s]=a}else if(lo(o)&&!Iw(o)){let a={v:o,n:this.norm.get(o)};n.$[s]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Hz(t,e,{getFn:r=De.getFn,fieldNormWeight:n=De.fieldNormWeight}={}){const i=new u9({getFn:r,fieldNormWeight:n});return i.setKeys(t.map(Wz)),i.setSources(e),i.create(),i}function B8e(t,{getFn:e=De.getFn,fieldNormWeight:r=De.fieldNormWeight}={}){const{keys:n,records:i}=t,s=new u9({getFn:e,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(i),s}function Sm(t,{errors:e=0,currentLocation:r=0,expectedLocation:n=0,distance:i=De.distance,ignoreLocation:s=De.ignoreLocation}={}){const o=e/t.length;if(s)return o;const a=Math.abs(n-r);return i?o+a/i:a?1:o}function F8e(t=[],e=De.minMatchCharLength){let r=[],n=-1,i=-1,s=0;for(let o=t.length;s=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}const Ol=32;function U8e(t,e,r,{location:n=De.location,distance:i=De.distance,threshold:s=De.threshold,findAllMatches:o=De.findAllMatches,minMatchCharLength:a=De.minMatchCharLength,includeMatches:c=De.includeMatches,ignoreLocation:l=De.ignoreLocation}={}){if(e.length>Ol)throw new Error(P8e(Ol));const u=e.length,f=t.length,d=Math.max(0,Math.min(n,f));let h=s,p=d;const m=a>1||c,v=m?Array(f):[];let y;for(;(y=t.indexOf(e,p))>-1;){let L=Sm(e,{currentLocation:y,expectedLocation:d,distance:i,ignoreLocation:l});if(h=Math.min(L,h),p=y+u,m){let j=0;for(;j=K;x-=1){let k=x-1,R=r[t.charAt(k)];if(m&&(v[k]=+!!R),Y[x]=(Y[x+1]<<1|1)&R,L&&(Y[x]|=(b[x+1]|b[x])<<1|1|b[x+1]),Y[x]&P&&(E=Sm(e,{errors:L,currentLocation:k,expectedLocation:d,distance:i,ignoreLocation:l}),E<=h)){if(h=E,p=k,p<=d)break;K=Math.max(1,2*d-p)}}if(Sm(e,{errors:L+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:l})>h)break;b=Y}const M={isMatch:p>=0,score:Math.max(.001,E)};if(m){const L=F8e(v,a);L.length?c&&(M.indices=L):M.isMatch=!1}return M}function z8e(t){let e={};for(let r=0,n=t.length;r{this.chunks.push({pattern:d,alphabet:z8e(d),startIndex:h})},f=this.pattern.length;if(f>Ol){let d=0;const h=f%Ol,p=f-h;for(;d{const{isMatch:y,score:b,indices:E}=U8e(e,p,m,{location:i+v,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:c,includeMatches:n,ignoreLocation:l});y&&(d=!0),f+=b,y&&E&&(u=[...u,...E])});let h={isMatch:d,score:d?f/this.chunks.length:1};return d&&n&&(h.indices=u),h}}class cl{constructor(e){this.pattern=e}static isMultiMatch(e){return zP(e,this.multiRegex)}static isSingleMatch(e){return zP(e,this.singleRegex)}search(){}}function zP(t,e){const r=t.match(e);return r?r[1]:null}class q8e extends cl{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class W8e extends cl{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class H8e extends cl{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class V8e extends cl{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class G8e extends cl{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class K8e extends cl{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class Gz extends cl{constructor(e,{location:r=De.location,threshold:n=De.threshold,distance:i=De.distance,includeMatches:s=De.includeMatches,findAllMatches:o=De.findAllMatches,minMatchCharLength:a=De.minMatchCharLength,isCaseSensitive:c=De.isCaseSensitive,ignoreLocation:l=De.ignoreLocation}={}){super(e),this._bitapSearch=new Vz(e,{location:r,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Kz extends cl{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,n;const i=[],s=this.pattern.length;for(;(n=e.indexOf(this.pattern,r))>-1;)r=n+s,i.push([n,r-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const z3=[q8e,Kz,H8e,V8e,K8e,G8e,W8e,Gz],qP=z3.length,Q8e=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Y8e="|";function J8e(t,e={}){return t.split(Y8e).map(r=>{let n=r.trim().split(Q8e).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=n.length;s!!(t[dg.AND]||t[dg.OR]),tEe=t=>!!t[H3.PATH],rEe=t=>!ba(t)&&zz(t)&&!V3(t),WP=t=>({[dg.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function Qz(t,e,{auto:r=!0}={}){const n=i=>{let s=Object.keys(i);const o=tEe(i);if(!o&&s.length>1&&!V3(i))return n(WP(i));if(rEe(i)){const c=o?i[H3.PATH]:s[0],l=o?i[H3.PATTERN]:i[c];if(!lo(l))throw new Error(_8e(c));const u={keyId:U3(c),pattern:l};return r&&(u.searcher=W3(l,e)),u}let a={children:[],operator:s[0]};return s.forEach(c=>{const l=i[c];ba(l)&&l.forEach(u=>{a.children.push(n(u))})}),a};return V3(t)||(t=WP(t)),n(t)}function nEe(t,{ignoreFieldNorm:e=De.ignoreFieldNorm}){t.forEach(r=>{let n=1;r.matches.forEach(({key:i,norm:s,score:o})=>{const a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:s))}),r.score=n})}function iEe(t,e){const r=t.matches;e.matches=[],yi(r)&&r.forEach(n=>{if(!yi(n.indices)||!n.indices.length)return;const{indices:i,value:s}=n;let o={indices:i,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function sEe(t,e){e.score=t.score}function oEe(t,e,{includeMatches:r=De.includeMatches,includeScore:n=De.includeScore}={}){const i=[];return r&&i.push(iEe),n&&i.push(sEe),t.map(s=>{const{idx:o}=s,a={item:e[o],refIndex:o};return i.length&&i.forEach(c=>{c(s,a)}),a})}class xa{constructor(e,r={},n){this.options={...De,...r},this.options.useExtendedSearch,this._keyStore=new O8e(this.options.keys),this.setCollection(e,n)}setCollection(e,r){if(this._docs=e,r&&!(r instanceof u9))throw new Error(A8e);this._myIndex=r||Hz(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){yi(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const r=[];for(let n=0,i=this._docs.length;n-1&&(c=c.slice(0,r)),oEe(c,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){const r=W3(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:s,i:o,n:a})=>{if(!yi(s))return;const{isMatch:c,score:l,indices:u}=r.searchIn(s);c&&i.push({item:s,idx:o,matches:[{score:l,value:s,norm:a,indices:u}]})}),i}_searchLogical(e){const r=Qz(e,this.options),n=(a,c,l)=>{if(!a.children){const{keyId:f,searcher:d}=a,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(c,f),searcher:d});return h&&h.length?[{idx:l,item:c,matches:h}]:[]}const u=[];for(let f=0,d=a.children.length;f{if(yi(a)){let l=n(r,a,c);l.length&&(s[c]||(s[c]={idx:c,item:a,matches:[]},o.push(s[c])),l.forEach(({matches:u})=>{s[c].matches.push(...u)}))}}),o}_searchObjectList(e){const r=W3(e,this.options),{keys:n,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!yi(o))return;let c=[];n.forEach((l,u)=>{c.push(...this._findMatches({key:l,value:o[u],searcher:r}))}),c.length&&s.push({idx:a,item:o,matches:c})}),s}_findMatches({key:e,value:r,searcher:n}){if(!yi(r))return[];let i=[];if(ba(r))r.forEach(({v:s,i:o,n:a})=>{if(!yi(s))return;const{isMatch:c,score:l,indices:u}=n.searchIn(s);c&&i.push({score:l,key:e,value:s,idx:o,norm:a,indices:u})});else{const{v:s,n:o}=r,{isMatch:a,score:c,indices:l}=n.searchIn(s);a&&i.push({score:c,key:e,value:s,norm:o,indices:l})}return i}}xa.version="6.6.2";xa.createIndex=Hz;xa.parseIndex=B8e;xa.config=De;xa.parseQuery=Qz;eEe(Z8e);function Yz(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;et.forEach(r=>cEe(r,e))}function Ou(...t){return w.useCallback(Jz(...t),t)}function Xz(t,e=[]){let r=[];function n(s,o){const a=w.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:h,...p}=f,m=(d==null?void 0:d[t][c])||a,v=w.useMemo(()=>p,Object.values(p));return w.createElement(m.Provider,{value:v},h)}function u(f,d){const h=(d==null?void 0:d[t][c])||a,p=w.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>w.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return w.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,lEe(i,...e)]}function lEe(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}const f9=w.forwardRef((t,e)=>{const{children:r,...n}=t,i=w.Children.toArray(r),s=i.find(fEe);if(s){const o=s.props.children,a=i.map(c=>c===s?w.Children.count(o)>1?w.Children.only(null):w.isValidElement(o)?o.props.children:null:c);return w.createElement(G3,ln({},n,{ref:e}),w.isValidElement(o)?w.cloneElement(o,void 0,a):null)}return w.createElement(G3,ln({},n,{ref:e}),r)});f9.displayName="Slot";const G3=w.forwardRef((t,e)=>{const{children:r,...n}=t;return w.isValidElement(r)?w.cloneElement(r,{...dEe(n,r.props),ref:e?Jz(e,r.ref):r.ref}):w.Children.count(r)>1?w.Children.only(null):null});G3.displayName="SlotClone";const uEe=({children:t})=>w.createElement(w.Fragment,null,t);function fEe(t){return w.isValidElement(t)&&t.type===uEe}function dEe(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const hEe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],wp=hEe.reduce((t,e)=>{const r=w.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?f9:e;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(a,ln({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function pEe(t,e){t&&Fs.flushSync(()=>t.dispatchEvent(e))}function Hc(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function mEe(t,e=globalThis==null?void 0:globalThis.document){const r=Hc(t);w.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const K3="dismissableLayer.update",vEe="dismissableLayer.pointerDownOutside",yEe="dismissableLayer.focusOutside";let HP;const gEe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bEe=w.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=w.useContext(gEe),[f,d]=w.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,p]=w.useState({}),m=Ou(e,j=>d(j)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),E=f?v.indexOf(f):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,P=E>=b,M=xEe(j=>{const H=j.target,K=[...u.branches].some(Q=>Q.contains(H));!P||K||(s==null||s(j),a==null||a(j),j.defaultPrevented||c==null||c())},h),L=wEe(j=>{const H=j.target;[...u.branches].some(Q=>Q.contains(H))||(o==null||o(j),a==null||a(j),j.defaultPrevented||c==null||c())},h);return mEe(j=>{E===u.layers.size-1&&(i==null||i(j),!j.defaultPrevented&&c&&(j.preventDefault(),c()))},h),w.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(HP=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),VP(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=HP)}},[f,h,n,u]),w.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),VP())},[f,u]),w.useEffect(()=>{const j=()=>p({});return document.addEventListener(K3,j),()=>document.removeEventListener(K3,j)},[]),w.createElement(wp.div,ln({},l,{ref:m,style:{pointerEvents:S?P?"auto":"none":void 0,...t.style},onFocusCapture:Gl(t.onFocusCapture,L.onFocusCapture),onBlurCapture:Gl(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Gl(t.onPointerDownCapture,M.onPointerDownCapture)}))});function xEe(t,e=globalThis==null?void 0:globalThis.document){const r=Hc(t),n=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){Zz(vEe,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function wEe(t,e=globalThis==null?void 0:globalThis.document){const r=Hc(t),n=w.useRef(!1);return w.useEffect(()=>{const i=s=>{s.target&&!n.current&&Zz(yEe,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function VP(){const t=new CustomEvent(K3);document.dispatchEvent(t)}function Zz(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?pEe(i,s):i.dispatchEvent(s)}let Tw=0;function EEe(){w.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:GP()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:GP()),Tw++,()=>{Tw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Tw--}},[])}function GP(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const Ow="focusScope.autoFocusOnMount",Rw="focusScope.autoFocusOnUnmount",KP={bubbles:!1,cancelable:!0},CEe=w.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=w.useState(null),l=Hc(i),u=Hc(s),f=w.useRef(null),d=Ou(e,m=>c(m)),h=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let m=function(E){if(h.paused||!a)return;const S=E.target;a.contains(S)?f.current=S:Ka(f.current,{select:!0})},v=function(E){if(h.paused||!a)return;const S=E.relatedTarget;S!==null&&(a.contains(S)||Ka(f.current,{select:!0}))},y=function(E){if(document.activeElement===document.body)for(const P of E)P.removedNodes.length>0&&Ka(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[n,a,h.paused]),w.useEffect(()=>{if(a){YP.add(h);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(Ow,KP);a.addEventListener(Ow,l),a.dispatchEvent(y),y.defaultPrevented||(SEe(IEe(eq(a)),{select:!0}),document.activeElement===m&&Ka(a))}return()=>{a.removeEventListener(Ow,l),setTimeout(()=>{const y=new CustomEvent(Rw,KP);a.addEventListener(Rw,u),a.dispatchEvent(y),y.defaultPrevented||Ka(m??document.body,{select:!0}),a.removeEventListener(Rw,u),YP.remove(h)},0)}}},[a,l,u,h]);const p=w.useCallback(m=>{if(!r&&!n||h.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const b=m.currentTarget,[E,S]=kEe(b);E&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&Ka(E,{select:!0})):m.shiftKey&&y===E&&(m.preventDefault(),r&&Ka(S,{select:!0})):y===b&&m.preventDefault()}},[r,n,h.paused]);return w.createElement(wp.div,ln({tabIndex:-1},o,{ref:d,onKeyDown:p}))});function SEe(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Ka(n,{select:e}),document.activeElement!==r)return}function kEe(t){const e=eq(t),r=QP(e,t),n=QP(e.reverse(),t);return[r,n]}function eq(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function QP(t,e){for(const r of t)if(!AEe(r,{upTo:e}))return r}function AEe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function _Ee(t){return t instanceof HTMLInputElement&&"select"in t}function Ka(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&_Ee(t)&&e&&t.select()}}const YP=PEe();function PEe(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=JP(t,e),t.unshift(e)},remove(e){var r;t=JP(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function JP(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function IEe(t){return t.filter(e=>e.tagName!=="A")}const wd=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},TEe=GI.useId||(()=>{});let OEe=0;function REe(t){const[e,r]=w.useState(TEe());return wd(()=>{t||r(n=>n??String(OEe++))},[t]),t||(e?`radix-${e}`:"")}const $Ee=["top","right","bottom","left"],Vc=Math.min,gi=Math.max,hg=Math.round,km=Math.floor,Gc=t=>({x:t,y:t}),MEe={left:"right",right:"left",bottom:"top",top:"bottom"},NEe={start:"end",end:"start"};function Q3(t,e,r){return gi(t,Vc(e,r))}function wa(t,e){return typeof t=="function"?t(e):t}function Ea(t){return t.split("-")[0]}function Xd(t){return t.split("-")[1]}function d9(t){return t==="x"?"y":"x"}function h9(t){return t==="y"?"height":"width"}function Zd(t){return["top","bottom"].includes(Ea(t))?"y":"x"}function p9(t){return d9(Zd(t))}function DEe(t,e,r){r===void 0&&(r=!1);const n=Xd(t),i=p9(t),s=h9(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=pg(o)),[o,pg(o)]}function LEe(t){const e=pg(t);return[Y3(t),e,Y3(e)]}function Y3(t){return t.replace(/start|end/g,e=>NEe[e])}function jEe(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function BEe(t,e,r,n){const i=Xd(t);let s=jEe(Ea(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Y3)))),s}function pg(t){return t.replace(/left|right|bottom|top/g,e=>MEe[e])}function FEe(t){return{top:0,right:0,bottom:0,left:0,...t}}function tq(t){return typeof t!="number"?FEe(t):{top:t,right:t,bottom:t,left:t}}function mg(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function XP(t,e,r){let{reference:n,floating:i}=t;const s=Zd(e),o=p9(e),a=h9(o),c=Ea(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(Xd(e)){case"start":h[o]-=d*(r&&l?-1:1);break;case"end":h[o]+=d*(r&&l?-1:1);break}return h}const UEe=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=XP(l,n,c),d=n,h={},p=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=wa(t,e)||{};if(l==null)return{};const f=tq(u),d={x:r,y:n},h=p9(i),p=h9(h),m=await o.getDimensions(l),v=h==="y",y=v?"top":"left",b=v?"bottom":"right",E=v?"clientHeight":"clientWidth",S=s.reference[p]+s.reference[h]-d[h]-s.floating[p],P=d[h]-s.reference[h],M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let L=M?M[E]:0;(!L||!await(o.isElement==null?void 0:o.isElement(M)))&&(L=a.floating[E]||s.floating[p]);const j=S/2-P/2,H=L/2-m[p]/2-1,K=Vc(f[y],H),Q=Vc(f[b],H),Y=K,F=L-m[p]-Q,x=L/2-m[p]/2+j,k=Q3(Y,x,F),R=!c.arrow&&Xd(i)!=null&&x!==k&&s.reference[p]/2-(xY<=0)){var H,K;const Y=(((H=s.flip)==null?void 0:H.index)||0)+1,F=P[Y];if(F)return{data:{index:Y,overflows:j},reset:{placement:F}};let x=(K=j.filter(k=>k.overflows[0]<=0).sort((k,R)=>k.overflows[1]-R.overflows[1])[0])==null?void 0:K.placement;if(!x)switch(h){case"bestFit":{var Q;const k=(Q=j.map(R=>[R.placement,R.overflows.filter(N=>N>0).reduce((N,A)=>N+A,0)]).sort((R,N)=>R[1]-N[1])[0])==null?void 0:Q[0];k&&(x=k);break}case"initialPlacement":x=a;break}if(i!==x)return{reset:{placement:x}}}return{}}}};function ZP(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function eI(t){return $Ee.some(e=>t[e]>=0)}const WEe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=wa(t,e);switch(n){case"referenceHidden":{const s=await T1(e,{...i,elementContext:"reference"}),o=ZP(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:eI(o)}}}case"escaped":{const s=await T1(e,{...i,altBoundary:!0}),o=ZP(s,r.floating);return{data:{escapedOffsets:o,escaped:eI(o)}}}default:return{}}}}};async function HEe(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Ea(r),a=Xd(r),c=Zd(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=wa(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const VEe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:s,placement:o,middlewareData:a}=e,c=await HEe(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},GEe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:v=>{let{x:y,y:b}=v;return{x:y,y:b}}},...c}=wa(t,e),l={x:r,y:n},u=await T1(e,c),f=Zd(Ea(i)),d=d9(f);let h=l[d],p=l[f];if(s){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=h+u[v],E=h-u[y];h=Q3(b,h,E)}if(o){const v=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=p+u[v],E=p-u[y];p=Q3(b,p,E)}const m=a.fn({...e,[d]:h,[f]:p});return{...m,data:{x:m.x-r,y:m.y-n}}}}},KEe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=wa(t,e),u={x:r,y:n},f=Zd(i),d=d9(f);let h=u[d],p=u[f];const m=wa(a,e),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const E=d==="y"?"height":"width",S=s.reference[d]-s.floating[E]+v.mainAxis,P=s.reference[d]+s.reference[E]-v.mainAxis;hP&&(h=P)}if(l){var y,b;const E=d==="y"?"width":"height",S=["top","left"].includes(Ea(i)),P=s.reference[f]-s.floating[E]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),M=s.reference[f]+s.reference[E]+(S?0:((b=o.offset)==null?void 0:b[f])||0)-(S?v.crossAxis:0);pM&&(p=M)}return{[d]:h,[f]:p}}}},QEe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=wa(t,e),c=await T1(e,a),l=Ea(r),u=Xd(r),f=Zd(r)==="y",{width:d,height:h}=n.floating;let p,m;l==="top"||l==="bottom"?(p=l,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=l,p=u==="end"?"top":"bottom");const v=h-c[p],y=d-c[m],b=!e.middlewareData.shift;let E=v,S=y;if(f){const M=d-c.left-c.right;S=u||b?Vc(y,M):M}else{const M=h-c.top-c.bottom;E=u||b?Vc(v,M):M}if(b&&!u){const M=gi(c.left,0),L=gi(c.right,0),j=gi(c.top,0),H=gi(c.bottom,0);f?S=d-2*(M!==0||L!==0?M+L:gi(c.left,c.right)):E=h-2*(j!==0||H!==0?j+H:gi(c.top,c.bottom))}await o({...e,availableWidth:S,availableHeight:E});const P=await i.getDimensions(s.floating);return d!==P.width||h!==P.height?{reset:{rects:!0}}:{}}}};function Kc(t){return rq(t)?(t.nodeName||"").toLowerCase():"#document"}function Ei(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Na(t){var e;return(e=(rq(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function rq(t){return t instanceof Node||t instanceof Ei(t).Node}function Ca(t){return t instanceof Element||t instanceof Ei(t).Element}function Po(t){return t instanceof HTMLElement||t instanceof Ei(t).HTMLElement}function tI(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ei(t).ShadowRoot}function Ep(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=ss(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function YEe(t){return["table","td","th"].includes(Kc(t))}function m9(t){const e=v9(),r=ss(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function JEe(t){let e=Ed(t);for(;Po(e)&&!x2(e);){if(m9(e))return e;e=Ed(e)}return null}function v9(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function x2(t){return["html","body","#document"].includes(Kc(t))}function ss(t){return Ei(t).getComputedStyle(t)}function w2(t){return Ca(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ed(t){if(Kc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||tI(t)&&t.host||Na(t);return tI(e)?e.host:e}function nq(t){const e=Ed(t);return x2(e)?t.ownerDocument?t.ownerDocument.body:t.body:Po(e)&&Ep(e)?e:nq(e)}function O1(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=nq(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=Ei(i);return s?e.concat(o,o.visualViewport||[],Ep(i)?i:[],o.frameElement&&r?O1(o.frameElement):[]):e.concat(i,O1(i,[],r))}function iq(t){const e=ss(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Po(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=hg(r)!==s||hg(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function y9(t){return Ca(t)?t:t.contextElement}function Gf(t){const e=y9(t);if(!Po(e))return Gc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=iq(e);let o=(s?hg(r.width):r.width)/n,a=(s?hg(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const XEe=Gc(0);function sq(t){const e=Ei(t);return!v9()||!e.visualViewport?XEe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ZEe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Ei(t)?!1:e}function vu(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=y9(t);let o=Gc(1);e&&(n?Ca(n)&&(o=Gf(n)):o=Gf(t));const a=ZEe(s,r,n)?sq(s):Gc(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=Ei(s),h=n&&Ca(n)?Ei(n):n;let p=d,m=p.frameElement;for(;m&&n&&h!==p;){const v=Gf(m),y=m.getBoundingClientRect(),b=ss(m),E=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,S=y.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=E,l+=S,p=Ei(m),m=p.frameElement}}return mg({width:u,height:f,x:c,y:l})}const eCe=[":popover-open",":modal"];function oq(t){return eCe.some(e=>{try{return t.matches(e)}catch{return!1}})}function tCe(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const s=i==="fixed",o=Na(n),a=e?oq(e.floating):!1;if(n===o||a&&s)return r;let c={scrollLeft:0,scrollTop:0},l=Gc(1);const u=Gc(0),f=Po(n);if((f||!f&&!s)&&((Kc(n)!=="body"||Ep(o))&&(c=w2(n)),Po(n))){const d=vu(n);l=Gf(n),u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop}return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x,y:r.y*l.y-c.scrollTop*l.y+u.y}}function rCe(t){return Array.from(t.getClientRects())}function aq(t){return vu(Na(t)).left+w2(t).scrollLeft}function nCe(t){const e=Na(t),r=w2(t),n=t.ownerDocument.body,i=gi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=gi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+aq(t);const a=-r.scrollTop;return ss(n).direction==="rtl"&&(o+=gi(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function iCe(t,e){const r=Ei(t),n=Na(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=v9();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function sCe(t,e){const r=vu(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=Po(t)?Gf(t):Gc(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function rI(t,e,r){let n;if(e==="viewport")n=iCe(t,r);else if(e==="document")n=nCe(Na(t));else if(Ca(e))n=sCe(e,r);else{const i=sq(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return mg(n)}function cq(t,e){const r=Ed(t);return r===e||!Ca(r)||x2(r)?!1:ss(r).position==="fixed"||cq(r,e)}function oCe(t,e){const r=e.get(t);if(r)return r;let n=O1(t,[],!1).filter(a=>Ca(a)&&Kc(a)!=="body"),i=null;const s=ss(t).position==="fixed";let o=s?Ed(t):t;for(;Ca(o)&&!x2(o);){const a=ss(o),c=m9(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ep(o)&&!c&&cq(t,o))?n=n.filter(u=>u!==o):i=a,o=Ed(o)}return e.set(t,n),n}function aCe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?oCe(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=rI(e,u,i);return l.top=gi(f.top,l.top),l.right=Vc(f.right,l.right),l.bottom=Vc(f.bottom,l.bottom),l.left=gi(f.left,l.left),l},rI(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function cCe(t){const{width:e,height:r}=iq(t);return{width:e,height:r}}function lCe(t,e,r){const n=Po(e),i=Na(e),s=r==="fixed",o=vu(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=Gc(0);if(n||!n&&!s)if((Kc(e)!=="body"||Ep(i))&&(a=w2(e)),n){const f=vu(e,!0,s,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=aq(i));const l=o.left+a.scrollLeft-c.x,u=o.top+a.scrollTop-c.y;return{x:l,y:u,width:o.width,height:o.height}}function nI(t,e){return!Po(t)||ss(t).position==="fixed"?null:e?e(t):t.offsetParent}function lq(t,e){const r=Ei(t);if(!Po(t)||oq(t))return r;let n=nI(t,e);for(;n&&YEe(n)&&ss(n).position==="static";)n=nI(n,e);return n&&(Kc(n)==="html"||Kc(n)==="body"&&ss(n).position==="static"&&!m9(n))?r:n||JEe(t)||r}const uCe=async function(t){const e=this.getOffsetParent||lq,r=this.getDimensions;return{reference:lCe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await r(t.floating)}}};function fCe(t){return ss(t).direction==="rtl"}const dCe={convertOffsetParentRelativeRectToViewportRelativeRect:tCe,getDocumentElement:Na,getClippingRect:aCe,getOffsetParent:lq,getElementRects:uCe,getClientRects:rCe,getDimensions:cCe,getScale:Gf,isElement:Ca,isRTL:fCe};function hCe(t,e){let r=null,n;const i=Na(t);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=km(u),p=km(i.clientWidth-(l+f)),m=km(i.clientHeight-(u+d)),v=km(l),b={rootMargin:-h+"px "+-p+"px "+-m+"px "+-v+"px",threshold:gi(0,Vc(1,c))||1};let E=!0;function S(P){const M=P[0].intersectionRatio;if(M!==c){if(!E)return o();M?o(!1,M):n=setTimeout(()=>{o(!1,1e-7)},100)}E=!1}try{r=new IntersectionObserver(S,{...b,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,b)}r.observe(t)}return o(!0),s}function pCe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=y9(t),u=i||s?[...l?O1(l):[],...O1(e)]:[];u.forEach(y=>{i&&y.addEventListener("scroll",r,{passive:!0}),s&&y.addEventListener("resize",r)});const f=l&&a?hCe(l,r):null;let d=-1,h=null;o&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var E;(E=h)==null||E.observe(e)})),r()}),l&&!c&&h.observe(l),h.observe(e));let p,m=c?vu(t):null;c&&v();function v(){const y=vu(t);m&&(y.x!==m.x||y.y!==m.y||y.width!==m.width||y.height!==m.height)&&r(),m=y,p=requestAnimationFrame(v)}return r(),()=>{var y;u.forEach(b=>{i&&b.removeEventListener("scroll",r),s&&b.removeEventListener("resize",r)}),f==null||f(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const mCe=GEe,vCe=qEe,yCe=QEe,gCe=WEe,iI=zEe,bCe=KEe,xCe=(t,e,r)=>{const n=new Map,i={platform:dCe,...r},s={...i.platform,_c:n};return UEe(t,e,{...i,platform:s})},wCe=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?iI({element:n.current,padding:i}).fn(r):{}:n?iI({element:n,padding:i}).fn(r):{}}}};var yv=typeof document<"u"?w.useLayoutEffect:w.useEffect;function vg(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!vg(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!vg(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function uq(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function sI(t,e){const r=uq(t);return Math.round(e*r)/r}function oI(t){const e=w.useRef(t);return yv(()=>{e.current=t}),e}function ECe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=w.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=w.useState(n);vg(d,n)||h(n);const[p,m]=w.useState(null),[v,y]=w.useState(null),b=w.useCallback(N=>{N!==M.current&&(M.current=N,m(N))},[]),E=w.useCallback(N=>{N!==L.current&&(L.current=N,y(N))},[]),S=s||p,P=o||v,M=w.useRef(null),L=w.useRef(null),j=w.useRef(u),H=c!=null,K=oI(c),Q=oI(i),Y=w.useCallback(()=>{if(!M.current||!L.current)return;const N={placement:e,strategy:r,middleware:d};Q.current&&(N.platform=Q.current),xCe(M.current,L.current,N).then(A=>{const O={...A,isPositioned:!0};F.current&&!vg(j.current,O)&&(j.current=O,Fs.flushSync(()=>{f(O)}))})},[d,e,r,Q]);yv(()=>{l===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[l]);const F=w.useRef(!1);yv(()=>(F.current=!0,()=>{F.current=!1}),[]),yv(()=>{if(S&&(M.current=S),P&&(L.current=P),S&&P){if(K.current)return K.current(S,P,Y);Y()}},[S,P,Y,K,H]);const x=w.useMemo(()=>({reference:M,floating:L,setReference:b,setFloating:E}),[b,E]),k=w.useMemo(()=>({reference:S,floating:P}),[S,P]),R=w.useMemo(()=>{const N={position:r,left:0,top:0};if(!k.floating)return N;const A=sI(k.floating,u.x),O=sI(k.floating,u.y);return a?{...N,transform:"translate("+A+"px, "+O+"px)",...uq(k.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:A,top:O}},[r,a,k.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:Y,refs:x,elements:k,floatingStyles:R}),[u,Y,x,k,R])}function CCe(t){const[e,r]=w.useState(void 0);return wd(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}const fq="Popper",[dq,hq]=Xz(fq),[SCe,pq]=dq(fq),kCe=t=>{const{__scopePopper:e,children:r}=t,[n,i]=w.useState(null);return w.createElement(SCe,{scope:e,anchor:n,onAnchorChange:i},r)},ACe="PopperAnchor",_Ce=w.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=pq(ACe,r),o=w.useRef(null),a=Ou(e,o);return w.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:w.createElement(wp.div,ln({},i,{ref:a}))}),mq="PopperContent",[PCe,WAe]=dq(mq),ICe=w.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:m=0,avoidCollisions:v=!0,collisionBoundary:y=[],collisionPadding:b=0,sticky:E="partial",hideWhenDetached:S=!1,updatePositionStrategy:P="optimized",onPlaced:M,...L}=t,j=pq(mq,u),[H,K]=w.useState(null),Q=Ou(e,ve=>K(ve)),[Y,F]=w.useState(null),x=CCe(Y),k=(r=x==null?void 0:x.width)!==null&&r!==void 0?r:0,R=(n=x==null?void 0:x.height)!==null&&n!==void 0?n:0,N=f+(h!=="center"?"-"+h:""),A=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},O=Array.isArray(y)?y:[y],B=O.length>0,I={padding:A,boundary:O.filter(TCe),altBoundary:B},{refs:C,floatingStyles:D,placement:z,isPositioned:_,middlewareData:W}=ECe({strategy:"fixed",placement:N,whileElementsMounted:(...ve)=>pCe(...ve,{animationFrame:P==="always"}),elements:{reference:j.anchor},middleware:[VEe({mainAxis:d+R,alignmentAxis:p}),v&&mCe({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?bCe():void 0,...I}),v&&vCe({...I}),yCe({...I,apply:({elements:ve,rects:$e,availableWidth:ge,availableHeight:Ee})=>{const{width:Ue,height:Ke}=$e.reference,Ye=ve.floating.style;Ye.setProperty("--radix-popper-available-width",`${ge}px`),Ye.setProperty("--radix-popper-available-height",`${Ee}px`),Ye.setProperty("--radix-popper-anchor-width",`${Ue}px`),Ye.setProperty("--radix-popper-anchor-height",`${Ke}px`)}}),Y&&wCe({element:Y,padding:m}),OCe({arrowWidth:k,arrowHeight:R}),S&&gCe({strategy:"referenceHidden",...I})]}),[G,J]=vq(z),ee=Hc(M);wd(()=>{_&&(ee==null||ee())},[_,ee]);const se=(i=W.arrow)===null||i===void 0?void 0:i.x,ie=(s=W.arrow)===null||s===void 0?void 0:s.y,oe=((o=W.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[be,he]=w.useState();return wd(()=>{H&&he(window.getComputedStyle(H).zIndex)},[H]),w.createElement("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:_?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(a=W.transformOrigin)===null||a===void 0?void 0:a.x,(c=W.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},w.createElement(PCe,{scope:u,placedSide:G,onArrowChange:F,arrowX:se,arrowY:ie,shouldHideArrow:oe},w.createElement(wp.div,ln({"data-side":G,"data-align":J},L,{ref:Q,style:{...L.style,animation:_?void 0:"none",opacity:(l=W.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function TCe(t){return t!==null}const OCe=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,h=f?0:t.arrowHeight,[p,m]=vq(a),v={start:"0%",center:"50%",end:"100%"}[m],y=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,b=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+h/2;let E="",S="";return p==="bottom"?(E=f?v:`${y}px`,S=`${-h}px`):p==="top"?(E=f?v:`${y}px`,S=`${c.floating.height+h}px`):p==="right"?(E=`${-h}px`,S=f?v:`${b}px`):p==="left"&&(E=`${c.floating.width+h}px`,S=f?v:`${b}px`),{data:{x:E,y:S}}}});function vq(t){const[e,r="center"]=t.split("-");return[e,r]}const RCe=kCe,yq=_Ce,$Ce=ICe;function MCe(t,e){return w.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const gq=t=>{const{present:e,children:r}=t,n=NCe(e),i=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),s=Ou(n.ref,i.ref);return typeof r=="function"||n.isPresent?w.cloneElement(i,{ref:s}):null};gq.displayName="Presence";function NCe(t){const[e,r]=w.useState(),n=w.useRef({}),i=w.useRef(t),s=w.useRef("none"),o=t?"mounted":"unmounted",[a,c]=MCe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const l=Am(n.current);s.current=a==="mounted"?l:"none"},[a]),wd(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,h=Am(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),wd(()=>{if(e){const l=f=>{const h=Am(n.current).includes(f.animationName);f.target===e&&h&&Fs.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=Am(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function Am(t){return(t==null?void 0:t.animationName)||"none"}function DCe({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=LCe({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Hc(r),c=w.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function LCe({defaultProp:t,onChange:e}){const r=w.useState(t),[n]=r,i=w.useRef(n),s=Hc(e);return w.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}var jCe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Vu=new WeakMap,_m=new WeakMap,Pm={},$w=0,bq=function(t){return t&&(t.host||bq(t.parentNode))},BCe=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=bq(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},FCe=function(t,e,r,n){var i=BCe(e,Array.isArray(t)?t:[t]);Pm[r]||(Pm[r]=new WeakMap);var s=Pm[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var h=d.getAttribute(n),p=h!==null&&h!=="false",m=(Vu.get(d)||0)+1,v=(s.get(d)||0)+1;Vu.set(d,m),s.set(d,v),o.push(d),m===1&&p&&_m.set(d,!0),v===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}})};return u(e),a.clear(),$w++,function(){o.forEach(function(f){var d=Vu.get(f)-1,h=s.get(f)-1;Vu.set(f,d),s.set(f,h),d||(_m.has(f)||f.removeAttribute(n),_m.delete(f)),h||f.removeAttribute(r)}),$w--,$w||(Vu=new WeakMap,Vu=new WeakMap,_m=new WeakMap,Pm={})}},UCe=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||jCe(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),FCe(n,i,r,"aria-hidden")):function(){return null}},gv="right-scroll-bar-position",bv="width-before-scroll-bar",zCe="with-scroll-bars-hidden",qCe="--removed-body-scroll-bar-size";function Mw(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function WCe(t,e){var r=w.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=e,r.facade}var aI=new WeakMap;function HCe(t,e){var r=WCe(e||null,function(n){return t.forEach(function(i){return Mw(i,n)})});return w.useLayoutEffect(function(){var n=aI.get(r);if(n){var i=new Set(n),s=new Set(t),o=r.current;i.forEach(function(a){s.has(a)||Mw(a,null)}),s.forEach(function(a){i.has(a)||Mw(a,o)})}aI.set(r,t)},[t]),r}function VCe(t){return t}function GCe(t,e){e===void 0&&(e=VCe);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(s){var o=e(s,n);return r.push(o),function(){r=r.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(n=!0;r.length;){var o=r;r=[],o.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var o=[];if(r.length){var a=r;r=[],a.forEach(s),o=r}var c=function(){var u=o;o=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),r}}}};return i}function KCe(t){t===void 0&&(t={});var e=GCe(null);return e.options=Gi({async:!0,ssr:!1},t),e}var xq=function(t){var e=t.sideCar,r=Cb(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return w.createElement(n,Gi({},r))};xq.isSideCarExport=!0;function QCe(t,e){return t.useMedium(e),xq}var wq=KCe(),Nw=function(){},E2=w.forwardRef(function(t,e){var r=w.useRef(null),n=w.useState({onScrollCapture:Nw,onWheelCapture:Nw,onTouchMoveCapture:Nw}),i=n[0],s=n[1],o=t.forwardProps,a=t.children,c=t.className,l=t.removeScrollBar,u=t.enabled,f=t.shards,d=t.sideCar,h=t.noIsolation,p=t.inert,m=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,b=Cb(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),E=d,S=HCe([r,e]),P=Gi(Gi({},b),i);return w.createElement(w.Fragment,null,u&&w.createElement(E,{sideCar:wq,removeScrollBar:l,shards:f,noIsolation:h,inert:p,setCallbacks:s,allowPinchZoom:!!m,lockRef:r}),o?w.cloneElement(w.Children.only(a),Gi(Gi({},P),{ref:S})):w.createElement(y,Gi({},P,{className:c,ref:S}),a))});E2.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};E2.classNames={fullWidth:bv,zeroRight:gv};var YCe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JCe(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=YCe();return e&&t.setAttribute("nonce",e),t}function XCe(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function ZCe(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var e4e=function(){var t=0,e=null;return{add:function(r){t==0&&(e=JCe())&&(XCe(e,r),ZCe(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},t4e=function(){var t=e4e();return function(e,r){w.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Eq=function(){var t=t4e(),e=function(r){var n=r.styles,i=r.dynamic;return t(n,i),null};return e},r4e={left:0,top:0,right:0,gap:0},Dw=function(t){return parseInt(t||"",10)||0},n4e=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Dw(r),Dw(n),Dw(i)]},i4e=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return r4e;var e=n4e(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},s4e=Eq(),o4e=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` + .`.concat(zCe,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; } @@ -285,29 +285,29 @@ Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.val `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` } - .`).concat(Tv,` { + .`).concat(gv,` { right: `).concat(a,"px ").concat(n,`; } - .`).concat(Ov,` { + .`).concat(bv,` { margin-right: `).concat(a,"px ").concat(n,`; } - .`).concat(Tv," .").concat(Tv,` { + .`).concat(gv," .").concat(gv,` { right: 0 `).concat(n,`; } - .`).concat(Ov," .").concat(Ov,` { + .`).concat(bv," .").concat(bv,` { margin-right: 0 `).concat(n,`; } body { - `).concat(_4e,": ").concat(a,`px; + `).concat(qCe,": ").concat(a,`px; } -`)},H4e=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=x.useMemo(function(){return z4e(i)},[i]);return x.createElement(q4e,{styles:W4e(s,!e,i,r?"":"!important")})},f8=!1;if(typeof window<"u")try{var Fm=Object.defineProperty({},"passive",{get:function(){return f8=!0,!0}});window.addEventListener("test",Fm,Fm),window.removeEventListener("test",Fm,Fm)}catch{f8=!1}var tf=f8?{passive:!1}:!1,V4e=function(t){return t.tagName==="TEXTAREA"},Vq=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!V4e(t)&&r[e]==="visible")},G4e=function(t){return Vq(t,"overflowY")},K4e=function(t){return Vq(t,"overflowX")},AI=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=Gq(t,r);if(n){var i=Kq(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},Q4e=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Y4e=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},Gq=function(t,e){return t==="v"?G4e(e):K4e(e)},Kq=function(t,e){return t==="v"?Q4e(e):Y4e(e)},J4e=function(t,e){return t==="h"&&e==="rtl"?-1:1},X4e=function(t,e,r,n,i){var s=J4e(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var h=Kq(t,a),p=h[0],m=h[1],v=h[2],y=m-v-s*p;(p||y)&&Gq(t,a)&&(f+=y,d+=p),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},Um=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},_I=function(t){return[t.deltaX,t.deltaY]},PI=function(t){return t&&"current"in t?t.current:t},Z4e=function(t,e){return t[0]===e[0]&&t[1]===e[1]},e9e=function(t){return` +`)},a4e=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=w.useMemo(function(){return i4e(i)},[i]);return w.createElement(s4e,{styles:o4e(s,!e,i,r?"":"!important")})},J3=!1;if(typeof window<"u")try{var Im=Object.defineProperty({},"passive",{get:function(){return J3=!0,!0}});window.addEventListener("test",Im,Im),window.removeEventListener("test",Im,Im)}catch{J3=!1}var Gu=J3?{passive:!1}:!1,c4e=function(t){return t.tagName==="TEXTAREA"},Cq=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!c4e(t)&&r[e]==="visible")},l4e=function(t){return Cq(t,"overflowY")},u4e=function(t){return Cq(t,"overflowX")},cI=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=Sq(t,r);if(n){var i=kq(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},f4e=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},d4e=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},Sq=function(t,e){return t==="v"?l4e(e):u4e(e)},kq=function(t,e){return t==="v"?f4e(e):d4e(e)},h4e=function(t,e){return t==="h"&&e==="rtl"?-1:1},p4e=function(t,e,r,n,i){var s=h4e(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var h=kq(t,a),p=h[0],m=h[1],v=h[2],y=m-v-s*p;(p||y)&&Sq(t,a)&&(f+=y,d+=p),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},Tm=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},lI=function(t){return[t.deltaX,t.deltaY]},uI=function(t){return t&&"current"in t?t.current:t},m4e=function(t,e){return t[0]===e[0]&&t[1]===e[1]},v4e=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},t9e=0,rf=[];function r9e(t){var e=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),i=x.useState(t9e++)[0],s=x.useState(function(){return Hq()})[0],o=x.useRef(t);x.useEffect(function(){o.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=a4([t.lockRef.current],(t.shards||[]).map(PI),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=x.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var y=Um(m),b=r.current,E="deltaX"in m?m.deltaX:b[0]-y[0],S="deltaY"in m?m.deltaY:b[1]-y[1],P,M=m.target,L=Math.abs(E)>Math.abs(S)?"h":"v";if("touches"in m&&L==="h"&&M.type==="range")return!1;var j=AI(L,M);if(!j)return!0;if(j?P=L:(P=L==="v"?"h":"v",j=AI(L,M)),!j)return!1;if(!n.current&&"changedTouches"in m&&(E||S)&&(n.current=P),!P)return!0;var H=n.current||P;return X4e(H,v,m,H==="h"?E:S,!0)},[]),c=x.useCallback(function(m){var v=m;if(!(!rf.length||rf[rf.length-1]!==s)){var y="deltaY"in v?_I(v):Um(v),b=e.current.filter(function(P){return P.name===v.type&&P.target===v.target&&Z4e(P.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var E=(o.current.shards||[]).map(PI).filter(Boolean).filter(function(P){return P.contains(v.target)}),S=E.length>0?a(v,E[0]):!o.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),l=x.useCallback(function(m,v,y,b){var E={name:m,delta:v,target:y,should:b};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(S){return S!==E})},1)},[]),u=x.useCallback(function(m){r.current=Um(m),n.current=void 0},[]),f=x.useCallback(function(m){l(m.type,_I(m),m.target,a(m,t.lockRef.current))},[]),d=x.useCallback(function(m){l(m.type,Um(m),m.target,a(m,t.lockRef.current))},[]);x.useEffect(function(){return rf.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,tf),document.addEventListener("touchmove",c,tf),document.addEventListener("touchstart",u,tf),function(){rf=rf.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,tf),document.removeEventListener("touchmove",c,tf),document.removeEventListener("touchstart",u,tf)}},[]);var h=t.removeScrollBar,p=t.inert;return x.createElement(x.Fragment,null,p?x.createElement(s,{styles:e9e(i)}):null,h?x.createElement(H4e,{gapMode:"margin"}):null)}const n9e=$4e(Wq,r9e);var Qq=x.forwardRef(function(t,e){return x.createElement(M2,Qi({},t,{ref:e,sideCar:n9e}))});Qq.classNames=M2.classNames;const i9e=Qq,Yq="Popover",[Jq,$_e]=wq(Yq,[Dq]),N2=Dq(),[s9e,uh]=Jq(Yq),o9e=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=N2(e),c=x.useRef(null),[l,u]=x.useState(!1),[f=!1,d]=x4e({prop:n,defaultProp:i,onChange:s});return x.createElement(v4e,a,x.createElement(s9e,{scope:e,contentId:vCe(),triggerRef:c,open:f,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:l,onCustomAnchorAdd:x.useCallback(()=>u(!0),[]),onCustomAnchorRemove:x.useCallback(()=>u(!1),[]),modal:o},r))},a9e="PopoverAnchor",c9e=x.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=uh(a9e,r),s=N2(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return x.useEffect(()=>(o(),()=>a()),[o,a]),x.createElement(Fq,un({},s,n,{ref:e}))}),l9e="PopoverTrigger",u9e=x.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=uh(l9e,r),s=N2(r),o=Lu(e,i.triggerRef),a=x.createElement(Rp.button,un({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Zq(i.open)},n,{ref:o,onClick:eu(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:x.createElement(Fq,un({asChild:!0},s),a)}),f9e="PopoverPortal",[M_e,d9e]=Jq(f9e,{forceMount:void 0}),q1="PopoverContent",h9e=x.forwardRef((t,e)=>{const r=d9e(q1,t.__scopePopover),{forceMount:n=r.forceMount,...i}=t,s=uh(q1,t.__scopePopover);return x.createElement(Uq,{present:n||s.open},s.modal?x.createElement(p9e,un({},i,{ref:e})):x.createElement(m9e,un({},i,{ref:e})))}),p9e=x.forwardRef((t,e)=>{const r=uh(q1,t.__scopePopover),n=x.useRef(null),i=Lu(e,n),s=x.useRef(!1);return x.useEffect(()=>{const o=n.current;if(o)return k4e(o)},[]),x.createElement(i9e,{as:_9,allowPinchZoom:!0},x.createElement(Xq,un({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:eu(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:eu(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:eu(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),m9e=x.forwardRef((t,e)=>{const r=uh(q1,t.__scopePopover),n=x.useRef(!1),i=x.useRef(!1);return x.createElement(Xq,un({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),Xq=x.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...f}=t,d=uh(q1,r),h=N2(r);return oCe(),x.createElement(aCe,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},x.createElement(nCe,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>d.onOpenChange(!1)},x.createElement(y4e,un({"data-state":Zq(d.open),role:"dialog",id:d.contentId},h,f,{ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function Zq(t){return t?"open":"closed"}const v9e=o9e,y9e=c9e,g9e=u9e,b9e=h9e,eW=()=>{const t=g.createContext(void 0);return[()=>{const r=g.useContext(t);if(!r)throw new Error("useGenericContext must be used within a Provider");return r},t.Provider]},[x9e,w9e]=eW(),Mp=()=>{const{setOpenWalletModal:t,openWalletModalState:e}=x9e();return{setOpenWalletModal:t,openWalletModalState:e}};function En(){return En=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}const fr=(t,e)=>t.toLowerCase()===e.toLowerCase(),M9=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},tW=t=>`0x${M9((t==null?void 0:t.substring(2))||"",8)}`;var Za=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(Za||{});const Oo=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=Za.VERY_LARGE:e<1e-10?r=Za.VERY_TINY:e<1?r=Za.FRACTION:r=Za.MIXED;let n,i;switch(r){case Za.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case Za.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case Za.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",En({notation:n},i)).format(e)},E9e=t=>t.charAt(0).toUpperCase()+t.slice(1),rW=(t,e)=>{const r=t.split(".");return r.length===1?t:`${r[0]}.${r[1].slice(0,e)}`},Ig=t=>/0x[a-fA-F0-9]{40}/.test(t),C9e=t=>t>0?Te.colors.positive:t<0?Te.colors.negative:Te.colors.text50,II=(t,e)=>{var r;const n=e.find(s=>fr(s.token.contractAddress,t.contractAddress));return n&&(n==null||(r=n.price24hChange)==null?void 0:r.value)||0},Ro=({balance:t,prices:e,decimals:r,conversionRate:n})=>{var i;let s=0;const o=e.find(f=>fr(f.token.contractAddress,t.contractAddress));if(!o)return"0.00";const a=((i=o.price)==null?void 0:i.value)||0,c=Nt(t.balance,r),l=parseFloat(c)*a;return s+=l,`${(s*n).toFixed(2)}`},nW=t=>{const e=[],r=[],n=[];t.forEach(a=>{a.contractAddress===Dt?e.push(a):a.contractType==="ERC20"?r.push(a):(a.contractType==="ERC721"||a.contractType==="ERC1155")&&n.push(a)});const i=e.sort((a,c)=>a.tokenID.localeCompare(c.tokenID)),s=r.sort((a,c)=>a.tokenID.localeCompare(c.tokenID)),o=n.sort((a,c)=>a.tokenID.localeCompare(c.tokenID));return{nativeTokens:i,erc20Tokens:s,collectibles:o}},iW=t=>{const e=[];return t==null||t.pages.forEach(r=>{e.push(...r.transactions)}),e},Tg=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=Zr(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:Dt,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:_s.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},N9=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await Zr(e),n=await r.getCoinPrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},Og=async({accountAddress:t,chainId:e,contractAddress:r},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:s=!0,verifiedOnly:o})=>{try{const{indexerClient:a}=Zr(e),c=await a.getTokenBalances(En({accountAddress:t,includeMetadata:s,metadataOptions:{verifiedOnly:o??!0}},r?{contractAddress:r}:{}));let l=(c==null?void 0:c.balances)||[];if(n&&l.length>0){const u=await N9({tokens:l.map(f=>({chainId:f.chainId,contractAddress:f.contractAddress,tokenId:f.tokenID}))});l=l.filter(f=>{const d=u==null?void 0:u.find(h=>fr(h.token.contractAddress,f.contractAddress)&&h.token.chainId===f.chainId);return f.contractType!=="ERC20"||!!d&&d.price!==null})}return i&&l.length>0&&(l=l.filter(u=>u.contractType!=="ERC721"&&u.contractType!=="ERC1155")),l}catch(a){return console.error(a),[]}},S9e=async({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})=>{try{return(await Promise.all([Tg({accountAddress:t,chainId:e}),Og({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})])).flat()}catch(i){return console.error(i),[]}},sW=async({accountAddress:t,chainId:e,collectionAddress:r,includeMetadata:n=!0,verifiedOnly:i})=>{try{const{indexerClient:s}=await Zr(e),o=await s.getTokenBalances({accountAddress:t,includeMetadata:n,contractAddress:r,metadataOptions:{verifiedOnly:i??!0}});return(o==null?void 0:o.balances)||[]}catch(s){return console.error(s),[]}},k9e=async({accountAddress:t,chainIds:e,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i})=>{let o=[];const a=r.length>0;try{if(a){const S=r.filter(j=>fr(j.contractAddress,Dt)),P=r.filter(j=>!fr(j.contractAddress,Dt)),M={},L={};S.forEach(j=>{M[j.chainId]||(M[j.chainId]=[]),M[j.chainId].push(j)}),P.forEach(j=>{L[j.chainId]||(L[j.chainId]=[]),L[j.chainId].push(j)}),o=(await Promise.all([...Object.keys(M).map(j=>Tg({accountAddress:t,chainId:Number(j)})),...Object.keys(L).map(j=>L[Number(j)].map(H=>Og({accountAddress:t,chainId:Number(j),contractAddress:H.contractAddress},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))).flat()])).flat()}else o=(await Promise.all([...e.map(S=>Tg({accountAddress:t,chainId:S})),...e.map(S=>Og({accountAddress:t,chainId:S},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))])).flat();const{nativeTokens:c,erc20Tokens:l,collectibles:u}=nW(o),f=new Promise(async(S,P)=>{if(l.length>0){const M=l.map(j=>({chainId:j.chainId,contractAddress:j.contractAddress})),L=await N9({tokens:M})||[];S(L)}else S([])}),d=u.map(async S=>a?S:await sW({accountAddress:t,chainId:S.chainId,collectionAddress:S.contractAddress,includeMetadata:!1})),h=async()=>{const S={},P={};l.forEach(L=>{P[L.chainId]?P[L.chainId].push(L):P[L.chainId]=[L]});const M=Object.keys(P).map(async L=>{const{metadataClient:j}=Zr(L),K=P[Number(L)].map(Y=>Y.contractAddress),Q=await j.getContractInfoBatch({chainID:String(L),contractAddresses:K});S[Number(L)]=Q});return await Promise.all([...M]),S},[p,m,...v]=await Promise.all([f,h(),...d]),y=l.sort((S,P)=>{var M,L;const j=p.find(A=>fr(A.token.contractAddress,S.contractAddress)),H=p.find(A=>fr(A.token.contractAddress,P.contractAddress)),K=j!=null&&j.price?j.price.value:0,Q=H!=null&&H.price?H.price.value:0,Y=(M=m[S.chainId].contractInfoMap[S.contractAddress])==null?void 0:M.decimals,F=(L=m[P.chainId].contractInfoMap[P.contractAddress])==null?void 0:L.decimals,w=Y===void 0?0:Number(Nt(S.balance,Y)),k=F===void 0?0:Number(Nt(P.balance,F)),R=w*K;return k*Q-R}),b=E8e(v.flat(),10).sort((S,P)=>S.contractAddress.localeCompare(P.contractAddress));return i?[...c.length>0?[c[0]]:[],...y.length>0?y.slice(0,11):[]]:[...c.length>0?[c[0]]:[],...y.length>0?[y[0]]:[],...b.length>0?[...b]:[]]}catch(c){return console.error(c),[]}},A9e=async({accountAddress:t,chainId:e,collectionAddress:r,tokenId:n,verifiedOnly:i})=>{const{indexerClient:s}=Zr(e);return(await s.getTokenBalances({accountAddress:t,includeMetadata:!0,contractAddress:r,tokenID:n,metadataOptions:{verifiedOnly:i??!0}})).balances[0]},_9e=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await Zr(e),n=await r.getCollectiblePrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},oW=async({chainId:t,contractAddress:e,accountAddress:r,tokenId:n,page:i})=>{const{indexerClient:s}=Zr(t);return s.getTransactionHistory({includeMetadata:!0,page:i,filter:{accountAddress:r,contractAddress:e,tokenID:n}})},P9e=async({chainIds:t,accountAddress:e})=>(await Promise.all([...t.map(s=>oW({chainId:s,accountAddress:e,page:{page:1}}))])).map(s=>s.transactions).flat().sort((s,o)=>{const a=new Date(s.timestamp).getTime();return new Date(o.timestamp).getTime()-a}),I9e=async({toCurrency:t})=>{if(t==="USD")return 1;const{apiClient:e}=Zr(137);return(await e.getExchangeRate({toCurrency:t})).exchangeRate.value},T9e=async({tokens:t})=>{const{metadataClient:e}=Zr(t.chainId);return(await e.getTokenMetadata({chainID:t.chainId.toString(),contractAddress:t.contractAddress,tokenIDs:t.tokenIds})).tokenMetadata},O9e=async t=>{const{metadataClient:e}=Zr(Number(t.chainID));return(await e.getContractInfo(t)).contractInfo},R9e=["chainIds"],$9e=["disabled"],Ii={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},L2=(t,e)=>Wn({queryKey:["balances",t,e],queryFn:async()=>{const{chainIds:r}=t,n=D2(t,R9e);return(await Promise.all(r.map(s=>S9e(En({},n,{chainId:s}),e)))).flat()},retry:!0,staleTime:Ii.oneSecond*30,enabled:t.chainIds.length>0&&!!t.accountAddress}),M9e=t=>Wn({queryKey:["collectionBalance",t],queryFn:()=>sW(t),retry:!0,staleTime:Ii.oneSecond*30,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress}),ju=t=>{let{disabled:e}=t,r=D2(t,$9e);return Wn({queryKey:["coinPrices",r],queryFn:()=>N9(r),retry:!0,staleTime:Ii.oneSecond*30,enabled:r.tokens.length>0&&!e})},N9e=(t,e)=>Wn({queryKey:["balancesAssetsSummary",t,e],queryFn:()=>k9e(t,e),retry:!0,refetchInterval:Ii.oneSecond*4,refetchOnMount:!0,staleTime:Ii.oneSecond,enabled:t.chainIds.length>0&&!!t.accountAddress}),D9e=(t,e)=>Wn({queryKey:["coinBalance",t,e],queryFn:()=>fr((t==null?void 0:t.contractAddress)||"",Dt)?Tg({accountAddress:t.accountAddress,chainId:t.chainId}).then(i=>i[0]):Og(t,e).then(n=>n[0]),retry:!0,staleTime:Ii.oneSecond*30,enabled:!!t.chainId&&!!t.accountAddress}),aW=t=>Wn({queryKey:["collectibleBalance",t],queryFn:()=>A9e(t),retry:!0,staleTime:Ii.oneSecond*30,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress&&!!t.tokenId}),cW=t=>Wn({queryKey:["useCollectiblePrices",t],queryFn:()=>_9e(t),retry:!0,staleTime:Ii.oneMinute,enabled:t.tokens.length>0}),lW=t=>Qwe({queryKey:["transactionHistory",t],queryFn:({pageParam:e})=>oW(En({},t,e?{page:{page:e}}:{page:{page:1}})),getNextPageParam:({page:e})=>{if(e.more)return(e==null?void 0:e.page)||1},retry:!0,staleTime:Ii.oneSecond*30,enabled:!!t.chainId&&!t.disabled&&!!t.accountAddress}),L9e=t=>Wn({queryKey:["transactionHistorySummary",t],queryFn:()=>P9e(t),retry:!0,staleTime:Ii.oneSecond,refetchOnMount:!0,enabled:t.chainIds.length>0&&!!t.accountAddress}),ml=t=>Wn({queryKey:["useConversionRate",t],queryFn:()=>I9e(t),retry:!0,staleTime:Ii.oneMinute*10}),uW=t=>Wn({queryKey:["useTokenMetadata",t],queryFn:()=>T9e(t),retry:!0,staleTime:Ii.oneMinute*10,enabled:!!t.tokens.chainId&&!!t.tokens.contractAddress}),j9e=t=>Wn({queryKey:["useContractInfo",t],queryFn:()=>O9e(t),retry:!0,staleTime:Ii.oneMinute*10,enabled:!!t.chainID&&!!t.contractAddress}),[B9e,F9e]=eW(),Ni=()=>{const{setHistory:t,history:e}=B9e();return{setNavigation:i=>{const s=document.getElementById("sequence-kit-wallet-content"),o=s==null?void 0:s.parentElement;o==null||o.scrollTo(0,0);const a=i.location==="home"?[]:[...e,i];t(a)},history:e,setHistory:t,goBack:()=>{const i=[...e];i.pop(),t(i)}}},U9e=[{inputs:[{internalType:"address",name:"_from",type:"address"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256[]",name:"_ids",type:"uint256[]"},{internalType:"uint256[]",name:"_amounts",type:"uint256[]"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],z9e=[{constant:!1,inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],q9e=[{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],fW=[{symbol:"USD",sign:"$",name:{message:"US Dollar"},decimals:2},{symbol:"CAD",sign:"$",name:{message:"Canadian Dollar"},decimals:2},{symbol:"GBP",sign:"£",name:{message:"British Pound Sterling"},decimals:2},{symbol:"EUR",sign:"€",name:{message:"Euro"},decimals:2},{symbol:"CNY",sign:"¥",name:{message:"Chinese Yuan"},decimals:2},{symbol:"JPY",sign:"¥",name:{message:"Japanese Yen"},decimals:2},{symbol:"KRW",sign:"₩",name:{message:"South Korean Won"},decimals:2},{symbol:"SGD",sign:"$",name:{message:"Singapore Dollar"},decimals:2},{symbol:"CHF",sign:"CHF ",name:{message:"Swiss Franc"},decimals:2},{symbol:"AUD",sign:"$",name:{message:"Australian Dollar"},decimals:2},{symbol:"NZD",sign:"$",name:{message:"New Zealand Dollar"},decimals:2},{symbol:"SEK",sign:"kr ",name:{message:"Swedish Krona"},decimals:2},{symbol:"NOK",sign:"kr ",name:{message:"Norwegian Krone"},decimals:2},{symbol:"MXN",sign:"$",name:{message:"Mexican Peso"},decimals:2},{symbol:"INR",sign:"₹",name:{message:"Indian Rupee"},decimals:2},{symbol:"ZAR",sign:"R ",name:{message:"South African Rand"},decimals:2},{symbol:"TRY",sign:"₺",name:{message:"Turkish Lira"},decimals:2},{symbol:"BRL",sign:"R$",name:{message:"Brazilian Real"},decimals:2},{symbol:"DKK",sign:"kr ",name:{message:"Danish Krone"},decimals:2},{symbol:"PLN",sign:"zł ",name:{message:"Polish Zloty"},decimals:2},{symbol:"THB",sign:"฿",name:{message:"Thai Baht"},decimals:2},{symbol:"IDR",sign:"Rp",name:{message:"Indonesian Rupiah"},decimals:2}],W9e=fW[0],Di="54px",Vn=()=>{const{chains:t}=Tt(),e=()=>{let l=!0,u=!1,f=W9e,d=t.map(h=>h.id);try{const h=localStorage.getItem(nr.Settings),p=JSON.parse(h||"{}");if((p==null?void 0:p.hideUnlistedTokens)!==void 0&&(l=p==null?void 0:p.hideUnlistedTokens),(p==null?void 0:p.hideCollectibles)!==void 0&&(u=p==null?void 0:p.hideCollectibles),(p==null?void 0:p.fiatCurrency)!==void 0&&(f=p==null?void 0:p.fiatCurrency),(p==null?void 0:p.selectedNetworks)!==void 0){let m=!0;p.selectedNetworks.forEach(v=>{t.find(y=>y.id===v)===void 0&&(m=!1)}),m&&(d=p==null?void 0:p.selectedNetworks)}}catch(h){console.error(h,"Failed to fetch settings")}return{hideUnlistedTokens:l,hideCollectibles:u,fiatCurrency:f,selectedNetworks:d}},r=e(),[n,i]=x.useState(r);return En({},n,{setFiatCurrency:l=>{const u=e(),f=En({},u,{fiatCurrency:l});localStorage.setItem(nr.Settings,JSON.stringify(f)),i(f)},setHideCollectibles:l=>{const u=e(),f=En({},u,{hideCollectibles:l});localStorage.setItem(nr.Settings,JSON.stringify(f)),i(f)},setHideUnlistedTokens:l=>{const u=e(),f=En({},u,{hideUnlistedTokens:l});localStorage.setItem(nr.Settings,JSON.stringify(f)),i(f)},setSelectedNetworks:l=>{const u=e(),f=En({},u,{selectedNetworks:l});localStorage.setItem(nr.Settings,JSON.stringify(f)),i(f)}})},H9e=({size:t=30})=>g.createElement(q,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",flexShrink:"0",style:{width:`${t}px`,height:`${t}px`}},g.createElement(ae,{variant:"large",color:"textInverse100"},"?")),el=({imageUrl:t,size:e=30})=>t?g.createElement(xr,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):g.createElement(H9e,{size:e}),TI=({networkLogoUrl:t,logoUrl:e,tokenName:r,balance:n,balanceFiat:i,priceChangePercentage:s,symbol:o})=>{const{fiatCurrency:a}=Vn(),c=s>0?"+":"";return g.createElement(q,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md",padding:"4",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"1"},g.createElement(q,{marginBottom:"1"},g.createElement(el,{size:36,imageUrl:e})),g.createElement(q,{marginBottom:"3"},g.createElement(q,{flexDirection:"row",gap:"1",justifyContent:"flex-start",alignItems:"center"},g.createElement(ae,{fontWeight:"bold",whiteSpace:"nowrap",color:"text100",style:{maxWidth:"130px",textOverflow:"ellipsis",overflow:"hidden"}},r),g.createElement(el,{size:12,imageUrl:t})),g.createElement(ae,{color:"text50",whiteSpace:"nowrap",style:{display:"block",maxWidth:"150px",textOverflow:"ellipsis",overflow:"hidden"}},`${n} ${o}`)),g.createElement(q,null,g.createElement(q,null,g.createElement(ae,{fontWeight:"bold",color:"text100"},`${a.sign}${i}`)),g.createElement(ae,{style:{color:C9e(s)}},`${c}${s.toFixed(2)}%`)))},OI=({balance:t})=>{var e;const{chains:r}=Tt(),{fiatCurrency:n}=Vn(),i=fr(t.contractAddress,Dt),s=Ir(t.chainId,r),{data:o=[],isLoading:a}=ju({tokens:[{chainId:t.chainId,contractAddress:t.contractAddress}]}),{data:c=1,isLoading:l}=ml({toCurrency:n.symbol}),{data:u,isLoading:f}=j9e({chainID:String(t.chainId),contractAddress:t.contractAddress});if(a||l||f)return g.createElement(q,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md"});if(i){const P=Ro({balance:t,prices:o,conversionRate:c,decimals:s.decimals}),M=II(t,o),L=Nt(t.balance,s.decimals),j=Oo(L);return g.createElement(TI,{networkLogoUrl:s.logoURI,logoUrl:s.logoURI,tokenName:s.name,balance:j,balanceFiat:P,priceChangePercentage:M,symbol:s.symbol})}const h=(e=u==null?void 0:u.decimals)!=null?e:18,p=Ro({balance:t,prices:o,conversionRate:c,decimals:h}),m=II(t,o),v=Nt(t.balance,h),y=Oo(v),b=(u==null?void 0:u.name)||"Unknown",E=(u==null?void 0:u.name)||"TOKEN",S=u==null?void 0:u.logoURI;return g.createElement(TI,{networkLogoUrl:s.logoURI,logoUrl:S,tokenName:b,balance:y,balanceFiat:p,priceChangePercentage:m,symbol:E})},Np=({imageUrl:t})=>g.createElement(kn,{padding:"0",aspectRatio:"1/1",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:"sm",background:"backgroundSecondary"},g.createElement(xr,{style:{height:"100%"},src:t})),V9e=({balance:t})=>{var e;const{data:r}=uW({tokens:{chainId:t.chainId,contractAddress:t.contractAddress,tokenIds:[t.tokenID]}}),n=r==null||(e=r[0])==null?void 0:e.image;return g.createElement(Np,{imageUrl:n})};Nu("packages/wallet/src/shared/Skeleton/styles.css.ts","kit");const G9e=Az({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),K9e=qn({height:"76px",backgroundColor:"#909090",animation:`${G9e} 2s ease-in-out infinite`},"skeleton");Du();const pt=({width:t="100%",height:e="100%",borderRadius:r="md",aspectRatio:n})=>g.createElement(q,{className:K9e,borderRadius:r,aspectRatio:n,style:{width:t,height:e}}),Q9e=()=>g.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${Te.space[1]}) calc(50% - ${Te.space[1]})`,gap:Te.space[2]}},Array(12).fill(null).map((t,e)=>g.createElement(q,{key:e},g.createElement(pt,{height:"100%",width:"100%",aspectRatio:"1/1"}))));Nu("packages/wallet/src/shared/styles.css.ts","kit");const wo=qn({":hover":{cursor:"pointer",opacity:"0.8",userSelect:"none"}},"clickable"),Y9e=qn({"> div":{overflowY:"scroll"}},"scrollbar"),D9=qn({},"walletContent");hs(`${D9} + button`,{backgroundColor:"transparent"});hs(`${D9} + button > svg`,{width:"20px",height:"20px"});Du();const J9e=()=>{const{address:t}=Hn(),{setNavigation:e}=Ni(),{displayedAssets:r}=$Se(),{hideUnlistedTokens:n,hideCollectibles:i,selectedNetworks:s}=Vn(),{data:o=[],isLoading:a}=N9e({accountAddress:t||"",chainIds:s,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i});if(a)return g.createElement(Q9e,null);const{nativeTokens:c,erc20Tokens:l,collectibles:u}=nW(o),f=d=>{d.contractType==="ERC1155"||d.contractType==="ERC721"?e&&e({location:"collectible-details",params:{contractAddress:d.contractAddress,chainId:d.chainId,tokenId:d.tokenID}}):d.contractType==="ERC20"?e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}}):e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}})};return g.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${Te.space[1]}) calc(50% - ${Te.space[1]})`,gap:Te.space[2]}},c.map((d,h)=>g.createElement(q,{key:h,className:wo,aspectRatio:"1/1",onClick:()=>f(d)},g.createElement(OI,{balance:d}))),l.map((d,h)=>g.createElement(q,{className:wo,key:h,aspectRatio:"1/1",onClick:()=>f(d)},g.createElement(OI,{balance:d}))),u.map((d,h)=>g.createElement(q,{className:wo,aspectRatio:"1/1",key:h,onClick:()=>f(d)},g.createElement(V9e,{balance:d}))))},qs=()=>{const[t,e]=x.useState("0px");return x.useEffect(()=>{e(navigator.userAgent.match(/chrome|chromium|crios/i)?"13px":"0px")},[]),t},X9e=()=>(qs(),g.createElement(q,{paddingX:"4",paddingBottom:"5",gap:"4",flexDirection:"column"},g.createElement(J9e,null))),Z9e=()=>{const{address:t,chain:e}=Hn(),{chains:r}=Tt(),[n,i]=x.useState(!1),s=Ir((e==null?void 0:e.id)||1,r);x.useEffect(()=>{n&&setTimeout(()=>{i(!1)},4e3)},[n]);const o=()=>{i(!0)},a=()=>{typeof window<"u"&&window.open(`https://twitter.com/intent/tweet?text=Here%20is%20my%20address%20${t}`)};return g.createElement(q,{style:{paddingTop:Di}},g.createElement(q,{padding:"5",paddingTop:"3",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4"},g.createElement(q,{marginTop:"1",width:"fit",background:"white",borderRadius:"md",alignItems:"center",justifyContent:"center",padding:"4"},g.createElement(nEe,{value:t||"",size:200,bgColor:"white",fgColor:"black","data-id":"receiveQR"})),g.createElement(q,null,g.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},g.createElement(ae,{variant:"medium",color:"text100",textAlign:"center",lineHeight:"inherit",style:{fontWeight:"700"}},"My Wallet"),g.createElement(xr,{width:"5",src:s.logoURI,alt:"icon"})),g.createElement(q,{marginTop:"2",style:{maxWidth:"180px",textAlign:"center"}},g.createElement(ae,{textAlign:"center",color:"text50",style:{fontSize:"14px",maxWidth:"180px",overflowWrap:"anywhere"}},t))),g.createElement(q,{gap:"3"},g.createElement(Yz.CopyToClipboard,{text:t||""},g.createElement(rt,{onClick:o,leftIcon:Fb,label:n?"Copied!":"Copy"})),g.createElement(rt,{onClick:a,leftIcon:yue,label:"Share"})),g.createElement(q,{justifyContent:"center",alignItems:"center",style:{maxWidth:"260px",textAlign:"center"}},g.createElement(ae,{color:"text100",variant:"small",style:{maxWidth:"260px",overflowWrap:"anywhere"}},`This is a ${s.name} address. Please only send assets on the ${s.name} network.`))))},dW=({imageUrl:t,name:e,decimals:r,balance:n,symbol:i,fiatValue:s,chainId:o,showSquareImage:a})=>{const{chains:c}=Tt(),{fiatCurrency:l}=Vn(),u=Nt(n,r),f=Oo(u),d=Ir(o,c);return g.createElement(q,{alignItems:"flex-end",justifyContent:"space-between"},g.createElement(q,{justifyContent:"space-between",alignItems:"center",gap:"2"},a?g.createElement(q,{style:{width:"40px"}},g.createElement(Np,{imageUrl:t})):g.createElement(el,{imageUrl:t,size:40}),g.createElement(q,{flexDirection:"column",alignItems:"flex-start"},g.createElement(q,{flexDirection:"row",alignItems:"center",gap:"1"},g.createElement(ae,{variant:"medium",color:"text100"},e),g.createElement(el,{imageUrl:d.logoURI,size:12})),g.createElement(ae,{color:"text50",variant:"normal"}," ",`${f} ${i} available`))),g.createElement(q,{flexDirection:"column",alignItems:"flex-end",justifyContent:"flex-end"},s&&g.createElement(ae,{variant:"normal",color:"text100"},`${l.sign}${s}`)))},e7e=({chainId:t,contractAddress:e})=>{var r,n,i,s,o;const{setNavigation:a}=Ni(),{analytics:c}=xW(),{chains:l}=Tt(),u=T2(),{address:f="",connector:d}=Hn(),h=!!(d!=null&&(r=d._wallet)!=null&&r.isSequenceBased),p=u===t,m=!p&&!h,{switchChainAsync:v}=E9(),y=x.useRef(null);Mp();const{fiatCurrency:b}=Vn(),[E,S]=x.useState("0"),[P,M]=x.useState(""),{sendTransaction:L}=w9(),[j,H]=x.useState(!1),{data:K=[],isLoading:Q}=L2({accountAddress:f,chainIds:[t],contractAddress:e},{hideUnlistedTokens:!1}),Y=Ir(t,l),F=K.find(he=>he.contractAddress===e),{data:w=[],isLoading:k}=ju({tokens:[{chainId:t,contractAddress:e}]}),{data:R=1,isLoading:N}=ml({toCurrency:b.symbol});if(Q||k||N)return null;const O=fr(e,Dt),B=O?Y.decimals:(F==null||(n=F.contractInfo)==null?void 0:n.decimals)||18,I=O?Y.name:(F==null||(i=F.contractInfo)==null?void 0:i.name)||"",C=O?Y.logoURI:F==null||(s=F.contractInfo)==null?void 0:s.logoURI,D=O?Y.symbol:(F==null||(o=F.contractInfo)==null?void 0:o.symbol)||"",z=E===""?"0":E,_=hu(z,B),W=Ro({balance:En({},F,{balance:_.toString()}),prices:w,conversionRate:R,decimals:B}),G=_.gt((F==null?void 0:F.balance)||"0"),J=_.gt(0),ee=he=>{const{value:ve}=he.target,$e=rW(ve,B);S($e)},se=()=>{var he;(he=y.current)==null||he.focus();const ve=Nt((F==null?void 0:F.balance)||0,B).toString();S(ve)},ie=async()=>{const he=await navigator.clipboard.readText();M(he)},oe=()=>{M("")},be=async he=>{!p&&h&&await v({chainId:t}),he.preventDefault();const ve=hu(z,B);if(O){var $e;c==null||c.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(d==null||($e=d._wallet)==null?void 0:$e.id)||"unknown",source:"sequence-kit/wallet"}}),H(!0),L({to:P,value:BigInt(ve.toString()),gas:null},{onSettled:(Ee,Ue)=>{Ee&&a({location:"home"}),H(!1)}})}else{var ge;c==null||c.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(d==null||(ge=d._wallet)==null?void 0:ge.id)||"unknown",source:"sequence-kit/wallet"}}),H(!0),L({to:F==null?void 0:F.contractAddress,data:new wr(z9e).encodeFunctionData("transfer",[P,ve.toHexString()]),gas:null},{onSettled:(Ee,Ue)=>{Ee&&a({location:"home"}),H(!1)}})}};return g.createElement(q,{padding:"5",paddingTop:"3",style:{marginTop:Di},gap:"2",flexDirection:"column",as:"form",onSubmit:be,pointerEvents:j?"none":"auto"},g.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},g.createElement(dW,{imageUrl:C,decimals:B,name:I,symbol:D,balance:(F==null?void 0:F.balance)||"0",fiatValue:Ro({balance:F,prices:w,conversionRate:R,decimals:B}),chainId:t}),g.createElement(oF,{ref:y,style:{fontSize:Te.fontSizes.xlarge,fontWeight:Te.fontWeights.bold},name:"amount",value:E,onChange:ee,controls:g.createElement(g.Fragment,null,g.createElement(ae,{variant:"small",color:"text50",whiteSpace:"nowrap"},`~${b.sign}${W}`),g.createElement(rt,{size:"xs",shape:"square",label:"Max",onClick:se,"data-id":"maxCoin",flexShrink:"0"}),g.createElement(ae,{fontSize:"xlarge",fontWeight:"bold",color:"text100"},D))}),G&&g.createElement(ae,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Funds")),g.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},g.createElement(ae,{fontSize:"normal",color:"text50"},"To"),Ig(P)?g.createElement(q,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:wo,onClick:oe,style:{height:"52px"}},g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},g.createElement(Ru,{address:P,style:{width:"20px"}}),g.createElement(ae,{color:"text100"},`0x${M9(P.substring(2),8)}`)),g.createElement(Tu,{size:"xs"})):g.createElement(ul,{value:P,onChange:he=>M(he.target.value),placeholder:`${Y.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:g.createElement(rt,{size:"xs",shape:"square",label:"Paste",onClick:ie,"data-id":"to-address",flexShrink:"0",leftIcon:Fb})})),m&&g.createElement(q,{marginTop:"3"},g.createElement(ae,{variant:"small",color:"negative",marginBottom:"2"},"The wallet is connected to the wrong network. Please switch network before proceeding"),g.createElement(rt,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:async()=>await v({chainId:t}),disabled:p,style:{height:"52px",borderRadius:Te.radii.md}})),g.createElement(q,{style:{height:"52px"},alignItems:"center",justifyContent:"center"},j?g.createElement(Vc,null):g.createElement(rt,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!J||!Ig(P)||G||!p&&!h,label:"Send",rightIcon:bo,style:{height:"52px",borderRadius:Te.radii.md}})))},t7e=({chainId:t,contractAddress:e,tokenId:r})=>{var n,i,s,o,a;const{setNavigation:c}=Ni(),{analytics:l}=xW(),{chains:u}=Tt(),f=T2(),{address:d="",connector:h}=Hn(),p=!!(h!=null&&(n=h._wallet)!=null&&n.isSequenceBased),m=f===t,v=!m&&!p,{switchChain:y}=E9(),b=x.useRef(null);Mp();const[E,S]=x.useState("0"),[P,M]=x.useState(""),[L,j]=x.useState(!1),{sendTransaction:H}=w9(),[K,Q]=x.useState(!1),{data:Y,isLoading:F}=aW({accountAddress:d,chainId:t,collectionAddress:e,tokenId:r,verifiedOnly:!1}),{contractType:w}=Y;x.useEffect(()=>{Y&&(w==="ERC721"?(S("1"),j(!1)):w==="ERC1155"&&(Number(Nt((Y==null?void 0:Y.balance)||0,N))>=1&&S("1"),j(!0)))},[Y]);const k=Ir(t,u);if(F)return null;const N=(Y==null||(i=Y.tokenMetadata)==null?void 0:i.decimals)||0,A=(Y==null||(s=Y.tokenMetadata)==null?void 0:s.name)||"Unknown",O=(Y==null||(o=Y.tokenMetadata)==null?void 0:o.image)||(Y==null||(a=Y.contractInfo)==null?void 0:a.logoURI)||"",B=E===""?"0":E,I=hu(B,N),C=I.gt((Y==null?void 0:Y.balance)||"0"),D=I.gt(0),z=he=>{const{value:ve}=he.target,$e=rW(ve,N);S($e)},_=()=>{var he;(he=b.current)==null||he.focus();const ve=Number(E)-1,$e=Math.max(ve,0).toString();S($e)},W=()=>{var he;(he=b.current)==null||he.focus();const ve=Number(E)+1,$e=Number(Nt((Y==null?void 0:Y.balance)||0,N)),ge=Math.min(ve,$e).toString();S(ge)},G=()=>{var he;(he=b.current)==null||he.focus();const ve=Nt((Y==null?void 0:Y.balance)||0,N).toString();S(ve)},J=async()=>{const he=await navigator.clipboard.readText();M(he)},ee=()=>{M("")},se=async he=>{var ve,$e;he.preventDefault(),!m&&p&&y({chainId:t});const ge=hu(B,N);switch(w){case"ERC721":l==null||l.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(h==null||(ve=h._wallet)==null?void 0:ve.id)||"unknown",source:"sequence-kit/wallet"}}),Q(!0),H({to:Y.contractAddress,data:new wr(q9e).encodeFunctionData("safeTransferFrom",[d,P,r]),gas:null},{onSettled:(Ee,Ue)=>{Ee&&c({location:"home"}),Q(!1)}});break;case"ERC1155":default:l==null||l.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(h==null||($e=h._wallet)==null?void 0:$e.id)||"unknown",source:"sequence-kit/wallet"}}),Q(!0),H({to:Y.contractAddress,data:new wr(U9e).encodeFunctionData("safeBatchTransferFrom",[d,P,[r],[ge.toHexString()],[]]),gas:null},{onSettled:(Ee,Ue)=>{Ee&&c({location:"home"}),Q(!1)}})}},ie=Nt((Y==null?void 0:Y.balance)||0,N).toString(),oe=Number(E)===0,be=Number(E)>=Number(ie);return g.createElement(q,{padding:"5",paddingTop:"3",style:{marginTop:Di},gap:"2",flexDirection:"column",as:"form",onSubmit:se,pointerEvents:K?"none":"auto"},g.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},g.createElement(dW,{imageUrl:O,showSquareImage:!0,decimals:N,name:A,symbol:"",balance:(Y==null?void 0:Y.balance)||"0",chainId:t}),g.createElement(oF,{ref:b,style:{fontSize:Te.fontSizes.xlarge,fontWeight:Te.fontWeights.bold},name:"amount",value:E,onChange:z,disabled:!L,controls:g.createElement(g.Fragment,null,L&&g.createElement(q,{gap:"2"},g.createElement(rt,{disabled:oe,size:"xs",onClick:_,leftIcon:xue}),g.createElement(rt,{disabled:be,size:"xs",onClick:W,leftIcon:Gle}),g.createElement(rt,{size:"xs",shape:"square",label:"Max",onClick:G,"data-id":"maxCoin",flexShrink:"0"})))}),C&&g.createElement(ae,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Balance")),g.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},g.createElement(ae,{fontSize:"normal",color:"text50"},"To"),Ig(P)?g.createElement(q,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:wo,onClick:ee,style:{height:"52px"}},g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},g.createElement(Ru,{address:P,style:{width:"20px"}}),g.createElement(ae,{color:"text100"},`0x${M9(P.substring(2),8)}`)),g.createElement(Tu,{size:"xs"})):g.createElement(ul,{value:P,onChange:he=>M(he.target.value),placeholder:`${k.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:g.createElement(rt,{size:"xs",shape:"square",label:"Paste",onClick:J,"data-id":"to-address",flexShrink:"0",leftIcon:Fb})})),v&&g.createElement(q,{marginTop:"3"},g.createElement(ae,{variant:"small",color:"negative",marginBottom:"2"},"The wallet is connected to the wrong network. Please switch network before proceeding"),g.createElement(rt,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:()=>y({chainId:t}),disabled:m,style:{height:"52px",borderRadius:Te.radii.md}})),g.createElement(q,{style:{height:"52px"},alignItems:"center",justifyContent:"center"},K?g.createElement(Vc,null):g.createElement(rt,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!D||!Ig(P)||C||!m&&!p,label:"Send",rightIcon:bo,style:{height:"52px",borderRadius:Te.radii.md}})))},r7e=({transaction:t})=>{var e;const{chains:r}=Tt(),{fiatCurrency:n}=Vn(),{setNavigation:i}=Ni(),s=()=>{i({location:"transaction-details",params:{transaction:t}})};let o=[];(e=t.transfers)==null||e.forEach(b=>{const E=b.contractAddress;o.includes(E)||o.push(E)});const{data:a=[],isLoading:c}=ju({tokens:o.map(b=>({contractAddress:b,chainId:t.chainId}))}),{data:l=1,isLoading:u}=ml({toCurrency:n.symbol}),f=c||u,{transfers:d}=t,h=Ir(t.chainId,r),p=b=>{switch(b){case yn.SEND:return g.createElement(i3,{style:{transform:"rotate(270deg)",width:"16px"}});case yn.RECEIVE:return g.createElement(i3,{style:{transform:"rotate(90deg)",width:"16px"}});case yn.UNKNOWN:default:return g.createElement(sB,{style:{width:"14px"}})}},m=b=>{switch(b){case yn.SEND:return"Sent";case yn.RECEIVE:return"Received";case yn.UNKNOWN:default:return"Transacted"}},v=(b,E,S)=>{let P="";S===yn.SEND?P="-":S===yn.RECEIVE&&(P="+");let M="text50";return S===yn.SEND?M=Te.colors.negative:S===yn.RECEIVE&&(M=Te.colors.positive),g.createElement(ae,{fontWeight:"bold",fontSize:"normal",style:{color:M}},`${P}${b} ${E}`)},y=({transfer:b,isFirstItem:E})=>{const{amounts:S}=b,P=lq(t.timestamp).format("MMM DD, YYYY");return g.createElement(q,{gap:"2",width:"full",flexDirection:"column",justifyContent:"space-between"},g.createElement(q,{flexDirection:"row",justifyContent:"space-between"},g.createElement(q,{color:"text50",gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},p(b.transferType),g.createElement(ae,{fontWeight:"medium",fontSize:"normal",color:"text100"},m(b.transferType)),g.createElement(xr,{src:h.logoURI,width:"3"})),E&&g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",fontSize:"normal",color:"text50"},P))),S.map((M,L)=>{var j,H,K,Q,Y,F;const w=Ir(t.chainId,r),k=fr(b.contractAddress,Dt),R=((j=b.contractInfo)==null?void 0:j.type)==="ERC721"||((H=b.contractInfo)==null?void 0:H.type)==="ERC1155";let N;const A=(K=b.tokenIds)==null?void 0:K[L];if(R&&A){var O;N=((O=b.tokenMetadata)==null||(O=O[A])==null?void 0:O.decimals)||0}else{var B;N=k?w.decimals:(B=b.contractInfo)==null?void 0:B.decimals}const I=Nt(M,N),C=k?w.symbol:((Q=b.contractInfo)==null?void 0:Q.symbol)||"",D=k?w.logoURI:(Y=b.contractInfo)==null?void 0:Y.logoURI,z=(F=a.find(_=>fr(_.token.contractAddress,b.contractAddress)))==null||(F=F.price)==null?void 0:F.value;return g.createElement(q,{key:L,flexDirection:"row",justifyContent:"space-between"},g.createElement(q,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},D&&g.createElement(xr,{src:D,width:"5",alt:"token logo"}),v(Oo(I),C,b.transferType)),f&&g.createElement(pt,{width:"35px",height:"20px"}),z&&g.createElement(ae,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${n.sign}${(Number(I)*z*l).toFixed(2)}`))}))};return g.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",className:wo,onClick:()=>s()},d==null?void 0:d.map((b,E)=>g.createElement(q,{key:`${t.txnHash}-${E}`,width:"full"},y({transfer:b,isFirstItem:E===0}))))},L9=()=>{const t=()=>g.createElement(q,{flexDirection:"column",gap:"2",width:"full",justifyContent:"space-between"},g.createElement(q,{flexDirection:"row",justifyContent:"space-between"},g.createElement(pt,{width:"65px",height:"20px"}),g.createElement(pt,{width:"75px",height:"17px"})),g.createElement(q,{flexDirection:"row",justifyContent:"space-between"},g.createElement(pt,{width:"120px",height:"20px"}),g.createElement(pt,{width:"35px",height:"17px"})));return g.createElement(q,{flexDirection:"column",gap:"3"},g.createElement(pt,{width:"70px",height:"17px"}),g.createElement(q,{flexDirection:"column",gap:"2"},Array(8).fill(null).map((e,r)=>g.createElement(q,{borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",background:"backgroundSecondary",key:r},t()))))},j9=({transactions:t,isLoading:e,isFetchingNextPage:r})=>{const n=[{id:"today",label:"Today"},{id:"yesterday",label:"Yesterday"},{id:"week",label:"Last Week"},{id:"month",label:"Last Month"},{id:"year",label:"Last Year"},{id:"years",label:"Past Years"}],i=x.useMemo(()=>{const a=new Date(new Date().setHours(0,0,0,0)).getTime(),c=new Date(new Date().setDate(new Date(a).getDate()-1)).getTime(),l=new Date(new Date().setDate(new Date().getDate()-7)).getTime(),u=new Date(new Date().setDate(new Date().getDate()-30)).getTime(),f=new Date(new Date().setDate(new Date().getDate()-365)).getTime(),d={today:[],yesterday:[],week:[],month:[],year:[],years:[]};return t.forEach(h=>{const p=new Date(h.timestamp).getTime();p>a?d.today.push(h):p>c?d.yesterday.push(h):p>l?d.week.push(h):p>u?d.month.push(h):p>f?d.year.push(h):d.years.push(h)}),d},[t]);if(e)return g.createElement(q,{flexDirection:"column",gap:"2"},g.createElement(L9,null));const s=({label:a})=>g.createElement(q,null,g.createElement(ae,{color:"text50",fontWeight:"medium",fontSize:"normal"},a)),o=({transactions:a})=>g.createElement(q,{flexDirection:"column",gap:"2"},a.map((c,l)=>g.createElement(q,{key:`${c.txnHash}-${l}`,flexDirection:"column",gap:"2"},g.createElement(r7e,{transaction:c}))));return g.createElement(q,{flexDirection:"column",gap:"5"},n.map(a=>{const c=i[a.id];return c.length===0?null:g.createElement(q,{key:a.id,flexDirection:"column",gap:"3"},g.createElement(s,{label:a.label}),g.createElement(o,{transactions:c}))}),t.length===0&&g.createElement(q,{flexDirection:"column",gap:"3"},g.createElement(s,{label:"History"}),g.createElement(ae,{color:"text100"},"No Recent Transaction History Found")),r&&g.createElement(q,{margin:"4",alignItems:"center",justifyContent:"center"},g.createElement(Vc,null)))},n7e=()=>{const{selectedNetworks:t}=Vn(),{address:e}=Hn();qs();const{data:r=[],isLoading:n}=L9e({accountAddress:e||"",chainIds:t});return g.createElement(q,null,g.createElement(q,{paddingX:"4",paddingBottom:"5",paddingTop:"3"},g.createElement(j9,{transactions:r,isLoading:n,isFetchingNextPage:!1})))},Rg=({balance:t})=>{var e,r;const{chains:n}=Tt(),{setNavigation:i}=Ni(),s=fr(t.contractAddress,Dt),o=Ir(t.chainId,n),a=s?o.logoURI:t==null||(e=t.contractInfo)==null?void 0:e.logoURI,c=s?o.name:(t==null||(r=t.contractInfo)==null?void 0:r.name)||"Unknown",l=()=>{var f,d;if(t.contractType==="ERC721"||t.contractType==="ERC1155")return t.balance;const h=s?o.decimals:t==null||(f=t.contractInfo)==null?void 0:f.decimals,p=Nt(t.balance,h||0),m=Oo(p),v=s?o.symbol:t==null||(d=t.contractInfo)==null?void 0:d.symbol;return`${m} ${v}`},u=()=>{const f=t.contractType==="ERC721"||t.contractType==="ERC1155";i(f?{location:"collection-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}}:{location:"coin-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}})};return g.createElement(q,{key:t.contractAddress,onClick:u,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:wo},g.createElement(q,{gap:"3",flexDirection:"row",alignItems:"center",justifyContent:"center"},g.createElement(el,{imageUrl:a,size:30}),g.createElement(q,{gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"center"},g.createElement(ae,{color:"text100",fontWeight:"bold",fontSize:"normal",style:{textOverflow:"ellipsis",overflow:"hidden",maxWidth:"250px",textWrap:"nowrap"}},c),g.createElement(xr,{src:o.logoURI,alt:"network logo",style:{width:"12px",height:"12px"}}))),g.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"1"},g.createElement(ae,{color:"text50",fontWeight:"bold",fontSize:"normal"},l()),g.createElement(bo,{color:"text50"})))},RI=({toLocation:t,label:e})=>{const{setNavigation:r}=Ni(),n=()=>{r(t)};return g.createElement(q,{onClick:n,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:wo},g.createElement(ae,{color:"text50",fontSize:"normal",fontWeight:"medium"},e),g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center"},g.createElement(ae,{color:"text50",fontSize:"normal",fontWeight:"medium"},"View all"),g.createElement(bo,{color:"text50",size:"sm"})))},i7e=()=>{const{chains:t}=Tt(),{fiatCurrency:e,hideUnlistedTokens:r,selectedNetworks:n}=Vn(),[i,s]=x.useState(""),{address:o}=Hn();qs();const{data:a,isLoading:c}=L2({accountAddress:o||"",chainIds:n},{hideUnlistedTokens:r}),l=(a==null?void 0:a.filter(K=>K.contractType==="ERC20"||fr(K.contractAddress,Dt)))||[],{data:u=[],isLoading:f}=ju({tokens:l.map(K=>({chainId:K.chainId,contractAddress:K.contractAddress}))}),{data:d=1,isLoading:h}=ml({toCurrency:e.symbol}),p=l.sort((K,Q)=>{var Y,F;return Number(Ro({balance:Q,prices:u,conversionRate:d,decimals:((Y=Q.contractInfo)==null?void 0:Y.decimals)||18}))-Number(Ro({balance:K,prices:u,conversionRate:d,decimals:((F=Q.contractInfo)==null?void 0:F.decimals)||18}))}),v=((a==null?void 0:a.filter(K=>K.contractType==="ERC721"||K.contractType==="ERC1155"))||[]).sort((K,Q)=>Number(Q.balance)-Number(K.balance)),y=c||f||h,b=v.map((K,Q)=>{var Y;return{index:Q,name:((Y=K.contractInfo)==null?void 0:Y.name)||"Unknown"}}),E=p.map((K,Q)=>{if(fr(K.contractAddress,Dt)){const F=Ir(K.chainId,t);return{index:Q,name:F.name}}else{var Y;return{index:Q,name:((Y=K.contractInfo)==null?void 0:Y.name)||"Unknown"}}}),S=p.length,P=v.length,M=new Sa(E,{keys:["name"]}),L=new Sa(b,{keys:["name"]}),j=(i===""?E:M.search(i).map(K=>K.item)).slice(0,5),H=(i===""?b:L.search(i).map(K=>K.item)).slice(0,5);return g.createElement(q,{paddingX:"4",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"10",alignItems:"center",justifyContent:"center"},g.createElement(q,{width:"full"},g.createElement(ul,{autoFocus:!0,name:"search wallet",leftIcon:Ub,value:i,onChange:K=>s(K.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),g.createElement(q,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},g.createElement(RI,{toLocation:{location:"search-view-all",params:{defaultTab:"collections"}},label:`Collections (${P})`}),y?Array(5).fill(null).map((K,Q)=>g.createElement(pt,{key:Q,width:"100%",height:"32px"})):H.length===0?g.createElement(ae,{color:"text100"},"No collections found"):H.map((K,Q)=>{const Y=v[K.index];return g.createElement(Rg,{key:Q,balance:Y})})),g.createElement(q,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},g.createElement(RI,{toLocation:{location:"search-view-all",params:{defaultTab:"coins"}},label:`Coins (${S})`}),y?Array(5).fill(null).map((K,Q)=>g.createElement(pt,{key:Q,width:"100%",height:"32px"})):j.length===0?g.createElement(ae,{color:"text100"},"No coins found"):j.map((K,Q)=>{const Y=p[K.index];return g.createElement(Rg,{key:Q,balance:Y})})))},s7e=({defaultTab:t})=>{const{chains:e}=Tt(),{fiatCurrency:r,hideUnlistedTokens:n,selectedNetworks:i}=Vn(),[s,o]=x.useState(""),[a,c]=x.useState(t);qs(),x.useEffect(()=>{o("")},[a]);const{address:l}=Hn(),{data:u,isLoading:f}=L2({accountAddress:l||"",chainIds:i},{hideUnlistedTokens:n}),d=(u==null?void 0:u.filter(k=>k.contractType==="ERC20"||fr(k.contractAddress,Dt)))||[],{data:h=[],isLoading:p}=ju({tokens:d.map(k=>({chainId:k.chainId,contractAddress:k.contractAddress}))}),{data:m=1,isLoading:v}=ml({toCurrency:r.symbol}),y=d.sort((k,R)=>{var N,A;return Number(Ro({balance:R,prices:h,conversionRate:m,decimals:((N=R.contractInfo)==null?void 0:N.decimals)||18}))-Number(Ro({balance:k,prices:h,conversionRate:m,decimals:((A=k.contractInfo)==null?void 0:A.decimals)||18}))}),E=((u==null?void 0:u.filter(k=>k.contractType==="ERC721"||k.contractType==="ERC1155"))||[]).sort((k,R)=>Number(R.balance)-Number(k.balance)),S=y.length,P=E.length,M=f||p||v,L=E.map((k,R)=>{var N;return{index:R,name:((N=k.contractInfo)==null?void 0:N.name)||"Unknown"}}),j=y.map((k,R)=>{if(fr(k.contractAddress,Dt)){const A=Ir(k.chainId,e);return{index:R,name:A.name}}else{var N;return{index:R,name:((N=k.contractInfo)==null?void 0:N.name)||"Unknown"}}}),H=new Sa(j,{keys:["name"]}),K=new Sa(L,{keys:["name"]}),Q=s===""?j:H.search(s).map(k=>k.item),Y=s===""?L:K.search(s).map(k=>k.item),F=()=>g.createElement(pt,{width:"360px",height:"48px"}),w=()=>g.createElement(g.Fragment,null,Array(8).fill(null).map((k,R)=>g.createElement(pt,{key:R,width:"full",height:"32px"})));return g.createElement(q,{paddingX:"4",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"5",alignItems:"center",justifyContent:"center"},g.createElement(q,{width:"full"},g.createElement(ul,{autoFocus:!0,name:"search wallet",leftIcon:Ub,value:s,onChange:k=>o(k.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),g.createElement(q,{width:"full"},g.createElement(J1e,{value:a,onValueChange:k=>c(k)},g.createElement(q,{marginBottom:"5"},!M&&g.createElement(Y1e,{value:a,tabs:[{label:`Collections (${P})`,value:"collections"},{label:`Coins (${S})`,value:"coins"}]}),M&&g.createElement(F,null)),g.createElement(p_,{value:"collections"},g.createElement(q,{flexDirection:"column",gap:"3"},M&&g.createElement(w,null),!M&&Y.length===0&&g.createElement(ae,{color:"text100"},"No Collectibles Found"),!M&&Y.length>0&&Y.map((k,R)=>{const N=E[k.index];return g.createElement(Rg,{key:R,balance:N})}))),g.createElement(p_,{value:"coins"},g.createElement(q,{flexDirection:"column",gap:"3"},M&&g.createElement(w,null),!M&&y.length==0&&g.createElement(ae,{color:"text100"},"No Coins Found"),!M&&Q.length>0&&Q.map((k,R)=>{const N=y[k.index];return g.createElement(Rg,{key:R,balance:N})}))))))},o7e=()=>{const{setNavigation:t}=Ni(),e=()=>{t({location:"settings-general"})},r=()=>{t({location:"settings-currency"})},n=()=>{t({location:"settings-networks"})};return g.createElement(q,{style:{paddingTop:Di}},g.createElement(q,{padding:"5",paddingTop:"3"},g.createElement(q,{flexDirection:"column",gap:"2"},g.createElement(rt,{onClick:e,leftIcon:nB,rightIcon:bo,width:"full",label:"General",style:{height:"52px",borderRadius:Te.radii.md}}),g.createElement(rt,{onClick:r,leftIcon:rue,rightIcon:bo,width:"full",label:"Currency",style:{height:"52px",borderRadius:Te.radii.md}}),g.createElement(rt,{onClick:n,leftIcon:uue,rightIcon:bo,width:"full",label:"Networks",style:{height:"52px",borderRadius:Te.radii.md}}))))},a7e=()=>{Dp();const{hideUnlistedTokens:t,setHideUnlistedTokens:e,hideCollectibles:r,setHideCollectibles:n}=Vn(),i=()=>{e(!t)},s=()=>{n(!r)};return g.createElement(q,{style:{paddingTop:Di}},g.createElement(q,{gap:"2",padding:"5",paddingTop:"3",flexDirection:"column"},g.createElement(kn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},g.createElement(ae,{color:"text100",fontWeight:"bold"},"Hide unlisted tokens"),g.createElement(m3,{checked:t,onCheckedChange:i})),g.createElement(kn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},g.createElement(ae,{color:"text100",fontWeight:"bold"},"Hide collectibles"),g.createElement(m3,{checked:r,onCheckedChange:s}))))},c7e=t=>{const{selected:e,className:r,squareIndicator:n=!1}=t;return g.createElement(q,{borderStyle:"solid",borderColor:n&&e?"transparent":"borderNormal",borderWidth:"thin",position:"relative",alignItems:"center",justifyContent:"center",flexShrink:"0",className:r,style:{borderRadius:n?"4px":Te.radii.circle,width:"20px",height:"20px"}},g.createElement(q,{as:Ic.div,background:n?"borderNormal":"backgroundInverse",position:"absolute",color:"textInverse100",initial:{opacity:e?1:0,scale:e?1:.5},animate:{opacity:e?1:0,scale:e?1:.5},transition:{ease:"backOut"},style:{borderRadius:n?"4px":Te.radii.circle,width:n?"20px":"14px",height:n?"20px":"14px"},justifyContent:"center",alignItems:"center"},n&&g.createElement(Kd,{color:"white",style:{width:"14px",height:"14px"}})))},l7e=["value","selected","children","disabled","onClick","className","hideIndicator","squareIndicator"],hW=t=>{const{value:e,selected:r,children:n,disabled:i,onClick:s,className:o,hideIndicator:a,squareIndicator:c=!1}=t,l=D2(t,l7e);return g.createElement(kn,En({as:"button",clickable:!0,className:HEe(o),disabled:i,onClick:()=>s(e),userSelect:"none",alignItems:"center",justifyContent:"space-between",textAlign:"left",width:"full",style:{appearance:"none"}},l),n,!a&&g.createElement(c7e,{selected:r,squareIndicator:c}))},u7e=()=>{const{fiatCurrency:t,setFiatCurrency:e}=Vn();return qs(),g.createElement(q,{paddingBottom:"5",paddingX:"4",paddingTop:"3"},g.createElement(q,{flexDirection:"column",gap:"2"},fW.map(r=>g.createElement(hW,{key:r.symbol,value:r.symbol,selected:r.symbol===t.symbol,onClick:()=>e&&e(r)},g.createElement(q,{gap:"2",justifyContent:"flex-start",alignItems:"center"},g.createElement(ae,{color:"text100",fontWeight:"bold"},r.symbol),g.createElement(ae,{color:"text50"},r.name.message))))))},f7e=()=>{const{selectedNetworks:t,setSelectedNetworks:e}=Vn(),{chains:r}=Tt(),n=i=>{if(t.includes(i)){if(t.length===1)return;e(t.filter(s=>s!==i))}else e([...t,i])};return g.createElement(q,{style:{paddingTop:Di}},g.createElement(q,{padding:"5",paddingTop:"3"},g.createElement(ae,{variant:"small",color:"text50"},"Networks"),g.createElement(q,{flexDirection:"column",gap:"2"},r.map(i=>{const s=Ir(i.id,r);return g.createElement(hW,{disabled:t.length===1&&t.includes(i.id),key:i.id,selected:t.includes(i.id),onClick:()=>n(i.id),value:i.id,squareIndicator:!0},g.createElement(q,{gap:"2",justifyContent:"center",alignItems:"center"},g.createElement(xr,{width:"3",height:"3",src:s.logoURI,alt:"network"}),g.createElement(ae,{color:"text100",variant:"small"},s.name)))}))))},fh=({chainId:t})=>{var e;const{chains:r}=Tt(),{network:n}=Zr(t),i=Ir(t,r),s=nSe(t),o=iSe(t);return g.createElement(q,{height:"6",paddingY:"1",paddingLeft:"1.5",paddingRight:"2",gap:"1",style:{background:o},borderRadius:"xs",flexDirection:"row",justifyContent:"center",alignItems:"center",width:"fit"},g.createElement(xr,{style:{width:"14px"},src:i.logoURI}),g.createElement(ae,{fontWeight:"bold",fontSize:"xsmall",style:{color:s}},E9e((e=n.title)!=null?e:n.name)))},d7e=({chainId:t})=>(qs(),g.createElement(q,{style:{paddingTop:Di}},g.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingX:"4",paddingTop:"0",style:{marginTop:"-20px"}},g.createElement(q,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},g.createElement(pt,{width:"32px",height:"32px"}),g.createElement(pt,{height:"24px",width:"70px"}),g.createElement(fh,{chainId:t})),g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),g.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},g.createElement(pt,{width:"150px",height:"36px"}),g.createElement(pt,{width:"33px",height:"17px"}))),g.createElement(rt,{color:"text100",marginTop:"4",marginBottom:"10",width:"full",variant:"primary",leftIcon:zb,label:"Send",disabled:!0,onClick:()=>{}}),g.createElement(q,null,g.createElement(L9,null))))),h7e=(t,e)=>{var r;const[n,i]=x.useState(null),s=x.useMemo(()=>new IntersectionObserver(([o])=>i(o),e),[]);return x.useEffect(()=>(t.current&&s.observe(t.current),()=>{t.current&&s.disconnect()}),[t.current,s]),(r=n==null?void 0:n.isIntersecting)!=null?r:!1},pW=t=>{const{onLoad:e,hasMore:r=!0,children:n}=t,[i,s]=x.useState(0),[o,a]=x.useState(!1),c=x.useRef(null),l=h7e(c);x.useEffect(()=>{l&&r&&!o&&u()},[l]);const u=async()=>{a(!0),await e(i),s(f=>f+1),a(!1)};return g.createElement(g.Fragment,null,n,g.createElement("div",{ref:c}))},p7e=({contractAddress:t,chainId:e})=>{var r,n,i,s;const{chains:o}=Tt(),{setNavigation:a}=Ni(),{fiatCurrency:c,hideUnlistedTokens:l}=Vn();qs();const{address:u}=Hn(),{data:f,isLoading:d,fetchNextPage:h,hasNextPage:p,isFetchingNextPage:m}=lW({chainId:e,accountAddress:u||"",contractAddress:t}),v=iW(f),{data:y,isLoading:b}=D9e({accountAddress:u||"",contractAddress:t,chainId:e},{hideUnlistedTokens:l}),{data:E,isLoading:S}=ju({tokens:[{chainId:e,contractAddress:t}]}),{data:P=1,isLoading:M}=ml({toCurrency:c.symbol});if(b||S||M)return g.createElement(d7e,{chainId:e});const j=fr(t,Dt),H=j?Ir(e,o).logoURI:y==null||(r=y.contractInfo)==null?void 0:r.logoURI,K=j?Ir(e,o).symbol:y==null||(n=y.contractInfo)==null?void 0:n.symbol,Q=j?Ir(e,o).name:y==null||(i=y.contractInfo)==null?void 0:i.name,Y=j?Ir(e,o).decimals:y==null||(s=y.contractInfo)==null?void 0:s.decimals,F=Nt((y==null?void 0:y.balance)||"0",Y),w=Oo(F),k=y?Ro({balance:y,prices:E||[],conversionRate:P,decimals:Y||0}):"0",R=()=>{a({location:"send-coin",params:{chainId:e,contractAddress:t}})};return g.createElement(q,{style:{paddingTop:Di}},g.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingX:"4",paddingTop:"0",style:{marginTop:"-20px"}},g.createElement(q,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},g.createElement(xr,{width:"8",src:H,alt:"logo"}),g.createElement(ae,{color:"text100",fontWeight:"bold",fontSize:"large"},Q),g.createElement(fh,{chainId:e})),g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),g.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},g.createElement(ae,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},`${w} ${K}`),g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${c.sign}${k}`))),g.createElement(rt,{width:"full",variant:"primary",leftIcon:zb,color:"text100",label:"Send",onClick:R}),g.createElement(q,null,g.createElement(pW,{onLoad:()=>h(),hasMore:p},g.createElement(j9,{transactions:v,isLoading:d,isFetchingNextPage:m})))))},m7e=({chainId:t})=>(qs(),g.createElement(q,{paddingX:"4",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10"},g.createElement(q,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},g.createElement(pt,{width:"32px",height:"32px"}),g.createElement(pt,{width:"100px",height:"24px"}),g.createElement(fh,{chainId:t}),g.createElement(pt,{width:"142px",height:"17px"})),g.createElement(q,{width:"full"},g.createElement(pt,{width:"168px",height:"20px"}),g.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${Te.space[1]}) calc(50% - ${Te.space[1]})`,gap:Te.space[2]},width:"full",marginTop:"3"},Array(8).fill(null).map((e,r)=>g.createElement(pt,{key:r,width:"full",aspectRatio:"1/1"})))))),v7e=({chainId:t,contractAddress:e})=>{var r;const{setNavigation:n}=Ni(),{address:i}=Hn(),{data:s,isLoading:o}=M9e({chainId:t,accountAddress:i||"",collectionAddress:e});qs();const a=s==null||(r=s[0])==null?void 0:r.contractInfo,c=a==null?void 0:a.logoURI;if(o)return g.createElement(m7e,{chainId:t});const l=u=>{n&&n({location:"collectible-details",params:{contractAddress:u.contractAddress,chainId:u.chainId,tokenId:u.tokenID}})};return g.createElement(q,{paddingX:"4",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10"},g.createElement(q,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},g.createElement(el,{imageUrl:c,size:32}),g.createElement(ae,{fontWeight:"bold",fontSize:"large",color:"text100"},(a==null?void 0:a.name)||"Unknown"),g.createElement(fh,{chainId:t}),g.createElement(ae,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${(s==null?void 0:s.length)||0} Unique Collectibles`)),g.createElement(q,{width:"full"},g.createElement(ae,{fontWeight:"medium",fontSize:"normal",color:"text50"},`Owned (${(s==null?void 0:s.length)||0})`),g.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${Te.space[1]}) calc(50% - ${Te.space[1]})`,gap:Te.space[2]},width:"full",marginTop:"3"},s==null?void 0:s.map((u,f)=>{var d,h,p;const m=u.balance,v=(u==null||(d=u.tokenMetadata)==null?void 0:d.decimals)||0,y=Oo(Nt(m,v));return g.createElement(q,{key:f,onClick:()=>l(u),className:wo},g.createElement(q,{background:"backgroundSecondary",aspectRatio:"1/1",width:"full",borderRadius:"md",justifyContent:"center",alignItems:"center",marginBottom:"2"},g.createElement(xr,{style:{height:"100%"},src:(h=u.tokenMetadata)==null?void 0:h.image})),g.createElement(q,null,g.createElement(ae,{fontWeight:"bold",fontSize:"normal",color:"text100"},`${(p=u.tokenMetadata)==null?void 0:p.name}`)),g.createElement(q,null,g.createElement(ae,{marginTop:"1",fontWeight:"medium",fontSize:"normal",color:"text50"},y," Owned")))}))))},y7e=()=>(qs(),g.createElement(q,{style:{paddingTop:Di}},g.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingX:"4",paddingTop:"0",style:{marginTop:"-20px"}},g.createElement(q,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},g.createElement(pt,{width:"120px",height:"30px"}),g.createElement(pt,{width:"140px",height:"40px"})),g.createElement(q,null,g.createElement(pt,{width:"347px",height:"347px"})),g.createElement(q,null,g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),g.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},g.createElement(pt,{width:"44px",height:"36px"}),g.createElement(pt,{width:"34px",height:"17px"}))),g.createElement(rt,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:zb,label:"Send",onClick:()=>{}})),g.createElement(q,null,g.createElement(ae,{fontSize:"normal",color:"text50",fontWeight:"medium"},"This week"),g.createElement(L9,null))))),g7e=({contractAddress:t,chainId:e,tokenId:r})=>{var n,i,s,o,a,c;const{chains:l}=Tt(),{address:u}=Hn(),{fiatCurrency:f}=Vn(),{setNavigation:d}=Ni();qs();const{data:h,isLoading:p,fetchNextPage:m,hasNextPage:v,isFetchingNextPage:y}=lW({chainId:e,accountAddress:u||"",contractAddress:t,tokenId:r}),b=iW(h),{data:E,isLoading:S}=aW({accountAddress:u||"",collectionAddress:t,chainId:e,tokenId:r,verifiedOnly:!1}),{data:P,isLoading:M}=cW({tokens:[{chainId:e,contractAddress:t,tokenId:r}]}),{data:L=1,isLoading:j}=ml({toCurrency:f.symbol});if(S||M||j)return g.createElement(y7e,null);const K=()=>{d({location:"send-collectible",params:{chainId:e,contractAddress:t,tokenId:r}})},Q=Ir(e,l),Y=E==null||(n=E.contractInfo)==null?void 0:n.logoURI,F=(E==null||(i=E.contractInfo)==null?void 0:i.name)||"Unknown Collection",w=(E==null||(s=E.tokenMetadata)==null?void 0:s.decimals)||0,k=(E==null?void 0:E.balance)||"0",R=Nt(k,w),N=Oo(Number(R)),A=E?Ro({balance:E,prices:P||[],conversionRate:L,decimals:w}):"0";return g.createElement(q,{style:{paddingTop:Di}},g.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingX:"4",paddingTop:"0",style:{marginTop:"-20px"}},g.createElement(q,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},g.createElement(q,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},g.createElement(xr,{borderRadius:"circle",width:"8",src:Y,alt:"collection logo",style:{objectFit:"cover"}}),g.createElement(q,{gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},g.createElement(ae,{fontWeight:"bold",fontSize:"small",color:"text100"},F),g.createElement(xr,{width:"3",src:Q.logoURI,alt:"collection logo"}))),g.createElement(q,{flexDirection:"column",justifyContent:"center",alignItems:"center"},g.createElement(ae,{color:"text100",fontWeight:"bold",fontSize:"large"},(E==null||(o=E.tokenMetadata)==null?void 0:o.name)||"Unknown Collectible"),g.createElement(ae,{color:"text50",fontSize:"small",fontWeight:"medium"},`#${r}`))),g.createElement(q,null,g.createElement(Np,{imageUrl:E==null||(a=E.tokenMetadata)==null?void 0:a.image})),g.createElement(q,null,g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),g.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},g.createElement(ae,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},N),P&&((c=P[0].price)==null?void 0:c.value)&&g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${f.symbol} ${A}`))),g.createElement(rt,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:zb,label:"Send",onClick:K})),g.createElement(q,null,g.createElement(pW,{onLoad:()=>m(),hasMore:v},g.createElement(j9,{transactions:b,isLoading:p,isFetchingNextPage:y})))))},b7e=["buttonVariant","text","size"],mW=t=>{const{buttonVariant:e="icon",text:r,size:n="xs"}=t,i=D2(t,b7e),[s,o]=x.useState(!1);x.useEffect(()=>{s&&setTimeout(()=>{o(!1)},4e3)},[s]);const a=()=>{o(!0)},c=s?"Copied!":"Copy",l=e==="icon"?"rgba(0,0,0,0)":Te.colors.buttonGlass;return g.createElement(Yz.CopyToClipboard,{text:r,onCopy:a},g.createElement(Po,En({size:n,icon:s?Kd:Fb},i,{style:En({background:l},t==null?void 0:t.style),label:e==="with-label"?c:void 0})))},x7e=({transaction:t})=>{var e,r;const{chains:n}=Tt(),{fiatCurrency:i}=Vn(),s=[],o=[];(e=t.transfers)==null||e.forEach(b=>{var E,S;if(((E=b.contractInfo)==null?void 0:E.type)==="ERC721"||((S=b.contractInfo)==null?void 0:S.type)==="ERC1155"){var P;(P=b.tokenIds)==null||P.forEach(L=>{if(!o.find(K=>{var Q;return K.chainId===t.chainId&&fr(K.contractAddress,((Q=b.contractInfo)==null?void 0:Q.address)||"")&&K.tokenId===L})){var H;o.push({chainId:t.chainId,contractAddress:((H=b.contractInfo)==null?void 0:H.address)||"",tokenId:L})}})}else{var M;const L=(b==null||(M=b.contractInfo)==null?void 0:M.address)||Dt;s.find(H=>H.chainId===t.chainId&&fr(H.contractAddress,L))||s.push({chainId:t.chainId,contractAddress:L})}});const{data:a,isLoading:c}=ju({tokens:s}),{data:l,isLoading:u}=cW({tokens:o}),{data:f=1,isLoading:d}=ml({toCurrency:i.symbol}),h=s.length>0&&c||o.length>0&&u||d,p=Ir(t.chainId,n),m=lq(t.timestamp).format("ddd MMM DD YYYY, h:m:s a"),v=()=>{typeof window<"u"&&window.open(`${p.blockExplorerUrl}/tx/${t.txnHash}`,"_blank")},y=({transfer:b})=>{var E,S,P,M;const L=b.to,j=L.substring(0,10)+"..."+L.substring(b.to.length-4,b.to.length),H=fr((b==null||(E=b.contractInfo)==null?void 0:E.address)||"",Dt),K=H?p.logoURI:b==null||(S=b.contractInfo)==null?void 0:S.logoURI,Q=H?p.symbol:(b==null||(P=b.contractInfo)==null?void 0:P.symbol)||"";return g.createElement(g.Fragment,null,(M=b.amounts)==null?void 0:M.map((Y,F)=>{var w,k,R,N,A;const O=b.contractType==="ERC721"||b.contractType==="ERC1155",B=((w=b.tokenIds)==null?void 0:w[F])||"0",I=(b==null||(k=b.tokenMetadata)==null||(k=k[B])==null?void 0:k.decimals)||0,C=H?p.decimals:(b==null||(R=b.contractInfo)==null?void 0:R.decimals)||0,z=Nt(Y,O?I:C),_=Oo(z),W=O?l==null||(N=l.find(J=>{var ee,se;return fr(J.token.contractAddress,((ee=b.contractInfo)==null?void 0:ee.address)||"")&&J.token.tokenId===((se=b.tokenIds)==null?void 0:se[F])&&J.token.chainId===t.chainId}))==null||(N=N.price)==null?void 0:N.value:a==null||(A=a.find(J=>{var ee;return fr(J.token.contractAddress,((ee=b.contractInfo)==null?void 0:ee.address)||Dt)&&J.token.chainId===t.chainId}))==null||(A=A.price)==null?void 0:A.value,G=(parseFloat(z)*(f*(W||0))).toFixed(2);return g.createElement(q,{key:F,width:"full",flexDirection:"row",gap:"2",justifyContent:"space-between",alignItems:"center"},g.createElement(q,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},g.createElement(el,{imageUrl:K,size:20}),g.createElement(q,{gap:"0.5",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"},g.createElement(ae,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},`${_} ${Q}`),h?g.createElement(pt,{width:"44px",height:"12px"}):g.createElement(ae,{fontWeight:"bold",fontSize:"xsmall",color:"text50"},W?`${i.sign}${G}`:""))),g.createElement(i3,{color:"text50",style:{width:"16px"}}),g.createElement(q,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},g.createElement(Ru,{address:L,style:{width:"20px"}}),g.createElement(ae,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},j)))}))};return g.createElement(q,{padding:"5",paddingTop:"3",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",marginTop:"5"},g.createElement(q,{marginTop:"6",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"1"},g.createElement(ae,{fontSize:"normal",fontWeight:"medium"},"Transaction details"),g.createElement(ae,{marginBottom:"1",fontSize:"small",fontWeight:"medium",color:"text50"},m),g.createElement(fh,{chainId:t.chainId})),g.createElement(q,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"4",width:"full",padding:"4",background:"backgroundSecondary",borderRadius:"md"},g.createElement(q,{width:"full",gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},g.createElement(ae,{fontSize:"normal",fontWeight:"medium",color:"text50"},"Transfer"),g.createElement(xr,{width:"3",src:p.logoURI,alt:"network logo"})),(r=t.transfers)==null?void 0:r.map((b,E)=>g.createElement(q,{width:"full",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4",key:`transfer-${E}`},g.createElement(y,{transfer:b})))),g.createElement(rt,{onClick:v,width:"full",borderRadius:"md",rightIcon:oue,label:`View on ${p.blockExplorerName}`}),g.createElement(q,null,g.createElement(q,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},g.createElement(m1,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),g.createElement(ae,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Status"),g.createElement(ae,{fontSize:"normal",fontWeight:"medium",color:"text100"},"Complete")),g.createElement(q,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},g.createElement(m1,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),g.createElement(ae,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Transaction Hash"),g.createElement(ae,{color:"text100",fontSize:"normal",fontWeight:"medium",style:{overflowWrap:"anywhere"}},t.txnHash),g.createElement(mW,{marginTop:"2",buttonVariant:"with-label",text:t.txnHash}))))},w7e=x.forwardRef(({onClickAccount:t},e)=>{const{address:r}=Hn();return g.createElement(q,{gap:"2",alignItems:"center"},g.createElement(q,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},g.createElement(q,{onClick:t,gap:"2",alignItems:"center",justifyContent:"center",className:wo,position:"relative",ref:e},g.createElement(Ru,{size:"sm",address:r||""}),g.createElement(ae,{color:"text100",fontWeight:"medium",variant:"normal"},tW(r||"")),g.createElement(l4,{color:"text100"}))))}),E7e=x.forwardRef(({setOpenWalletDropdown:t},e)=>{const{setNavigation:r}=Ni(),{setOpenWalletModal:n}=Mp(),{address:i}=Hn(),{disconnect:s}=Vz(),{theme:o}=Dp(),a=()=>{t(!1),r({location:"receive"})},c=()=>{t(!1),r({location:"history"})},l=()=>{t(!1),r({location:"settings"})},u=()=>{n(!1),t(!1),s()},f=()=>{switch(o){case"dark":return"rgba(38, 38, 38, 0.85)";case"light":return"rgba(217, 217, 217, 0.85)";default:return Te.colors.transparent}};return g.createElement(q,{padding:"3",ref:e,zIndex:"30",borderRadius:"md",style:{position:"relative",pointerEvents:"auto",width:"370px",backdropFilter:"blur(12.5px)",top:"16px",left:"15px",background:f()}},g.createElement(q,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"3",marginLeft:"2",color:"text100"},g.createElement(Ru,{style:{width:"28px"},size:"md",address:i||""}),g.createElement(ae,{fontSize:"large",style:{fontWeight:"700"},color:"text100"},tW(i||"")),g.createElement(mW,{buttonVariant:"icon",size:"md",text:i||"",color:"text100",style:{marginLeft:"-16px"}})),g.createElement(Po,{onClick:()=>t(!1),size:"xs",background:"buttonGlass",icon:Tu})),g.createElement(q,{gap:"2",marginTop:"3",flexDirection:"column"},g.createElement(rt,{variant:"glass",style:{borderRadius:Te.radii.md},width:"full",leftIcon:due,label:"Receive",onClick:a}),g.createElement(rt,{style:{borderRadius:Te.radii.md},width:"full",leftIcon:sB,label:"History",onClick:c}),g.createElement(rt,{style:{borderRadius:Te.radii.md},width:"full",leftIcon:nB,label:"Settings",onClick:l}),g.createElement(rt,{label:"Sign Out",style:{borderRadius:Te.radii.md},width:"full",leftIcon:iB,onClick:u})))});Nu("packages/wallet/src/shared/WalletHeader/styles.css.ts","kit");const C7e=qn({":focus-visible":{boxShadow:"none"}},"searchButton");Du();const Jw=({})=>{const{openWalletModalState:t}=Mp(),[e,r]=x.useState(!1),{goBack:n,history:i,setNavigation:s}=Ni(),o=x.useRef(!1);x.useEffect(()=>{t||r(!1)},[t]),x.useEffect(()=>{e?o.current?r(!1):o.current=!0:o.current=!1},[i.length,e]);const a=()=>{r(!0)},c=()=>{n()},l=()=>{s({location:"search"})};return g.createElement(q,{as:Ic.div},g.createElement(v9e,{open:e},g.createElement(y9e,null),g.createElement(q,{background:"backgroundPrimary",zIndex:"20",position:"fixed",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"full",style:{height:Di,paddingTop:"6px"}},i.length>0?g.createElement(Po,{onClick:c,icon:Bb,style:{backgroundColor:Te.colors.backgroundPrimary,width:"44px"}}):g.createElement(Po,{onClick:l,icon:Ub,className:C7e,style:{backgroundColor:Te.colors.backgroundPrimary,width:"44px"}}),g.createElement(g9e,{asChild:!0},g.createElement(w7e,{onClickAccount:a})),g.createElement(q,{style:{width:"44px"}})),g.createElement(wd,null,e&&g.createElement(b9e,{asChild:!0,side:"bottom",align:"start"},g.createElement(E7e,{setOpenWalletDropdown:r})))))},Ks=({secondaryText:t,primaryText:e})=>{const{goBack:r,history:n}=Ni(),i=()=>{r()};return g.createElement(q,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:Di,paddingTop:"6px",backgroundColor:Te.colors.backgroundPrimary}},n.length>0?g.createElement(Po,{onClick:i,icon:Bb,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):g.createElement(q,null),g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",variant:"small",color:"text50"},t),g.createElement(ae,{fontWeight:"medium",variant:"small",color:"text100"},e)),g.createElement(q,{style:{width:"44px"}}))},$I=t=>{const{location:e}=t;switch(e){case"send-coin":return g.createElement(e7e,{chainId:t.params.chainId,contractAddress:t.params.contractAddress});case"send-collectible":return g.createElement(t7e,{chainId:t.params.chainId,contractAddress:t.params.contractAddress,tokenId:t.params.tokenId});case"receive":return g.createElement(Z9e,null);case"history":return g.createElement(n7e,null);case"search":return g.createElement(i7e,null);case"search-view-all":return g.createElement(s7e,{defaultTab:t.params.defaultTab});case"settings":return g.createElement(o7e,null);case"settings-general":return g.createElement(a7e,null);case"settings-currency":return g.createElement(u7e,null);case"settings-networks":return g.createElement(f7e,null);case"coin-details":return g.createElement(p7e,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"collectible-details":return g.createElement(g7e,{contractAddress:t.params.contractAddress,chainId:t.params.chainId,tokenId:t.params.tokenId});case"collection-details":return g.createElement(v7e,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"transaction-details":return g.createElement(x7e,{transaction:t.params.transaction});case"home":default:return g.createElement(X9e,null)}},S7e=t=>{const{location:e}=t;switch(e){case"search":return g.createElement(Ks,{primaryText:"Search wallet"});case"search-view-all":return g.createElement(Ks,{secondaryText:"Search wallet / ",primaryText:"View all"});case"settings":return g.createElement(Ks,{secondaryText:"Wallet / ",primaryText:"Settings"});case"settings-general":return g.createElement(Ks,{secondaryText:"Wallet / Settings / ",primaryText:"General"});case"settings-currency":return g.createElement(Ks,{secondaryText:"Wallet / Settings / ",primaryText:"Currency"});case"settings-networks":return g.createElement(Ks,{secondaryText:"Wallet / Settings / ",primaryText:"Networks"});case"receive":return g.createElement(Ks,{secondaryText:"Wallet / ",primaryText:"Receive"});case"history":return g.createElement(Ks,{secondaryText:"Wallet / ",primaryText:"History"});case"coin-details":return g.createElement(Jw,null);case"collectible-details":return g.createElement(Jw,null);case"transaction-details":return g.createElement(Ks,{secondaryText:"",primaryText:""});case"send-collectible":case"send-coin":return g.createElement(Ks,{secondaryText:"Wallet / ",primaryText:"Send"});case"home":default:return g.createElement(Jw,null)}},k7e={location:"home"},A7e=t=>{const e=new i9;return g.createElement(b9,{client:e},g.createElement(_7e,t))},_7e=({children:t})=>{const{theme:e,position:r}=Dp(),[n,i]=x.useState(!1),[s,o]=x.useState([]),a=s.length>0?s[s.length-1]:k7e,c=a.location==="home"||a.location==="collection-details"||a.location==="collectible-details"||a.location==="coin-details"||a.location==="history"||a.location==="search"||a.location==="search-view-all"||a.location==="settings-currency";return x.useEffect(()=>{n&&o([])},[n]),g.createElement(w9e,{value:{setOpenWalletModal:i,openWalletModalState:n}},g.createElement(F9e,{value:{setHistory:o,history:s}},g.createElement("div",{id:"kit-provider"},g.createElement(Qb,{root:"#kit-provider",scope:"kit",theme:e},g.createElement(wd,null,n&&g.createElement(eg,{contentProps:{style:En({maxWidth:"400px",height:"fit-content"},Mg(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},g.createElement(q,{className:D9,id:"sequence-kit-wallet-content"},S7e(a),c?g.createElement(rF,{className:Y9e,style:{paddingTop:Di,height:"min(800px, 80vh)"}},$I(a)):$I(a)))))),t))};var Cs={};const P7e=Er(JQ),I7e=Er(UK),T7e=Er(XR),O7e=Er(oX),R7e=Er(mK),$7e=Er(KQ),M7e=Er(gX),N7e=Er(OX),D7e=Er(DK),L7e=Er(hK),MI=Er(lX),j7e=Er(_Z),B7e=Er(wX),F7e=Er(SK),U7e=Er(NR),z7e=Er(qJ),NI=Er(hQ),q7e=Er(JJ),W7e=Er(IZ),H7e=Er(NX),V7e=Er(WX);(function(t){var e=yi&&yi.__createBinding||(Object.create?function(Q,Y,F,w){w===void 0&&(w=F),Object.defineProperty(Q,w,{enumerable:!0,get:function(){return Y[F]}})}:function(Q,Y,F,w){w===void 0&&(w=F),Q[w]=Y[F]}),r=yi&&yi.__setModuleDefault||(Object.create?function(Q,Y){Object.defineProperty(Q,"default",{enumerable:!0,value:Y})}:function(Q,Y){Q.default=Y}),n=yi&&yi.__importStar||function(Q){if(Q&&Q.__esModule)return Q;var Y={};if(Q!=null)for(var F in Q)F!=="default"&&Object.prototype.hasOwnProperty.call(Q,F)&&e(Y,Q,F);return r(Y,Q),Y};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var i=P7e;Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var s=I7e;Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return s.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return s.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return s.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return s.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}});var o=n(T7e);t.base64=o;var a=O7e;Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return a.Base58}});var c=R7e;Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return c.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return c.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return c.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return c.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return c.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return c.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return c.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return c.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return c.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return c.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return c.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return c.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return c.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return c.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return c.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return c.stripZeros}});var l=$7e;Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return l._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return l.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return l.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return l.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return l.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return l.namehash}});var u=M7e;Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return u.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return u.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return u.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return u.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return u.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return u.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return u.mnemonicToSeed}});var f=N7e;Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return f.getJsonWalletAddress}});var d=D7e;Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return d.keccak256}});var h=L7e;Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return h.Logger}});var p=MI;Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return p.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return p.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return p.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return p.sha512}});var m=j7e;Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return m.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return m.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return m.sha256}});var v=B7e;Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return v.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return v.shuffled}});var y=F7e;Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return y.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return y.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return y.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return y.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return y.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return y.shallowCopy}});var b=n(U7e);t.RLP=b;var E=z7e;Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return E.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return E.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return E.SigningKey}});var S=NI;Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return S.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return S.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return S.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return S._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return S.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return S.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return S.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return S.Utf8ErrorFuncs}});var P=q7e;Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return P.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return P.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return P.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return P.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return P.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return P.TransactionTypes}});var M=W7e;Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return M.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return M.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return M.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return M.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return M.parseUnits}});var L=H7e;Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return L.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return L.verifyTypedData}});var j=V7e;Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return j._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return j.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return j.poll}});var H=MI;Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return H.SupportedAlgorithm}});var K=NI;Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return K.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return K.Utf8ErrorReason}})})(Cs);const G7e=(t,e)=>t.toLowerCase()===e.toLowerCase();function Ln(){return Ln=Object.assign?Object.assign.bind():function(t){for(var e=1;e svg`,{width:"20px",height:"20px"});const yW=qn({},"googleWaasButtonContainer");hs(`${yW}`,{width:"40px",height:"40px",overflow:"hidden",borderRadius:"4px",alignItems:"center",justifyContent:"center"});const Y7e=qn([Zj({variant:"large"}),{height:"48px",width:"40px",display:"flex",justifyContent:"center",alignItems:"center",padding:"10px",border:`${Te.borderWidths.thick} solid ${Te.colors.borderNormal}`,borderRadius:Te.radii.sm,color:Te.colors.text100,background:"transparent",textAlign:"center",caretColor:"transparent",boxShadow:"none",":hover":{borderColor:Te.colors.borderFocus},":focus":{borderColor:Te.colors.borderFocus},"::selection":{background:"transparent"}}],"digitInput");Du();const J7e=({onConnect:t,connectors:e})=>{const{theme:r}=gp(),{isPending:n}=lz();return g.createElement(q,{flexDirection:"column",gap:"2",marginTop:"5"},e.map(i=>{const s=r==="dark"?i._wallet.logoDark:i._wallet.logoLight,o=i._wallet.name,a=i._wallet.id;return g.createElement(q,{key:a,as:"button",flexDirection:"row",alignItems:"center",justifyContent:"space-between",background:"backgroundSecondary",color:"text100",borderRadius:"md",padding:"4",style:{height:"60px"},className:K7e,onClick:()=>t(i)},g.createElement(ae,{variant:"medium",color:"text100"},o,n),g.createElement(q,{justifyContent:"center",alignItems:"center",style:{backgroundColor:i._wallet.iconBackground},borderRadius:"md",className:vW},g.createElement(s,null)))}))},X7e=({config:t={}})=>{const{signIn:e={}}=t,{logoUrl:r}=e;return g.createElement(g.Fragment,null,r&&g.createElement(q,{marginTop:"5",justifyContent:"center",alignItems:"center"},g.createElement(xr,{src:r,style:{height:"110px"}})))};let nr=function(t){return t.Settings="@kit.settings",t.Theme="@kit.theme",t.EthAuthProof="@kit.ethAuthProof",t.EthAuthSettings="@kit.ethAuthSettings",t.ProjectAccessKey="@kit.projectAccessKey",t.WaasGoogleClientID="@kit.waasGoogleClientId",t.WaasGoogleIdToken="@kit.waasGoogleIdToken",t.WaasAppleClientID="@kit.waasAppleClientId",t.WaasAppleRedirectURI="@kit.waasAppleRedirectURI",t.WaasAppleIdToken="@kit.waasAppleIdToken",t.WaasSessionHash="@kit.waasSessionHash",t.WaasActiveLoginType="@kit.waasActiveLoginType",t.WaasEmailIdToken="@kit.waasEmailIdToken",t}({});const Xw={showEmailInput:!0,walletAuthOptions:["sequence","sequence-waas","metamask","wallet-connect","coinbase-wallet"],socialAuthOptions:["google","facebook","twitch","apple","google-waas","apple-waas"]},gW=60*60*24*7;function Z7e(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}const eSe=["createConnector"],bW=(t,e)=>{localStorage.setItem(nr.ProjectAccessKey,t);const r=[];return e.forEach(n=>{const{createConnector:i}=n,s=Z7e(n,eSe),o=Ln({},s),a=c=>{const u=i()(c);return u._wallet=Ln({},o),u};r.push(a)}),r},tSe=t=>/^\S+@\S+\.\S{2,}$/.test(t),d8={1:{name:"Ethereum",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",decimals:18,blockExplorerName:"Etherscan",blockExplorerUrl:"https://etherscan.io"},5:{name:"Goerli",symbol:"ETH",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",blockExplorerName:"Etherscan (Goerli)",blockExplorerUrl:"https://goerli.etherscan.io"},10:{name:"Optimism",symbol:"OP",logoURI:"https://assets.coingecko.com/coins/images/25244/small/Optimism.png",decimals:18,blockExplorerName:"Etherscan (Optimism)",blockExplorerUrl:"https://optimistic.etherscan.io"},56:{name:"BNB",symbol:"BNB",logoURI:"https://assets.coingecko.com/coins/images/825/thumb/bnb-icon2_2x.png",decimals:18,blockExplorerName:"BscScan",blockExplorerUrl:"https://bscscan.com"},100:{name:"Gnosis",symbol:"GNO",logoURI:"https://assets.coingecko.com/coins/images/662/small/logo_square_simple_300px.png",decimals:18,blockExplorerUrl:"https://gnosisscan.io",blockExplorerName:"Gnosis Scan"},137:{name:"Polygon",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan",blockExplorerUrl:"https://polygonscan.com"},1101:{name:"Polygon zkEVM",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"PolygonScan",blockExplorerUrl:"https://zkevm.polygonscan.com"},42161:{name:"Arbitrum",symbol:"ARB",logoURI:"https://assets.coingecko.com/asset_platforms/images/33/small/arbitrum-one.png",decimals:18,blockExplorerName:"Arbiscan",blockExplorerUrl:"https://arbiscan.io"},43114:{name:"Avalanche",symbol:"AVAX",logoURI:"https://assets.coingecko.com/coins/images/12559/small/Avalanche_Circle_RedWhite_Trans.png",decimals:18,blockExplorerName:"Snowtrace",blockExplorerUrl:"https://snowtrace.io"},80001:{name:"Mumbai",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan (Mumbai)",blockExplorerUrl:"https://mumbai.polygonscan.com"}},rSe=(t,e)=>{const r=e.find(s=>s.id===t);if(r){var n,i;return{name:r.nativeCurrency.name,symbol:r.nativeCurrency.symbol,decimals:r.nativeCurrency.decimals,logoURI:d8[1].logoURI,blockExplorerName:(n=r.blockExplorers)==null?void 0:n.default.name,blockExplorerUrl:(i=r.blockExplorers)==null?void 0:i.default.url}}},Ir=(t,e)=>d8[t]||rSe(t,e)||d8[1],dh=()=>{const t=g.createContext(void 0);return[()=>{const r=g.useContext(t);if(!r)throw new Error("useGenericContext must be used within a Provider");return r},t.Provider]},Mg=t=>{switch(t){case"top-right":return{top:"0px",right:"0px"};case"top-left":return{top:"0px",left:"0px"};case"top-center":return{top:"0px"};case"bottom-right":return{bottom:"0px",right:"0px"};case"bottom-left":return{bottom:"0px",left:"0px"};case"bottom-center":return{bottom:"0px"};case"middle-right":return{right:"0px"};case"middle-left":return{left:"0px"};case"center":default:return{}}},nSe=(t,e="light")=>{switch(t){case 1:return"#abf";case 137:return"#c7a6ff";case 42161:return"#52A7E6";case 10:return"#DB3132";case 56:return e==="light"?"#CB9C1D":"#EEB445";case 43114:return"#E84142";case 100:return e==="light"?"#00193C":"#D8E8FF";case 5:return e==="light"?"#A77A00":"#FFA700";case 80001:return e==="light"?"#D68828":"#FFA700";default:return"#abf"}},iSe=(t,e="light")=>{switch(t){case 1:return"#132362";case 137:return"#350881";case 42161:return e==="light"?"#EDF7FF":"#0C3754";case 10:return e==="light"?"#FFEAE9":"#390B0C";case 56:return e==="light"?"#FFE8AB":"#554018";case 43114:return e==="light"?"#FBDFDF":"#390B0C";case 100:return e==="light"?"#D8E8FF":"#00193C";case 5:return e==="light"?"#FFD871":"#554018";case 80001:return e==="light"?"#FFE8CD":"#554018";default:return"#132362"}};function sSe(t){var e;const{account:r,chain:n,transport:i}=t,s={chainId:n.id,name:n.name,ensAddress:(e=n.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return new lM(i,s).getSigner(r.address)}function oSe(t){var e;const{chain:r,transport:n}=t,i={chainId:r.id,name:r.name,ensAddress:(e=r.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return n.type==="fallback"?new bZ(n.transports.map(({value:s})=>new ha(s==null?void 0:s.url,i))):new ha(n.url,i)}const aSe=async t=>{const e=localStorage.getItem(nr.EthAuthProof);if(e)return JSON.parse(e);const r=localStorage.getItem(nr.EthAuthSettings);if(!r)throw new Error("No ETHAuth settings found");const n=JSON.parse(r),i=t.account.address,s=new pb;s.address=i,s.claims.app=n.app||"app",s.claims.ogn=n.origin,s.claims.n=n.nonce,s.setExpiryIn(n.expiry?Math.max(n.expiry,200):gW);const o=s.messageTypedData();o.domain.verifyingContract;const c=await sSe(t)._signTypedData(o.domain,o.types,o.message);s.signature=c;const u=await new s1().encodeProof(s,!0);return{typedData:o,proofString:u}},cSe=async(t,e,r)=>{const n=t.account.address,s=await new s1().decodeProof(r.proofString,!0),o=oSe(e);return await vu.utils.isValidTypedDataSignature(n,r.typedData,s.signature,o)},Zr=t=>{const e=lt[t];if(!e)throw"invalid network";const r=localStorage.getItem(nr.ProjectAccessKey)||void 0,n=new xC("https://metadata.sequence.app",r),i=new bC(ZE(e.name),r),s=new c0("https://api.sequence.app",r);return{network:e,metadataClient:n,indexerClient:i,apiClient:s}};function lSe({connector:t,onSuccess:e}){if(!t)return{inProgress:!1,loading:!1,error:void 0,initiateAuth:async d=>{},sendChallengeAnswer:async d=>{}};const[r,n]=x.useState(""),[i,s]=x.useState(),[o,a]=x.useState(!1),[c,l]=x.useState("");return{inProgress:o||!!c,loading:o,error:i,initiateAuth:async d=>{a(!0);try{var h;const p=t,{instance:m}=await((h=p.sequenceWaas)==null?void 0:h.email.initiateAuth({email:d}));l(m),n(d)}catch(p){s(p.message||"Unknown error")}finally{a(!1)}},sendChallengeAnswer:c?async d=>{a(!0);try{var h,p;const m=t,v=await((h=m.sequenceWaas)==null?void 0:h.getSessionHash()),{idToken:y}=await((p=m.sequenceWaas)==null?void 0:p.email.finalizeAuth({instance:c,answer:d,email:r,sessionHash:v}));e(y)}catch(m){s(m.message||"Unknown error"),a(!1)}}:void 0}}const uSe=t=>{const{value:e,digits:r=6,onChange:n,disabled:i=!1}=t,s=x.useMemo(()=>DI(0,r).map(()=>x.createRef()),[]);x.useEffect(()=>{var l;(l=s[0])==null||(l=l.current)==null||l.focus()},[]);const o=(l,u)=>{/^\d$/.test(u)||(u="");const f=[...e];if(f[l]=u,u!==""){var d;(d=s[l+1])==null||(d=d.current)==null||d.focus()}n(f)},a=(l,u)=>{var f,d;const h=s[l].current,p=(f=s[l-1])==null?void 0:f.current,m=(d=s[l+1])==null?void 0:d.current;switch(u.key){case"Backspace":u.preventDefault(),h&&(h.value="",o(l,"")),p==null||p.focus();break;case"ArrowLeft":u.preventDefault(),p==null||p.focus();break;case"ArrowRight":u.preventDefault(),m==null||m.focus();break;default:(h==null?void 0:h.value)===u.key&&(u.preventDefault(),o(l,u.key))}},c=(l,u)=>{const d=u.clipboardData.getData("text/plain").replace(/\D/g,"");if(/^\d{6}$/.test(d)){var h;(h=s[0])==null||(h=h.current)==null||h.focus(),n(d.split("")),setTimeout(()=>{var p;(p=s[s.length-1])==null||(p=p.current)==null||p.focus()})}};return g.createElement(q,{gap:"2"},DI(0,r).map(l=>g.createElement(x.Fragment,{key:l},l===r/2&&g.createElement("span",null),g.createElement(q,{as:"input",className:Y7e,value:e[l]||"",ref:s[l],type:"text",inputMode:"numeric",maxLength:1,disabled:i,onFocus:u=>u.target.select(),onPaste:u=>c(l,u),onChange:u=>o(l,u.target.value),onKeyDown:u=>{a(l,u)}}))))},DI=(t,e)=>Array.from({length:e-t},(r,n)=>n+t),fSe=t=>{_v.useScript(_v.appleAuthHelpers.APPLE_SCRIPT_SRC);const{isConnected:e}=XU(),{theme:r}=gp(),{config:n={}}=t,{signIn:i={}}=n,{showEmailInput:s=Xw.showEmailInput,socialAuthOptions:o=Xw.socialAuthOptions,walletAuthOptions:a=Xw.walletAuthOptions}=i,{openConnectModal:c,setOpenConnectModal:l}=t,[u,f]=x.useState(""),[d,h]=x.useState(!1),[p,m]=x.useState([]),{connectors:v,connect:y}=lz(),b=v.filter(N=>!!(N!=null&&N._wallet)),[E,S]=x.useState(!1),P=b.find(N=>N._wallet.id==="mock"),M=b.find(N=>N._wallet.id.includes("email")),L=b.filter(N=>!!a.find(O=>O===N._wallet.id)).sort((N,A)=>a.indexOf(N._wallet.id)-a.indexOf(A._wallet.id)),j=b.filter(N=>!!o.find(O=>O===N._wallet.id)).sort((N,A)=>o.indexOf(N._wallet.id)-o.indexOf(A._wallet.id)),H=L.length>4,K=N=>{f(N.target.value)},{inProgress:Q,loading:Y,initiateAuth:F,sendChallengeAnswer:w}=lSe({connector:b.find(N=>N._wallet.id==="email-waas"),onSuccess:async N=>{localStorage.setItem(nr.WaasEmailIdToken,N),M&&y({connector:M})}});x.useEffect(()=>{e&&c&&l(!1)},[e,c]);const k=N=>{if(i.useMock&&P){y({connector:P});return}if(N._wallet.id==="email"){const O=prompt("Auto-email login, please specify the email address:");localStorage.setItem(H3,O||"")}if(N._wallet.id==="metamask"&&typeof window<"u"){var A;if(!!!((A=window)!=null&&(A=A.ethereum)!=null&&A._metamask)){window.open("https://metamask.io/download/");return}}y({connector:N})},R=async N=>{if(N.preventDefault(),i.useMock&&P){y({connector:P});return}if(M)if(localStorage.setItem(H3,u),M._wallet.id==="email-waas")try{await F(u),h(!0)}catch(A){console.log(A)}else y({connector:M})};return d?g.createElement(g.Fragment,null,g.createElement(q,{paddingY:"6",alignItems:"center",justifyContent:"center",flexDirection:"column"},g.createElement(ae,{marginTop:"5",marginBottom:"4",variant:"normal",color:"text80"},"Enter code received in email."),g.createElement(uSe,{value:p,digits:6,onChange:m}),g.createElement(q,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",style:{height:"44px"}},Y?g.createElement(Vc,null):g.createElement(rt,{variant:"primary",disabled:p.includes(""),label:"Verify",onClick:()=>w==null?void 0:w(p.join("")),"data-id":"verifyButton"})))):E?g.createElement(g.Fragment,null,g.createElement(q,{as:"button",position:"absolute",style:{top:"20px"},onClick:()=>S(!1),className:hf},g.createElement(Bb,null)),g.createElement(J7e,{connectors:L,onConnect:k})):g.createElement(g.Fragment,null,g.createElement(X7e,{config:n}),g.createElement(q,{marginTop:"5"},M&&s&&g.createElement(g.Fragment,null,g.createElement("form",{onSubmit:R},g.createElement(ul,{onChange:K,value:u,name:"email",placeholder:"Enter email","data-1p-ignore":!0}),g.createElement(q,{alignItems:"center",justifyContent:"center",style:{height:"48px"}},!Q&&g.createElement(rt,{type:"submit",disabled:!tSe(u),marginTop:"4",width:"full",label:"Continue",rightIcon:bo}),Q&&g.createElement(Vc,{marginTop:"4"})))),j.length>0&&g.createElement(g.Fragment,null,M&&s&&g.createElement(g.Fragment,null,g.createElement(q,{style:{marginBottom:"-4px"}},g.createElement(m1,{color:"backgroundSecondary"})),g.createElement(q,{justifyContent:"center",alignItems:"center"},g.createElement(ae,{variant:"small",color:"text50"},"or sign in via"))),g.createElement(q,{marginTop:"3",gap:"2",flexDirection:"row",justifyContent:"center",alignItems:"center",flexWrap:"wrap"},j.map(N=>{var A;const O=r==="dark"?N._wallet.monochromeLogoDark:N._wallet.monochromeLogoLight;return g.createElement(q,{key:N._wallet.id,aspectRatio:"1/1",alignItems:"center",justifyContent:"center",style:{width:"40px",height:"40px",margin:"12px 4px"}},N._wallet.id==="google-waas"&&g.createElement(q,{className:yW},g.createElement(Ppe,{type:"icon",size:"large",nonce:(A=localStorage.getItem(nr.WaasSessionHash))!=null?A:void 0,onSuccess:B=>{B.credential&&(localStorage.setItem(nr.WaasGoogleIdToken,B.credential),k(N))},onError:()=>{console.log("Login Failed")}})),N._wallet.id==="apple-waas"&&g.createElement(kn,{width:"full",height:"full",padding:"2",borderRadius:"xs",className:hf,justifyContent:"center",alignItems:"center",onClick:()=>{const B=localStorage.getItem(nr.WaasAppleClientID)||"",I=localStorage.getItem(nr.WaasAppleRedirectURI)||"",C=localStorage.getItem(nr.WaasSessionHash)||"";_v.appleAuthHelpers.signIn({authOptions:{clientId:B,scope:"openid email",redirectURI:I,usePopup:!0,nonce:C},onSuccess:D=>{var z;(z=D.authorization)!=null&&z.id_token?(localStorage.setItem(nr.WaasAppleIdToken,D.authorization.id_token),k(N)):console.log("Apple login error: No id_token found")},onError:D=>console.error(D)})}},g.createElement(q,{width:"12",height:"12",flexDirection:"column",alignItems:"center",justifyContent:"center"},g.createElement(O,null))),!N._wallet.id.includes("waas")&&g.createElement(kn,{width:"full",height:"full",padding:"2",borderRadius:"xs",className:hf,justifyContent:"center",alignItems:"center",onClick:()=>{k(N)}},g.createElement(q,{width:"16",height:"16",flexDirection:"column",alignItems:"center",justifyContent:"center"},g.createElement(O,null))))}))),L.length>0&&g.createElement(g.Fragment,null,(M&&s||j.length>0)&&g.createElement(g.Fragment,null,g.createElement(q,{style:{marginBottom:"-4px"}},g.createElement(m1,{color:"backgroundSecondary"})),g.createElement(q,{justifyContent:"center",alignItems:"center"},g.createElement(ae,{variant:"small",color:"text50"},"or select a wallet"))),g.createElement(q,{marginTop:"2",gap:"2",flexDirection:"row",justifyContent:"center",alignItems:"center"},L.map(N=>{const A=r==="dark"?N._wallet.logoDark||N._wallet.logoDark:N._wallet.logoLight||N._wallet.logoLight;return g.createElement(kn,{key:N._wallet.id,style:{width:"43px",height:"43px",margin:"12px 4px"},padding:"2",borderRadius:"xs",className:hf,justifyContent:"center",alignItems:"center",onClick:()=>k(N)},g.createElement(q,{width:"16",height:"16",flexDirection:"column",alignItems:"center",justifyContent:"center"},g.createElement(A,null)))})),H&&g.createElement(q,{padding:"4",marginTop:"3",background:"backgroundSecondary",width:"full",justifyContent:"space-between",alignItems:"center",borderRadius:"md",color:"text100",as:"button",className:hf,onClick:()=>S(!0)},g.createElement(ae,{variant:"medium"},"More options"),g.createElement(bo,null)))))};function dSe(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const LI=t=>{let e=Ln({},(dSe(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Ln({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),g.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},g.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}))),g.createElement("defs",{id:"defs1314"},g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},g.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),g.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},g.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),g.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},g.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),g.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},g.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),g.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},g.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),g.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},g.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),g.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},g.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),g.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},g.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),g.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},g.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),g.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},g.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),g.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),g.createElement("clipPath",{id:"clip0_5_131"},g.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),g.createElement("clipPath",{id:"clip1_5_131"},g.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))},[xW,hSe]=dh(),[pSe,mSe]=dh(),[vSe,ySe]=dh(),[gSe,bSe]=dh();class h8{constructor(){this._resolve=()=>{},this._reject=()=>{},this._promise=new Promise((e,r)=>{this._reject=r,this._resolve=e})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}let nf;function xSe(t){const[e,r]=x.useState();function n(s){var o;(o=nf)==null||o.resolve({id:s,confirmed:!0}),r(void 0),nf=void 0}function i(s){var o;(o=nf)==null||o.resolve({id:s,confirmed:!1}),r(void 0),nf=void 0}return x.useEffect(()=>{async function s(){if(!t)return;const o=t.sequenceWaasProvider;o&&(o.requestConfirmationHandler={confirmSignTransactionRequest(a,c,l){const u=new h8;return r({id:a,type:"signTransaction",txs:Array.isArray(c)?c:[c],chainId:l}),nf=u,u.promise},confirmSignMessageRequest(a,c,l){const u=new h8;return r({id:a,type:"signMessage",message:c,chainId:l}),nf=u,u.promise}})}s()}),[e,n,i]}let ec=function(t){return t.APPROVE="approve",t.TRANSFER="transfer",t.SWAP="swap",t.AWARD_ITEM="awardItem",t.UNIMPLEMENTED="unimplemented",t.UNKNOWN="unknown",t}({});const wW=t=>Object.fromEntries(t.map((e,r)=>[e.name&&!e.name.startsWith("unnamed")?e.name:`_${r}`,Array.isArray(e.value)&&e.type.startsWith("(")&&(e.type.endsWith(")")||e.type.endsWith(")[]"))?wW(e.value):e.value])),EW=(t,e,r,n)=>{const i=wW(e.args),s=rr(n,0,4);let o=[];switch(e.signature){case"execute((bool,bool,uint256,address,uint256,bytes)[],uint256,bytes)":case"selfExecute((bool,bool,uint256,address,uint256,bytes)[])":o=e.args[0].value.map(c=>c.call?EW(c.target,c.call,c.value,c.data):{to:c.target,signature:"",byteSignature:rr(c.data,0,4),methodName:"",args:{},objs:[],value:te.from(c.value).toString(),data:le(c.data)})}return{to:t,signature:e.signature,byteSignature:s,methodName:e.function,args:i,objs:o,value:te.from(r).toString(),data:le(n)}},wSe=t=>t.map(e=>"target"in e?e:Ln({},e,{target:e.to})).map(e=>{var r,n,i,s,o,a;return{delegateCall:(r=e.delegateCall)!=null?r:!1,revertOnError:(n=e.revertOnError)!=null?n:!1,gasLimit:(i=e.gasLimit)!=null?i:0,target:(s=e.target)!=null?s:"0x0000000000000000000000000000000000000000",value:(o=e.value)!=null?o:0,data:(a=e.data)!=null?a:"0x"}});let sf=function(t){return t.SEQUENCE_DEPLOY="0x32c02a14",t.SEQUENCE_PUBLISH_CONFIG="0x44d466c2",t.SEQUENCE_UPDATE_IMAGE_HASH="0x29561426",t.SEQUENCE_UPDATE_IMPLEMENTATION="0x025b22bc",t.SEQUENCE_REQUIRE_SESSION_NONCE="0x8853baa0",t.EXECUTE="0x7a9a1628",t.SELF_EXECUTE="0x61c2926c",t.APPROVE="0x095ea7b3",t.TRANSFER="0xa9059cbb",t.DEPOSIT="0xd0e30db0",t.WITHDRAW="0x2e1a7d4d",t.ERC721_SAFE_TRANSFER_FROM="0x42842e0e",t.ERC721_SAFE_TRANSFER_FROM_WITH_DATA="0xb88d4fde",t.ERC1155_SAFE_TRANSFER_FROM="0xf242432a",t.ERC1155_SAFE_BATCH_TRANSFER_FROM="0x2eb2c2d6",t.NIFTYSWAP_BUY_TOKENS="0xd93e8aaa",t.TRANSFORM_ERC20="0x415565b0",t.OUTBOUND_TRANSFER_TO="0xa44bbb15",t.CELER_SEND="0xa5977fbb",t.UNISWAPV3_MULTICALL="0x5ae401dc",t.UNISWAPV2_SWAP_EXACT_TOKENS_FOR_TOKENS="0x38ed1739",t.UNISWAPV2_SWAP_TOKENS_FOR_EXACT_TOKENS="0x8803dbee",t.UNISWAPV2_SWAP_EXACT_ETH_FOR_TOKENS="0x7ff36ab5",t.UNISWAPV2_SWAP_ETH_FOR_EXACT_TOKENS="0xfb3bdb41",t.UNISWAPV2_SWAP_TOKENS_FOR_EXACT_ETH="0x4a25d94a",t.UNISWAPV2_SWAP_EXACT_TOKENS_FOR_ETH="0x18cbafe5",t.AWARD_ITEM="0xcf378343",t}({});const ESe=async t=>{const r=new wr(SSe).encodeFunctionData("selfExecute",[t]);try{const{apiClient:n}=Zr(1),{call:i}=await n.decodeContractCall({callData:r});return EW("",i,0,r)}catch(n){throw new Error(n)}},CSe=async(t,e)=>{const r=wSe(e),n=(await ESe(r)).objs,i=Cs.getAddress(t);return r.map((o,a)=>{const c=n[a],l=o.data.toString(),u=te.from(o.value).toString(),f=o.target;if(l==="0x"||!l)return{signature:"",byteSignature:"",type:ec.TRANSFER,methodName:"nativeTokenTransfer",transferType:yn.SEND,contractAddress:Dt,contractType:_s.UNKNOWN,from:i,to:Cs.getAddress(o.target),tokenIds:["0"],amounts:[u],target:f,value:u};if(!c)return;const d=Cs.getAddress(o.target),h={type:ec.UNIMPLEMENTED,signature:c.signature,byteSignature:c.byteSignature,methodName:c.methodName,target:f,value:u};switch(c.byteSignature){case sf.TRANSFER:{const{args:p}=c;return Ln({},h,{type:ec.TRANSFER,transferType:yn.SEND,contractAddress:d,contractType:_s.ERC20,from:i,to:Cs.getAddress(p.recipient),tokenIds:["0"],amounts:[String(p.amount)]})}case sf.ERC721_SAFE_TRANSFER_FROM:case sf.ERC721_SAFE_TRANSFER_FROM_WITH_DATA:{const p=c.args;return Ln({},h,{type:ec.TRANSFER,transferType:yn.SEND,contractAddress:d,contractType:_s.ERC721,from:i,to:Cs.getAddress(p.to),tokenIds:[p.tokenId],amounts:["1"]})}case sf.ERC1155_SAFE_TRANSFER_FROM:{const p=c.args;return Ln({},h,{type:ec.TRANSFER,transferType:yn.SEND,contractAddress:d,contractType:_s.ERC1155,from:i,to:Cs.getAddress(p._to),tokenIds:[p._id],amounts:[p._amount]})}case sf.ERC1155_SAFE_BATCH_TRANSFER_FROM:{const{args:p}=c;return Ln({},h,{type:ec.TRANSFER,transferType:yn.SEND,contractAddress:d,contractType:_s.ERC1155,from:i,to:Cs.getAddress(p._to),tokenIds:p._ids,amounts:p._amounts})}case sf.AWARD_ITEM:{const{args:p}=c;return Ln({},h,{type:ec.AWARD_ITEM,contractAddress:d,to:Cs.getAddress(p._0),amount:"1"})}}}).flatMap(o=>o?[o]:[])},SSe=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"},{type:"function",name:"setExtraImageHash",constant:!1,inputs:[{type:"bytes32",name:"imageHash"},{type:"uint256",name:"expiration"}],outputs:[],payable:!1,stateMutability:"nonpayable"}],kSe=()=>g.createElement(q,{alignItems:"center",justifyContent:"space-between"},g.createElement(q,{justifyContent:"center",alignItems:"center",gap:"2"},g.createElement(pt,{width:30,height:30,borderRadius:"circle"}),g.createElement(q,{flexDirection:"column",gap:"2",alignItems:"flex-start"},g.createElement(pt,{width:100,height:14}),g.createElement(pt,{width:75,height:14}))),g.createElement(q,{flexDirection:"column",gap:"2",alignItems:"flex-end"},g.createElement(pt,{width:100,height:14}),g.createElement(pt,{width:50,height:12}))),ASe=({address:t,txs:e,chainId:r})=>{sh();const[n,i]=x.useState(void 0),[s,o]=x.useState([]),[a,c]=x.useState([]),l=async()=>{const u=await CSe(t,e);i(u[0].type),u[0].type==="transfer"&&o(u),u[0].type==="awardItem"&&c(u)};if(x.useEffect(()=>{l()},[]),!n)return g.createElement(kSe,null);if(n===ec.UNKNOWN)return g.createElement(g.Fragment,null);if(s.length>=1)return g.createElement(_Se,{address:t,transferProps:s,chainId:r});if(a.length>=1)return g.createElement(PSe,{awardItemProps:a[0]})},_Se=({address:t,transferProps:e,chainId:r})=>{var n,i,s,o,a,c,l,u,f,d,h,p,m,v,y,b,E,S,P;const{chains:M}=sh(),L=(n=e[0])==null?void 0:n.contractAddress,j=(i=e[0])==null?void 0:i.to,H=L?G7e(L,Dt):!0,K=((s=e[0])==null?void 0:s.contractType)===_s.ERC1155,Q=((o=e[0])==null?void 0:o.contractType)===_s.ERC1155||((a=e[0])==null?void 0:a.contractType)===_s.ERC721,Y=Ir(r,M),{data:F=[],isLoading:w}=L2({accountAddress:t,chainIds:[r],contractAddress:L},{hideUnlistedTokens:!1}),{data:k,isLoading:R}=uW({tokens:{chainId:r,contractAddress:L,tokenIds:(c=(l=e[0])==null?void 0:l.tokenIds)!=null?c:[]}}),N=L?F.find(_=>Cs.getAddress(_.contractAddress)===Cs.getAddress(L)):void 0,A=H?Y.decimals:(N==null||(u=N.contractInfo)==null?void 0:u.decimals)||18,O=H?Y.logoURI:Q?k==null||(f=k[0])==null?void 0:f.image:N==null||(d=N.contractInfo)==null?void 0:d.logoURI,B=H?Y.name:Q?k==null||(h=k[0])==null?void 0:h.name:(N==null||(p=N.contractInfo)==null?void 0:p.name)||"",I=H?Y.symbol:Q?"":(N==null||(m=N.contractInfo)==null?void 0:m.symbol)||"",C=N!==void 0?Nt(N.balance,A):"";Oo(C);const D=(v=(y=e[0])==null||(y=y.amounts)==null?void 0:y[0])!=null?v:(b=e[0])==null?void 0:b.value,z=Q;return g.createElement(kn,null,g.createElement(q,{marginBottom:"2"},g.createElement(ae,{variant:"medium",color:"text100"},ISe((E=(S=e[0])==null?void 0:S.type)!=null?E:""))),g.createElement(q,{alignItems:"flex-end",justifyContent:"space-between",marginBottom:"2"},g.createElement(q,{justifyContent:"space-between",alignItems:"center",gap:"2"},z?g.createElement(q,{style:{width:"40px"}},g.createElement(Np,{imageUrl:O})):g.createElement(el,{imageUrl:O,size:40}),g.createElement(q,{flexDirection:"column",alignItems:"flex-start"},g.createElement(q,{flexDirection:"row",alignItems:"center",gap:"1"},g.createElement(ae,{variant:"medium",color:"text100"},B)),g.createElement(ae,{color:"text50",variant:"normal"}," ",`${Nt(D,K?k==null||(P=k[0])==null?void 0:P.decimals:Q?0:A)} ${I} `)))),j!==void 0&&g.createElement(q,null,g.createElement(ae,{fontSize:"normal",color:"text50"},"To"),g.createElement(q,{marginTop:"2",borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",style:{height:"52px"}},g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},g.createElement(Ru,{address:j,style:{width:"20px"}}),g.createElement(ae,{color:"text100"},`0x${CW(j.substring(2),12)}`)))))},PSe=({awardItemProps:t})=>g.createElement(kn,null,g.createElement(q,{marginBottom:"2"},g.createElement(ae,{variant:"medium",color:"text100"},"Mint")),g.createElement(q,{alignItems:"flex-end",justifyContent:"space-between",marginBottom:"2"},g.createElement(q,{justifyContent:"space-between",alignItems:"center",gap:"2"},g.createElement(q,{style:{width:"40px"}},g.createElement(Np,{imageUrl:"https://dev-metadata.sequence.app/projects/277/collections/62/tokens/0/image.jpeg"})),g.createElement(q,{flexDirection:"column",alignItems:"flex-start"},g.createElement(q,{flexDirection:"row",alignItems:"center",gap:"1"},g.createElement(ae,{variant:"medium",color:"text100"},"Waas Demo NFT")),g.createElement(ae,{color:"text50",variant:"normal"},t.amount)))),t.to!==void 0&&g.createElement(q,null,g.createElement(ae,{fontSize:"normal",color:"text50"},"To"),g.createElement(q,{marginTop:"2",borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",style:{height:"52px"}},g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},g.createElement(Ru,{address:t.to,style:{width:"20px"}}),g.createElement(ae,{color:"text100"},`0x${CW(t.to.substring(2),12)}`))))),ISe=t=>t.charAt(0).toUpperCase()+t.slice(1),CW=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},TSe={dark:"dark",light:"light"},OSe=t=>{var e,r,n,i;const{config:s,children:o}=t,{defaultTheme:a="dark",signIn:c={},position:l="center",displayedAssets:u=[],ethAuth:f={},disableAnalytics:d=!1}=s,h=c.projectName||"app",{expiry:p=gW,app:m=h,origin:v=location.origin,nonce:y}=f,{projectName:b}=c,[E,S]=x.useState(!1),[P,M]=x.useState(a||TSe.dark),[L,j]=x.useState(l),[H,K]=x.useState(u),[Q,Y]=x.useState(),{address:F,isConnected:w}=XU(),R=(e=uz().find(D=>D.connector.id.includes("waas")))==null?void 0:e.connector,[N,A,O]=xSe(R),B=localStorage.getItem(nr.WaasGoogleClientID)||"",I=D=>{const _=vu.initWallet(D).client.analytics;Y(_)};x.useEffect(()=>{if(!w){Q==null||Q.reset();return}F&&(Q==null||Q.identify(F.toLowerCase()))},[Q,F,w]);const C=()=>{typeof window<"u"&&window.open("https://sequence.xyz")};return x.useEffect(()=>{const D=localStorage.getItem(nr.ProjectAccessKey)||"";d||I(D)},[]),x.useEffect(()=>{P!==a&&M(a)},[a]),x.useEffect(()=>{L!==l&&j(l)},[l]),x.useEffect(()=>{typeof P=="object"||localStorage.setItem(nr.Theme,P),localStorage.setItem(nr.EthAuthSettings,JSON.stringify({expiry:p,app:m,origin:v,nonce:y}))},[P,f]),x.useEffect(()=>{K(H)},[u]),g.createElement(ySe,{value:{theme:P,setTheme:M,position:L,setPosition:j}},g.createElement(Spe,{clientId:B},g.createElement(mSe,{value:{setOpenConnectModal:S,openConnectModalState:E}},g.createElement(bSe,{value:{setDisplayedAssets:K,displayedAssets:H}},g.createElement(hSe,{value:{setAnalytics:Y,analytics:Q}},g.createElement("div",{id:"kit-provider"},g.createElement(Qb,{root:"#kit-provider",scope:"kit",theme:P},g.createElement(wd,null,E&&g.createElement(eg,{scroll:!1,backdropColor:"backgroundBackdrop",size:"sm",contentProps:{style:Ln({maxWidth:"364px"},Mg(l))},onClose:()=>S(!1)},g.createElement(q,{padding:"4",className:$g},g.createElement(q,{justifyContent:"center",color:"text100",alignItems:"center",fontWeight:"medium",style:{marginTop:"4px"}},g.createElement(ae,null,"Sign in ",b?`to ${b}`:"")),g.createElement(fSe,Ln({openConnectModal:E,setOpenConnectModal:S},t)),g.createElement(q,{onClick:C,className:hf,gap:"1",marginTop:"2",flexDirection:"row",alignItems:"center",justifyContent:"center"},g.createElement(ae,{fontSize:"small",color:"text100"},"Powered by Sequence"),g.createElement(q,{height:"5",width:"5"},g.createElement(LI,null)))))),g.createElement(wd,null,N&&g.createElement(eg,{scroll:!1,backdropColor:"backgroundBackdrop",size:"sm",contentProps:{style:Ln({maxWidth:"364px"},Mg(l))},isDismissible:!1,onClose:()=>{O("")}},g.createElement(q,{paddingX:"4",paddingTop:"4",paddingBottom:"2",className:$g},g.createElement(q,{flexDirection:"column",justifyContent:"center",color:"text100",alignItems:"center",fontWeight:"medium",style:{marginTop:"4px"}},g.createElement(ae,{as:"h1",variant:"large",marginBottom:"5"},"Confirm ",N.type==="signMessage"?"signing message":"transaction"),N.type==="signMessage"&&g.createElement(q,{flexDirection:"column",width:"full"},g.createElement(ae,{fontSize:"normal",color:"text50"},"Message"),g.createElement(kn,{marginTop:"2",paddingY:"6"},g.createElement(ae,{variant:"normal",marginBottom:"4"},cs((r=N.message)!=null?r:"")))),N.type==="signTransaction"&&g.createElement(q,{flexDirection:"column",width:"full"},g.createElement(ASe,{address:F??"",txs:(n=N.txs)!=null?n:[],chainId:(i=N.chainId)!=null?i:137}),g.createElement(que,{label:"Transaction data",marginTop:"4"},g.createElement(kn,{overflowX:"scroll",marginY:"3"},g.createElement(ae,{variant:"code",marginBottom:"4"},JSON.stringify(N.txs,null,2))))),N.chainId&&g.createElement(q,{width:"full",marginTop:"3",justifyContent:"flex-end",alignItems:"center"},g.createElement(q,{width:"1/2",justifyContent:"flex-start"},g.createElement(ae,{variant:"small",color:"text50"},"Network")),g.createElement(q,{width:"1/2",justifyContent:"flex-end"},g.createElement(fh,{chainId:N.chainId}))),g.createElement(q,{flexDirection:"row",gap:"2",width:"full",marginTop:"5"},g.createElement(rt,{width:"full",shape:"square",size:"lg",label:"Reject",onClick:()=>{O(N==null?void 0:N.id)}}),g.createElement(rt,{alignItems:"center",textAlign:"center",width:"full",shape:"square",size:"lg",label:"Confirm",variant:"primary",onClick:()=>{A(N==null?void 0:N.id)}}))),g.createElement(q,{gap:"1",marginTop:"4",flexDirection:"row",alignItems:"center",justifyContent:"center"},g.createElement(ae,{fontSize:"small",color:"text80"},"Powered by Sequence"),g.createElement(q,{height:"4",width:"4",marginTop:"1"},g.createElement(LI,null)))))))),o)))))},RSe=()=>{const{setOpenConnectModal:t,openConnectModalState:e}=pSe();return{setOpenConnectModal:t,openConnectModalState:e}},Dp=()=>{const{setTheme:t,theme:e,position:r,setPosition:n}=vSe();return{setTheme:t,theme:e,position:r,setPosition:n}},$Se=()=>{const{setDisplayedAssets:t,displayedAssets:e}=gSe();return{displayedAssets:e,setDisplayedAssets:t}};let qh;function MSe(){var t;const r=(t=uz().find(a=>a.connector.id.includes("waas")))==null?void 0:t.connector,[n,i]=x.useState();function s(a,c){var l;(l=qh)==null||l.resolve({id:a,feeTokenAddress:c,confirmed:!0}),i(void 0),qh=void 0}function o(a){var c;(c=qh)==null||c.resolve({id:a,feeTokenAddress:void 0,confirmed:!1}),i(void 0),qh=void 0}return x.useEffect(()=>{async function a(){if(!r)return;const c=r.sequenceWaasProvider;c&&(c.feeConfirmationHandler={confirmFeeOption(l,u,f,d){const h=new h8;return i({id:l,options:u,chainId:d}),qh=h,h.promise}})}a()}),[n,s,o]}var NSe=()=>typeof window<"u"&&window.localStorage.getItem("IS_PAPER_DEV")==="true",DSe=()=>typeof window<"u"&&window.location.origin.includes("paper.xyz"),LSe=()=>typeof window<"u"&&window.location.origin.includes("thirdweb.com"),SW=()=>{var t;return NSe()?(t=window.localStorage.getItem("PAPER_DEV_URL"))!=null?t:"http://localhost:3000":DSe()||LSe()?window.location.origin:"https://withpaper.com"},kW={colorPrimary:"#cf3781",colorBackground:"#ffffff",colorText:"#1a202c",borderRadius:12,fontFamily:"Open Sans"},jSe=Object.defineProperty,BSe=Object.defineProperties,FSe=Object.getOwnPropertyDescriptors,jI=Object.getOwnPropertySymbols,USe=Object.prototype.hasOwnProperty,zSe=Object.prototype.propertyIsEnumerable,BI=(t,e,r)=>e in t?jSe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kn=(t,e)=>{for(var r in e||(e={}))USe.call(e,r)&&BI(t,r,e[r]);if(jI)for(var r of jI(e))zSe.call(e,r)&&BI(t,r,e[r]);return t},FI=(t,e)=>BSe(t,FSe(e)),qSe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),AW=qSe((t,e)=>{e.exports={name:"@paperxyz/js-client-sdk",description:"Paper JS SDK for Checkout Elements",version:"0.2.7",license:"Apache-2.0",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",files:["dist/**"],bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",scripts:{build:"tsup src/index.ts --env.NODE_ENV production","build-package-checkout":"yarn build","dev-checkout":"tsup src/index.ts --env.NODE_ENV development --watch",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/js-client-sdk"},keywords:[],devDependencies:{"@paperxyz/tsconfig":"*","eslint-config-paperxyz":"*",typescript:"^4.7.4"},dependencies:{"@paperxyz/sdk-common-utilities":"*",ethers:"^5.7.2"},publishConfig:{access:"public"}}}),_W=SW(),WSe="/sdk/2022-08-12/checkout-with-card",HSe=(t=>(t.UserAbandonedCheckout="User abandoned the checkout",t.UserLoginFailed="User login failed",t.InvalidProps="The props you passed in to this component are not valid.",t.InvalidCard="The card information is invalid. Please double check that the Card, CVC, and Zip code are all correct.",t.EmailNotVerified="The email was unable to be verified.",t.NotEnoughSupply="There is not enough supply to claim.",t.AddressNotAllowed="This address is not on the allowlist.",t.NoActiveClaimPhase="There is no active claim phase at the moment.",t))(HSe||{}),VSe=(t=>(t.ErrorConnectingToWallet="Error connecting to wallet",t.ErrorSendingTransaction="Something went wrong sending transaction",t.InsufficientBalance="Insufficient ETH",t.TransactionCancelled="Transaction Cancelled",t.WrongChain="Wrong Chain Detected",t.ChainSwitchUnderway="There is a network switch already underway",t.PendingSignature="Pending Signature",t))(VSe||{}),GSe=class{constructor(t){this.link=t}addStylingOptions(t){t.colorPrimary&&this.link.searchParams.set("colorPrimary",t.colorPrimary),t.colorBackground&&this.link.searchParams.set("colorBackground",t.colorBackground),t.colorText&&this.link.searchParams.set("colorText",t.colorText),t.borderRadius!==void 0&&this.link.searchParams.set("borderRadius",t.borderRadius.toString()),t.fontFamily&&this.link.searchParams.set("fontFamily",t.fontFamily),t.inputBackgroundColor&&this.link.searchParams.set("inputBackgroundColor",t.inputBackgroundColor),t.inputBorderColor&&this.link.searchParams.set("inputBorderColor",t.inputBorderColor)}addClientSecret(t){this.link.searchParams.set("sdkClientSecret",t)}addLocale(t){t&&this.link.searchParams.set("locale",t.toString())}addOTP(){this.link.searchParams.set("withOTP","true")}addAppName(t){t&&this.link.searchParams.set("appName",t)}addShowConnectWalletOptions(t){this.link.searchParams.append("showConnectWalletOptions",t.toString())}addReceivingWalletType(t){this.link.searchParams.append("walletType",t||"Preset")}addRecipientWalletAddress(t){this.link.searchParams.set("recipientWalletAddress",t)}addPayerWalletAddress(t){this.link.searchParams.append("payerWalletAddress",t)}addDate(t){this.link.searchParams.set("date",t?t.toString():Date.now().toString())}getLink(){return this.link}},KSe=({url:t,width:e=440,height:r=700})=>{if(!(window!=null&&window.top))return null;let n=window.top.outerHeight/2+window.top.screenY-r/2,i=window.top.outerWidth/2+window.top.screenX-e/2;return window.open(t,"_blank",`popup=true,width=${e},height=${r},top=${n},left=${i}`)};function UI(t,e,r){var n;(n=t.contentWindow)==null||n.postMessage(Kn({eventType:e},r),"*")}var QSe=AW(),YSe=class{constructor({elementOrId:e,onLoad:r}){this.elementOrId=e,this.onLoad=r}createPaymentElement({handler:e,link:r,iframeId:n}){let i=document.createElement("iframe");if(i.src=r.href,i.id=n,i.allow="payment",i.setAttribute("style","margin-left:auto; margin-right:auto; width:100%; height: 100%; min-height:375px; transition-property:all; transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1); transition-duration:150ms; color-scheme: light;"),i.onload=a=>{this.onLoad&&this.onLoad(a)},i.setAttribute("data-paper-sdk-version",`@paperxyz/js-client-sdk@${QSe.version}`),!this.elementOrId)return window.addEventListener("message",e(i)),i;let s=this.elementOrId;if(typeof s=="string"){let a=document.getElementById(s);if(!a)throw new Error("Invalid id given");s=a}let o=s.querySelector("#"+n);return o?(o.src===r.href||(o.src=r.href),o):(window.addEventListener("message",e(i)),s.appendChild(i))}},zI={top:"0px",left:"0px",right:"0px",bottom:"0px"},JSe=()=>({main:FI(Kn({},zI),{position:"fixed",zIndex:"10000",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto"}),overlay:FI(Kn({},zI),{position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.33)",pointerEvents:"auto"}),body:{background:"transparent",borderRadius:"12px",position:"relative",overflow:"hidden",width:"100%",maxWidth:"500px",height:"700px",maxHeight:"80%",animation:"pew-modal-slideIn 0.2s forwards",pointerEvents:"auto"},spinner:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",margin:"auto",borderWidth:"3px",borderColor:"#2D3748 #2D3748 transparent transparent",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite"},iframe:{position:"relative",height:"100%",width:"100%",border:"none",background:"transparent"}}),XSe=` +`)},y4e=0,Ku=[];function g4e(t){var e=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),i=w.useState(y4e++)[0],s=w.useState(function(){return Eq()})[0],o=w.useRef(t);w.useEffect(function(){o.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var m=GC([t.lockRef.current],(t.shards||[]).map(uI),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=w.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var y=Tm(m),b=r.current,E="deltaX"in m?m.deltaX:b[0]-y[0],S="deltaY"in m?m.deltaY:b[1]-y[1],P,M=m.target,L=Math.abs(E)>Math.abs(S)?"h":"v";if("touches"in m&&L==="h"&&M.type==="range")return!1;var j=cI(L,M);if(!j)return!0;if(j?P=L:(P=L==="v"?"h":"v",j=cI(L,M)),!j)return!1;if(!n.current&&"changedTouches"in m&&(E||S)&&(n.current=P),!P)return!0;var H=n.current||P;return p4e(H,v,m,H==="h"?E:S,!0)},[]),c=w.useCallback(function(m){var v=m;if(!(!Ku.length||Ku[Ku.length-1]!==s)){var y="deltaY"in v?lI(v):Tm(v),b=e.current.filter(function(P){return P.name===v.type&&P.target===v.target&&m4e(P.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var E=(o.current.shards||[]).map(uI).filter(Boolean).filter(function(P){return P.contains(v.target)}),S=E.length>0?a(v,E[0]):!o.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),l=w.useCallback(function(m,v,y,b){var E={name:m,delta:v,target:y,should:b};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(S){return S!==E})},1)},[]),u=w.useCallback(function(m){r.current=Tm(m),n.current=void 0},[]),f=w.useCallback(function(m){l(m.type,lI(m),m.target,a(m,t.lockRef.current))},[]),d=w.useCallback(function(m){l(m.type,Tm(m),m.target,a(m,t.lockRef.current))},[]);w.useEffect(function(){return Ku.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Gu),document.addEventListener("touchmove",c,Gu),document.addEventListener("touchstart",u,Gu),function(){Ku=Ku.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,Gu),document.removeEventListener("touchmove",c,Gu),document.removeEventListener("touchstart",u,Gu)}},[]);var h=t.removeScrollBar,p=t.inert;return w.createElement(w.Fragment,null,p?w.createElement(s,{styles:v4e(i)}):null,h?w.createElement(a4e,{gapMode:"margin"}):null)}const b4e=QCe(wq,g4e);var Aq=w.forwardRef(function(t,e){return w.createElement(E2,Gi({},t,{ref:e,sideCar:b4e}))});Aq.classNames=E2.classNames;const x4e=Aq,_q="Popover",[Pq,HAe]=Xz(_q,[hq]),C2=hq(),[w4e,eh]=Pq(_q),E4e=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=C2(e),c=w.useRef(null),[l,u]=w.useState(!1),[f=!1,d]=DCe({prop:n,defaultProp:i,onChange:s});return w.createElement(RCe,a,w.createElement(w4e,{scope:e,contentId:REe(),triggerRef:c,open:f,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:l,onCustomAnchorAdd:w.useCallback(()=>u(!0),[]),onCustomAnchorRemove:w.useCallback(()=>u(!1),[]),modal:o},r))},C4e="PopoverAnchor",S4e=w.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=eh(C4e,r),s=C2(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return w.useEffect(()=>(o(),()=>a()),[o,a]),w.createElement(yq,ln({},s,n,{ref:e}))}),k4e="PopoverTrigger",A4e=w.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=eh(k4e,r),s=C2(r),o=Ou(e,i.triggerRef),a=w.createElement(wp.button,ln({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Tq(i.open)},n,{ref:o,onClick:Gl(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:w.createElement(yq,ln({asChild:!0},s),a)}),_4e="PopoverPortal",[VAe,P4e]=Pq(_4e,{forceMount:void 0}),R1="PopoverContent",I4e=w.forwardRef((t,e)=>{const r=P4e(R1,t.__scopePopover),{forceMount:n=r.forceMount,...i}=t,s=eh(R1,t.__scopePopover);return w.createElement(gq,{present:n||s.open},s.modal?w.createElement(T4e,ln({},i,{ref:e})):w.createElement(O4e,ln({},i,{ref:e})))}),T4e=w.forwardRef((t,e)=>{const r=eh(R1,t.__scopePopover),n=w.useRef(null),i=Ou(e,n),s=w.useRef(!1);return w.useEffect(()=>{const o=n.current;if(o)return UCe(o)},[]),w.createElement(x4e,{as:f9,allowPinchZoom:!0},w.createElement(Iq,ln({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Gl(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Gl(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Gl(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),O4e=w.forwardRef((t,e)=>{const r=eh(R1,t.__scopePopover),n=w.useRef(!1),i=w.useRef(!1);return w.createElement(Iq,ln({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),Iq=w.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...f}=t,d=eh(R1,r),h=C2(r);return EEe(),w.createElement(CEe,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},w.createElement(bEe,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>d.onOpenChange(!1)},w.createElement($Ce,ln({"data-state":Tq(d.open),role:"dialog",id:d.contentId},h,f,{ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function Tq(t){return t?"open":"closed"}const R4e=E4e,$4e=S4e,M4e=A4e,N4e=I4e,Oq=()=>{const t=g.createContext(void 0);return[()=>{const r=g.useContext(t);if(!r)throw new Error("useGenericContext must be used within a Provider");return r},t.Provider]},[D4e,L4e]=Oq(),Cp=()=>{const{setOpenWalletModal:t,openWalletModalState:e}=D4e();return{setOpenWalletModal:t,openWalletModalState:e}};function En(){return En=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}const fr=(t,e)=>t.toLowerCase()===e.toLowerCase(),g9=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},Rq=t=>`0x${g9((t==null?void 0:t.substring(2))||"",8)}`;var Qa=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(Qa||{});const Io=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=Qa.VERY_LARGE:e<1e-10?r=Qa.VERY_TINY:e<1?r=Qa.FRACTION:r=Qa.MIXED;let n,i;switch(r){case Qa.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case Qa.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case Qa.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",En({notation:n},i)).format(e)},j4e=t=>t.charAt(0).toUpperCase()+t.slice(1),$q=(t,e)=>{const r=t.split(".");return r.length===1?t:`${r[0]}.${r[1].slice(0,e)}`},yg=t=>/0x[a-fA-F0-9]{40}/.test(t),B4e=t=>t>0?Te.colors.positive:t<0?Te.colors.negative:Te.colors.text50,fI=(t,e)=>{var r;const n=e.find(s=>fr(s.token.contractAddress,t.contractAddress));return n&&(n==null||(r=n.price24hChange)==null?void 0:r.value)||0},To=({balance:t,prices:e,decimals:r,conversionRate:n})=>{var i;let s=0;const o=e.find(f=>fr(f.token.contractAddress,t.contractAddress));if(!o)return"0.00";const a=((i=o.price)==null?void 0:i.value)||0,c=Nt(t.balance,r),l=parseFloat(c)*a;return s+=l,`${(s*n).toFixed(2)}`},Mq=t=>{const e=[],r=[],n=[];t.forEach(a=>{a.contractAddress===Dt?e.push(a):a.contractType==="ERC20"?r.push(a):(a.contractType==="ERC721"||a.contractType==="ERC1155")&&n.push(a)});const i=e.sort((a,c)=>a.tokenID.localeCompare(c.tokenID)),s=r.sort((a,c)=>a.tokenID.localeCompare(c.tokenID)),o=n.sort((a,c)=>a.tokenID.localeCompare(c.tokenID));return{nativeTokens:i,erc20Tokens:s,collectibles:o}},Nq=t=>{const e=[];return t==null||t.pages.forEach(r=>{e.push(...r.transactions)}),e},gg=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=Xr(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:Dt,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:ks.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},b9=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await Xr(e),n=await r.getCoinPrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},bg=async({accountAddress:t,chainId:e,contractAddress:r},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:s=!0,verifiedOnly:o})=>{try{const{indexerClient:a}=Xr(e),c=await a.getTokenBalances(En({accountAddress:t,includeMetadata:s,metadataOptions:{verifiedOnly:o??!0}},r?{contractAddress:r}:{}));let l=(c==null?void 0:c.balances)||[];if(n&&l.length>0){const u=await b9({tokens:l.map(f=>({chainId:f.chainId,contractAddress:f.contractAddress,tokenId:f.tokenID}))});l=l.filter(f=>{const d=u==null?void 0:u.find(h=>fr(h.token.contractAddress,f.contractAddress)&&h.token.chainId===f.chainId);return f.contractType!=="ERC20"||!!d&&d.price!==null})}return i&&l.length>0&&(l=l.filter(u=>u.contractType!=="ERC721"&&u.contractType!=="ERC1155")),l}catch(a){return console.error(a),[]}},F4e=async({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})=>{try{return(await Promise.all([gg({accountAddress:t,chainId:e}),bg({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})])).flat()}catch(i){return console.error(i),[]}},Dq=async({accountAddress:t,chainId:e,collectionAddress:r,includeMetadata:n=!0,verifiedOnly:i})=>{try{const{indexerClient:s}=await Xr(e),o=await s.getTokenBalances({accountAddress:t,includeMetadata:n,contractAddress:r,metadataOptions:{verifiedOnly:i??!0}});return(o==null?void 0:o.balances)||[]}catch(s){return console.error(s),[]}},U4e=async({accountAddress:t,chainIds:e,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i})=>{let o=[];const a=r.length>0;try{if(a){const S=r.filter(j=>fr(j.contractAddress,Dt)),P=r.filter(j=>!fr(j.contractAddress,Dt)),M={},L={};S.forEach(j=>{M[j.chainId]||(M[j.chainId]=[]),M[j.chainId].push(j)}),P.forEach(j=>{L[j.chainId]||(L[j.chainId]=[]),L[j.chainId].push(j)}),o=(await Promise.all([...Object.keys(M).map(j=>gg({accountAddress:t,chainId:Number(j)})),...Object.keys(L).map(j=>L[Number(j)].map(H=>bg({accountAddress:t,chainId:Number(j),contractAddress:H.contractAddress},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))).flat()])).flat()}else o=(await Promise.all([...e.map(S=>gg({accountAddress:t,chainId:S})),...e.map(S=>bg({accountAddress:t,chainId:S},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))])).flat();const{nativeTokens:c,erc20Tokens:l,collectibles:u}=Mq(o),f=new Promise(async(S,P)=>{if(l.length>0){const M=l.map(j=>({chainId:j.chainId,contractAddress:j.contractAddress})),L=await b9({tokens:M})||[];S(L)}else S([])}),d=u.map(async S=>a?S:await Dq({accountAddress:t,chainId:S.chainId,collectionAddress:S.contractAddress,includeMetadata:!1})),h=async()=>{const S={},P={};l.forEach(L=>{P[L.chainId]?P[L.chainId].push(L):P[L.chainId]=[L]});const M=Object.keys(P).map(async L=>{const{metadataClient:j}=Xr(L),K=P[Number(L)].map(Y=>Y.contractAddress),Q=await j.getContractInfoBatch({chainID:String(L),contractAddresses:K});S[Number(L)]=Q});return await Promise.all([...M]),S},[p,m,...v]=await Promise.all([f,h(),...d]),y=l.sort((S,P)=>{var M,L;const j=p.find(A=>fr(A.token.contractAddress,S.contractAddress)),H=p.find(A=>fr(A.token.contractAddress,P.contractAddress)),K=j!=null&&j.price?j.price.value:0,Q=H!=null&&H.price?H.price.value:0,Y=(M=m[S.chainId].contractInfoMap[S.contractAddress])==null?void 0:M.decimals,F=(L=m[P.chainId].contractInfoMap[P.contractAddress])==null?void 0:L.decimals,x=Y===void 0?0:Number(Nt(S.balance,Y)),k=F===void 0?0:Number(Nt(P.balance,F)),R=x*K;return k*Q-R}),b=Y3e(v.flat(),10).sort((S,P)=>S.contractAddress.localeCompare(P.contractAddress));return i?[...c.length>0?[c[0]]:[],...y.length>0?y.slice(0,11):[]]:[...c.length>0?[c[0]]:[],...y.length>0?[y[0]]:[],...b.length>0?[...b]:[]]}catch(c){return console.error(c),[]}},z4e=async({accountAddress:t,chainId:e,collectionAddress:r,tokenId:n,verifiedOnly:i})=>{const{indexerClient:s}=Xr(e);return(await s.getTokenBalances({accountAddress:t,includeMetadata:!0,contractAddress:r,tokenID:n,metadataOptions:{verifiedOnly:i??!0}})).balances[0]},q4e=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await Xr(e),n=await r.getCollectiblePrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},Lq=async({chainId:t,contractAddress:e,accountAddress:r,tokenId:n,page:i})=>{const{indexerClient:s}=Xr(t);return s.getTransactionHistory({includeMetadata:!0,page:i,filter:{accountAddress:r,contractAddress:e,tokenID:n}})},W4e=async({chainIds:t,accountAddress:e})=>(await Promise.all([...t.map(s=>Lq({chainId:s,accountAddress:e,page:{page:1}}))])).map(s=>s.transactions).flat().sort((s,o)=>{const a=new Date(s.timestamp).getTime();return new Date(o.timestamp).getTime()-a}),H4e=async({toCurrency:t})=>{if(t==="USD")return 1;const{apiClient:e}=Xr(137);return(await e.getExchangeRate({toCurrency:t})).exchangeRate.value},V4e=async({tokens:t})=>{const{metadataClient:e}=Xr(t.chainId);return(await e.getTokenMetadata({chainID:t.chainId.toString(),contractAddress:t.contractAddress,tokenIDs:t.tokenIds})).tokenMetadata},G4e=async t=>{const{metadataClient:e}=Xr(Number(t.chainID));return(await e.getContractInfo(t)).contractInfo},K4e=["chainIds"],Q4e=["disabled"],_i={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},k2=(t,e)=>qn({queryKey:["balances",t,e],queryFn:async()=>{const{chainIds:r}=t,n=S2(t,K4e);return(await Promise.all(r.map(s=>F4e(En({},n,{chainId:s}),e)))).flat()},retry:!0,staleTime:_i.oneSecond*30,enabled:t.chainIds.length>0&&!!t.accountAddress}),Y4e=t=>qn({queryKey:["collectionBalance",t],queryFn:()=>Dq(t),retry:!0,staleTime:_i.oneSecond*30,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress}),Ru=t=>{let{disabled:e}=t,r=S2(t,Q4e);return qn({queryKey:["coinPrices",r],queryFn:()=>b9(r),retry:!0,staleTime:_i.oneSecond*30,enabled:r.tokens.length>0&&!e})},J4e=(t,e)=>qn({queryKey:["balancesAssetsSummary",t,e],queryFn:()=>U4e(t,e),retry:!0,refetchInterval:_i.oneSecond*4,refetchOnMount:!0,staleTime:_i.oneSecond,enabled:t.chainIds.length>0&&!!t.accountAddress}),X4e=(t,e)=>qn({queryKey:["coinBalance",t,e],queryFn:()=>fr((t==null?void 0:t.contractAddress)||"",Dt)?gg({accountAddress:t.accountAddress,chainId:t.chainId}).then(i=>i[0]):bg(t,e).then(n=>n[0]),retry:!0,staleTime:_i.oneSecond*30,enabled:!!t.chainId&&!!t.accountAddress}),jq=t=>qn({queryKey:["collectibleBalance",t],queryFn:()=>z4e(t),retry:!0,staleTime:_i.oneSecond*30,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress&&!!t.tokenId}),Bq=t=>qn({queryKey:["useCollectiblePrices",t],queryFn:()=>q4e(t),retry:!0,staleTime:_i.oneMinute,enabled:t.tokens.length>0}),Fq=t=>Cbe({queryKey:["transactionHistory",t],queryFn:({pageParam:e})=>Lq(En({},t,e?{page:{page:e}}:{page:{page:1}})),getNextPageParam:({page:e})=>{if(e.more)return(e==null?void 0:e.page)||1},retry:!0,staleTime:_i.oneSecond*30,enabled:!!t.chainId&&!t.disabled&&!!t.accountAddress}),Z4e=t=>qn({queryKey:["transactionHistorySummary",t],queryFn:()=>W4e(t),retry:!0,staleTime:_i.oneSecond,refetchOnMount:!0,enabled:t.chainIds.length>0&&!!t.accountAddress}),ll=t=>qn({queryKey:["useConversionRate",t],queryFn:()=>H4e(t),retry:!0,staleTime:_i.oneMinute*10}),Uq=t=>qn({queryKey:["useTokenMetadata",t],queryFn:()=>V4e(t),retry:!0,staleTime:_i.oneMinute*10,enabled:!!t.tokens.chainId&&!!t.tokens.contractAddress}),e9e=t=>qn({queryKey:["useContractInfo",t],queryFn:()=>G4e(t),retry:!0,staleTime:_i.oneMinute*10,enabled:!!t.chainID&&!!t.contractAddress}),[t9e,r9e]=Oq(),$i=()=>{const{setHistory:t,history:e}=t9e();return{setNavigation:i=>{const s=document.getElementById("sequence-kit-wallet-content"),o=s==null?void 0:s.parentElement;o==null||o.scrollTo(0,0);const a=i.location==="home"?[]:[...e,i];t(a)},history:e,setHistory:t,goBack:()=>{const i=[...e];i.pop(),t(i)}}},n9e=[{inputs:[{internalType:"address",name:"_from",type:"address"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256[]",name:"_ids",type:"uint256[]"},{internalType:"uint256[]",name:"_amounts",type:"uint256[]"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],i9e=[{constant:!1,inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],s9e=[{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],zq=[{symbol:"USD",sign:"$",name:{message:"US Dollar"},decimals:2},{symbol:"CAD",sign:"$",name:{message:"Canadian Dollar"},decimals:2},{symbol:"GBP",sign:"£",name:{message:"British Pound Sterling"},decimals:2},{symbol:"EUR",sign:"€",name:{message:"Euro"},decimals:2},{symbol:"CNY",sign:"¥",name:{message:"Chinese Yuan"},decimals:2},{symbol:"JPY",sign:"¥",name:{message:"Japanese Yen"},decimals:2},{symbol:"KRW",sign:"₩",name:{message:"South Korean Won"},decimals:2},{symbol:"SGD",sign:"$",name:{message:"Singapore Dollar"},decimals:2},{symbol:"CHF",sign:"CHF ",name:{message:"Swiss Franc"},decimals:2},{symbol:"AUD",sign:"$",name:{message:"Australian Dollar"},decimals:2},{symbol:"NZD",sign:"$",name:{message:"New Zealand Dollar"},decimals:2},{symbol:"SEK",sign:"kr ",name:{message:"Swedish Krona"},decimals:2},{symbol:"NOK",sign:"kr ",name:{message:"Norwegian Krone"},decimals:2},{symbol:"MXN",sign:"$",name:{message:"Mexican Peso"},decimals:2},{symbol:"INR",sign:"₹",name:{message:"Indian Rupee"},decimals:2},{symbol:"ZAR",sign:"R ",name:{message:"South African Rand"},decimals:2},{symbol:"TRY",sign:"₺",name:{message:"Turkish Lira"},decimals:2},{symbol:"BRL",sign:"R$",name:{message:"Brazilian Real"},decimals:2},{symbol:"DKK",sign:"kr ",name:{message:"Danish Krone"},decimals:2},{symbol:"PLN",sign:"zł ",name:{message:"Polish Zloty"},decimals:2},{symbol:"THB",sign:"฿",name:{message:"Thai Baht"},decimals:2},{symbol:"IDR",sign:"Rp",name:{message:"Indonesian Rupiah"},decimals:2}],o9e=zq[0],Mi="54px",Hn=()=>{const{chains:t}=vt(),e=()=>{let l=!0,u=!1,f=o9e,d=t.map(h=>h.id);try{const h=localStorage.getItem(nr.Settings),p=JSON.parse(h||"{}");if((p==null?void 0:p.hideUnlistedTokens)!==void 0&&(l=p==null?void 0:p.hideUnlistedTokens),(p==null?void 0:p.hideCollectibles)!==void 0&&(u=p==null?void 0:p.hideCollectibles),(p==null?void 0:p.fiatCurrency)!==void 0&&(f=p==null?void 0:p.fiatCurrency),(p==null?void 0:p.selectedNetworks)!==void 0){let m=!0;p.selectedNetworks.forEach(v=>{t.find(y=>y.id===v)===void 0&&(m=!1)}),m&&(d=p==null?void 0:p.selectedNetworks)}}catch(h){console.error(h,"Failed to fetch settings")}return{hideUnlistedTokens:l,hideCollectibles:u,fiatCurrency:f,selectedNetworks:d}},r=e(),[n,i]=w.useState(r);return En({},n,{setFiatCurrency:l=>{const u=e(),f=En({},u,{fiatCurrency:l});localStorage.setItem(nr.Settings,JSON.stringify(f)),i(f)},setHideCollectibles:l=>{const u=e(),f=En({},u,{hideCollectibles:l});localStorage.setItem(nr.Settings,JSON.stringify(f)),i(f)},setHideUnlistedTokens:l=>{const u=e(),f=En({},u,{hideUnlistedTokens:l});localStorage.setItem(nr.Settings,JSON.stringify(f)),i(f)},setSelectedNetworks:l=>{const u=e(),f=En({},u,{selectedNetworks:l});localStorage.setItem(nr.Settings,JSON.stringify(f)),i(f)}})},a9e=({size:t=30})=>g.createElement(q,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",flexShrink:"0",style:{width:`${t}px`,height:`${t}px`}},g.createElement(ae,{variant:"large",color:"textInverse100"},"?")),Qc=({imageUrl:t,size:e=30})=>t?g.createElement(br,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):g.createElement(a9e,{size:e}),dI=({networkLogoUrl:t,logoUrl:e,tokenName:r,balance:n,balanceFiat:i,priceChangePercentage:s,symbol:o})=>{const{fiatCurrency:a}=Hn(),c=s>0?"+":"";return g.createElement(q,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md",padding:"4",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"1"},g.createElement(q,{marginBottom:"1"},g.createElement(Qc,{size:36,imageUrl:e})),g.createElement(q,{marginBottom:"3"},g.createElement(q,{flexDirection:"row",gap:"1",justifyContent:"flex-start",alignItems:"center"},g.createElement(ae,{fontWeight:"bold",whiteSpace:"nowrap",color:"text100",style:{maxWidth:"130px",textOverflow:"ellipsis",overflow:"hidden"}},r),g.createElement(Qc,{size:12,imageUrl:t})),g.createElement(ae,{color:"text50",whiteSpace:"nowrap",style:{display:"block",maxWidth:"150px",textOverflow:"ellipsis",overflow:"hidden"}},`${n} ${o}`)),g.createElement(q,null,g.createElement(q,null,g.createElement(ae,{fontWeight:"bold",color:"text100"},`${a.sign}${i}`)),g.createElement(ae,{style:{color:B4e(s)}},`${c}${s.toFixed(2)}%`)))},hI=({balance:t})=>{var e;const{chains:r}=vt(),{fiatCurrency:n}=Hn(),i=fr(t.contractAddress,Dt),s=Pr(t.chainId,r),{data:o=[],isLoading:a}=Ru({tokens:[{chainId:t.chainId,contractAddress:t.contractAddress}]}),{data:c=1,isLoading:l}=ll({toCurrency:n.symbol}),{data:u,isLoading:f}=e9e({chainID:String(t.chainId),contractAddress:t.contractAddress});if(a||l||f)return g.createElement(q,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md"});if(i){const P=To({balance:t,prices:o,conversionRate:c,decimals:s.decimals}),M=fI(t,o),L=Nt(t.balance,s.decimals),j=Io(L);return g.createElement(dI,{networkLogoUrl:s.logoURI,logoUrl:s.logoURI,tokenName:s.name,balance:j,balanceFiat:P,priceChangePercentage:M,symbol:s.symbol})}const h=(e=u==null?void 0:u.decimals)!=null?e:18,p=To({balance:t,prices:o,conversionRate:c,decimals:h}),m=fI(t,o),v=Nt(t.balance,h),y=Io(v),b=(u==null?void 0:u.name)||"Unknown",E=(u==null?void 0:u.name)||"TOKEN",S=u==null?void 0:u.logoURI;return g.createElement(dI,{networkLogoUrl:s.logoURI,logoUrl:S,tokenName:b,balance:y,balanceFiat:p,priceChangePercentage:m,symbol:E})},Sp=({imageUrl:t})=>g.createElement(kn,{padding:"0",aspectRatio:"1/1",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:"sm",background:"backgroundSecondary"},g.createElement(br,{style:{height:"100%"},src:t})),c9e=({balance:t})=>{var e;const{data:r}=Uq({tokens:{chainId:t.chainId,contractAddress:t.contractAddress,tokenIds:[t.tokenID]}}),n=r==null||(e=r[0])==null?void 0:e.image;return g.createElement(Sp,{imageUrl:n})};Iu("packages/wallet/src/shared/Skeleton/styles.css.ts","kit");const l9e=dz({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),u9e=Wn({height:"76px",backgroundColor:"#909090",animation:`${l9e} 2s ease-in-out infinite`},"skeleton");Tu();const pt=({width:t="100%",height:e="100%",borderRadius:r="md",aspectRatio:n})=>g.createElement(q,{className:u9e,borderRadius:r,aspectRatio:n,style:{width:t,height:e}}),f9e=()=>g.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${Te.space[1]}) calc(50% - ${Te.space[1]})`,gap:Te.space[2]}},Array(12).fill(null).map((t,e)=>g.createElement(q,{key:e},g.createElement(pt,{height:"100%",width:"100%",aspectRatio:"1/1"}))));Iu("packages/wallet/src/shared/styles.css.ts","kit");const bo=Wn({":hover":{cursor:"pointer",opacity:"0.8",userSelect:"none"}},"clickable"),d9e=Wn({"> div":{overflowY:"scroll"}},"scrollbar"),x9=Wn({},"walletContent");fs(`${x9} + button`,{backgroundColor:"transparent"});fs(`${x9} + button > svg`,{width:"20px",height:"20px"});Tu();const h9e=()=>{const{address:t}=fn(),{setNavigation:e}=$i(),{displayedAssets:r}=Q7e(),{hideUnlistedTokens:n,hideCollectibles:i,selectedNetworks:s}=Hn(),{data:o=[],isLoading:a}=J4e({accountAddress:t||"",chainIds:s,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i});if(a)return g.createElement(f9e,null);const{nativeTokens:c,erc20Tokens:l,collectibles:u}=Mq(o),f=d=>{d.contractType==="ERC1155"||d.contractType==="ERC721"?e&&e({location:"collectible-details",params:{contractAddress:d.contractAddress,chainId:d.chainId,tokenId:d.tokenID}}):d.contractType==="ERC20"?e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}}):e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}})};return g.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${Te.space[1]}) calc(50% - ${Te.space[1]})`,gap:Te.space[2]}},c.map((d,h)=>g.createElement(q,{key:h,className:bo,aspectRatio:"1/1",onClick:()=>f(d)},g.createElement(hI,{balance:d}))),l.map((d,h)=>g.createElement(q,{className:bo,key:h,aspectRatio:"1/1",onClick:()=>f(d)},g.createElement(hI,{balance:d}))),u.map((d,h)=>g.createElement(q,{className:bo,aspectRatio:"1/1",key:h,onClick:()=>f(d)},g.createElement(c9e,{balance:d}))))},Us=()=>{const[t,e]=w.useState("0px");return w.useEffect(()=>{e(navigator.userAgent.match(/chrome|chromium|crios/i)?"13px":"0px")},[]),t},p9e=()=>(Us(),g.createElement(q,{paddingX:"4",paddingBottom:"5",gap:"4",flexDirection:"column"},g.createElement(h9e,null))),m9e=()=>{const{address:t,chain:e}=fn(),{chains:r}=vt(),[n,i]=w.useState(!1),s=Pr((e==null?void 0:e.id)||1,r);w.useEffect(()=>{n&&setTimeout(()=>{i(!1)},4e3)},[n]);const o=()=>{i(!0)},a=()=>{typeof window<"u"&&window.open(`https://twitter.com/intent/tweet?text=Here%20is%20my%20address%20${t}`)};return g.createElement(q,{style:{paddingTop:Mi}},g.createElement(q,{padding:"5",paddingTop:"3",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4"},g.createElement(q,{marginTop:"1",width:"fit",background:"white",borderRadius:"md",alignItems:"center",justifyContent:"center",padding:"4"},g.createElement(b8e,{value:t||"",size:200,bgColor:"white",fgColor:"black","data-id":"receiveQR"})),g.createElement(q,null,g.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},g.createElement(ae,{variant:"medium",color:"text100",textAlign:"center",lineHeight:"inherit",style:{fontWeight:"700"}},"My Wallet"),g.createElement(br,{width:"5",src:s.logoURI,alt:"icon"})),g.createElement(q,{marginTop:"2",style:{maxWidth:"180px",textAlign:"center"}},g.createElement(ae,{textAlign:"center",color:"text50",style:{fontSize:"14px",maxWidth:"180px",overflowWrap:"anywhere"}},t))),g.createElement(q,{gap:"3"},g.createElement(_z.CopyToClipboard,{text:t||""},g.createElement(rt,{onClick:o,leftIcon:Pb,label:n?"Copied!":"Copy"})),g.createElement(rt,{onClick:a,leftIcon:Kle,label:"Share"})),g.createElement(q,{justifyContent:"center",alignItems:"center",style:{maxWidth:"260px",textAlign:"center"}},g.createElement(ae,{color:"text100",variant:"small",style:{maxWidth:"260px",overflowWrap:"anywhere"}},`This is a ${s.name} address. Please only send assets on the ${s.name} network.`))))},qq=({imageUrl:t,name:e,decimals:r,balance:n,symbol:i,fiatValue:s,chainId:o,showSquareImage:a})=>{const{chains:c}=vt(),{fiatCurrency:l}=Hn(),u=Nt(n,r),f=Io(u),d=Pr(o,c);return g.createElement(q,{alignItems:"flex-end",justifyContent:"space-between"},g.createElement(q,{justifyContent:"space-between",alignItems:"center",gap:"2"},a?g.createElement(q,{style:{width:"40px"}},g.createElement(Sp,{imageUrl:t})):g.createElement(Qc,{imageUrl:t,size:40}),g.createElement(q,{flexDirection:"column",alignItems:"flex-start"},g.createElement(q,{flexDirection:"row",alignItems:"center",gap:"1"},g.createElement(ae,{variant:"medium",color:"text100"},e),g.createElement(Qc,{imageUrl:d.logoURI,size:12})),g.createElement(ae,{color:"text50",variant:"normal"}," ",`${f} ${i} available`))),g.createElement(q,{flexDirection:"column",alignItems:"flex-end",justifyContent:"flex-end"},s&&g.createElement(ae,{variant:"normal",color:"text100"},`${l.sign}${s}`)))},v9e=({chainId:t,contractAddress:e})=>{var r,n,i,s,o;const{setNavigation:a}=$i(),{analytics:c}=Jq(),{chains:l}=vt(),u=u2(),{address:f="",connector:d}=fn(),h=!!(d!=null&&(r=d._wallet)!=null&&r.isSequenceBased),p=u===t,m=!p&&!h,{switchChainAsync:v}=G4(),y=w.useRef(null);Cp();const{fiatCurrency:b}=Hn(),[E,S]=w.useState("0"),[P,M]=w.useState(""),{sendTransaction:L}=V4(),[j,H]=w.useState(!1),{data:K=[],isLoading:Q}=k2({accountAddress:f,chainIds:[t],contractAddress:e},{hideUnlistedTokens:!1}),Y=Pr(t,l),F=K.find(he=>he.contractAddress===e),{data:x=[],isLoading:k}=Ru({tokens:[{chainId:t,contractAddress:e}]}),{data:R=1,isLoading:N}=ll({toCurrency:b.symbol});if(Q||k||N)return null;const O=fr(e,Dt),B=O?Y.decimals:(F==null||(n=F.contractInfo)==null?void 0:n.decimals)||18,I=O?Y.name:(F==null||(i=F.contractInfo)==null?void 0:i.name)||"",C=O?Y.logoURI:F==null||(s=F.contractInfo)==null?void 0:s.logoURI,D=O?Y.symbol:(F==null||(o=F.contractInfo)==null?void 0:o.symbol)||"",z=E===""?"0":E,_=ou(z,B),W=To({balance:En({},F,{balance:_.toString()}),prices:x,conversionRate:R,decimals:B}),G=_.gt((F==null?void 0:F.balance)||"0"),J=_.gt(0),ee=he=>{const{value:ve}=he.target,$e=$q(ve,B);S($e)},se=()=>{var he;(he=y.current)==null||he.focus();const ve=Nt((F==null?void 0:F.balance)||0,B).toString();S(ve)},ie=async()=>{const he=await navigator.clipboard.readText();M(he)},oe=()=>{M("")},be=async he=>{!p&&h&&await v({chainId:t}),he.preventDefault();const ve=ou(z,B);if(O){var $e;c==null||c.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(d==null||($e=d._wallet)==null?void 0:$e.id)||"unknown",source:"sequence-kit/wallet"}}),H(!0),L({to:P,value:BigInt(ve.toString()),gas:null},{onSettled:(Ee,Ue)=>{Ee&&a({location:"home"}),H(!1)}})}else{var ge;c==null||c.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(d==null||(ge=d._wallet)==null?void 0:ge.id)||"unknown",source:"sequence-kit/wallet"}}),H(!0),L({to:F==null?void 0:F.contractAddress,data:new xr(i9e).encodeFunctionData("transfer",[P,ve.toHexString()]),gas:null},{onSettled:(Ee,Ue)=>{Ee&&a({location:"home"}),H(!1)}})}};return g.createElement(q,{padding:"5",paddingTop:"3",style:{marginTop:Mi},gap:"2",flexDirection:"column",as:"form",onSubmit:be,pointerEvents:j?"none":"auto"},g.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},g.createElement(qq,{imageUrl:C,decimals:B,name:I,symbol:D,balance:(F==null?void 0:F.balance)||"0",fiatValue:To({balance:F,prices:x,conversionRate:R,decimals:B}),chainId:t}),g.createElement(UB,{ref:y,style:{fontSize:Te.fontSizes.xlarge,fontWeight:Te.fontWeights.bold},name:"amount",value:E,onChange:ee,controls:g.createElement(g.Fragment,null,g.createElement(ae,{variant:"small",color:"text50",whiteSpace:"nowrap"},`~${b.sign}${W}`),g.createElement(rt,{size:"xs",shape:"square",label:"Max",onClick:se,"data-id":"maxCoin",flexShrink:"0"}),g.createElement(ae,{fontSize:"xlarge",fontWeight:"bold",color:"text100"},D))}),G&&g.createElement(ae,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Funds")),g.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},g.createElement(ae,{fontSize:"normal",color:"text50"},"To"),yg(P)?g.createElement(q,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:bo,onClick:oe,style:{height:"52px"}},g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},g.createElement(ku,{address:P,style:{width:"20px"}}),g.createElement(ae,{color:"text100"},`0x${g9(P.substring(2),8)}`)),g.createElement(Cu,{size:"xs"})):g.createElement(sl,{value:P,onChange:he=>M(he.target.value),placeholder:`${Y.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:g.createElement(rt,{size:"xs",shape:"square",label:"Paste",onClick:ie,"data-id":"to-address",flexShrink:"0",leftIcon:Pb})})),m&&g.createElement(q,{marginTop:"3"},g.createElement(ae,{variant:"small",color:"negative",marginBottom:"2"},"The wallet is connected to the wrong network. Please switch network before proceeding"),g.createElement(rt,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:async()=>await v({chainId:t}),disabled:p,style:{height:"52px",borderRadius:Te.radii.md}})),g.createElement(q,{style:{height:"52px"},alignItems:"center",justifyContent:"center"},j?g.createElement(Fc,null):g.createElement(rt,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!J||!yg(P)||G||!p&&!h,label:"Send",rightIcon:yo,style:{height:"52px",borderRadius:Te.radii.md}})))},y9e=({chainId:t,contractAddress:e,tokenId:r})=>{var n,i,s,o,a;const{setNavigation:c}=$i(),{analytics:l}=Jq(),{chains:u}=vt(),f=u2(),{address:d="",connector:h}=fn(),p=!!(h!=null&&(n=h._wallet)!=null&&n.isSequenceBased),m=f===t,v=!m&&!p,{switchChain:y}=G4(),b=w.useRef(null);Cp();const[E,S]=w.useState("0"),[P,M]=w.useState(""),[L,j]=w.useState(!1),{sendTransaction:H}=V4(),[K,Q]=w.useState(!1),{data:Y,isLoading:F}=jq({accountAddress:d,chainId:t,collectionAddress:e,tokenId:r,verifiedOnly:!1}),{contractType:x}=Y;w.useEffect(()=>{Y&&(x==="ERC721"?(S("1"),j(!1)):x==="ERC1155"&&(Number(Nt((Y==null?void 0:Y.balance)||0,N))>=1&&S("1"),j(!0)))},[Y]);const k=Pr(t,u);if(F)return null;const N=(Y==null||(i=Y.tokenMetadata)==null?void 0:i.decimals)||0,A=(Y==null||(s=Y.tokenMetadata)==null?void 0:s.name)||"Unknown",O=(Y==null||(o=Y.tokenMetadata)==null?void 0:o.image)||(Y==null||(a=Y.contractInfo)==null?void 0:a.logoURI)||"",B=E===""?"0":E,I=ou(B,N),C=I.gt((Y==null?void 0:Y.balance)||"0"),D=I.gt(0),z=he=>{const{value:ve}=he.target,$e=$q(ve,N);S($e)},_=()=>{var he;(he=b.current)==null||he.focus();const ve=Number(E)-1,$e=Math.max(ve,0).toString();S($e)},W=()=>{var he;(he=b.current)==null||he.focus();const ve=Number(E)+1,$e=Number(Nt((Y==null?void 0:Y.balance)||0,N)),ge=Math.min(ve,$e).toString();S(ge)},G=()=>{var he;(he=b.current)==null||he.focus();const ve=Nt((Y==null?void 0:Y.balance)||0,N).toString();S(ve)},J=async()=>{const he=await navigator.clipboard.readText();M(he)},ee=()=>{M("")},se=async he=>{var ve,$e;he.preventDefault(),!m&&p&&y({chainId:t});const ge=ou(B,N);switch(x){case"ERC721":l==null||l.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(h==null||(ve=h._wallet)==null?void 0:ve.id)||"unknown",source:"sequence-kit/wallet"}}),Q(!0),H({to:Y.contractAddress,data:new xr(s9e).encodeFunctionData("safeTransferFrom",[d,P,r]),gas:null},{onSettled:(Ee,Ue)=>{Ee&&c({location:"home"}),Q(!1)}});break;case"ERC1155":default:l==null||l.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(h==null||($e=h._wallet)==null?void 0:$e.id)||"unknown",source:"sequence-kit/wallet"}}),Q(!0),H({to:Y.contractAddress,data:new xr(n9e).encodeFunctionData("safeBatchTransferFrom",[d,P,[r],[ge.toHexString()],[]]),gas:null},{onSettled:(Ee,Ue)=>{Ee&&c({location:"home"}),Q(!1)}})}},ie=Nt((Y==null?void 0:Y.balance)||0,N).toString(),oe=Number(E)===0,be=Number(E)>=Number(ie);return g.createElement(q,{padding:"5",paddingTop:"3",style:{marginTop:Mi},gap:"2",flexDirection:"column",as:"form",onSubmit:se,pointerEvents:K?"none":"auto"},g.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},g.createElement(qq,{imageUrl:O,showSquareImage:!0,decimals:N,name:A,symbol:"",balance:(Y==null?void 0:Y.balance)||"0",chainId:t}),g.createElement(UB,{ref:b,style:{fontSize:Te.fontSizes.xlarge,fontWeight:Te.fontWeights.bold},name:"amount",value:E,onChange:z,disabled:!L,controls:g.createElement(g.Fragment,null,L&&g.createElement(q,{gap:"2"},g.createElement(rt,{disabled:oe,size:"xs",onClick:_,leftIcon:Jle}),g.createElement(rt,{disabled:be,size:"xs",onClick:W,leftIcon:Sle}),g.createElement(rt,{size:"xs",shape:"square",label:"Max",onClick:G,"data-id":"maxCoin",flexShrink:"0"})))}),C&&g.createElement(ae,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Balance")),g.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},g.createElement(ae,{fontSize:"normal",color:"text50"},"To"),yg(P)?g.createElement(q,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:bo,onClick:ee,style:{height:"52px"}},g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},g.createElement(ku,{address:P,style:{width:"20px"}}),g.createElement(ae,{color:"text100"},`0x${g9(P.substring(2),8)}`)),g.createElement(Cu,{size:"xs"})):g.createElement(sl,{value:P,onChange:he=>M(he.target.value),placeholder:`${k.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:g.createElement(rt,{size:"xs",shape:"square",label:"Paste",onClick:J,"data-id":"to-address",flexShrink:"0",leftIcon:Pb})})),v&&g.createElement(q,{marginTop:"3"},g.createElement(ae,{variant:"small",color:"negative",marginBottom:"2"},"The wallet is connected to the wrong network. Please switch network before proceeding"),g.createElement(rt,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:()=>y({chainId:t}),disabled:m,style:{height:"52px",borderRadius:Te.radii.md}})),g.createElement(q,{style:{height:"52px"},alignItems:"center",justifyContent:"center"},K?g.createElement(Fc,null):g.createElement(rt,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!D||!yg(P)||C||!m&&!p,label:"Send",rightIcon:yo,style:{height:"52px",borderRadius:Te.radii.md}})))},g9e=({transaction:t})=>{var e;const{chains:r}=vt(),{fiatCurrency:n}=Hn(),{setNavigation:i}=$i(),s=()=>{i({location:"transaction-details",params:{transaction:t}})};let o=[];(e=t.transfers)==null||e.forEach(b=>{const E=b.contractAddress;o.includes(E)||o.push(E)});const{data:a=[],isLoading:c}=Ru({tokens:o.map(b=>({contractAddress:b,chainId:t.chainId}))}),{data:l=1,isLoading:u}=ll({toCurrency:n.symbol}),f=c||u,{transfers:d}=t,h=Pr(t.chainId,r),p=b=>{switch(b){case yn.SEND:return g.createElement(W6,{style:{transform:"rotate(270deg)",width:"16px"}});case yn.RECEIVE:return g.createElement(W6,{style:{transform:"rotate(90deg)",width:"16px"}});case yn.UNKNOWN:default:return g.createElement(Fj,{style:{width:"14px"}})}},m=b=>{switch(b){case yn.SEND:return"Sent";case yn.RECEIVE:return"Received";case yn.UNKNOWN:default:return"Transacted"}},v=(b,E,S)=>{let P="";S===yn.SEND?P="-":S===yn.RECEIVE&&(P="+");let M="text50";return S===yn.SEND?M=Te.colors.negative:S===yn.RECEIVE&&(M=Te.colors.positive),g.createElement(ae,{fontWeight:"bold",fontSize:"normal",style:{color:M}},`${P}${b} ${E}`)},y=({transfer:b,isFirstItem:E})=>{const{amounts:S}=b,P=Fz(t.timestamp).format("MMM DD, YYYY");return g.createElement(q,{gap:"2",width:"full",flexDirection:"column",justifyContent:"space-between"},g.createElement(q,{flexDirection:"row",justifyContent:"space-between"},g.createElement(q,{color:"text50",gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},p(b.transferType),g.createElement(ae,{fontWeight:"medium",fontSize:"normal",color:"text100"},m(b.transferType)),g.createElement(br,{src:h.logoURI,width:"3"})),E&&g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",fontSize:"normal",color:"text50"},P))),S.map((M,L)=>{var j,H,K,Q,Y,F;const x=Pr(t.chainId,r),k=fr(b.contractAddress,Dt),R=((j=b.contractInfo)==null?void 0:j.type)==="ERC721"||((H=b.contractInfo)==null?void 0:H.type)==="ERC1155";let N;const A=(K=b.tokenIds)==null?void 0:K[L];if(R&&A){var O;N=((O=b.tokenMetadata)==null||(O=O[A])==null?void 0:O.decimals)||0}else{var B;N=k?x.decimals:(B=b.contractInfo)==null?void 0:B.decimals}const I=Nt(M,N),C=k?x.symbol:((Q=b.contractInfo)==null?void 0:Q.symbol)||"",D=k?x.logoURI:(Y=b.contractInfo)==null?void 0:Y.logoURI,z=(F=a.find(_=>fr(_.token.contractAddress,b.contractAddress)))==null||(F=F.price)==null?void 0:F.value;return g.createElement(q,{key:L,flexDirection:"row",justifyContent:"space-between"},g.createElement(q,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},D&&g.createElement(br,{src:D,width:"5",alt:"token logo"}),v(Io(I),C,b.transferType)),f&&g.createElement(pt,{width:"35px",height:"20px"}),z&&g.createElement(ae,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${n.sign}${(Number(I)*z*l).toFixed(2)}`))}))};return g.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",className:bo,onClick:()=>s()},d==null?void 0:d.map((b,E)=>g.createElement(q,{key:`${t.txnHash}-${E}`,width:"full"},y({transfer:b,isFirstItem:E===0}))))},w9=()=>{const t=()=>g.createElement(q,{flexDirection:"column",gap:"2",width:"full",justifyContent:"space-between"},g.createElement(q,{flexDirection:"row",justifyContent:"space-between"},g.createElement(pt,{width:"65px",height:"20px"}),g.createElement(pt,{width:"75px",height:"17px"})),g.createElement(q,{flexDirection:"row",justifyContent:"space-between"},g.createElement(pt,{width:"120px",height:"20px"}),g.createElement(pt,{width:"35px",height:"17px"})));return g.createElement(q,{flexDirection:"column",gap:"3"},g.createElement(pt,{width:"70px",height:"17px"}),g.createElement(q,{flexDirection:"column",gap:"2"},Array(8).fill(null).map((e,r)=>g.createElement(q,{borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",background:"backgroundSecondary",key:r},t()))))},E9=({transactions:t,isLoading:e,isFetchingNextPage:r})=>{const n=[{id:"today",label:"Today"},{id:"yesterday",label:"Yesterday"},{id:"week",label:"Last Week"},{id:"month",label:"Last Month"},{id:"year",label:"Last Year"},{id:"years",label:"Past Years"}],i=w.useMemo(()=>{const a=new Date(new Date().setHours(0,0,0,0)).getTime(),c=new Date(new Date().setDate(new Date(a).getDate()-1)).getTime(),l=new Date(new Date().setDate(new Date().getDate()-7)).getTime(),u=new Date(new Date().setDate(new Date().getDate()-30)).getTime(),f=new Date(new Date().setDate(new Date().getDate()-365)).getTime(),d={today:[],yesterday:[],week:[],month:[],year:[],years:[]};return t.forEach(h=>{const p=new Date(h.timestamp).getTime();p>a?d.today.push(h):p>c?d.yesterday.push(h):p>l?d.week.push(h):p>u?d.month.push(h):p>f?d.year.push(h):d.years.push(h)}),d},[t]);if(e)return g.createElement(q,{flexDirection:"column",gap:"2"},g.createElement(w9,null));const s=({label:a})=>g.createElement(q,null,g.createElement(ae,{color:"text50",fontWeight:"medium",fontSize:"normal"},a)),o=({transactions:a})=>g.createElement(q,{flexDirection:"column",gap:"2"},a.map((c,l)=>g.createElement(q,{key:`${c.txnHash}-${l}`,flexDirection:"column",gap:"2"},g.createElement(g9e,{transaction:c}))));return g.createElement(q,{flexDirection:"column",gap:"5"},n.map(a=>{const c=i[a.id];return c.length===0?null:g.createElement(q,{key:a.id,flexDirection:"column",gap:"3"},g.createElement(s,{label:a.label}),g.createElement(o,{transactions:c}))}),t.length===0&&g.createElement(q,{flexDirection:"column",gap:"3"},g.createElement(s,{label:"History"}),g.createElement(ae,{color:"text100"},"No Recent Transaction History Found")),r&&g.createElement(q,{margin:"4",alignItems:"center",justifyContent:"center"},g.createElement(Fc,null)))},b9e=()=>{const{selectedNetworks:t}=Hn(),{address:e}=fn();Us();const{data:r=[],isLoading:n}=Z4e({accountAddress:e||"",chainIds:t});return g.createElement(q,null,g.createElement(q,{paddingX:"4",paddingBottom:"5",paddingTop:"3"},g.createElement(E9,{transactions:r,isLoading:n,isFetchingNextPage:!1})))},xg=({balance:t})=>{var e,r;const{chains:n}=vt(),{setNavigation:i}=$i(),s=fr(t.contractAddress,Dt),o=Pr(t.chainId,n),a=s?o.logoURI:t==null||(e=t.contractInfo)==null?void 0:e.logoURI,c=s?o.name:(t==null||(r=t.contractInfo)==null?void 0:r.name)||"Unknown",l=()=>{var f,d;if(t.contractType==="ERC721"||t.contractType==="ERC1155")return t.balance;const h=s?o.decimals:t==null||(f=t.contractInfo)==null?void 0:f.decimals,p=Nt(t.balance,h||0),m=Io(p),v=s?o.symbol:t==null||(d=t.contractInfo)==null?void 0:d.symbol;return`${m} ${v}`},u=()=>{const f=t.contractType==="ERC721"||t.contractType==="ERC1155";i(f?{location:"collection-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}}:{location:"coin-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}})};return g.createElement(q,{key:t.contractAddress,onClick:u,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:bo},g.createElement(q,{gap:"3",flexDirection:"row",alignItems:"center",justifyContent:"center"},g.createElement(Qc,{imageUrl:a,size:30}),g.createElement(q,{gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"center"},g.createElement(ae,{color:"text100",fontWeight:"bold",fontSize:"normal",style:{textOverflow:"ellipsis",overflow:"hidden",maxWidth:"250px",textWrap:"nowrap"}},c),g.createElement(br,{src:o.logoURI,alt:"network logo",style:{width:"12px",height:"12px"}}))),g.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"1"},g.createElement(ae,{color:"text50",fontWeight:"bold",fontSize:"normal"},l()),g.createElement(yo,{color:"text50"})))},pI=({toLocation:t,label:e})=>{const{setNavigation:r}=$i(),n=()=>{r(t)};return g.createElement(q,{onClick:n,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:bo},g.createElement(ae,{color:"text50",fontSize:"normal",fontWeight:"medium"},e),g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center"},g.createElement(ae,{color:"text50",fontSize:"normal",fontWeight:"medium"},"View all"),g.createElement(yo,{color:"text50",size:"sm"})))},x9e=()=>{const{chains:t}=vt(),{fiatCurrency:e,hideUnlistedTokens:r,selectedNetworks:n}=Hn(),[i,s]=w.useState(""),{address:o}=fn();Us();const{data:a,isLoading:c}=k2({accountAddress:o||"",chainIds:n},{hideUnlistedTokens:r}),l=(a==null?void 0:a.filter(K=>K.contractType==="ERC20"||fr(K.contractAddress,Dt)))||[],{data:u=[],isLoading:f}=Ru({tokens:l.map(K=>({chainId:K.chainId,contractAddress:K.contractAddress}))}),{data:d=1,isLoading:h}=ll({toCurrency:e.symbol}),p=l.sort((K,Q)=>{var Y,F;return Number(To({balance:Q,prices:u,conversionRate:d,decimals:((Y=Q.contractInfo)==null?void 0:Y.decimals)||18}))-Number(To({balance:K,prices:u,conversionRate:d,decimals:((F=Q.contractInfo)==null?void 0:F.decimals)||18}))}),v=((a==null?void 0:a.filter(K=>K.contractType==="ERC721"||K.contractType==="ERC1155"))||[]).sort((K,Q)=>Number(Q.balance)-Number(K.balance)),y=c||f||h,b=v.map((K,Q)=>{var Y;return{index:Q,name:((Y=K.contractInfo)==null?void 0:Y.name)||"Unknown"}}),E=p.map((K,Q)=>{if(fr(K.contractAddress,Dt)){const F=Pr(K.chainId,t);return{index:Q,name:F.name}}else{var Y;return{index:Q,name:((Y=K.contractInfo)==null?void 0:Y.name)||"Unknown"}}}),S=p.length,P=v.length,M=new xa(E,{keys:["name"]}),L=new xa(b,{keys:["name"]}),j=(i===""?E:M.search(i).map(K=>K.item)).slice(0,5),H=(i===""?b:L.search(i).map(K=>K.item)).slice(0,5);return g.createElement(q,{paddingX:"4",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"10",alignItems:"center",justifyContent:"center"},g.createElement(q,{width:"full"},g.createElement(sl,{autoFocus:!0,name:"search wallet",leftIcon:Ib,value:i,onChange:K=>s(K.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),g.createElement(q,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},g.createElement(pI,{toLocation:{location:"search-view-all",params:{defaultTab:"collections"}},label:`Collections (${P})`}),y?Array(5).fill(null).map((K,Q)=>g.createElement(pt,{key:Q,width:"100%",height:"32px"})):H.length===0?g.createElement(ae,{color:"text100"},"No collections found"):H.map((K,Q)=>{const Y=v[K.index];return g.createElement(xg,{key:Q,balance:Y})})),g.createElement(q,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},g.createElement(pI,{toLocation:{location:"search-view-all",params:{defaultTab:"coins"}},label:`Coins (${S})`}),y?Array(5).fill(null).map((K,Q)=>g.createElement(pt,{key:Q,width:"100%",height:"32px"})):j.length===0?g.createElement(ae,{color:"text100"},"No coins found"):j.map((K,Q)=>{const Y=p[K.index];return g.createElement(xg,{key:Q,balance:Y})})))},w9e=({defaultTab:t})=>{const{chains:e}=vt(),{fiatCurrency:r,hideUnlistedTokens:n,selectedNetworks:i}=Hn(),[s,o]=w.useState(""),[a,c]=w.useState(t);Us(),w.useEffect(()=>{o("")},[a]);const{address:l}=fn(),{data:u,isLoading:f}=k2({accountAddress:l||"",chainIds:i},{hideUnlistedTokens:n}),d=(u==null?void 0:u.filter(k=>k.contractType==="ERC20"||fr(k.contractAddress,Dt)))||[],{data:h=[],isLoading:p}=Ru({tokens:d.map(k=>({chainId:k.chainId,contractAddress:k.contractAddress}))}),{data:m=1,isLoading:v}=ll({toCurrency:r.symbol}),y=d.sort((k,R)=>{var N,A;return Number(To({balance:R,prices:h,conversionRate:m,decimals:((N=R.contractInfo)==null?void 0:N.decimals)||18}))-Number(To({balance:k,prices:h,conversionRate:m,decimals:((A=k.contractInfo)==null?void 0:A.decimals)||18}))}),E=((u==null?void 0:u.filter(k=>k.contractType==="ERC721"||k.contractType==="ERC1155"))||[]).sort((k,R)=>Number(R.balance)-Number(k.balance)),S=y.length,P=E.length,M=f||p||v,L=E.map((k,R)=>{var N;return{index:R,name:((N=k.contractInfo)==null?void 0:N.name)||"Unknown"}}),j=y.map((k,R)=>{if(fr(k.contractAddress,Dt)){const A=Pr(k.chainId,e);return{index:R,name:A.name}}else{var N;return{index:R,name:((N=k.contractInfo)==null?void 0:N.name)||"Unknown"}}}),H=new xa(j,{keys:["name"]}),K=new xa(L,{keys:["name"]}),Q=s===""?j:H.search(s).map(k=>k.item),Y=s===""?L:K.search(s).map(k=>k.item),F=()=>g.createElement(pt,{width:"360px",height:"48px"}),x=()=>g.createElement(g.Fragment,null,Array(8).fill(null).map((k,R)=>g.createElement(pt,{key:R,width:"full",height:"32px"})));return g.createElement(q,{paddingX:"4",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"5",alignItems:"center",justifyContent:"center"},g.createElement(q,{width:"full"},g.createElement(sl,{autoFocus:!0,name:"search wallet",leftIcon:Ib,value:s,onChange:k=>o(k.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),g.createElement(q,{width:"full"},g.createElement(P1e,{value:a,onValueChange:k=>c(k)},g.createElement(q,{marginBottom:"5"},!M&&g.createElement(_1e,{value:a,tabs:[{label:`Collections (${P})`,value:"collections"},{label:`Coins (${S})`,value:"coins"}]}),M&&g.createElement(F,null)),g.createElement(XA,{value:"collections"},g.createElement(q,{flexDirection:"column",gap:"3"},M&&g.createElement(x,null),!M&&Y.length===0&&g.createElement(ae,{color:"text100"},"No Collectibles Found"),!M&&Y.length>0&&Y.map((k,R)=>{const N=E[k.index];return g.createElement(xg,{key:R,balance:N})}))),g.createElement(XA,{value:"coins"},g.createElement(q,{flexDirection:"column",gap:"3"},M&&g.createElement(x,null),!M&&y.length==0&&g.createElement(ae,{color:"text100"},"No Coins Found"),!M&&Q.length>0&&Q.map((k,R)=>{const N=y[k.index];return g.createElement(xg,{key:R,balance:N})}))))))},E9e=()=>{const{setNavigation:t}=$i(),e=()=>{t({location:"settings-general"})},r=()=>{t({location:"settings-currency"})},n=()=>{t({location:"settings-networks"})};return g.createElement(q,{style:{paddingTop:Mi}},g.createElement(q,{padding:"5",paddingTop:"3"},g.createElement(q,{flexDirection:"column",gap:"2"},g.createElement(rt,{onClick:e,leftIcon:jj,rightIcon:yo,width:"full",label:"General",style:{height:"52px",borderRadius:Te.radii.md}}),g.createElement(rt,{onClick:r,leftIcon:$le,rightIcon:yo,width:"full",label:"Currency",style:{height:"52px",borderRadius:Te.radii.md}}),g.createElement(rt,{onClick:n,leftIcon:Ule,rightIcon:yo,width:"full",label:"Networks",style:{height:"52px",borderRadius:Te.radii.md}}))))},C9e=()=>{kp();const{hideUnlistedTokens:t,setHideUnlistedTokens:e,hideCollectibles:r,setHideCollectibles:n}=Hn(),i=()=>{e(!t)},s=()=>{n(!r)};return g.createElement(q,{style:{paddingTop:Mi}},g.createElement(q,{gap:"2",padding:"5",paddingTop:"3",flexDirection:"column"},g.createElement(kn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},g.createElement(ae,{color:"text100",fontWeight:"bold"},"Hide unlisted tokens"),g.createElement(t3,{checked:t,onCheckedChange:i})),g.createElement(kn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},g.createElement(ae,{color:"text100",fontWeight:"bold"},"Hide collectibles"),g.createElement(t3,{checked:r,onCheckedChange:s}))))},S9e=t=>{const{selected:e,className:r,squareIndicator:n=!1}=t;return g.createElement(q,{borderStyle:"solid",borderColor:n&&e?"transparent":"borderNormal",borderWidth:"thin",position:"relative",alignItems:"center",justifyContent:"center",flexShrink:"0",className:r,style:{borderRadius:n?"4px":Te.radii.circle,width:"20px",height:"20px"}},g.createElement(q,{as:Cc.div,background:n?"borderNormal":"backgroundInverse",position:"absolute",color:"textInverse100",initial:{opacity:e?1:0,scale:e?1:.5},animate:{opacity:e?1:0,scale:e?1:.5},transition:{ease:"backOut"},style:{borderRadius:n?"4px":Te.radii.circle,width:n?"20px":"14px",height:n?"20px":"14px"},justifyContent:"center",alignItems:"center"},n&&g.createElement(Bd,{color:"white",style:{width:"14px",height:"14px"}})))},k9e=["value","selected","children","disabled","onClick","className","hideIndicator","squareIndicator"],Wq=t=>{const{value:e,selected:r,children:n,disabled:i,onClick:s,className:o,hideIndicator:a,squareIndicator:c=!1}=t,l=S2(t,k9e);return g.createElement(kn,En({as:"button",clickable:!0,className:aEe(o),disabled:i,onClick:()=>s(e),userSelect:"none",alignItems:"center",justifyContent:"space-between",textAlign:"left",width:"full",style:{appearance:"none"}},l),n,!a&&g.createElement(S9e,{selected:r,squareIndicator:c}))},A9e=()=>{const{fiatCurrency:t,setFiatCurrency:e}=Hn();return Us(),g.createElement(q,{paddingBottom:"5",paddingX:"4",paddingTop:"3"},g.createElement(q,{flexDirection:"column",gap:"2"},zq.map(r=>g.createElement(Wq,{key:r.symbol,value:r.symbol,selected:r.symbol===t.symbol,onClick:()=>e&&e(r)},g.createElement(q,{gap:"2",justifyContent:"flex-start",alignItems:"center"},g.createElement(ae,{color:"text100",fontWeight:"bold"},r.symbol),g.createElement(ae,{color:"text50"},r.name.message))))))},_9e=()=>{const{selectedNetworks:t,setSelectedNetworks:e}=Hn(),{chains:r}=vt(),n=i=>{if(t.includes(i)){if(t.length===1)return;e(t.filter(s=>s!==i))}else e([...t,i])};return g.createElement(q,{style:{paddingTop:Mi}},g.createElement(q,{padding:"5",paddingTop:"3"},g.createElement(ae,{variant:"small",color:"text50"},"Networks"),g.createElement(q,{flexDirection:"column",gap:"2"},r.map(i=>{const s=Pr(i.id,r);return g.createElement(Wq,{disabled:t.length===1&&t.includes(i.id),key:i.id,selected:t.includes(i.id),onClick:()=>n(i.id),value:i.id,squareIndicator:!0},g.createElement(q,{gap:"2",justifyContent:"center",alignItems:"center"},g.createElement(br,{width:"3",height:"3",src:s.logoURI,alt:"network"}),g.createElement(ae,{color:"text100",variant:"small"},s.name)))}))))},th=({chainId:t})=>{var e;const{chains:r}=vt(),{network:n}=Xr(t),i=Pr(t,r),s=b7e(t),o=x7e(t);return g.createElement(q,{height:"6",paddingY:"1",paddingLeft:"1.5",paddingRight:"2",gap:"1",style:{background:o},borderRadius:"xs",flexDirection:"row",justifyContent:"center",alignItems:"center",width:"fit"},g.createElement(br,{style:{width:"14px"},src:i.logoURI}),g.createElement(ae,{fontWeight:"bold",fontSize:"xsmall",style:{color:s}},j4e((e=n.title)!=null?e:n.name)))},P9e=({chainId:t})=>(Us(),g.createElement(q,{style:{paddingTop:Mi}},g.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingX:"4",paddingTop:"0",style:{marginTop:"-20px"}},g.createElement(q,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},g.createElement(pt,{width:"32px",height:"32px"}),g.createElement(pt,{height:"24px",width:"70px"}),g.createElement(th,{chainId:t})),g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),g.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},g.createElement(pt,{width:"150px",height:"36px"}),g.createElement(pt,{width:"33px",height:"17px"}))),g.createElement(rt,{color:"text100",marginTop:"4",marginBottom:"10",width:"full",variant:"primary",leftIcon:Tb,label:"Send",disabled:!0,onClick:()=>{}}),g.createElement(q,null,g.createElement(w9,null))))),I9e=(t,e)=>{var r;const[n,i]=w.useState(null),s=w.useMemo(()=>new IntersectionObserver(([o])=>i(o),e),[]);return w.useEffect(()=>(t.current&&s.observe(t.current),()=>{t.current&&s.disconnect()}),[t.current,s]),(r=n==null?void 0:n.isIntersecting)!=null?r:!1},Hq=t=>{const{onLoad:e,hasMore:r=!0,children:n}=t,[i,s]=w.useState(0),[o,a]=w.useState(!1),c=w.useRef(null),l=I9e(c);w.useEffect(()=>{l&&r&&!o&&u()},[l]);const u=async()=>{a(!0),await e(i),s(f=>f+1),a(!1)};return g.createElement(g.Fragment,null,n,g.createElement("div",{ref:c}))},T9e=({contractAddress:t,chainId:e})=>{var r,n,i,s;const{chains:o}=vt(),{setNavigation:a}=$i(),{fiatCurrency:c,hideUnlistedTokens:l}=Hn();Us();const{address:u}=fn(),{data:f,isLoading:d,fetchNextPage:h,hasNextPage:p,isFetchingNextPage:m}=Fq({chainId:e,accountAddress:u||"",contractAddress:t}),v=Nq(f),{data:y,isLoading:b}=X4e({accountAddress:u||"",contractAddress:t,chainId:e},{hideUnlistedTokens:l}),{data:E,isLoading:S}=Ru({tokens:[{chainId:e,contractAddress:t}]}),{data:P=1,isLoading:M}=ll({toCurrency:c.symbol});if(b||S||M)return g.createElement(P9e,{chainId:e});const j=fr(t,Dt),H=j?Pr(e,o).logoURI:y==null||(r=y.contractInfo)==null?void 0:r.logoURI,K=j?Pr(e,o).symbol:y==null||(n=y.contractInfo)==null?void 0:n.symbol,Q=j?Pr(e,o).name:y==null||(i=y.contractInfo)==null?void 0:i.name,Y=j?Pr(e,o).decimals:y==null||(s=y.contractInfo)==null?void 0:s.decimals,F=Nt((y==null?void 0:y.balance)||"0",Y),x=Io(F),k=y?To({balance:y,prices:E||[],conversionRate:P,decimals:Y||0}):"0",R=()=>{a({location:"send-coin",params:{chainId:e,contractAddress:t}})};return g.createElement(q,{style:{paddingTop:Mi}},g.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingX:"4",paddingTop:"0",style:{marginTop:"-20px"}},g.createElement(q,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},g.createElement(br,{width:"8",src:H,alt:"logo"}),g.createElement(ae,{color:"text100",fontWeight:"bold",fontSize:"large"},Q),g.createElement(th,{chainId:e})),g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),g.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},g.createElement(ae,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},`${x} ${K}`),g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${c.sign}${k}`))),g.createElement(rt,{width:"full",variant:"primary",leftIcon:Tb,color:"text100",label:"Send",onClick:R}),g.createElement(q,null,g.createElement(Hq,{onLoad:()=>h(),hasMore:p},g.createElement(E9,{transactions:v,isLoading:d,isFetchingNextPage:m})))))},O9e=({chainId:t})=>(Us(),g.createElement(q,{paddingX:"4",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10"},g.createElement(q,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},g.createElement(pt,{width:"32px",height:"32px"}),g.createElement(pt,{width:"100px",height:"24px"}),g.createElement(th,{chainId:t}),g.createElement(pt,{width:"142px",height:"17px"})),g.createElement(q,{width:"full"},g.createElement(pt,{width:"168px",height:"20px"}),g.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${Te.space[1]}) calc(50% - ${Te.space[1]})`,gap:Te.space[2]},width:"full",marginTop:"3"},Array(8).fill(null).map((e,r)=>g.createElement(pt,{key:r,width:"full",aspectRatio:"1/1"})))))),R9e=({chainId:t,contractAddress:e})=>{var r;const{setNavigation:n}=$i(),{address:i}=fn(),{data:s,isLoading:o}=Y4e({chainId:t,accountAddress:i||"",collectionAddress:e});Us();const a=s==null||(r=s[0])==null?void 0:r.contractInfo,c=a==null?void 0:a.logoURI;if(o)return g.createElement(O9e,{chainId:t});const l=u=>{n&&n({location:"collectible-details",params:{contractAddress:u.contractAddress,chainId:u.chainId,tokenId:u.tokenID}})};return g.createElement(q,{paddingX:"4",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10"},g.createElement(q,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},g.createElement(Qc,{imageUrl:c,size:32}),g.createElement(ae,{fontWeight:"bold",fontSize:"large",color:"text100"},(a==null?void 0:a.name)||"Unknown"),g.createElement(th,{chainId:t}),g.createElement(ae,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${(s==null?void 0:s.length)||0} Unique Collectibles`)),g.createElement(q,{width:"full"},g.createElement(ae,{fontWeight:"medium",fontSize:"normal",color:"text50"},`Owned (${(s==null?void 0:s.length)||0})`),g.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${Te.space[1]}) calc(50% - ${Te.space[1]})`,gap:Te.space[2]},width:"full",marginTop:"3"},s==null?void 0:s.map((u,f)=>{var d,h,p;const m=u.balance,v=(u==null||(d=u.tokenMetadata)==null?void 0:d.decimals)||0,y=Io(Nt(m,v));return g.createElement(q,{key:f,onClick:()=>l(u),className:bo},g.createElement(q,{background:"backgroundSecondary",aspectRatio:"1/1",width:"full",borderRadius:"md",justifyContent:"center",alignItems:"center",marginBottom:"2"},g.createElement(br,{style:{height:"100%"},src:(h=u.tokenMetadata)==null?void 0:h.image})),g.createElement(q,null,g.createElement(ae,{fontWeight:"bold",fontSize:"normal",color:"text100"},`${(p=u.tokenMetadata)==null?void 0:p.name}`)),g.createElement(q,null,g.createElement(ae,{marginTop:"1",fontWeight:"medium",fontSize:"normal",color:"text50"},y," Owned")))}))))},$9e=()=>(Us(),g.createElement(q,{style:{paddingTop:Mi}},g.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingX:"4",paddingTop:"0",style:{marginTop:"-20px"}},g.createElement(q,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},g.createElement(pt,{width:"120px",height:"30px"}),g.createElement(pt,{width:"140px",height:"40px"})),g.createElement(q,null,g.createElement(pt,{width:"347px",height:"347px"})),g.createElement(q,null,g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),g.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},g.createElement(pt,{width:"44px",height:"36px"}),g.createElement(pt,{width:"34px",height:"17px"}))),g.createElement(rt,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:Tb,label:"Send",onClick:()=>{}})),g.createElement(q,null,g.createElement(ae,{fontSize:"normal",color:"text50",fontWeight:"medium"},"This week"),g.createElement(w9,null))))),M9e=({contractAddress:t,chainId:e,tokenId:r})=>{var n,i,s,o,a,c;const{chains:l}=vt(),{address:u}=fn(),{fiatCurrency:f}=Hn(),{setNavigation:d}=$i();Us();const{data:h,isLoading:p,fetchNextPage:m,hasNextPage:v,isFetchingNextPage:y}=Fq({chainId:e,accountAddress:u||"",contractAddress:t,tokenId:r}),b=Nq(h),{data:E,isLoading:S}=jq({accountAddress:u||"",collectionAddress:t,chainId:e,tokenId:r,verifiedOnly:!1}),{data:P,isLoading:M}=Bq({tokens:[{chainId:e,contractAddress:t,tokenId:r}]}),{data:L=1,isLoading:j}=ll({toCurrency:f.symbol});if(S||M||j)return g.createElement($9e,null);const K=()=>{d({location:"send-collectible",params:{chainId:e,contractAddress:t,tokenId:r}})},Q=Pr(e,l),Y=E==null||(n=E.contractInfo)==null?void 0:n.logoURI,F=(E==null||(i=E.contractInfo)==null?void 0:i.name)||"Unknown Collection",x=(E==null||(s=E.tokenMetadata)==null?void 0:s.decimals)||0,k=(E==null?void 0:E.balance)||"0",R=Nt(k,x),N=Io(Number(R)),A=E?To({balance:E,prices:P||[],conversionRate:L,decimals:x}):"0";return g.createElement(q,{style:{paddingTop:Mi}},g.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingX:"4",paddingTop:"0",style:{marginTop:"-20px"}},g.createElement(q,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},g.createElement(q,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},g.createElement(br,{borderRadius:"circle",width:"8",src:Y,alt:"collection logo",style:{objectFit:"cover"}}),g.createElement(q,{gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},g.createElement(ae,{fontWeight:"bold",fontSize:"small",color:"text100"},F),g.createElement(br,{width:"3",src:Q.logoURI,alt:"collection logo"}))),g.createElement(q,{flexDirection:"column",justifyContent:"center",alignItems:"center"},g.createElement(ae,{color:"text100",fontWeight:"bold",fontSize:"large"},(E==null||(o=E.tokenMetadata)==null?void 0:o.name)||"Unknown Collectible"),g.createElement(ae,{color:"text50",fontSize:"small",fontWeight:"medium"},`#${r}`))),g.createElement(q,null,g.createElement(Sp,{imageUrl:E==null||(a=E.tokenMetadata)==null?void 0:a.image})),g.createElement(q,null,g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),g.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},g.createElement(ae,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},N),P&&((c=P[0].price)==null?void 0:c.value)&&g.createElement(ae,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${f.symbol} ${A}`))),g.createElement(rt,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:Tb,label:"Send",onClick:K})),g.createElement(q,null,g.createElement(Hq,{onLoad:()=>m(),hasMore:v},g.createElement(E9,{transactions:b,isLoading:p,isFetchingNextPage:y})))))},N9e=["buttonVariant","text","size"],Vq=t=>{const{buttonVariant:e="icon",text:r,size:n="xs"}=t,i=S2(t,N9e),[s,o]=w.useState(!1);w.useEffect(()=>{s&&setTimeout(()=>{o(!1)},4e3)},[s]);const a=()=>{o(!0)},c=s?"Copied!":"Copy",l=e==="icon"?"rgba(0,0,0,0)":Te.colors.buttonGlass;return g.createElement(_z.CopyToClipboard,{text:r,onCopy:a},g.createElement(Ao,En({size:n,icon:s?Bd:Pb},i,{style:En({background:l},t==null?void 0:t.style),label:e==="with-label"?c:void 0})))},D9e=({transaction:t})=>{var e,r;const{chains:n}=vt(),{fiatCurrency:i}=Hn(),s=[],o=[];(e=t.transfers)==null||e.forEach(b=>{var E,S;if(((E=b.contractInfo)==null?void 0:E.type)==="ERC721"||((S=b.contractInfo)==null?void 0:S.type)==="ERC1155"){var P;(P=b.tokenIds)==null||P.forEach(L=>{if(!o.find(K=>{var Q;return K.chainId===t.chainId&&fr(K.contractAddress,((Q=b.contractInfo)==null?void 0:Q.address)||"")&&K.tokenId===L})){var H;o.push({chainId:t.chainId,contractAddress:((H=b.contractInfo)==null?void 0:H.address)||"",tokenId:L})}})}else{var M;const L=(b==null||(M=b.contractInfo)==null?void 0:M.address)||Dt;s.find(H=>H.chainId===t.chainId&&fr(H.contractAddress,L))||s.push({chainId:t.chainId,contractAddress:L})}});const{data:a,isLoading:c}=Ru({tokens:s}),{data:l,isLoading:u}=Bq({tokens:o}),{data:f=1,isLoading:d}=ll({toCurrency:i.symbol}),h=s.length>0&&c||o.length>0&&u||d,p=Pr(t.chainId,n),m=Fz(t.timestamp).format("ddd MMM DD YYYY, h:m:s a"),v=()=>{typeof window<"u"&&window.open(`${p.blockExplorerUrl}/tx/${t.txnHash}`,"_blank")},y=({transfer:b})=>{var E,S,P,M;const L=b.to,j=L.substring(0,10)+"..."+L.substring(b.to.length-4,b.to.length),H=fr((b==null||(E=b.contractInfo)==null?void 0:E.address)||"",Dt),K=H?p.logoURI:b==null||(S=b.contractInfo)==null?void 0:S.logoURI,Q=H?p.symbol:(b==null||(P=b.contractInfo)==null?void 0:P.symbol)||"";return g.createElement(g.Fragment,null,(M=b.amounts)==null?void 0:M.map((Y,F)=>{var x,k,R,N,A;const O=b.contractType==="ERC721"||b.contractType==="ERC1155",B=((x=b.tokenIds)==null?void 0:x[F])||"0",I=(b==null||(k=b.tokenMetadata)==null||(k=k[B])==null?void 0:k.decimals)||0,C=H?p.decimals:(b==null||(R=b.contractInfo)==null?void 0:R.decimals)||0,z=Nt(Y,O?I:C),_=Io(z),W=O?l==null||(N=l.find(J=>{var ee,se;return fr(J.token.contractAddress,((ee=b.contractInfo)==null?void 0:ee.address)||"")&&J.token.tokenId===((se=b.tokenIds)==null?void 0:se[F])&&J.token.chainId===t.chainId}))==null||(N=N.price)==null?void 0:N.value:a==null||(A=a.find(J=>{var ee;return fr(J.token.contractAddress,((ee=b.contractInfo)==null?void 0:ee.address)||Dt)&&J.token.chainId===t.chainId}))==null||(A=A.price)==null?void 0:A.value,G=(parseFloat(z)*(f*(W||0))).toFixed(2);return g.createElement(q,{key:F,width:"full",flexDirection:"row",gap:"2",justifyContent:"space-between",alignItems:"center"},g.createElement(q,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},g.createElement(Qc,{imageUrl:K,size:20}),g.createElement(q,{gap:"0.5",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"},g.createElement(ae,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},`${_} ${Q}`),h?g.createElement(pt,{width:"44px",height:"12px"}):g.createElement(ae,{fontWeight:"bold",fontSize:"xsmall",color:"text50"},W?`${i.sign}${G}`:""))),g.createElement(W6,{color:"text50",style:{width:"16px"}}),g.createElement(q,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},g.createElement(ku,{address:L,style:{width:"20px"}}),g.createElement(ae,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},j)))}))};return g.createElement(q,{padding:"5",paddingTop:"3",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",marginTop:"5"},g.createElement(q,{marginTop:"6",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"1"},g.createElement(ae,{fontSize:"normal",fontWeight:"medium"},"Transaction details"),g.createElement(ae,{marginBottom:"1",fontSize:"small",fontWeight:"medium",color:"text50"},m),g.createElement(th,{chainId:t.chainId})),g.createElement(q,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"4",width:"full",padding:"4",background:"backgroundSecondary",borderRadius:"md"},g.createElement(q,{width:"full",gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},g.createElement(ae,{fontSize:"normal",fontWeight:"medium",color:"text50"},"Transfer"),g.createElement(br,{width:"3",src:p.logoURI,alt:"network logo"})),(r=t.transfers)==null?void 0:r.map((b,E)=>g.createElement(q,{width:"full",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4",key:`transfer-${E}`},g.createElement(y,{transfer:b})))),g.createElement(rt,{onClick:v,width:"full",borderRadius:"md",rightIcon:Lle,label:`View on ${p.blockExplorerName}`}),g.createElement(q,null,g.createElement(q,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},g.createElement(s1,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),g.createElement(ae,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Status"),g.createElement(ae,{fontSize:"normal",fontWeight:"medium",color:"text100"},"Complete")),g.createElement(q,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},g.createElement(s1,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),g.createElement(ae,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Transaction Hash"),g.createElement(ae,{color:"text100",fontSize:"normal",fontWeight:"medium",style:{overflowWrap:"anywhere"}},t.txnHash),g.createElement(Vq,{marginTop:"2",buttonVariant:"with-label",text:t.txnHash}))))},L9e=w.forwardRef(({onClickAccount:t},e)=>{const{address:r}=fn();return g.createElement(q,{gap:"2",alignItems:"center"},g.createElement(q,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},g.createElement(q,{onClick:t,gap:"2",alignItems:"center",justifyContent:"center",className:bo,position:"relative",ref:e},g.createElement(ku,{size:"sm",address:r||""}),g.createElement(ae,{color:"text100",fontWeight:"medium",variant:"normal"},Rq(r||"")),g.createElement(QC,{color:"text100"}))))}),j9e=w.forwardRef(({setOpenWalletDropdown:t},e)=>{const{setNavigation:r}=$i(),{setOpenWalletModal:n}=Cp(),{address:i}=fn(),{disconnect:s}=YU(),{theme:o}=kp(),a=()=>{t(!1),r({location:"receive"})},c=()=>{t(!1),r({location:"history"})},l=()=>{t(!1),r({location:"settings"})},u=()=>{n(!1),t(!1),s()},f=()=>{switch(o){case"dark":return"rgba(38, 38, 38, 0.85)";case"light":return"rgba(217, 217, 217, 0.85)";default:return Te.colors.transparent}};return g.createElement(q,{padding:"3",ref:e,zIndex:"30",borderRadius:"md",style:{position:"relative",pointerEvents:"auto",width:"370px",backdropFilter:"blur(12.5px)",top:"16px",left:"15px",background:f()}},g.createElement(q,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"3",marginLeft:"2",color:"text100"},g.createElement(ku,{style:{width:"28px"},size:"md",address:i||""}),g.createElement(ae,{fontSize:"large",style:{fontWeight:"700"},color:"text100"},Rq(i||"")),g.createElement(Vq,{buttonVariant:"icon",size:"md",text:i||"",color:"text100",style:{marginLeft:"-16px"}})),g.createElement(Ao,{onClick:()=>t(!1),size:"xs",background:"buttonGlass",icon:Cu})),g.createElement(q,{gap:"2",marginTop:"3",flexDirection:"column"},g.createElement(rt,{variant:"glass",style:{borderRadius:Te.radii.md},width:"full",leftIcon:qle,label:"Receive",onClick:a}),g.createElement(rt,{style:{borderRadius:Te.radii.md},width:"full",leftIcon:Fj,label:"History",onClick:c}),g.createElement(rt,{style:{borderRadius:Te.radii.md},width:"full",leftIcon:jj,label:"Settings",onClick:l}),g.createElement(rt,{label:"Sign Out",style:{borderRadius:Te.radii.md},width:"full",leftIcon:Bj,onClick:u})))});Iu("packages/wallet/src/shared/WalletHeader/styles.css.ts","kit");const B9e=Wn({":focus-visible":{boxShadow:"none"}},"searchButton");Tu();const Lw=({})=>{const{openWalletModalState:t}=Cp(),[e,r]=w.useState(!1),{goBack:n,history:i,setNavigation:s}=$i(),o=w.useRef(!1);w.useEffect(()=>{t||r(!1)},[t]),w.useEffect(()=>{e?o.current?r(!1):o.current=!0:o.current=!1},[i.length,e]);const a=()=>{r(!0)},c=()=>{n()},l=()=>{s({location:"search"})};return g.createElement(q,{as:Cc.div},g.createElement(R4e,{open:e},g.createElement($4e,null),g.createElement(q,{background:"backgroundPrimary",zIndex:"20",position:"fixed",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"full",style:{height:Mi,paddingTop:"6px"}},i.length>0?g.createElement(Ao,{onClick:c,icon:_b,style:{backgroundColor:Te.colors.backgroundPrimary,width:"44px"}}):g.createElement(Ao,{onClick:l,icon:Ib,className:B9e,style:{backgroundColor:Te.colors.backgroundPrimary,width:"44px"}}),g.createElement(M4e,{asChild:!0},g.createElement(L9e,{onClickAccount:a})),g.createElement(q,{style:{width:"44px"}})),g.createElement(dd,null,e&&g.createElement(N4e,{asChild:!0,side:"bottom",align:"start"},g.createElement(j9e,{setOpenWalletDropdown:r})))))},Vs=({secondaryText:t,primaryText:e})=>{const{goBack:r,history:n}=$i(),i=()=>{r()};return g.createElement(q,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:Mi,paddingTop:"6px",backgroundColor:Te.colors.backgroundPrimary}},n.length>0?g.createElement(Ao,{onClick:i,icon:_b,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):g.createElement(q,null),g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",variant:"small",color:"text50"},t),g.createElement(ae,{fontWeight:"medium",variant:"small",color:"text100"},e)),g.createElement(q,{style:{width:"44px"}}))},mI=t=>{const{location:e}=t;switch(e){case"send-coin":return g.createElement(v9e,{chainId:t.params.chainId,contractAddress:t.params.contractAddress});case"send-collectible":return g.createElement(y9e,{chainId:t.params.chainId,contractAddress:t.params.contractAddress,tokenId:t.params.tokenId});case"receive":return g.createElement(m9e,null);case"history":return g.createElement(b9e,null);case"search":return g.createElement(x9e,null);case"search-view-all":return g.createElement(w9e,{defaultTab:t.params.defaultTab});case"settings":return g.createElement(E9e,null);case"settings-general":return g.createElement(C9e,null);case"settings-currency":return g.createElement(A9e,null);case"settings-networks":return g.createElement(_9e,null);case"coin-details":return g.createElement(T9e,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"collectible-details":return g.createElement(M9e,{contractAddress:t.params.contractAddress,chainId:t.params.chainId,tokenId:t.params.tokenId});case"collection-details":return g.createElement(R9e,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"transaction-details":return g.createElement(D9e,{transaction:t.params.transaction});case"home":default:return g.createElement(p9e,null)}},F9e=t=>{const{location:e}=t;switch(e){case"search":return g.createElement(Vs,{primaryText:"Search wallet"});case"search-view-all":return g.createElement(Vs,{secondaryText:"Search wallet / ",primaryText:"View all"});case"settings":return g.createElement(Vs,{secondaryText:"Wallet / ",primaryText:"Settings"});case"settings-general":return g.createElement(Vs,{secondaryText:"Wallet / Settings / ",primaryText:"General"});case"settings-currency":return g.createElement(Vs,{secondaryText:"Wallet / Settings / ",primaryText:"Currency"});case"settings-networks":return g.createElement(Vs,{secondaryText:"Wallet / Settings / ",primaryText:"Networks"});case"receive":return g.createElement(Vs,{secondaryText:"Wallet / ",primaryText:"Receive"});case"history":return g.createElement(Vs,{secondaryText:"Wallet / ",primaryText:"History"});case"coin-details":return g.createElement(Lw,null);case"collectible-details":return g.createElement(Lw,null);case"transaction-details":return g.createElement(Vs,{secondaryText:"",primaryText:""});case"send-collectible":case"send-coin":return g.createElement(Vs,{secondaryText:"Wallet / ",primaryText:"Send"});case"home":default:return g.createElement(Lw,null)}},U9e={location:"home"},z9e=t=>{const e=new z4;return g.createElement(H4,{client:e},g.createElement(q9e,t))},q9e=({children:t})=>{const{theme:e,position:r}=kp(),[n,i]=w.useState(!1),[s,o]=w.useState([]),a=s.length>0?s[s.length-1]:U9e,c=a.location==="home"||a.location==="collection-details"||a.location==="collectible-details"||a.location==="coin-details"||a.location==="history"||a.location==="search"||a.location==="search-view-all"||a.location==="settings-currency";return w.useEffect(()=>{n&&o([])},[n]),g.createElement(L4e,{value:{setOpenWalletModal:i,openWalletModalState:n}},g.createElement(r9e,{value:{setHistory:o,history:s}},g.createElement("div",{id:"kit-provider"},g.createElement(Lb,{root:"#kit-provider",scope:"kit",theme:e},g.createElement(dd,null,n&&g.createElement(zy,{contentProps:{style:En({maxWidth:"400px",height:"fit-content"},Eg(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},g.createElement(q,{className:x9,id:"sequence-kit-wallet-content"},F9e(a),c?g.createElement(LB,{className:d9e,style:{paddingTop:Mi,height:"min(800px, 80vh)"}},mI(a)):mI(a)))))),t))};var ws={};const W9e=wr(PQ),H9e=wr(gK),V9e=wr($R),G9e=wr(LJ),K9e=wr(VG),Q9e=wr(kQ),Y9e=wr(QJ),J9e=wr(cX),X9e=wr(hK),Z9e=wr(WG),vI=wr(FJ),e7e=wr(iZ),t7e=wr(XJ),r7e=wr(tK),n7e=wr(vR),i7e=wr(xJ),yI=wr(WK),s7e=wr(PJ),o7e=wr(oZ),a7e=wr(dX),c7e=wr(wX);(function(t){var e=mi&&mi.__createBinding||(Object.create?function(Q,Y,F,x){x===void 0&&(x=F),Object.defineProperty(Q,x,{enumerable:!0,get:function(){return Y[F]}})}:function(Q,Y,F,x){x===void 0&&(x=F),Q[x]=Y[F]}),r=mi&&mi.__setModuleDefault||(Object.create?function(Q,Y){Object.defineProperty(Q,"default",{enumerable:!0,value:Y})}:function(Q,Y){Q.default=Y}),n=mi&&mi.__importStar||function(Q){if(Q&&Q.__esModule)return Q;var Y={};if(Q!=null)for(var F in Q)F!=="default"&&Object.prototype.hasOwnProperty.call(Q,F)&&e(Y,Q,F);return r(Y,Q),Y};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var i=W9e;Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var s=H9e;Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return s.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return s.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return s.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return s.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return s.isAddress}});var o=n(V9e);t.base64=o;var a=G9e;Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return a.Base58}});var c=K9e;Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return c.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return c.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return c.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return c.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return c.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return c.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return c.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return c.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return c.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return c.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return c.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return c.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return c.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return c.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return c.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return c.stripZeros}});var l=Q9e;Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return l._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return l.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return l.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return l.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return l.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return l.namehash}});var u=Y9e;Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return u.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return u.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return u.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return u.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return u.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return u.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return u.mnemonicToSeed}});var f=J9e;Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return f.getJsonWalletAddress}});var d=X9e;Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return d.keccak256}});var h=Z9e;Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return h.Logger}});var p=vI;Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return p.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return p.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return p.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return p.sha512}});var m=e7e;Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return m.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return m.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return m.sha256}});var v=t7e;Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return v.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return v.shuffled}});var y=r7e;Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return y.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return y.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return y.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return y.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return y.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return y.shallowCopy}});var b=n(n7e);t.RLP=b;var E=i7e;Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return E.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return E.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return E.SigningKey}});var S=yI;Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return S.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return S.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return S.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return S._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return S.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return S.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return S.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return S.Utf8ErrorFuncs}});var P=s7e;Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return P.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return P.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return P.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return P.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return P.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return P.TransactionTypes}});var M=o7e;Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return M.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return M.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return M.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return M.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return M.parseUnits}});var L=a7e;Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return L.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return L.verifyTypedData}});var j=c7e;Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return j._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return j.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return j.poll}});var H=vI;Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return H.SupportedAlgorithm}});var K=yI;Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return K.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return K.Utf8ErrorReason}})})(ws);const l7e=(t,e)=>t.toLowerCase()===e.toLowerCase();function Ln(){return Ln=Object.assign?Object.assign.bind():function(t){for(var e=1;e svg`,{width:"20px",height:"20px"});const Kq=Wn({},"googleWaasButtonContainer");fs(`${Kq}`,{width:"40px",height:"40px",overflow:"hidden",borderRadius:"4px",alignItems:"center",justifyContent:"center"});const d7e=Wn([Mj({variant:"large"}),{height:"48px",width:"40px",display:"flex",justifyContent:"center",alignItems:"center",padding:"10px",border:`${Te.borderWidths.thick} solid ${Te.colors.borderNormal}`,borderRadius:Te.radii.sm,color:Te.colors.text100,background:"transparent",textAlign:"center",caretColor:"transparent",boxShadow:"none",":hover":{borderColor:Te.colors.borderFocus},":focus":{borderColor:Te.colors.borderFocus},"::selection":{background:"transparent"}}],"digitInput");Tu();const h7e=({onConnect:t,connectors:e})=>{const{theme:r}=op(),{isPending:n}=QU();return g.createElement(q,{flexDirection:"column",gap:"2",marginTop:"5"},e.map(i=>{const s=r==="dark"?i._wallet.logoDark:i._wallet.logoLight,o=i._wallet.name,a=i._wallet.id;return g.createElement(q,{key:a,as:"button",flexDirection:"row",alignItems:"center",justifyContent:"space-between",background:"backgroundSecondary",color:"text100",borderRadius:"md",padding:"4",style:{height:"60px"},className:u7e,onClick:()=>t(i)},g.createElement(ae,{variant:"medium",color:"text100"},o,n),g.createElement(q,{justifyContent:"center",alignItems:"center",style:{backgroundColor:i._wallet.iconBackground},borderRadius:"md",className:Gq},g.createElement(s,null)))}))},p7e=({config:t={}})=>{const{signIn:e={}}=t,{logoUrl:r}=e;return g.createElement(g.Fragment,null,r&&g.createElement(q,{marginTop:"5",justifyContent:"center",alignItems:"center"},g.createElement(br,{src:r,style:{height:"110px"}})))};let nr=function(t){return t.Settings="@kit.settings",t.Theme="@kit.theme",t.EthAuthProof="@kit.ethAuthProof",t.EthAuthSettings="@kit.ethAuthSettings",t.ProjectAccessKey="@kit.projectAccessKey",t.WaasGoogleClientID="@kit.waasGoogleClientId",t.WaasGoogleIdToken="@kit.waasGoogleIdToken",t.WaasAppleClientID="@kit.waasAppleClientId",t.WaasAppleRedirectURI="@kit.waasAppleRedirectURI",t.WaasAppleIdToken="@kit.waasAppleIdToken",t.WaasSessionHash="@kit.waasSessionHash",t.WaasActiveLoginType="@kit.waasActiveLoginType",t.WaasEmailIdToken="@kit.waasEmailIdToken",t}({});const jw={showEmailInput:!0,walletAuthOptions:["sequence","sequence-waas","metamask","wallet-connect","coinbase-wallet"],socialAuthOptions:["google","facebook","twitch","apple","google-waas","apple-waas"]},Qq=60*60*24*7;function m7e(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}const v7e=["createConnector"],Yq=(t,e)=>{localStorage.setItem(nr.ProjectAccessKey,t);const r=[];return e.forEach(n=>{const{createConnector:i}=n,s=m7e(n,v7e),o=Ln({},s),a=c=>{const u=i()(c);return u._wallet=Ln({},o),u};r.push(a)}),r},y7e=t=>/^\S+@\S+\.\S{2,}$/.test(t),X3={1:{name:"Ethereum",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",decimals:18,blockExplorerName:"Etherscan",blockExplorerUrl:"https://etherscan.io"},5:{name:"Goerli",symbol:"ETH",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",blockExplorerName:"Etherscan (Goerli)",blockExplorerUrl:"https://goerli.etherscan.io"},10:{name:"Optimism",symbol:"OP",logoURI:"https://assets.coingecko.com/coins/images/25244/small/Optimism.png",decimals:18,blockExplorerName:"Etherscan (Optimism)",blockExplorerUrl:"https://optimistic.etherscan.io"},56:{name:"BNB",symbol:"BNB",logoURI:"https://assets.coingecko.com/coins/images/825/thumb/bnb-icon2_2x.png",decimals:18,blockExplorerName:"BscScan",blockExplorerUrl:"https://bscscan.com"},100:{name:"Gnosis",symbol:"GNO",logoURI:"https://assets.coingecko.com/coins/images/662/small/logo_square_simple_300px.png",decimals:18,blockExplorerUrl:"https://gnosisscan.io",blockExplorerName:"Gnosis Scan"},137:{name:"Polygon",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan",blockExplorerUrl:"https://polygonscan.com"},1101:{name:"Polygon zkEVM",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"PolygonScan",blockExplorerUrl:"https://zkevm.polygonscan.com"},42161:{name:"Arbitrum",symbol:"ARB",logoURI:"https://assets.coingecko.com/asset_platforms/images/33/small/arbitrum-one.png",decimals:18,blockExplorerName:"Arbiscan",blockExplorerUrl:"https://arbiscan.io"},43114:{name:"Avalanche",symbol:"AVAX",logoURI:"https://assets.coingecko.com/coins/images/12559/small/Avalanche_Circle_RedWhite_Trans.png",decimals:18,blockExplorerName:"Snowtrace",blockExplorerUrl:"https://snowtrace.io"},80001:{name:"Mumbai",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan (Mumbai)",blockExplorerUrl:"https://mumbai.polygonscan.com"}},g7e=(t,e)=>{const r=e.find(s=>s.id===t);if(r){var n,i;return{name:r.nativeCurrency.name,symbol:r.nativeCurrency.symbol,decimals:r.nativeCurrency.decimals,logoURI:X3[1].logoURI,blockExplorerName:(n=r.blockExplorers)==null?void 0:n.default.name,blockExplorerUrl:(i=r.blockExplorers)==null?void 0:i.default.url}}},Pr=(t,e)=>X3[t]||g7e(t,e)||X3[1],rh=()=>{const t=g.createContext(void 0);return[()=>{const r=g.useContext(t);if(!r)throw new Error("useGenericContext must be used within a Provider");return r},t.Provider]},Eg=t=>{switch(t){case"top-right":return{top:"0px",right:"0px"};case"top-left":return{top:"0px",left:"0px"};case"top-center":return{top:"0px"};case"bottom-right":return{bottom:"0px",right:"0px"};case"bottom-left":return{bottom:"0px",left:"0px"};case"bottom-center":return{bottom:"0px"};case"middle-right":return{right:"0px"};case"middle-left":return{left:"0px"};case"center":default:return{}}},b7e=(t,e="light")=>{switch(t){case 1:return"#abf";case 137:return"#c7a6ff";case 42161:return"#52A7E6";case 10:return"#DB3132";case 56:return e==="light"?"#CB9C1D":"#EEB445";case 43114:return"#E84142";case 100:return e==="light"?"#00193C":"#D8E8FF";case 5:return e==="light"?"#A77A00":"#FFA700";case 80001:return e==="light"?"#D68828":"#FFA700";default:return"#abf"}},x7e=(t,e="light")=>{switch(t){case 1:return"#132362";case 137:return"#350881";case 42161:return e==="light"?"#EDF7FF":"#0C3754";case 10:return e==="light"?"#FFEAE9":"#390B0C";case 56:return e==="light"?"#FFE8AB":"#554018";case 43114:return e==="light"?"#FBDFDF":"#390B0C";case 100:return e==="light"?"#D8E8FF":"#00193C";case 5:return e==="light"?"#FFD871":"#554018";case 80001:return e==="light"?"#FFE8CD":"#554018";default:return"#132362"}};function w7e(t){var e;const{account:r,chain:n,transport:i}=t,s={chainId:n.id,name:n.name,ensAddress:(e=n.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return new W$(i,s).getSigner(r.address)}function E7e(t){var e;const{chain:r,transport:n}=t,i={chainId:r.id,name:r.name,ensAddress:(e=r.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return n.type==="fallback"?new YX(n.transports.map(({value:s})=>new ua(s==null?void 0:s.url,i))):new ua(n.url,i)}const C7e=async t=>{const e=localStorage.getItem(nr.EthAuthProof);if(e)return JSON.parse(e);const r=localStorage.getItem(nr.EthAuthSettings);if(!r)throw new Error("No ETHAuth settings found");const n=JSON.parse(r),i=t.account.address,s=new rb;s.address=i,s.claims.app=n.app||"app",s.claims.ogn=n.origin,s.claims.n=n.nonce,s.setExpiryIn(n.expiry?Math.max(n.expiry,200):Qq);const o=s.messageTypedData();o.domain.verifyingContract;const c=await w7e(t)._signTypedData(o.domain,o.types,o.message);s.signature=c;const u=await new Q0().encodeProof(s,!0);return{typedData:o,proofString:u}},S7e=async(t,e,r)=>{const n=t.account.address,s=await new Q0().decodeProof(r.proofString,!0),o=E7e(e);return await lu.utils.isValidTypedDataSignature(n,r.typedData,s.signature,o)},Xr=t=>{const e=lt[t];if(!e)throw"invalid network";const r=localStorage.getItem(nr.ProjectAccessKey)||void 0,n=new oC("https://metadata.sequence.app",r),i=new sC(BE(e.name),r),s=new Xh("https://api.sequence.app",r);return{network:e,metadataClient:n,indexerClient:i,apiClient:s}};function k7e({connector:t,onSuccess:e}){if(!t)return{inProgress:!1,loading:!1,error:void 0,initiateAuth:async d=>{},sendChallengeAnswer:async d=>{}};const[r,n]=w.useState(""),[i,s]=w.useState(),[o,a]=w.useState(!1),[c,l]=w.useState("");return{inProgress:o||!!c,loading:o,error:i,initiateAuth:async d=>{a(!0);try{var h;const p=t,{instance:m}=await((h=p.sequenceWaas)==null?void 0:h.email.initiateAuth({email:d}));l(m),n(d)}catch(p){s(p.message||"Unknown error")}finally{a(!1)}},sendChallengeAnswer:c?async d=>{a(!0);try{var h,p;const m=t,v=await((h=m.sequenceWaas)==null?void 0:h.getSessionHash()),{idToken:y}=await((p=m.sequenceWaas)==null?void 0:p.email.finalizeAuth({instance:c,answer:d,email:r,sessionHash:v}));e(y)}catch(m){s(m.message||"Unknown error"),a(!1)}}:void 0}}const A7e=t=>{const{value:e,digits:r=6,onChange:n,disabled:i=!1}=t,s=w.useMemo(()=>gI(0,r).map(()=>w.createRef()),[]);w.useEffect(()=>{var l;(l=s[0])==null||(l=l.current)==null||l.focus()},[]);const o=(l,u)=>{/^\d$/.test(u)||(u="");const f=[...e];if(f[l]=u,u!==""){var d;(d=s[l+1])==null||(d=d.current)==null||d.focus()}n(f)},a=(l,u)=>{var f,d;const h=s[l].current,p=(f=s[l-1])==null?void 0:f.current,m=(d=s[l+1])==null?void 0:d.current;switch(u.key){case"Backspace":u.preventDefault(),h&&(h.value="",o(l,"")),p==null||p.focus();break;case"ArrowLeft":u.preventDefault(),p==null||p.focus();break;case"ArrowRight":u.preventDefault(),m==null||m.focus();break;default:(h==null?void 0:h.value)===u.key&&(u.preventDefault(),o(l,u.key))}},c=(l,u)=>{const d=u.clipboardData.getData("text/plain").replace(/\D/g,"");if(/^\d{6}$/.test(d)){var h;(h=s[0])==null||(h=h.current)==null||h.focus(),n(d.split("")),setTimeout(()=>{var p;(p=s[s.length-1])==null||(p=p.current)==null||p.focus()})}};return g.createElement(q,{gap:"2"},gI(0,r).map(l=>g.createElement(w.Fragment,{key:l},l===r/2&&g.createElement("span",null),g.createElement(q,{as:"input",className:d7e,value:e[l]||"",ref:s[l],type:"text",inputMode:"numeric",maxLength:1,disabled:i,onFocus:u=>u.target.select(),onPaste:u=>c(l,u),onChange:u=>o(l,u.target.value),onKeyDown:u=>{a(l,u)}}))))},gI=(t,e)=>Array.from({length:e-t},(r,n)=>n+t),_7e=t=>{mv.useScript(mv.appleAuthHelpers.APPLE_SCRIPT_SRC);const{isConnected:e}=fn(),{theme:r}=op(),{config:n={}}=t,{signIn:i={}}=n,{showEmailInput:s=jw.showEmailInput,socialAuthOptions:o=jw.socialAuthOptions,walletAuthOptions:a=jw.walletAuthOptions}=i,{openConnectModal:c,setOpenConnectModal:l}=t,[u,f]=w.useState(""),[d,h]=w.useState(!1),[p,m]=w.useState([]),{connectors:v,connect:y}=QU(),b=v.filter(N=>!!(N!=null&&N._wallet)),[E,S]=w.useState(!1),P=b.find(N=>N._wallet.id==="mock"),M=b.find(N=>N._wallet.id.includes("email")),L=b.filter(N=>!!a.find(O=>O===N._wallet.id)).sort((N,A)=>a.indexOf(N._wallet.id)-a.indexOf(A._wallet.id)),j=b.filter(N=>!!o.find(O=>O===N._wallet.id)).sort((N,A)=>o.indexOf(N._wallet.id)-o.indexOf(A._wallet.id)),H=L.length>4,K=N=>{f(N.target.value)},{inProgress:Q,loading:Y,initiateAuth:F,sendChallengeAnswer:x}=k7e({connector:b.find(N=>N._wallet.id==="email-waas"),onSuccess:async N=>{localStorage.setItem(nr.WaasEmailIdToken,N),M&&y({connector:M})}});w.useEffect(()=>{e&&c&&l(!1)},[e,c]);const k=N=>{if(i.useMock&&P){y({connector:P});return}if(N._wallet.id==="email"){const O=prompt("Auto-email login, please specify the email address:");localStorage.setItem(O3,O||"")}if(N._wallet.id==="metamask"&&typeof window<"u"){var A;if(!!!((A=window)!=null&&(A=A.ethereum)!=null&&A._metamask)){window.open("https://metamask.io/download/");return}}y({connector:N})},R=async N=>{if(N.preventDefault(),i.useMock&&P){y({connector:P});return}if(M)if(localStorage.setItem(O3,u),M._wallet.id==="email-waas")try{await F(u),h(!0)}catch(A){console.log(A)}else y({connector:M})};return d?g.createElement(g.Fragment,null,g.createElement(q,{paddingY:"6",alignItems:"center",justifyContent:"center",flexDirection:"column"},g.createElement(ae,{marginTop:"5",marginBottom:"4",variant:"normal",color:"text80"},"Enter code received in email."),g.createElement(A7e,{value:p,digits:6,onChange:m}),g.createElement(q,{gap:"2",marginY:"4",alignItems:"center",justifyContent:"center",style:{height:"44px"}},Y?g.createElement(Fc,null):g.createElement(rt,{variant:"primary",disabled:p.includes(""),label:"Verify",onClick:()=>x==null?void 0:x(p.join("")),"data-id":"verifyButton"})))):E?g.createElement(g.Fragment,null,g.createElement(q,{as:"button",position:"absolute",style:{top:"20px"},onClick:()=>S(!1),className:sf},g.createElement(_b,null)),g.createElement(h7e,{connectors:L,onConnect:k})):g.createElement(g.Fragment,null,g.createElement(p7e,{config:n}),g.createElement(q,{marginTop:"5"},M&&s&&g.createElement(g.Fragment,null,g.createElement("form",{onSubmit:R},g.createElement(sl,{onChange:K,value:u,name:"email",placeholder:"Enter email","data-1p-ignore":!0}),g.createElement(q,{alignItems:"center",justifyContent:"center",style:{height:"48px"}},!Q&&g.createElement(rt,{type:"submit",disabled:!y7e(u),marginTop:"4",width:"full",label:"Continue",rightIcon:yo}),Q&&g.createElement(Fc,{marginTop:"4"})))),j.length>0&&g.createElement(g.Fragment,null,M&&s&&g.createElement(g.Fragment,null,g.createElement(q,{style:{marginBottom:"-4px"}},g.createElement(s1,{color:"backgroundSecondary"})),g.createElement(q,{justifyContent:"center",alignItems:"center"},g.createElement(ae,{variant:"small",color:"text50"},"or sign in via"))),g.createElement(q,{marginTop:"3",gap:"2",flexDirection:"row",justifyContent:"center",alignItems:"center",flexWrap:"wrap"},j.map(N=>{var A;const O=r==="dark"?N._wallet.monochromeLogoDark:N._wallet.monochromeLogoLight;return g.createElement(q,{key:N._wallet.id,aspectRatio:"1/1",alignItems:"center",justifyContent:"center",style:{width:"40px",height:"40px",margin:"12px 4px"}},N._wallet.id==="google-waas"&&g.createElement(q,{className:Kq},g.createElement(spe,{type:"icon",size:"large",nonce:(A=localStorage.getItem(nr.WaasSessionHash))!=null?A:void 0,onSuccess:B=>{B.credential&&(localStorage.setItem(nr.WaasGoogleIdToken,B.credential),k(N))},onError:()=>{console.log("Login Failed")}})),N._wallet.id==="apple-waas"&&g.createElement(kn,{width:"full",height:"full",padding:"2",borderRadius:"xs",className:sf,justifyContent:"center",alignItems:"center",onClick:()=>{const B=localStorage.getItem(nr.WaasAppleClientID)||"",I=localStorage.getItem(nr.WaasAppleRedirectURI)||"",C=localStorage.getItem(nr.WaasSessionHash)||"";mv.appleAuthHelpers.signIn({authOptions:{clientId:B,scope:"openid email",redirectURI:I,usePopup:!0,nonce:C},onSuccess:D=>{var z;(z=D.authorization)!=null&&z.id_token?(localStorage.setItem(nr.WaasAppleIdToken,D.authorization.id_token),k(N)):console.log("Apple login error: No id_token found")},onError:D=>console.error(D)})}},g.createElement(q,{width:"12",height:"12",flexDirection:"column",alignItems:"center",justifyContent:"center"},g.createElement(O,null))),!N._wallet.id.includes("waas")&&g.createElement(kn,{width:"full",height:"full",padding:"2",borderRadius:"xs",className:sf,justifyContent:"center",alignItems:"center",onClick:()=>{k(N)}},g.createElement(q,{width:"16",height:"16",flexDirection:"column",alignItems:"center",justifyContent:"center"},g.createElement(O,null))))}))),L.length>0&&g.createElement(g.Fragment,null,(M&&s||j.length>0)&&g.createElement(g.Fragment,null,g.createElement(q,{style:{marginBottom:"-4px"}},g.createElement(s1,{color:"backgroundSecondary"})),g.createElement(q,{justifyContent:"center",alignItems:"center"},g.createElement(ae,{variant:"small",color:"text50"},"or select a wallet"))),g.createElement(q,{marginTop:"2",gap:"2",flexDirection:"row",justifyContent:"center",alignItems:"center"},L.map(N=>{const A=r==="dark"?N._wallet.logoDark||N._wallet.logoDark:N._wallet.logoLight||N._wallet.logoLight;return g.createElement(kn,{key:N._wallet.id,style:{width:"43px",height:"43px",margin:"12px 4px"},padding:"2",borderRadius:"xs",className:sf,justifyContent:"center",alignItems:"center",onClick:()=>k(N)},g.createElement(q,{width:"16",height:"16",flexDirection:"column",alignItems:"center",justifyContent:"center"},g.createElement(A,null)))})),H&&g.createElement(q,{padding:"4",marginTop:"3",background:"backgroundSecondary",width:"full",justifyContent:"space-between",alignItems:"center",borderRadius:"md",color:"text100",as:"button",className:sf,onClick:()=>S(!0)},g.createElement(ae,{variant:"medium"},"More options"),g.createElement(yo,null)))))};function P7e(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const bI=t=>{let e=Ln({},(P7e(t),t));return g.createElement(g.Fragment,null,g.createElement("svg",Ln({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),g.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},g.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}),g.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"}))),g.createElement("defs",{id:"defs1314"},g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},g.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),g.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},g.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),g.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},g.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),g.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},g.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),g.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},g.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),g.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},g.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),g.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},g.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),g.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},g.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),g.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},g.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),g.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),g.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},g.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),g.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),g.createElement("clipPath",{id:"clip0_5_131"},g.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),g.createElement("clipPath",{id:"clip1_5_131"},g.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))},[Jq,I7e]=rh(),[T7e,O7e]=rh(),[R7e,$7e]=rh(),[M7e,N7e]=rh();class Z3{constructor(){this._resolve=()=>{},this._reject=()=>{},this._promise=new Promise((e,r)=>{this._reject=r,this._resolve=e})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}let Qu;function D7e(t){const[e,r]=w.useState();function n(s){var o;(o=Qu)==null||o.resolve({id:s,confirmed:!0}),r(void 0),Qu=void 0}function i(s){var o;(o=Qu)==null||o.resolve({id:s,confirmed:!1}),r(void 0),Qu=void 0}return w.useEffect(()=>{async function s(){if(!t)return;const o=t.sequenceWaasProvider;o&&(o.requestConfirmationHandler={confirmSignTransactionRequest(a,c,l){const u=new Z3;return r({id:a,type:"signTransaction",txs:Array.isArray(c)?c:[c],chainId:l}),Qu=u,u.promise},confirmSignMessageRequest(a,c,l){const u=new Z3;return r({id:a,type:"signMessage",message:c,chainId:l}),Qu=u,u.promise}})}s()}),[e,n,i]}let Ya=function(t){return t.APPROVE="approve",t.TRANSFER="transfer",t.SWAP="swap",t.AWARD_ITEM="awardItem",t.UNIMPLEMENTED="unimplemented",t.UNKNOWN="unknown",t}({});const Xq=t=>Object.fromEntries(t.map((e,r)=>[e.name&&!e.name.startsWith("unnamed")?e.name:`_${r}`,Array.isArray(e.value)&&e.type.startsWith("(")&&(e.type.endsWith(")")||e.type.endsWith(")[]"))?Xq(e.value):e.value])),Zq=(t,e,r,n)=>{const i=Xq(e.args),s=rr(n,0,4);let o=[];switch(e.signature){case"execute((bool,bool,uint256,address,uint256,bytes)[],uint256,bytes)":case"selfExecute((bool,bool,uint256,address,uint256,bytes)[])":o=e.args[0].value.map(c=>c.call?Zq(c.target,c.call,c.value,c.data):{to:c.target,signature:"",byteSignature:rr(c.data,0,4),methodName:"",args:{},objs:[],value:te.from(c.value).toString(),data:le(c.data)})}return{to:t,signature:e.signature,byteSignature:s,methodName:e.function,args:i,objs:o,value:te.from(r).toString(),data:le(n)}},L7e=t=>t.map(e=>"target"in e?e:Ln({},e,{target:e.to})).map(e=>{var r,n,i,s,o,a;return{delegateCall:(r=e.delegateCall)!=null?r:!1,revertOnError:(n=e.revertOnError)!=null?n:!1,gasLimit:(i=e.gasLimit)!=null?i:0,target:(s=e.target)!=null?s:"0x0000000000000000000000000000000000000000",value:(o=e.value)!=null?o:0,data:(a=e.data)!=null?a:"0x"}});let Yu=function(t){return t.SEQUENCE_DEPLOY="0x32c02a14",t.SEQUENCE_PUBLISH_CONFIG="0x44d466c2",t.SEQUENCE_UPDATE_IMAGE_HASH="0x29561426",t.SEQUENCE_UPDATE_IMPLEMENTATION="0x025b22bc",t.SEQUENCE_REQUIRE_SESSION_NONCE="0x8853baa0",t.EXECUTE="0x7a9a1628",t.SELF_EXECUTE="0x61c2926c",t.APPROVE="0x095ea7b3",t.TRANSFER="0xa9059cbb",t.DEPOSIT="0xd0e30db0",t.WITHDRAW="0x2e1a7d4d",t.ERC721_SAFE_TRANSFER_FROM="0x42842e0e",t.ERC721_SAFE_TRANSFER_FROM_WITH_DATA="0xb88d4fde",t.ERC1155_SAFE_TRANSFER_FROM="0xf242432a",t.ERC1155_SAFE_BATCH_TRANSFER_FROM="0x2eb2c2d6",t.NIFTYSWAP_BUY_TOKENS="0xd93e8aaa",t.TRANSFORM_ERC20="0x415565b0",t.OUTBOUND_TRANSFER_TO="0xa44bbb15",t.CELER_SEND="0xa5977fbb",t.UNISWAPV3_MULTICALL="0x5ae401dc",t.UNISWAPV2_SWAP_EXACT_TOKENS_FOR_TOKENS="0x38ed1739",t.UNISWAPV2_SWAP_TOKENS_FOR_EXACT_TOKENS="0x8803dbee",t.UNISWAPV2_SWAP_EXACT_ETH_FOR_TOKENS="0x7ff36ab5",t.UNISWAPV2_SWAP_ETH_FOR_EXACT_TOKENS="0xfb3bdb41",t.UNISWAPV2_SWAP_TOKENS_FOR_EXACT_ETH="0x4a25d94a",t.UNISWAPV2_SWAP_EXACT_TOKENS_FOR_ETH="0x18cbafe5",t.AWARD_ITEM="0xcf378343",t}({});const j7e=async t=>{const r=new xr(F7e).encodeFunctionData("selfExecute",[t]);try{const{apiClient:n}=Xr(1),{call:i}=await n.decodeContractCall({callData:r});return Zq("",i,0,r)}catch(n){throw new Error(n)}},B7e=async(t,e)=>{const r=L7e(e),n=(await j7e(r)).objs,i=ws.getAddress(t);return r.map((o,a)=>{const c=n[a],l=o.data.toString(),u=te.from(o.value).toString(),f=o.target;if(l==="0x"||!l)return{signature:"",byteSignature:"",type:Ya.TRANSFER,methodName:"nativeTokenTransfer",transferType:yn.SEND,contractAddress:Dt,contractType:ks.UNKNOWN,from:i,to:ws.getAddress(o.target),tokenIds:["0"],amounts:[u],target:f,value:u};if(!c)return;const d=ws.getAddress(o.target),h={type:Ya.UNIMPLEMENTED,signature:c.signature,byteSignature:c.byteSignature,methodName:c.methodName,target:f,value:u};switch(c.byteSignature){case Yu.TRANSFER:{const{args:p}=c;return Ln({},h,{type:Ya.TRANSFER,transferType:yn.SEND,contractAddress:d,contractType:ks.ERC20,from:i,to:ws.getAddress(p.recipient),tokenIds:["0"],amounts:[String(p.amount)]})}case Yu.ERC721_SAFE_TRANSFER_FROM:case Yu.ERC721_SAFE_TRANSFER_FROM_WITH_DATA:{const p=c.args;return Ln({},h,{type:Ya.TRANSFER,transferType:yn.SEND,contractAddress:d,contractType:ks.ERC721,from:i,to:ws.getAddress(p.to),tokenIds:[p.tokenId],amounts:["1"]})}case Yu.ERC1155_SAFE_TRANSFER_FROM:{const p=c.args;return Ln({},h,{type:Ya.TRANSFER,transferType:yn.SEND,contractAddress:d,contractType:ks.ERC1155,from:i,to:ws.getAddress(p._to),tokenIds:[p._id],amounts:[p._amount]})}case Yu.ERC1155_SAFE_BATCH_TRANSFER_FROM:{const{args:p}=c;return Ln({},h,{type:Ya.TRANSFER,transferType:yn.SEND,contractAddress:d,contractType:ks.ERC1155,from:i,to:ws.getAddress(p._to),tokenIds:p._ids,amounts:p._amounts})}case Yu.AWARD_ITEM:{const{args:p}=c;return Ln({},h,{type:Ya.AWARD_ITEM,contractAddress:d,to:ws.getAddress(p._0),amount:"1"})}}}).flatMap(o=>o?[o]:[])},F7e=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"},{type:"function",name:"setExtraImageHash",constant:!1,inputs:[{type:"bytes32",name:"imageHash"},{type:"uint256",name:"expiration"}],outputs:[],payable:!1,stateMutability:"nonpayable"}],U7e=()=>g.createElement(q,{alignItems:"center",justifyContent:"space-between"},g.createElement(q,{justifyContent:"center",alignItems:"center",gap:"2"},g.createElement(pt,{width:30,height:30,borderRadius:"circle"}),g.createElement(q,{flexDirection:"column",gap:"2",alignItems:"flex-start"},g.createElement(pt,{width:100,height:14}),g.createElement(pt,{width:75,height:14}))),g.createElement(q,{flexDirection:"column",gap:"2",alignItems:"flex-end"},g.createElement(pt,{width:100,height:14}),g.createElement(pt,{width:50,height:12}))),z7e=({address:t,txs:e,chainId:r})=>{vt();const[n,i]=w.useState(void 0),[s,o]=w.useState([]),[a,c]=w.useState([]),l=async()=>{const u=await B7e(t,e);i(u[0].type),u[0].type==="transfer"&&o(u),u[0].type==="awardItem"&&c(u)};if(w.useEffect(()=>{l()},[]),!n)return g.createElement(U7e,null);if(n===Ya.UNKNOWN)return g.createElement(g.Fragment,null);if(s.length>=1)return g.createElement(q7e,{address:t,transferProps:s,chainId:r});if(a.length>=1)return g.createElement(W7e,{awardItemProps:a[0]})},q7e=({address:t,transferProps:e,chainId:r})=>{var n,i,s,o,a,c,l,u,f,d,h,p,m,v,y,b,E,S,P;const{chains:M}=vt(),L=(n=e[0])==null?void 0:n.contractAddress,j=(i=e[0])==null?void 0:i.to,H=L?l7e(L,Dt):!0,K=((s=e[0])==null?void 0:s.contractType)===ks.ERC1155,Q=((o=e[0])==null?void 0:o.contractType)===ks.ERC1155||((a=e[0])==null?void 0:a.contractType)===ks.ERC721,Y=Pr(r,M),{data:F=[],isLoading:x}=k2({accountAddress:t,chainIds:[r],contractAddress:L},{hideUnlistedTokens:!1}),{data:k,isLoading:R}=Uq({tokens:{chainId:r,contractAddress:L,tokenIds:(c=(l=e[0])==null?void 0:l.tokenIds)!=null?c:[]}}),N=L?F.find(_=>ws.getAddress(_.contractAddress)===ws.getAddress(L)):void 0,A=H?Y.decimals:(N==null||(u=N.contractInfo)==null?void 0:u.decimals)||18,O=H?Y.logoURI:Q?k==null||(f=k[0])==null?void 0:f.image:N==null||(d=N.contractInfo)==null?void 0:d.logoURI,B=H?Y.name:Q?k==null||(h=k[0])==null?void 0:h.name:(N==null||(p=N.contractInfo)==null?void 0:p.name)||"",I=H?Y.symbol:Q?"":(N==null||(m=N.contractInfo)==null?void 0:m.symbol)||"",C=N!==void 0?Nt(N.balance,A):"";Io(C);const D=(v=(y=e[0])==null||(y=y.amounts)==null?void 0:y[0])!=null?v:(b=e[0])==null?void 0:b.value,z=Q;return g.createElement(kn,null,g.createElement(q,{marginBottom:"2"},g.createElement(ae,{variant:"medium",color:"text100"},H7e((E=(S=e[0])==null?void 0:S.type)!=null?E:""))),g.createElement(q,{alignItems:"flex-end",justifyContent:"space-between",marginBottom:"2"},g.createElement(q,{justifyContent:"space-between",alignItems:"center",gap:"2"},z?g.createElement(q,{style:{width:"40px"}},g.createElement(Sp,{imageUrl:O})):g.createElement(Qc,{imageUrl:O,size:40}),g.createElement(q,{flexDirection:"column",alignItems:"flex-start"},g.createElement(q,{flexDirection:"row",alignItems:"center",gap:"1"},g.createElement(ae,{variant:"medium",color:"text100"},B)),g.createElement(ae,{color:"text50",variant:"normal"}," ",`${Nt(D,K?k==null||(P=k[0])==null?void 0:P.decimals:Q?0:A)} ${I} `)))),j!==void 0&&g.createElement(q,null,g.createElement(ae,{fontSize:"normal",color:"text50"},"To"),g.createElement(q,{marginTop:"2",borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",style:{height:"52px"}},g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},g.createElement(ku,{address:j,style:{width:"20px"}}),g.createElement(ae,{color:"text100"},`0x${eW(j.substring(2),12)}`)))))},W7e=({awardItemProps:t})=>g.createElement(kn,null,g.createElement(q,{marginBottom:"2"},g.createElement(ae,{variant:"medium",color:"text100"},"Mint")),g.createElement(q,{alignItems:"flex-end",justifyContent:"space-between",marginBottom:"2"},g.createElement(q,{justifyContent:"space-between",alignItems:"center",gap:"2"},g.createElement(q,{style:{width:"40px"}},g.createElement(Sp,{imageUrl:"https://dev-metadata.sequence.app/projects/277/collections/62/tokens/0/image.jpeg"})),g.createElement(q,{flexDirection:"column",alignItems:"flex-start"},g.createElement(q,{flexDirection:"row",alignItems:"center",gap:"1"},g.createElement(ae,{variant:"medium",color:"text100"},"Waas Demo NFT")),g.createElement(ae,{color:"text50",variant:"normal"},t.amount)))),t.to!==void 0&&g.createElement(q,null,g.createElement(ae,{fontSize:"normal",color:"text50"},"To"),g.createElement(q,{marginTop:"2",borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",style:{height:"52px"}},g.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},g.createElement(ku,{address:t.to,style:{width:"20px"}}),g.createElement(ae,{color:"text100"},`0x${eW(t.to.substring(2),12)}`))))),H7e=t=>t.charAt(0).toUpperCase()+t.slice(1),eW=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},V7e={dark:"dark",light:"light"},G7e=t=>{var e,r,n,i;const{config:s,children:o}=t,{defaultTheme:a="dark",signIn:c={},position:l="center",displayedAssets:u=[],ethAuth:f={},disableAnalytics:d=!1}=s,h=c.projectName||"app",{expiry:p=Qq,app:m=h,origin:v=location.origin,nonce:y}=f,{projectName:b}=c,[E,S]=w.useState(!1),[P,M]=w.useState(a||V7e.dark),[L,j]=w.useState(l),[H,K]=w.useState(u),[Q,Y]=w.useState(),{address:F,isConnected:x}=fn(),R=(e=f2().find(D=>D.connector.id.includes("waas")))==null?void 0:e.connector,[N,A,O]=D7e(R),B=localStorage.getItem(nr.WaasGoogleClientID)||"",I=D=>{const _=lu.initWallet(D).client.analytics;Y(_)};w.useEffect(()=>{if(!x){Q==null||Q.reset();return}F&&(Q==null||Q.identify(F.toLowerCase()))},[Q,F,x]);const C=()=>{typeof window<"u"&&window.open("https://sequence.xyz")};return w.useEffect(()=>{const D=localStorage.getItem(nr.ProjectAccessKey)||"";d||I(D)},[]),w.useEffect(()=>{P!==a&&M(a)},[a]),w.useEffect(()=>{L!==l&&j(l)},[l]),w.useEffect(()=>{typeof P=="object"||localStorage.setItem(nr.Theme,P),localStorage.setItem(nr.EthAuthSettings,JSON.stringify({expiry:p,app:m,origin:v,nonce:y}))},[P,f]),w.useEffect(()=>{K(H)},[u]),g.createElement($7e,{value:{theme:P,setTheme:M,position:L,setPosition:j}},g.createElement(tpe,{clientId:B},g.createElement(O7e,{value:{setOpenConnectModal:S,openConnectModalState:E}},g.createElement(N7e,{value:{setDisplayedAssets:K,displayedAssets:H}},g.createElement(I7e,{value:{setAnalytics:Y,analytics:Q}},g.createElement("div",{id:"kit-provider"},g.createElement(Lb,{root:"#kit-provider",scope:"kit",theme:P},g.createElement(dd,null,E&&g.createElement(zy,{scroll:!1,backdropColor:"backgroundBackdrop",size:"sm",contentProps:{style:Ln({maxWidth:"364px"},Eg(l))},onClose:()=>S(!1)},g.createElement(q,{padding:"4",className:wg},g.createElement(q,{justifyContent:"center",color:"text100",alignItems:"center",fontWeight:"medium",style:{marginTop:"4px"}},g.createElement(ae,null,"Sign in ",b?`to ${b}`:"")),g.createElement(_7e,Ln({openConnectModal:E,setOpenConnectModal:S},t)),g.createElement(q,{onClick:C,className:sf,gap:"1",marginTop:"2",flexDirection:"row",alignItems:"center",justifyContent:"center"},g.createElement(ae,{fontSize:"small",color:"text100"},"Powered by Sequence"),g.createElement(q,{height:"5",width:"5"},g.createElement(bI,null)))))),g.createElement(dd,null,N&&g.createElement(zy,{scroll:!1,backdropColor:"backgroundBackdrop",size:"sm",contentProps:{style:Ln({maxWidth:"364px"},Eg(l))},isDismissible:!1,onClose:()=>{O("")}},g.createElement(q,{paddingX:"4",paddingTop:"4",paddingBottom:"2",className:wg},g.createElement(q,{flexDirection:"column",justifyContent:"center",color:"text100",alignItems:"center",fontWeight:"medium",style:{marginTop:"4px"}},g.createElement(ae,{as:"h1",variant:"large",marginBottom:"5"},"Confirm ",N.type==="signMessage"?"signing message":"transaction"),N.type==="signMessage"&&g.createElement(q,{flexDirection:"column",width:"full"},g.createElement(ae,{fontSize:"normal",color:"text50"},"Message"),g.createElement(kn,{marginTop:"2",paddingY:"6"},g.createElement(ae,{variant:"normal",marginBottom:"4"},os((r=N.message)!=null?r:"")))),N.type==="signTransaction"&&g.createElement(q,{flexDirection:"column",width:"full"},g.createElement(z7e,{address:F??"",txs:(n=N.txs)!=null?n:[],chainId:(i=N.chainId)!=null?i:137}),g.createElement(xue,{label:"Transaction data",marginTop:"4"},g.createElement(kn,{overflowX:"scroll",marginY:"3"},g.createElement(ae,{variant:"code",marginBottom:"4"},JSON.stringify(N.txs,null,2))))),N.chainId&&g.createElement(q,{width:"full",marginTop:"3",justifyContent:"flex-end",alignItems:"center"},g.createElement(q,{width:"1/2",justifyContent:"flex-start"},g.createElement(ae,{variant:"small",color:"text50"},"Network")),g.createElement(q,{width:"1/2",justifyContent:"flex-end"},g.createElement(th,{chainId:N.chainId}))),g.createElement(q,{flexDirection:"row",gap:"2",width:"full",marginTop:"5"},g.createElement(rt,{width:"full",shape:"square",size:"lg",label:"Reject",onClick:()=>{O(N==null?void 0:N.id)}}),g.createElement(rt,{alignItems:"center",textAlign:"center",width:"full",shape:"square",size:"lg",label:"Confirm",variant:"primary",onClick:()=>{A(N==null?void 0:N.id)}}))),g.createElement(q,{gap:"1",marginTop:"4",flexDirection:"row",alignItems:"center",justifyContent:"center"},g.createElement(ae,{fontSize:"small",color:"text80"},"Powered by Sequence"),g.createElement(q,{height:"4",width:"4",marginTop:"1"},g.createElement(bI,null)))))))),o)))))},K7e=()=>{const{setOpenConnectModal:t,openConnectModalState:e}=T7e();return{setOpenConnectModal:t,openConnectModalState:e}},kp=()=>{const{setTheme:t,theme:e,position:r,setPosition:n}=R7e();return{setTheme:t,theme:e,position:r,setPosition:n}},Q7e=()=>{const{setDisplayedAssets:t,displayedAssets:e}=M7e();return{displayedAssets:e,setDisplayedAssets:t}};let $h;function Y7e(){var t;const r=(t=f2().find(a=>a.connector.id.includes("waas")))==null?void 0:t.connector,[n,i]=w.useState();function s(a,c){var l;(l=$h)==null||l.resolve({id:a,feeTokenAddress:c,confirmed:!0}),i(void 0),$h=void 0}function o(a){var c;(c=$h)==null||c.resolve({id:a,feeTokenAddress:void 0,confirmed:!1}),i(void 0),$h=void 0}return w.useEffect(()=>{async function a(){if(!r)return;const c=r.sequenceWaasProvider;c&&(c.feeConfirmationHandler={confirmFeeOption(l,u,f,d){const h=new Z3;return i({id:l,options:u,chainId:d}),$h=h,h.promise}})}a()}),[n,s,o]}var J7e=()=>typeof window<"u"&&window.localStorage.getItem("IS_PAPER_DEV")==="true",X7e=()=>typeof window<"u"&&window.location.origin.includes("paper.xyz"),Z7e=()=>typeof window<"u"&&window.location.origin.includes("thirdweb.com"),tW=()=>{var t;return J7e()?(t=window.localStorage.getItem("PAPER_DEV_URL"))!=null?t:"http://localhost:3000":X7e()||Z7e()?window.location.origin:"https://withpaper.com"},rW={colorPrimary:"#cf3781",colorBackground:"#ffffff",colorText:"#1a202c",borderRadius:12,fontFamily:"Open Sans"},eSe=Object.defineProperty,tSe=Object.defineProperties,rSe=Object.getOwnPropertyDescriptors,xI=Object.getOwnPropertySymbols,nSe=Object.prototype.hasOwnProperty,iSe=Object.prototype.propertyIsEnumerable,wI=(t,e,r)=>e in t?eSe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gn=(t,e)=>{for(var r in e||(e={}))nSe.call(e,r)&&wI(t,r,e[r]);if(xI)for(var r of xI(e))iSe.call(e,r)&&wI(t,r,e[r]);return t},EI=(t,e)=>tSe(t,rSe(e)),sSe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),nW=sSe((t,e)=>{e.exports={name:"@paperxyz/js-client-sdk",description:"Paper JS SDK for Checkout Elements",version:"0.2.7",license:"Apache-2.0",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",files:["dist/**"],bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",scripts:{build:"tsup src/index.ts --env.NODE_ENV production","build-package-checkout":"yarn build","dev-checkout":"tsup src/index.ts --env.NODE_ENV development --watch",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/js-client-sdk"},keywords:[],devDependencies:{"@paperxyz/tsconfig":"*","eslint-config-paperxyz":"*",typescript:"^4.7.4"},dependencies:{"@paperxyz/sdk-common-utilities":"*",ethers:"^5.7.2"},publishConfig:{access:"public"}}}),iW=tW(),oSe="/sdk/2022-08-12/checkout-with-card",aSe=(t=>(t.UserAbandonedCheckout="User abandoned the checkout",t.UserLoginFailed="User login failed",t.InvalidProps="The props you passed in to this component are not valid.",t.InvalidCard="The card information is invalid. Please double check that the Card, CVC, and Zip code are all correct.",t.EmailNotVerified="The email was unable to be verified.",t.NotEnoughSupply="There is not enough supply to claim.",t.AddressNotAllowed="This address is not on the allowlist.",t.NoActiveClaimPhase="There is no active claim phase at the moment.",t))(aSe||{}),cSe=(t=>(t.ErrorConnectingToWallet="Error connecting to wallet",t.ErrorSendingTransaction="Something went wrong sending transaction",t.InsufficientBalance="Insufficient ETH",t.TransactionCancelled="Transaction Cancelled",t.WrongChain="Wrong Chain Detected",t.ChainSwitchUnderway="There is a network switch already underway",t.PendingSignature="Pending Signature",t))(cSe||{}),lSe=class{constructor(t){this.link=t}addStylingOptions(t){t.colorPrimary&&this.link.searchParams.set("colorPrimary",t.colorPrimary),t.colorBackground&&this.link.searchParams.set("colorBackground",t.colorBackground),t.colorText&&this.link.searchParams.set("colorText",t.colorText),t.borderRadius!==void 0&&this.link.searchParams.set("borderRadius",t.borderRadius.toString()),t.fontFamily&&this.link.searchParams.set("fontFamily",t.fontFamily),t.inputBackgroundColor&&this.link.searchParams.set("inputBackgroundColor",t.inputBackgroundColor),t.inputBorderColor&&this.link.searchParams.set("inputBorderColor",t.inputBorderColor)}addClientSecret(t){this.link.searchParams.set("sdkClientSecret",t)}addLocale(t){t&&this.link.searchParams.set("locale",t.toString())}addOTP(){this.link.searchParams.set("withOTP","true")}addAppName(t){t&&this.link.searchParams.set("appName",t)}addShowConnectWalletOptions(t){this.link.searchParams.append("showConnectWalletOptions",t.toString())}addReceivingWalletType(t){this.link.searchParams.append("walletType",t||"Preset")}addRecipientWalletAddress(t){this.link.searchParams.set("recipientWalletAddress",t)}addPayerWalletAddress(t){this.link.searchParams.append("payerWalletAddress",t)}addDate(t){this.link.searchParams.set("date",t?t.toString():Date.now().toString())}getLink(){return this.link}},uSe=({url:t,width:e=440,height:r=700})=>{if(!(window!=null&&window.top))return null;let n=window.top.outerHeight/2+window.top.screenY-r/2,i=window.top.outerWidth/2+window.top.screenX-e/2;return window.open(t,"_blank",`popup=true,width=${e},height=${r},top=${n},left=${i}`)};function CI(t,e,r){var n;(n=t.contentWindow)==null||n.postMessage(Gn({eventType:e},r),"*")}var fSe=nW(),dSe=class{constructor({elementOrId:e,onLoad:r}){this.elementOrId=e,this.onLoad=r}createPaymentElement({handler:e,link:r,iframeId:n}){let i=document.createElement("iframe");if(i.src=r.href,i.id=n,i.allow="payment",i.setAttribute("style","margin-left:auto; margin-right:auto; width:100%; height: 100%; min-height:375px; transition-property:all; transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1); transition-duration:150ms; color-scheme: light;"),i.onload=a=>{this.onLoad&&this.onLoad(a)},i.setAttribute("data-paper-sdk-version",`@paperxyz/js-client-sdk@${fSe.version}`),!this.elementOrId)return window.addEventListener("message",e(i)),i;let s=this.elementOrId;if(typeof s=="string"){let a=document.getElementById(s);if(!a)throw new Error("Invalid id given");s=a}let o=s.querySelector("#"+n);return o?(o.src===r.href||(o.src=r.href),o):(window.addEventListener("message",e(i)),s.appendChild(i))}},SI={top:"0px",left:"0px",right:"0px",bottom:"0px"},hSe=()=>({main:EI(Gn({},SI),{position:"fixed",zIndex:"10000",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto"}),overlay:EI(Gn({},SI),{position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.33)",pointerEvents:"auto"}),body:{background:"transparent",borderRadius:"12px",position:"relative",overflow:"hidden",width:"100%",maxWidth:"500px",height:"700px",maxHeight:"80%",animation:"pew-modal-slideIn 0.2s forwards",pointerEvents:"auto"},spinner:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",margin:"auto",borderWidth:"3px",borderColor:"#2D3748 #2D3748 transparent transparent",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite"},iframe:{position:"relative",height:"100%",width:"100%",border:"none",background:"transparent"}}),pSe=` @keyframes pew-modal-slideIn { from {opacity: 0; transform: translate3d(0, 20px, 0);} to {opacity: 1; transform: translate3d(0, 0, 0);} @@ -321,54 +321,54 @@ Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.val @keyframes spin { to { transform: rotate(360deg); } } -`,Wh="paper-js-sdk-modal",ZSe=class{constructor(t,e){this.styles=JSe(),this.container=t||document.body,e&&this.mergeStyles(e),this.main=document.createElement("div"),this.main.id=Wh,this.overlay=document.createElement("div"),this.overlay.id=`${Wh}-overlay`,this.body=document.createElement("div"),this.body.id=`${Wh}-body`,this.spinner=document.createElement("div"),this.spinner.id=`${Wh}-spinner`,this.iframe=document.createElement("iframe"),this.iframe.id=`${Wh}-iframe`,this.iframe.allow="camera; microphone; payment",this.style=document.createElement("style"),this.style.innerHTML=XSe,this.assignStyles(this.main,this.styles.main),this.assignStyles(this.overlay,this.styles.overlay),this.assignStyles(this.body,this.styles.body),this.assignStyles(this.spinner,this.styles.spinner),this.assignStyles(this.iframe,this.styles.iframe)}open({iframeUrl:t}={}){t&&(this.body.appendChild(this.spinner),this.iframe.src=t,this.iframe.onload=()=>this.body.removeChild(this.spinner),this.body.appendChild(this.iframe)),this.addAccessibility(),this.main.appendChild(this.overlay),this.main.appendChild(this.style),this.main.appendChild(this.body),this.container.appendChild(this.main),document.body.style.overflow="hidden"}close(){this.body.style.animation="pew-modal-slideOut 0.2s forwards",window.setTimeout(()=>this.main.remove(),250)}mergeStyles(t){this.styles.body=Kn(Kn({},this.styles.body),t.body||{}),this.styles.spinner=Kn(Kn({},this.styles.spinner),t.spinner||{}),this.styles.overlay=Kn(Kn({},this.styles.overlay),t.overlay||{}),this.styles.main=Kn(Kn({},this.styles.main),t.main||{}),this.styles.iframe=Kn(Kn({},this.styles.iframe),t.iframe||{})}addAccessibility(){this.main.setAttribute("aria-hidden","true"),this.overlay.setAttribute("aria-hidden","true"),this.body.setAttribute("aria-modal","true"),this.body.setAttribute("role","dialog")}assignStyles(t,e){Object.assign(t.style,e)}};function eke({sdkClientSecret:t,appName:e,options:r=Kn({},kW),locale:n,configs:i}){let s=new URL(WSe,_W),o=t;if(!o&&i&&(o=btoa(JSON.stringify(i))),!o){let c="/error?errorMessage=Must have either sdkClientSecret or configs field set. Received neither",l=SW();return new URL(c,l)}let a=new GSe(s);return a.addClientSecret(o??""),a.addStylingOptions(r),a.addLocale(n),a.addAppName(e),a.getLink()}function tke({iframe:t,onError:e,onReview:r,onPaymentSuccess:n,onBeforeModalOpen:i,onPriceUpdate:s}){let o;return a=>{if(!a.origin.startsWith(_W))return;let{data:c}=a;switch(c.eventType){case"checkoutWithCardError":e&&e({code:c.code,error:c.error});break;case"paymentSuccess":n&&n({transactionId:c.id,id:c.id}),c.postToIframe&&UI(t,c.eventType,c);break;case"reviewComplete":r&&r({id:c.id,cardholderName:c.cardholderName});break;case"openModalWithUrl":i&&c.url&&c.url.includes("promptKYCModal")?i({url:c.url}):(o=new ZSe(void 0,{body:{colorScheme:"light"}}),o.open({iframeUrl:c.url}));break;case"completedSDKModal":o.close(),c.postToIframe&&UI(t,c.eventType,c);break;case"requestedPopup":{KSe({url:c.url,width:c.width,height:c.height})||console.error("CheckoutWithCard: Unable to open popup.");break}case"sizing":t.style.height=c.height+"px",t.style.maxHeight=c.height+"px";break;case"onPriceUpdate":{s==null||s(c);break}}}}function rke({onCloseKycModal:t,onOpenKycModal:e,sdkClientSecret:r,appName:n,elementOrId:i,onLoad:s,onError:o,locale:a,options:c,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:h=!0,configs:p}){let m="checkout-with-card-iframe",v=b=>tke({iframe:b,onCloseKycModal:t,onOpenKycModal:e,onError:o,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:h}),y=eke({sdkClientSecret:r,appName:n,locale:a,options:c,useAltDomain:h,configs:p});return new YSe({onLoad:s,elementOrId:i}).createPaymentElement({handler:v,iframeId:m,link:y})}AW();function nke(t){if(t.sheet)return t.sheet;for(var e=0;e0?on(hh,--fi):0,Rd--,Dr===10&&(Rd=1,B2--),Dr}function ki(){return Dr=fi2||H1(Dr)>3?"":" "}function vke(t,e){for(;--e&&ki()&&!(Dr<48||Dr>102||Dr>57&&Dr<65||Dr>70&&Dr<97););return Lp(t,Rv()+(e<6&&Eo()==32&&ki()==32))}function m8(t){for(;ki();)switch(Dr){case t:return fi;case 34:case 39:t!==34&&t!==39&&m8(Dr);break;case 40:t===41&&m8(t);break;case 92:ki();break}return fi}function yke(t,e){for(;ki()&&t+Dr!==57;)if(t+Dr===84&&Eo()===47)break;return"/*"+Lp(e,fi-1)+"*"+j2(t===47?t:ki())}function gke(t){for(;!H1(Eo());)ki();return Lp(t,fi)}function bke(t){return $W(Mv("",null,null,null,[""],t=RW(t),0,[0],t))}function Mv(t,e,r,n,i,s,o,a,c){for(var l=0,u=0,f=o,d=0,h=0,p=0,m=1,v=1,y=1,b=0,E="",S=i,P=s,M=n,L=E;v;)switch(p=b,b=ki()){case 40:if(p!=108&&on(L,f-1)==58){p8(L+=ht($v(b),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:L+=$v(b);break;case 9:case 10:case 13:case 32:L+=mke(p);break;case 92:L+=vke(Rv()-1,7);continue;case 47:switch(Eo()){case 42:case 47:zm(xke(yke(ki(),Rv()),e,r),c);break;default:L+="/"}break;case 123*m:a[l++]=no(L)*y;case 125*m:case 59:case 0:switch(b){case 0:case 125:v=0;case 59+u:y==-1&&(L=ht(L,/\f/g,"")),h>0&&no(L)-f&&zm(h>32?WI(L+";",n,r,f-1):WI(ht(L," ","")+";",n,r,f-2),c);break;case 59:L+=";";default:if(zm(M=qI(L,e,r,l,u,i,a,E,S=[],P=[],f),s),b===123)if(u===0)Mv(L,e,M,M,S,s,f,a,P);else switch(d===99&&on(L,3)===110?100:d){case 100:case 108:case 109:case 115:Mv(t,M,M,n&&zm(qI(t,M,M,0,0,i,a,E,i,S=[],f),P),i,P,f,a,n?S:P);break;default:Mv(L,M,M,M,[""],P,0,a,P)}}l=u=h=0,m=y=1,E=L="",f=o;break;case 58:f=1+no(L),h=p;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&pke()==125)continue}switch(L+=j2(b),b*m){case 38:y=u>0?1:(L+="\f",-1);break;case 44:a[l++]=(no(L)-1)*y,y=1;break;case 64:Eo()===45&&(L+=$v(ki())),d=Eo(),u=f=no(E=L+=gke(Rv())),b++;break;case 45:p===45&&no(L)==2&&(m=0)}}return s}function qI(t,e,r,n,i,s,o,a,c,l,u){for(var f=i-1,d=i===0?s:[""],h=U9(d),p=0,m=0,v=0;p0?d[y]+" "+b:ht(b,/&\f/g,d[y])))&&(c[v++]=E);return F2(t,e,r,i===0?B9:a,c,l,u)}function xke(t,e,r){return F2(t,e,r,PW,j2(hke()),W1(t,2,-2),0)}function WI(t,e,r,n){return F2(t,e,r,F9,W1(t,0,n),W1(t,n+1,-1),n)}function rd(t,e){for(var r="",n=U9(t),i=0;i6)switch(on(t,e+1)){case 109:if(on(t,e+4)!==45)break;case 102:return ht(t,/(.+:)(.+)-([^]+)/,"$1"+dt+"$2-$3$1"+Ng+(on(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~p8(t,"stretch")?MW(ht(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(on(t,e+1)!==115)break;case 6444:switch(on(t,no(t)-3-(~p8(t,"!important")&&10))){case 107:return ht(t,":",":"+dt)+t;case 101:return ht(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+dt+(on(t,14)===45?"inline-":"")+"box$3$1"+dt+"$2$3$1"+vn+"$2box$3")+t}break;case 5936:switch(on(t,e+11)){case 114:return dt+t+vn+ht(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return dt+t+vn+ht(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return dt+t+vn+ht(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return dt+t+vn+t+t}return t}var Tke=function(e,r,n,i){if(e.length>-1&&!e.return)switch(e.type){case F9:e.return=MW(e.value,e.length);break;case IW:return rd([Hh(e,{value:ht(e.value,"@","@"+dt)})],i);case B9:if(e.length)return dke(e.props,function(s){switch(fke(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return rd([Hh(e,{props:[ht(s,/:(read-\w+)/,":"+Ng+"$1")]})],i);case"::placeholder":return rd([Hh(e,{props:[ht(s,/:(plac\w+)/,":"+dt+"input-$1")]}),Hh(e,{props:[ht(s,/:(plac\w+)/,":"+Ng+"$1")]}),Hh(e,{props:[ht(s,/:(plac\w+)/,vn+"input-$1")]})],i)}return""})}},Oke=[Tke],Rke=function(e){var r=e.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var v=m.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=e.stylisPlugins||Oke,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var v=m.getAttribute("data-emotion").split(" "),y=1;ye in t?Wke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gke=(t,e)=>{for(var r in e||(e={}))Hke.call(e,r)&&XI(t,r,e[r]);if(JI)for(var r of JI(e))Vke.call(e,r)&&XI(t,r,e[r]);return t},Kke=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),q9=Kke((t,e)=>{e.exports={name:"@paperxyz/react-client-sdk",version:"1.1.5",description:"Paper React Client SDK for Checkout Elements",license:"Apache-2.0",main:"dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist/**"],exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts"}},bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",keywords:[],scripts:{build:"tsup-node src/index.ts --env.NODE_ENV production --env.ESM_ONLY true ","build-package-checkout":"yarn build","dev-checkout":"tsup-node src/index.ts --env.NODE_ENV development --watch --env.ESM_ONLY true",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/react-client-sdk"},peerDependencies:{react:">=16.0.0","react-dom":">=16.0.0"},devDependencies:{"@paperxyz/tsconfig":"*","@types/react":"18.0.26","eslint-config-paperxyz":"*",react:"^18.2.0","react-dom":"^18.2.0",typescript:"^4.7.4"},dependencies:{"@emotion/css":"11.10.5","@headlessui/react":"1.7.6","@paperxyz/js-client-sdk":"*","@paperxyz/sdk-common-utilities":"*"}}}),Qke=x.createContext({chainName:"Polygon",setChainName:()=>{},clientId:"",appName:""}),Yke=()=>x.useContext(Qke);Ws` +`,Mh="paper-js-sdk-modal",mSe=class{constructor(t,e){this.styles=hSe(),this.container=t||document.body,e&&this.mergeStyles(e),this.main=document.createElement("div"),this.main.id=Mh,this.overlay=document.createElement("div"),this.overlay.id=`${Mh}-overlay`,this.body=document.createElement("div"),this.body.id=`${Mh}-body`,this.spinner=document.createElement("div"),this.spinner.id=`${Mh}-spinner`,this.iframe=document.createElement("iframe"),this.iframe.id=`${Mh}-iframe`,this.iframe.allow="camera; microphone; payment",this.style=document.createElement("style"),this.style.innerHTML=pSe,this.assignStyles(this.main,this.styles.main),this.assignStyles(this.overlay,this.styles.overlay),this.assignStyles(this.body,this.styles.body),this.assignStyles(this.spinner,this.styles.spinner),this.assignStyles(this.iframe,this.styles.iframe)}open({iframeUrl:t}={}){t&&(this.body.appendChild(this.spinner),this.iframe.src=t,this.iframe.onload=()=>this.body.removeChild(this.spinner),this.body.appendChild(this.iframe)),this.addAccessibility(),this.main.appendChild(this.overlay),this.main.appendChild(this.style),this.main.appendChild(this.body),this.container.appendChild(this.main),document.body.style.overflow="hidden"}close(){this.body.style.animation="pew-modal-slideOut 0.2s forwards",window.setTimeout(()=>this.main.remove(),250)}mergeStyles(t){this.styles.body=Gn(Gn({},this.styles.body),t.body||{}),this.styles.spinner=Gn(Gn({},this.styles.spinner),t.spinner||{}),this.styles.overlay=Gn(Gn({},this.styles.overlay),t.overlay||{}),this.styles.main=Gn(Gn({},this.styles.main),t.main||{}),this.styles.iframe=Gn(Gn({},this.styles.iframe),t.iframe||{})}addAccessibility(){this.main.setAttribute("aria-hidden","true"),this.overlay.setAttribute("aria-hidden","true"),this.body.setAttribute("aria-modal","true"),this.body.setAttribute("role","dialog")}assignStyles(t,e){Object.assign(t.style,e)}};function vSe({sdkClientSecret:t,appName:e,options:r=Gn({},rW),locale:n,configs:i}){let s=new URL(oSe,iW),o=t;if(!o&&i&&(o=btoa(JSON.stringify(i))),!o){let c="/error?errorMessage=Must have either sdkClientSecret or configs field set. Received neither",l=tW();return new URL(c,l)}let a=new lSe(s);return a.addClientSecret(o??""),a.addStylingOptions(r),a.addLocale(n),a.addAppName(e),a.getLink()}function ySe({iframe:t,onError:e,onReview:r,onPaymentSuccess:n,onBeforeModalOpen:i,onPriceUpdate:s}){let o;return a=>{if(!a.origin.startsWith(iW))return;let{data:c}=a;switch(c.eventType){case"checkoutWithCardError":e&&e({code:c.code,error:c.error});break;case"paymentSuccess":n&&n({transactionId:c.id,id:c.id}),c.postToIframe&&CI(t,c.eventType,c);break;case"reviewComplete":r&&r({id:c.id,cardholderName:c.cardholderName});break;case"openModalWithUrl":i&&c.url&&c.url.includes("promptKYCModal")?i({url:c.url}):(o=new mSe(void 0,{body:{colorScheme:"light"}}),o.open({iframeUrl:c.url}));break;case"completedSDKModal":o.close(),c.postToIframe&&CI(t,c.eventType,c);break;case"requestedPopup":{uSe({url:c.url,width:c.width,height:c.height})||console.error("CheckoutWithCard: Unable to open popup.");break}case"sizing":t.style.height=c.height+"px",t.style.maxHeight=c.height+"px";break;case"onPriceUpdate":{s==null||s(c);break}}}}function gSe({onCloseKycModal:t,onOpenKycModal:e,sdkClientSecret:r,appName:n,elementOrId:i,onLoad:s,onError:o,locale:a,options:c,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:h=!0,configs:p}){let m="checkout-with-card-iframe",v=b=>ySe({iframe:b,onCloseKycModal:t,onOpenKycModal:e,onError:o,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:h}),y=vSe({sdkClientSecret:r,appName:n,locale:a,options:c,useAltDomain:h,configs:p});return new dSe({onLoad:s,elementOrId:i}).createPaymentElement({handler:v,iframeId:m,link:y})}nW();function bSe(t){if(t.sheet)return t.sheet;for(var e=0;e0?sn(nh,--ui):0,Cd--,Nr===10&&(Cd=1,_2--),Nr}function Ci(){return Nr=ui2||M1(Nr)>3?"":" "}function RSe(t,e){for(;--e&&Ci()&&!(Nr<48||Nr>102||Nr>57&&Nr<65||Nr>70&&Nr<97););return Ap(t,xv()+(e<6&&xo()==32&&Ci()==32))}function t8(t){for(;Ci();)switch(Nr){case t:return ui;case 34:case 39:t!==34&&t!==39&&t8(Nr);break;case 40:t===41&&t8(t);break;case 92:Ci();break}return ui}function $Se(t,e){for(;Ci()&&t+Nr!==57;)if(t+Nr===84&&xo()===47)break;return"/*"+Ap(e,ui-1)+"*"+A2(t===47?t:Ci())}function MSe(t){for(;!M1(xo());)Ci();return Ap(t,ui)}function NSe(t){return uW(Ev("",null,null,null,[""],t=lW(t),0,[0],t))}function Ev(t,e,r,n,i,s,o,a,c){for(var l=0,u=0,f=o,d=0,h=0,p=0,m=1,v=1,y=1,b=0,E="",S=i,P=s,M=n,L=E;v;)switch(p=b,b=Ci()){case 40:if(p!=108&&sn(L,f-1)==58){e8(L+=ht(wv(b),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:L+=wv(b);break;case 9:case 10:case 13:case 32:L+=OSe(p);break;case 92:L+=RSe(xv()-1,7);continue;case 47:switch(xo()){case 42:case 47:Om(DSe($Se(Ci(),xv()),e,r),c);break;default:L+="/"}break;case 123*m:a[l++]=to(L)*y;case 125*m:case 59:case 0:switch(b){case 0:case 125:v=0;case 59+u:y==-1&&(L=ht(L,/\f/g,"")),h>0&&to(L)-f&&Om(h>32?AI(L+";",n,r,f-1):AI(ht(L," ","")+";",n,r,f-2),c);break;case 59:L+=";";default:if(Om(M=kI(L,e,r,l,u,i,a,E,S=[],P=[],f),s),b===123)if(u===0)Ev(L,e,M,M,S,s,f,a,P);else switch(d===99&&sn(L,3)===110?100:d){case 100:case 108:case 109:case 115:Ev(t,M,M,n&&Om(kI(t,M,M,0,0,i,a,E,i,S=[],f),P),i,P,f,a,n?S:P);break;default:Ev(L,M,M,M,[""],P,0,a,P)}}l=u=h=0,m=y=1,E=L="",f=o;break;case 58:f=1+to(L),h=p;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&TSe()==125)continue}switch(L+=A2(b),b*m){case 38:y=u>0?1:(L+="\f",-1);break;case 44:a[l++]=(to(L)-1)*y,y=1;break;case 64:xo()===45&&(L+=wv(Ci())),d=xo(),u=f=to(E=L+=MSe(xv())),b++;break;case 45:p===45&&to(L)==2&&(m=0)}}return s}function kI(t,e,r,n,i,s,o,a,c,l,u){for(var f=i-1,d=i===0?s:[""],h=k9(d),p=0,m=0,v=0;p0?d[y]+" "+b:ht(b,/&\f/g,d[y])))&&(c[v++]=E);return P2(t,e,r,i===0?C9:a,c,l,u)}function DSe(t,e,r){return P2(t,e,r,sW,A2(ISe()),$1(t,2,-2),0)}function AI(t,e,r,n){return P2(t,e,r,S9,$1(t,0,n),$1(t,n+1,-1),n)}function Kf(t,e){for(var r="",n=k9(t),i=0;i6)switch(sn(t,e+1)){case 109:if(sn(t,e+4)!==45)break;case 102:return ht(t,/(.+:)(.+)-([^]+)/,"$1"+dt+"$2-$3$1"+Cg+(sn(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~e8(t,"stretch")?fW(ht(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(sn(t,e+1)!==115)break;case 6444:switch(sn(t,to(t)-3-(~e8(t,"!important")&&10))){case 107:return ht(t,":",":"+dt)+t;case 101:return ht(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+dt+(sn(t,14)===45?"inline-":"")+"box$3$1"+dt+"$2$3$1"+vn+"$2box$3")+t}break;case 5936:switch(sn(t,e+11)){case 114:return dt+t+vn+ht(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return dt+t+vn+ht(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return dt+t+vn+ht(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return dt+t+vn+t+t}return t}var VSe=function(e,r,n,i){if(e.length>-1&&!e.return)switch(e.type){case S9:e.return=fW(e.value,e.length);break;case oW:return Kf([Nh(e,{value:ht(e.value,"@","@"+dt)})],i);case C9:if(e.length)return PSe(e.props,function(s){switch(_Se(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Kf([Nh(e,{props:[ht(s,/:(read-\w+)/,":"+Cg+"$1")]})],i);case"::placeholder":return Kf([Nh(e,{props:[ht(s,/:(plac\w+)/,":"+dt+"input-$1")]}),Nh(e,{props:[ht(s,/:(plac\w+)/,":"+Cg+"$1")]}),Nh(e,{props:[ht(s,/:(plac\w+)/,vn+"input-$1")]})],i)}return""})}},GSe=[VSe],KSe=function(e){var r=e.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var v=m.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=e.stylisPlugins||GSe,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var v=m.getAttribute("data-emotion").split(" "),y=1;ye in t?oke(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lke=(t,e)=>{for(var r in e||(e={}))ake.call(e,r)&&MI(t,r,e[r]);if($I)for(var r of $I(e))cke.call(e,r)&&MI(t,r,e[r]);return t},uke=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),_9=uke((t,e)=>{e.exports={name:"@paperxyz/react-client-sdk",version:"1.1.5",description:"Paper React Client SDK for Checkout Elements",license:"Apache-2.0",main:"dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist/**"],exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts"}},bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",keywords:[],scripts:{build:"tsup-node src/index.ts --env.NODE_ENV production --env.ESM_ONLY true ","build-package-checkout":"yarn build","dev-checkout":"tsup-node src/index.ts --env.NODE_ENV development --watch --env.ESM_ONLY true",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/react-client-sdk"},peerDependencies:{react:">=16.0.0","react-dom":">=16.0.0"},devDependencies:{"@paperxyz/tsconfig":"*","@types/react":"18.0.26","eslint-config-paperxyz":"*",react:"^18.2.0","react-dom":"^18.2.0",typescript:"^4.7.4"},dependencies:{"@emotion/css":"11.10.5","@headlessui/react":"1.7.6","@paperxyz/js-client-sdk":"*","@paperxyz/sdk-common-utilities":"*"}}}),fke=w.createContext({chainName:"Polygon",setChainName:()=>{},clientId:"",appName:""}),dke=()=>w.useContext(fke);zs` opacity: 0; -`;Ws` +`;zs` opacity: 1; -`;var Jke=Ws` +`;var hke=zs` position: relative; width: 100%; height: 100%; -`;Ws` +`;zs` display: grid; position: relative; width: 100%; -`;Ws` +`;zs` transition-delay: 150ms; transition-property: opacity; transition-duration: 75ms; -`;Ws` +`;zs` transition-property: opacity; transition-duration: 150ms; -`;Ws` +`;zs` background-color: transparent; grid-column-start: 1; grid-row-start: 1; -`;var Xke=({className:t})=>pe.jsx("div",{id:"loader",className:zke(eAe,t)}),Zke=qke` +`;var pke=({className:t})=>pe.jsx("div",{id:"loader",className:ike(vke,t)}),mke=ske` from { transform: rotate(0deg); } to { transform: rotate(360deg); } -`,eAe=Ws` +`,vke=zs` border: 0.15rem solid #f3f3f300; border-top: 0.15rem solid #000000; border-left: 0.15rem solid #000000; border-radius: 50%; width: 4rem; height: 4rem; - animation: ${Zke} 1s linear infinite; -`,tAe=()=>pe.jsx("div",{className:rAe,children:pe.jsx(Xke,{className:nAe})}),rAe=Ws` + animation: ${mke} 1s linear infinite; +`,yke=()=>pe.jsx("div",{className:gke,children:pe.jsx(pke,{className:bke})}),gke=zs` position: absolute; top: 50%; left: 50%; transform: translate3d(-50%, -50%, 0); -`,nAe=Ws` +`,bke=zs` color: #000000; width: 2rem; height: 2rem; -`,iAe=q9(),sAe=({sdkClientSecret:t,appName:e,options:r=Gke({},kW),onPaymentSuccess:n,onReview:i,onError:s,onBeforeModalOpen:o,onPriceUpdate:a,locale:c,configs:l})=>{let{appName:u}=Yke(),[f,d]=x.useState(!0),h=x.useCallback(()=>{d(!1)},[]),p=x.useRef(null),m=e||u;return x.useEffect(()=>{let v=setTimeout(()=>{d(!1)},1e3);return()=>{clearTimeout(v)}},[]),x.useEffect(()=>{p.current&&rke({sdkClientSecret:t,appName:m,elementOrId:p.current,locale:c,onError:s,onLoad:h,onPaymentSuccess:n,onReview:i,onBeforeModalOpen:o,onPriceUpdate:a,options:r,configs:l})},[p.current]),pe.jsx(pe.Fragment,{children:pe.jsx("div",{className:Jke,ref:p,"data-paper-sdk-version":`@paperxyz/react-client-sdk@${iAe.version}`,children:f&&pe.jsx(tAe,{})})})};Ws` +`,xke=_9(),wke=({sdkClientSecret:t,appName:e,options:r=lke({},rW),onPaymentSuccess:n,onReview:i,onError:s,onBeforeModalOpen:o,onPriceUpdate:a,locale:c,configs:l})=>{let{appName:u}=dke(),[f,d]=w.useState(!0),h=w.useCallback(()=>{d(!1)},[]),p=w.useRef(null),m=e||u;return w.useEffect(()=>{let v=setTimeout(()=>{d(!1)},1e3);return()=>{clearTimeout(v)}},[]),w.useEffect(()=>{p.current&&gSe({sdkClientSecret:t,appName:m,elementOrId:p.current,locale:c,onError:s,onLoad:h,onPaymentSuccess:n,onReview:i,onBeforeModalOpen:o,onPriceUpdate:a,options:r,configs:l})},[p.current]),pe.jsx(pe.Fragment,{children:pe.jsx("div",{className:hke,ref:p,"data-paper-sdk-version":`@paperxyz/react-client-sdk@${xke.version}`,children:f&&pe.jsx(yke,{})})})};zs` padding-top: 0.625rem; padding-bottom: 0.625rem; padding-left: 1.25rem; @@ -383,10 +383,10 @@ Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.val border-radius: 0.5rem; border: none; cursor: pointer; -`;q9();q9();var oAe=(t=>(t.THIRDWEB_NFT_DROP_V2="THIRDWEB_NFT_DROP_V2",t.THIRDWEB_EDITION_DROP_V2="THIRDWEB_EDITION_DROP_V2",t.THIRDWEB_SIGNATURE="THIRDWEB_SIGNATURE",t.CANDY_MACHINE="CANDY_MACHINE",t.AUCTION_HOUSE="AUCTION_HOUSE",t))(oAe||{}),aAe=(t=>(t.POPUP="POPUP",t.NEW_TAB="NEW_TAB",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t))(aAe||{});const[cAe,lAe]=dh(),jp=()=>{const{triggerCheckout:t,closeCheckout:e,settings:r}=cAe();return{triggerCheckout:t,closeCheckout:e,settings:r}};function Su(){return Su=Object.assign?Object.assign.bind():function(t){for(var e=1;et.toLowerCase()===e.toLowerCase();var tc=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(tc||{});const v8=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=tc.VERY_LARGE:e<1e-10?r=tc.VERY_TINY:e<1?r=tc.FRACTION:r=tc.MIXED;let n,i;switch(r){case tc.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case tc.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case tc.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",Su({notation:n},i)).format(e)},uAe=t=>t.charAt(0).toUpperCase()+t.slice(1),fAe=t=>t.chainId===1?"Ethereum":uAe(t.name),dAe=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=Zr(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:Dt,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:_s.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},hAe=async({accountAddress:t,chainId:e,verifiedOnly:r})=>{try{const{indexerClient:n}=Zr(e),i=await n.getTokenBalances({accountAddress:t,includeMetadata:!0,metadataOptions:{verifiedOnly:r??!0}});return(i==null?void 0:i.balances)||[]}catch(n){return console.error(n),[]}},pAe=async({accountAddress:t,chainId:e})=>{try{return(await Promise.all([dAe({accountAddress:t,chainId:e}),hAe({accountAddress:t,chainId:e})])).flat()}catch(r){return console.error(r),[]}},mAe=async({chainId:t,tokenId:e,contractAddress:r})=>{const{metadataClient:n}=Zr(t);return(await n.getTokenMetadata({chainID:String(t),contractAddress:r,tokenIDs:[e]})).tokenMetadata[0]},vAe=async({chainID:t,contractAddress:e})=>{const{metadataClient:r}=Zr(t);return(await r.getContractInfo({chainID:t,contractAddress:e})).contractInfo},yAe=async({chainId:t,email:e,contractAddress:r,abi:n,receiptTitle:i,collectionContractAddress:s,methodArguments:o,currency:a,currencyAmount:c,methodName:l,recipientAddress:u})=>{const{network:f,apiClient:d}=await Zr(t),h=fAe(f),p=JSON.stringify(Su({title:i,email:e,limitPerTransaction:1,quantity:1,mintMethod:{args:o,payment:{currency:a,value:`${c} * $QUANTITY`},name:l},walletAddress:u},s?{contractArgs:{collectionContractAddress:s}}:{})),{secret:m}=await d.paperSessionSecret2({chainName:h,contractAddress:r,abi:n,paramsJson:p});return m},W9={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},gAe=t=>Wn({queryKey:["balances",t],queryFn:()=>pAe(t),retry:!0,staleTime:10*W9.oneMinute,enabled:!!t.chainId&&!!t.accountAddress}),bAe=t=>Wn({queryKey:["useTokenMetadata",t],queryFn:()=>mAe(t),retry:!0,staleTime:10*W9.oneMinute,enabled:!!t.chainId&&!!t.contractAddress}),LW=t=>Wn({queryKey:["useContractInfo",t],queryFn:()=>vAe(t),retry:!0,staleTime:60*W9.oneMinute,enabled:!!t.chainID&&!!t.contractAddress}),[xAe,wAe]=dh(),EAe=({settings:t})=>{var e,r;const[n,i]=x.useState(!0),[s,o]=x.useState(((e=t.creditCardCheckout)==null?void 0:e.email)||""),[a,c]=x.useState(s),[l,u]=x.useState(null),[f,d]=x.useState(!1),{setNavigation:h}=ph(),p=()=>{n&&o(a||""),n||c(s),i(!n)},m=async()=>{d(!0);try{if(!s)throw"No email address found";if(!t.creditCardCheckout)throw"No credit card checkout settings found";const P=await yAe(Su({email:s},t.creditCardCheckout));u(P)}catch(P){console.error("Failed to fetch paper secret",P),h({location:"transaction-error",params:{error:P}})}d(!1)};x.useEffect(()=>{const P=setInterval(()=>{const M=document.getElementById("paper-js-sdk-modal");M&&(M.style.pointerEvents="visible")},100);return()=>{clearInterval(P)}},[]),x.useEffect(()=>{s!==""&&m()},[s]);const v=()=>/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/.test(a||""),y=P=>{c(P.target.value)},b=P=>{h({location:"transaction-pending",params:{transactionId:P}})},E=P=>{h({location:"transaction-error",params:{error:P}})},S=()=>n?g.createElement(q,{as:"form",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",onSubmit:p},g.createElement(q,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},g.createElement(ae,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),g.createElement(ul,{autoFocus:!0,name:"email",type:"email",placeholder:"Email Address",value:a,onChange:y,"data-1p-ignore":!0})),g.createElement(rt,{size:"xs",label:"Save",leftIcon:Kd,disabled:!v(),type:"submit"})):g.createElement(q,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},g.createElement(q,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},g.createElement(ae,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),g.createElement(ae,{fontSize:"normal",fontWeight:"bold",color:"text100"},s)),g.createElement(rt,{size:"xs",label:"Edit",leftIcon:iue,onClick:p}));return g.createElement(q,null,S(),f&&g.createElement(q,{width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",style:{height:"200px"}},g.createElement(Vc,{size:"lg",style:{width:"60px",height:"60px"}})),l&&!f&&g.createElement(kn,{marginY:"4",flexDirection:"column"},g.createElement(sAe,{sdkClientSecret:l,appName:t==null||(r=t.creditCardCheckout)==null?void 0:r.receiptTitle,onReview:()=>{},onPaymentSuccess:P=>{b(P.id)},onError:P=>{console.error("Payment error:",P),E(P.error)},options:{colorPrimary:"#447dd1",colorText:"#ffffff",borderRadius:12}})))},H9="54px",CAe=()=>{const{settings:t}=jp();return g.createElement(q,{paddingX:"4",paddingBottom:"8",gap:"4",flexDirection:"column",style:{marginTop:H9}},t&&g.createElement(EAe,{settings:t}))},SAe=10*1e3,kAe=()=>{const t=ph(),{params:{transactionId:e}}=t.navigation,{setNavigation:r}=t,n=`https://withpaper.com/api/v1/transaction-status/${e}`,i=async()=>{try{console.log("Polling for transaction status");const s=await fetch(n,{method:"GET",headers:{accept:"application/json"}}).then(c=>c.json()),o=s.result.status,a=s.result.transactionHash;if(console.log("transaction status poll response:",o),o==="PENDING")return;if(o==="TRANSFER_SUCCEEDED"){r&&r({location:"transaction-success",params:{transactionHash:a}});return}if(o==="TRANSFER_FAILED"||o==="PAYMENT_FAILED"){r&&r({location:"transaction-error",params:{error:new Error("Failed to transfer collectible")}});return}}catch(s){console.error("An error occurred while fetching the transaction status"),r&&r({location:"transaction-error",params:{error:s}})}};return x.useEffect(()=>{const s=setInterval(()=>{i()},SAe);return()=>{clearInterval(s)}},[]),g.createElement(q,{style:{height:"500px"}},g.createElement(q,{position:"absolute",top:"0",left:"0",width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},g.createElement(Vc,{size:"lg",style:{width:"60px",height:"60px"}}),g.createElement(ae,{variant:"medium",color:"text50",textAlign:"center",marginTop:"8"},"Transaction in progress. ",g.createElement("br",null),"This may take a few minutes.")))},AAe=()=>{const{closeCheckout:t,settings:e}=jp(),n=ph().navigation;return x.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onSuccess&&(e==null||(s=e.creditCardCheckout)==null||s.onSuccess(n.params.transactionHash))},3e3)},[]),g.createElement(q,{style:{height:"500px"}},g.createElement(q,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},g.createElement(_Ae,null),g.createElement(ae,{fontSize:"xlarge"},"Success!"),g.createElement(ae,{textAlign:"center",variant:"normal",color:"text80"},"The transaction was successful.")))},_Ae=()=>g.createElement(q,{color:"white",background:"positive",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2"},g.createElement(Kd,{size:"xl"})),PAe=()=>{const{closeCheckout:t,settings:e}=jp(),n=ph().navigation;return x.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onError&&(e==null||(s=e.creditCardCheckout)==null||s.onError(n.params.error))},3e3)},[]),g.createElement(q,{style:{height:"500px"}},g.createElement(q,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},g.createElement(IAe,null),g.createElement(ae,{fontSize:"xlarge"},"Error"),g.createElement(ae,{textAlign:"center",variant:"normal",color:"text80"},"An error occurred while processing the transaction.")))},IAe=()=>g.createElement(q,{color:"white",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2",background:"negative"},g.createElement(Tu,{size:"xl"})),TAe=({size:t=30})=>g.createElement(q,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",style:{width:`${t}px`,height:`${t}px`}},g.createElement(ae,{style:{fontSize:`${t-4}px`},display:"inline-block",variant:"large",color:"textInverse100"},"?")),O0=({imageUrl:t,size:e=30})=>t?g.createElement(xr,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):g.createElement(TAe,{size:e});Nu("packages/checkout/src/shared/components/Skeleton/styles.css.ts","kit");const OAe=Az({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),RAe=qn({height:"76px",backgroundColor:"#909090",animation:`${OAe} 2s ease-in-out infinite`},"skeleton");Du();const Nf=({width:t="100%",height:e="100%",borderRadius:r="md"})=>g.createElement(q,{className:RAe,borderRadius:r,style:{width:t,height:e}}),$Ae=({contractAddress:t,tokenId:e,quantityRaw:r,chainId:n})=>{const{chains:i}=Tt(),{data:s,isLoading:o}=bAe({chainId:n,contractAddress:t,tokenId:e}),{data:a,isLoading:c}=LW({chainID:String(n),contractAddress:t});if(o||c)return g.createElement(MAe,null);const u=Ir(n,[...i]),{name:f="unknown",image:d,decimals:h=0}=s||{},{logoURI:p,name:m="Unknown Collection"}=a||{},v=Nt(r,h);return g.createElement(kn,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},g.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},g.createElement(q,{aspectRatio:"1/1",height:"full",justifyContent:"center",alignItems:"center",style:{width:"80px"}},g.createElement(xr,{src:d,borderRadius:"md",style:{height:"80px"}})),g.createElement(q,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},g.createElement(q,{gap:"1",alignItems:"center"},g.createElement(O0,{size:12,imageUrl:p}),g.createElement(ae,{marginLeft:"1",fontSize:"small",color:"text80",fontWeight:"bold"},m),g.createElement(O0,{size:12,imageUrl:u.logoURI})),g.createElement(q,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",style:{width:"180px"}},g.createElement(ae,{color:"text100",fontSize:"normal",fontWeight:"normal"},f),g.createElement(ae,{color:"text50",fontSize:"normal",fontWeight:"normal"},`#${e}`)))),g.createElement(q,{height:"full",fontSize:"small",color:"text50",fontWeight:"bold"},`x${v8(v)}`))},MAe=()=>g.createElement(kn,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},g.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},g.createElement(Nf,{height:"80px",width:"80px"}),g.createElement(q,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},g.createElement(Nf,{width:"100px",height:"14px"}),g.createElement(Nf,{width:"180px",height:"34px"}))),g.createElement(Nf,{height:"14px",width:"14px"}));Nu("packages/checkout/src/views/CheckoutSelection/styles.css.ts","kit");const jW=qn({},"insufficientBalanceButton");hs(`${jW} > div`,{justifyContent:"center"});Du();const NAe=()=>{var t,e,r,n;const{chains:i}=Tt();ph();const{closeCheckout:s,settings:o}=jp(),{address:a}=Hn(),c=o==null?void 0:o.cryptoCheckout,l=!!c,{data:u,isLoading:f}=LW({contractAddress:(c==null||(t=c.coinQuantity)==null?void 0:t.contractAddress)||"",chainID:String((c==null?void 0:c.chainId)||1)}),{data:d,isLoading:h}=gAe({accountAddress:a||"",chainId:(c==null?void 0:c.chainId)||1}),p=(f||h)&&c,m=ZI((c==null||(e=c.coinQuantity)==null?void 0:e.contractAddress)||"",Dt),v=Ir((c==null?void 0:c.chainId)||1,i),y=m?v.decimals:(u==null?void 0:u.decimals)||0,b=m?v.symbol:(u==null?void 0:u.symbol)||"COIN",E=m?v.logoURI:(u==null?void 0:u.logoURI)||"",S=d==null?void 0:d.find(F=>{var w;return ZI(F.contractAddress,(c==null||(w=c.coinQuantity)==null?void 0:w.contractAddress)||"")}),P=S?S.balance:"0",M=(c==null||(r=c.coinQuantity)==null?void 0:r.amountRequiredRaw)||"0",L=Nt(P,y),j=Nt(M,y),H=te.from(P).lt(te.from(M)),K=(o==null?void 0:o.orderSummaryItems)||[],Q=(o==null||(n=o.cryptoCheckout)==null?void 0:n.chainId)||1,Y=()=>{var F;console.log("trigger transaction");const w=o==null||(F=o.cryptoCheckout)==null?void 0:F.triggerTransaction;w&&w(),s()};return g.createElement(q,{paddingX:"5",paddingBottom:"5",style:{marginTop:H9},flexDirection:"column",gap:"3"},K.length>0&&g.createElement(g.Fragment,null,g.createElement(ae,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Order summary"),g.createElement(q,{flexDirection:"column",gap:"2"},K.map((F,w)=>g.createElement($Ae,Su({key:w},F,{chainId:Q})))),g.createElement(q,{marginTop:"2"},g.createElement(m1,{color:"backgroundSecondary",style:{margin:"0px"}}))),l&&g.createElement(q,{justifyContent:"space-between",alignItems:"center"},g.createElement(ae,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Total"),p?g.createElement(Nf,{width:"100px",height:"17px"}):g.createElement(q,{flexDirection:"row",gap:"1",alignItems:"center"},g.createElement(O0,{imageUrl:E,size:12}),g.createElement(ae,{fontWeight:"normal",fontSize:"normal",color:"text100"},`${v8(j)} ${b}`))),g.createElement(q,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2"},l&&!H&&!p&&g.createElement(rt,{style:{borderRadius:Te.radii.md,height:"56px"},width:"full",leftIcon:()=>g.createElement(O0,{size:20,imageUrl:E}),variant:"primary",label:`Pay with ${b}`,rightIcon:bo,onClick:Y}),l&&(H||p)&&g.createElement(rt,{className:jW,style:{borderRadius:Te.radii.md,height:"56px",justifyContent:"center"},width:"full",leftIcon:()=>g.createElement(O0,{size:20,imageUrl:E}),variant:"glass",label:`Insufficient ${b}`,onClick:Y,disabled:!0})),l&&g.createElement(q,{width:"full",justifyContent:"flex-end"},p?g.createElement(Nf,{width:"102px",height:"14px"}):g.createElement(ae,{fontWeight:"bold",fontSize:"small",color:"text50"},"Balance: ",`${v8(L)} ${b}`)))},t5=({secondaryText:t,primaryText:e,disableBack:r=!1})=>{const{goBack:n,history:i}=ph(),s=()=>{n()};return g.createElement(q,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:H9,paddingTop:"6px",backgroundColor:Te.colors.backgroundPrimary}},i.length>0&&!r?g.createElement(Po,{onClick:s,icon:Bb,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):g.createElement(q,null),g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",variant:"small",color:"text50"},t),g.createElement(ae,{fontWeight:"medium",variant:"small",color:"text100"},e)),g.createElement(q,{style:{width:"44px"}}))};Nu("packages/checkout/src/shared/styles.css.ts","kit");const V9=qn({},"walletContent");hs(`${V9} + button`,{backgroundColor:"transparent"});hs(`${V9} + button > svg`,{width:"20px",height:"20px"});Du();const BW={location:"select-method-checkout"},DAe=t=>{const e=new i9;return g.createElement(b9,{client:e},g.createElement(LAe,t))},LAe=({children:t})=>{const{theme:e,position:r}=Dp(),[n,i]=x.useState(!1),[s,o]=x.useState(),[a,c]=x.useState([]),l=a.length>0?a[a.length-1]:BW,u=p=>{o(p),i(!0)},f=()=>{i(!1)},d=()=>{const{location:p}=l;switch(p){case"select-method-checkout":return g.createElement(NAe,null);case"transaction-pending":return g.createElement(kAe,null);case"transaction-success":return g.createElement(AAe,null);case"transaction-error":return g.createElement(PAe,null);case"transaction-form":default:return g.createElement(CAe,null)}},h=()=>{const{location:p}=l;switch(p){case"select-method-checkout":return g.createElement(t5,{primaryText:"Checkout"});case"transaction-success":case"transaction-error":case"transaction-pending":return g.createElement(t5,{disableBack:!0,primaryText:"Pay with credit or debit card"});case"transaction-form":default:return g.createElement(t5,{primaryText:"Pay with credit or debit card"})}};return x.useEffect(()=>{n&&c([])},[n]),g.createElement(lAe,{value:{triggerCheckout:u,closeCheckout:f,settings:s,theme:e}},g.createElement(wAe,{value:{history:a,setHistory:c}},g.createElement("div",{id:"kit-checkout"},g.createElement(Qb,{root:"#kit-checkout",scope:"kit",theme:e},g.createElement(wd,null,n&&g.createElement(eg,{contentProps:{style:Su({maxWidth:"400px",height:"auto"},Mg(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},g.createElement(q,{id:"sequence-kit-checkout-content",className:V9},h(),d()))))),t))},ph=()=>{const{setHistory:t,history:e}=xAe(),r=s=>{const o=document.getElementById("sequence-kit-wallet-content"),a=o==null?void 0:o.parentElement;a==null||a.scrollTo(0,0);const c=[...e,s];t(c)},n=()=>{const s=[...e];s.pop(),t(s)},i=e.length>0?e[e.length-1]:BW;return{setNavigation:r,history:e,setHistory:t,goBack:n,navigation:i}},eT="Two roads diverged in a yellow wood",jAe=[{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"}],BAe=[{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 tT="u3q5o00";const FAe=()=>{const{theme:t}=gp(),e=RF("isMobile"),r=s=>{typeof window<"u"&&window.open(s)},n=()=>pe.jsx(q,{flexDirection:"row",gap:"4",children:jAe.map((s,o)=>pe.jsx(q,{onClick:()=>r(s.url),className:tT,gap:"4",children:pe.jsx(ae,{fontWeight:"normal",fontSize:"small",color:"text50",children:s.label})},o))}),i=()=>pe.jsx(q,{gap:"4",justifyContent:"center",alignItems:"center",children:BAe.map((s,o)=>pe.jsx(q,{className:tT,onClick:()=>{typeof window<"u"&&window.open(s.url)},children:pe.jsx(xr,{height:"3",src:s.icon,alt:s.id,style:{filter:t==="dark"?"invert(0)":"invert(1)"}})},o))});return e?pe.jsxs(q,{flexDirection:"column",padding:"5",gap:"2",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"center",alignItems:"center",children:[pe.jsx(n,{}),pe.jsx(i,{})]}):pe.jsxs(q,{padding:"5",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"space-between",children:[pe.jsx(n,{}),pe.jsx(i,{})]})},UAe=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},zAe=t=>`0x${UAe((t==null?void 0:t.substring(2))||"",8)}`,qAe=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"owner",type:"address"}],name:"ERC721IncorrectOwner",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC721InsufficientApproval",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC721InvalidApprover",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC721InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"ERC721InvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC721InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC721InvalidSender",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC721NonexistentToken",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"_fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"_toTokenId",type:"uint256"}],name:"BatchMetadataUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"MetadataUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"player",type:"address"},{internalType:"string",name:"tokenURI",type:"string"}],name:"awardItem",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}];function WAe(){var $e;const{theme:t,setTheme:e}=gp(),{setTheme:r}=Dp(),{address:n,connector:i,isConnected:s}=Hn(),{setOpenConnectModal:o}=RSe(),{setOpenWalletModal:a}=Mp();jp();const{disconnect:c}=Vz(),{data:l}=$8e(),{switchChain:u}=E9(),d=Hz().find(ge=>ge.connector.id.includes("waas"))!==void 0,h=RF("isMobile"),{data:p,sendTransaction:m,isLoading:v}=w9(),{data:y,isLoading:b,writeContract:E}=M8e(),[S,P]=g.useState(!1),[M,L]=g.useState(),[j,H]=g.useState(),[K,Q]=g.useState(),[Y,F]=g.useState(),[w,k]=g.useState(localStorage.getItem("confirmationEnabled")==="true"),[R,N,A]=MSe(),[O,B]=g.useState();x.useEffect(()=>{R&&B(R.options[0].token.name)},[R]);const I=T2(),C=vu.network.allNetworks.find(ge=>ge.chainId===I),D=R8e({chainId:I}),{debug:z}=mL.parse(location.search),_=z==="true",W=async()=>{if(!(!l||!D))try{const ge=await aSe(l);console.log("proof:",ge);const Ee=await cSe(l,D,ge);console.log("isValid?:",Ee)}catch(ge){console.error(ge)}};x.useEffect(()=>{p&&Q(p.hash??p),y&&F(y.hash??p)},[p,y]);const G=async()=>{if(l){P(!0);try{const ge=eT,Ee=await l.signMessage({account:n||"",message:ge});console.log("address",n),console.log("signature:",Ee),console.log("chainId in homepage",I);const[Ue]=await l.getAddresses(),Ke=await D.verifyMessage({address:Ue,message:ge,signature:Ee});P(!1),L(Ke),H(Ee),console.log("isValid?",Ke)}catch(ge){P(!1),console.error(ge)}}},J=async()=>{if(!l)return;const[ge]=await l.getAddresses();m({to:ge,value:"0",gas:null})},ee=async()=>{if(!l)return;const[ge]=await l.getAddresses();E({address:"0x0d402C63cAe0200F0723B3e6fa0914627a48462E",abi:qAe,functionName:"awardItem",args:[ge,"https://dev-metadata.sequence.app/projects/277/collections/62/tokens/0.json"]})},se=()=>{e(t==="dark"?"light":"dark"),r(t==="dark"?"light":"dark")},ie=()=>s?pe.jsxs(q,{padding:"5",justifyContent:"space-between",children:[pe.jsxs(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[pe.jsx(xr,{style:{width:"36px"},src:"kit-logo.svg"}),pe.jsx(xr,{style:{width:"24px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),pe.jsx(q,{children:pe.jsxs(q,{flexDirection:"column",children:[pe.jsxs(q,{flexDirection:"row",gap:"2",justifyContent:"flex-end",alignItems:"center",children:[pe.jsx(he,{}),pe.jsx(ae,{fontWeight:"medium",fontSize:"normal",color:"text100",children:h?zAe(n||""):n})]}),pe.jsx(q,{alignItems:"center",justifyContent:"flex-end",flexDirection:"row",children:pe.jsx(ae,{fontWeight:"medium",fontSize:"normal",color:"text50",children:i==null?void 0:i.name})})]})})]}):pe.jsx(q,{padding:"5",justifyContent:"flex-end",children:pe.jsx(he,{})}),oe=({title:ge,description:Ee,disabled:Ue,isLoading:Ke,onClick:Ye})=>pe.jsxs(kn,{style:{width:"332px"},clickable:!Ue,onClick:Ue?()=>{}:Ye,opacity:Ue?"50":"100",children:[pe.jsx(ae,{color:"text100",lineHeight:"5",fontSize:"normal",fontWeight:"bold",children:ge}),pe.jsx(q,{marginTop:"1",children:pe.jsx(ae,{fontWeight:"medium",lineHeight:"5",color:"text50",fontSize:"normal",children:Ee})}),Ke&&pe.jsx(Vc,{marginTop:"3",size:"sm",color:"text100"})]}),be=()=>{o(!0)},he=()=>pe.jsx(Po,{onClick:se,icon:t==="dark"?Eue:cue}),ve=()=>{u(I===421614?{chainId:42170}:{chainId:421614}),L(void 0)};return pe.jsxs(q,{background:"backgroundPrimary",children:[_&&pe.jsx(q,{justifyContent:"center",alignItems:"center",children:pe.jsx(ae,{children:"Debug mode"})}),pe.jsx(q,{style:{height:"72px"},position:"fixed",width:"full",top:"0",children:pe.jsx(ie,{})}),pe.jsx(q,{style:h?{paddingTop:"85px",paddingBottom:"80px"}:{height:"100vh"},flexDirection:"column",justifyContent:"center",alignItems:"center",children:s?pe.jsxs(q,{flexDirection:"column",gap:"4",children:[pe.jsxs(q,{flexDirection:"column",gap:"2",children:[pe.jsx(ae,{color:"text50",fontSize:"small",fontWeight:"medium",children:"Demos"}),pe.jsx(oe,{title:"Embedded wallet",description:"Connect a Sequence wallet to view, swap, send, and receive collections",onClick:()=>a(!0)}),pe.jsx(oe,{title:"Send transaction",description:"Send a transaction with your wallet",isLoading:v,onClick:J}),K&&((p==null?void 0:p.chainId)===I||p)&&pe.jsxs(ae,{as:"a",marginLeft:"4",variant:"small",underline:!0,href:`${C.blockExplorer.rootUrl}/tx/${p.hash??p}`,target:"_blank",rel:"noreferrer",children:["View on ",C.blockExplorer.name]}),pe.jsx(oe,{title:"Sign message",description:"Sign a message with your wallet",onClick:G,isLoading:S}),M&&pe.jsxs(kn,{style:{width:"332px"},color:"text100",flexDirection:"column",gap:"2",children:[pe.jsx(ae,{variant:"medium",children:"Signed message:"}),pe.jsx(ae,{children:eT}),pe.jsx(ae,{variant:"medium",children:"Signature:"}),pe.jsx(ae,{variant:"code",as:"p",ellipsis:!0,children:j}),pe.jsxs(ae,{variant:"medium",children:["isValid: ",pe.jsx(ae,{variant:"code",children:M.toString()})]})]}),pe.jsx(oe,{title:"Mint an NFT",description:"Test minting an NFT to your wallet",isLoading:b,onClick:ee}),Y&&((y==null?void 0:y.chainId)===I||y)&&pe.jsxs(ae,{as:"a",marginLeft:"4",variant:"small",underline:!0,href:`${C.blockExplorer.rootUrl}/tx/${y.hash??y}`,target:"_blank",rel:"noreferrer",children:["View on ",C.blockExplorer.name]}),_&&pe.jsx(oe,{title:"Generate EthAuth proof",description:"Generate EthAuth proof",onClick:W}),pe.jsx(oe,{title:"Switch network",description:`Current network: ${C.title}`,onClick:ve})]}),R&&pe.jsxs(q,{marginY:"3",children:[pe.jsx(E1e,{name:"feeOption",labelLocation:"top",label:"Pick a fee option",onValueChange:ge=>{var Ue;const Ee=(Ue=R==null?void 0:R.options)==null?void 0:Ue.find(Ke=>Ke.token.name===ge);Ee&&B(Ee.token.name)},value:O,options:[...($e=R==null?void 0:R.options)==null?void 0:$e.map(ge=>({label:pe.jsxs(q,{alignItems:"center",gap:"2",children:[pe.jsx(ae,{children:ge.token.name}),pe.jsx(ae,{children:Nt(ge.value,ge.token.decimals)})]}),value:ge.token.name}))]}),pe.jsx(q,{marginY:"2",alignItems:"center",justifyContent:"center",children:pe.jsx(rt,{onClick:()=>{var Ee;const ge=(Ee=R==null?void 0:R.options)==null?void 0:Ee.find(Ue=>Ue.token.name===O);ge.token.contractAddress!==void 0&&(console.log("a3",ge.token.contractAddress),N(R==null?void 0:R.id,ge.token.contractAddress))},label:"Confirm fee option"})})]}),d&&pe.jsx(q,{marginY:"3",children:pe.jsxs(q,{as:"label",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[pe.jsx(ae,{fontWeight:"semibold",variant:"small",color:"text50",children:"Confirmations"}),pe.jsx(q,{alignItems:"center",gap:"2",children:pe.jsx(m3,{name:"confirmations",checked:w,onCheckedChange:async ge=>{ge?(localStorage.setItem("confirmationEnabled","true"),k(!0)):(localStorage.removeItem("confirmationEnabled"),k(!1)),await HAe(300),window.location.reload()}})})]})}),pe.jsx(q,{width:"full",gap:"2",flexDirection:"row",justifyContent:"flex-end",children:pe.jsx(rt,{onClick:()=>{c(),Q(void 0),F(void 0),L(void 0)},leftIcon:iB,label:"Sign out"})})]}):pe.jsx(q,{children:pe.jsxs(q,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5",children:[pe.jsxs(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[pe.jsx(xr,{style:{width:"48px"},src:"kit-logo.svg"}),pe.jsx(xr,{style:{width:"32px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),pe.jsx(q,{gap:"2",flexDirection:"row",alignItems:"center",children:pe.jsx(rt,{onClick:be,variant:"feature",label:"Connect"})})]})})}),!h&&pe.jsx(FAe,{})]})}function HAe(t){return new Promise(e=>setTimeout(e,t))}const VAe=y2({id:42170,name:"Arbitrum Nova",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://nova.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://nova.arbiscan.io",apiUrl:"https://api-nova.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1746963}}}),GAe=y2({id:421614,name:"Arbitrum Sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://sepolia.arbiscan.io",apiUrl:"https://sepolia.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:81930}},testnet:!0}),KAe=y2({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}}}),QAe=y2({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}}}),YAe=new i9;function JAe(){const{debug:t}=mL.parse(location.search),e=t==="true",r=[VAe,GAe,KAe,QAe],n="T3czhtWsTONJpbjFgAdLAuEAAAAAAAAA",i=[...w2e({walletConnectProjectId:"c65a6cb1aa83c4e24500130f23a437d8",defaultChainId:42170,appName:"demo app",projectAccessKey:n}),...e?bW(n,[y2e({accounts:["0xCb88b6315507e9d8c35D81AFB7F190aB6c3227C9"]})]):[]],s={};r.forEach(c=>{const l=vu.network.findNetworkConfig(vu.network.allNetworks,c.id);l&&(s[c.id]=Aye(l.rpcUrl))});const o=Bge({transports:s,chains:r,connectors:i}),a={defaultTheme:"dark",signIn:{projectName:"Kit Demo",useMock:e},displayedAssets:[{contractAddress:Dt,chainId:42170},{contractAddress:Dt,chainId:421614},{contractAddress:"0x0d402c63cae0200f0723b3e6fa0914627a48462e",chainId:42170},{contractAddress:"0x0d402c63cae0200f0723b3e6fa0914627a48462e",chainId:421614},{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",chainId:137}]};return pe.jsx(S8e,{config:o,children:pe.jsx(b9,{client:YAe,children:pe.jsx(OSe,{config:a,children:pe.jsx(A7e,{children:pe.jsx(DAe,{children:pe.jsx("div",{id:"app",children:pe.jsx(Qb,{root:"#app",scope:"app",theme:"dark",children:pe.jsx(WAe,{})})})})})})})})}const XAe=r5.createRoot(document.getElementById("root"));XAe.render(pe.jsx(g.StrictMode,{children:pe.jsx(JAe,{})}));export{il as B,I0 as H,Ad as I,V4 as _,Ti as a,uK as b,yi as c,Bn as d,kge as e,ye as f,Er as g,_4 as h,sY as i,wa as j,_ve as k,h2 as l,xa as m,wp as n,Io as o,nn as p,lK as r,ci as s,o_e as t}; +`;_9();_9();var Eke=(t=>(t.THIRDWEB_NFT_DROP_V2="THIRDWEB_NFT_DROP_V2",t.THIRDWEB_EDITION_DROP_V2="THIRDWEB_EDITION_DROP_V2",t.THIRDWEB_SIGNATURE="THIRDWEB_SIGNATURE",t.CANDY_MACHINE="CANDY_MACHINE",t.AUCTION_HOUSE="AUCTION_HOUSE",t))(Eke||{}),Cke=(t=>(t.POPUP="POPUP",t.NEW_TAB="NEW_TAB",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t))(Cke||{});const[Ske,kke]=rh(),_p=()=>{const{triggerCheckout:t,closeCheckout:e,settings:r}=Ske();return{triggerCheckout:t,closeCheckout:e,settings:r}};function yu(){return yu=Object.assign?Object.assign.bind():function(t){for(var e=1;et.toLowerCase()===e.toLowerCase();var Ja=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(Ja||{});const r8=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=Ja.VERY_LARGE:e<1e-10?r=Ja.VERY_TINY:e<1?r=Ja.FRACTION:r=Ja.MIXED;let n,i;switch(r){case Ja.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case Ja.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case Ja.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",yu({notation:n},i)).format(e)},Ake=t=>t.charAt(0).toUpperCase()+t.slice(1),_ke=t=>t.chainId===1?"Ethereum":Ake(t.name),Pke=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=Xr(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:Dt,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:ks.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},Ike=async({accountAddress:t,chainId:e,verifiedOnly:r})=>{try{const{indexerClient:n}=Xr(e),i=await n.getTokenBalances({accountAddress:t,includeMetadata:!0,metadataOptions:{verifiedOnly:r??!0}});return(i==null?void 0:i.balances)||[]}catch(n){return console.error(n),[]}},Tke=async({accountAddress:t,chainId:e})=>{try{return(await Promise.all([Pke({accountAddress:t,chainId:e}),Ike({accountAddress:t,chainId:e})])).flat()}catch(r){return console.error(r),[]}},Oke=async({chainId:t,tokenId:e,contractAddress:r})=>{const{metadataClient:n}=Xr(t);return(await n.getTokenMetadata({chainID:String(t),contractAddress:r,tokenIDs:[e]})).tokenMetadata[0]},Rke=async({chainID:t,contractAddress:e})=>{const{metadataClient:r}=Xr(t);return(await r.getContractInfo({chainID:t,contractAddress:e})).contractInfo},$ke=async({chainId:t,email:e,contractAddress:r,abi:n,receiptTitle:i,collectionContractAddress:s,methodArguments:o,currency:a,currencyAmount:c,methodName:l,recipientAddress:u})=>{const{network:f,apiClient:d}=await Xr(t),h=_ke(f),p=JSON.stringify(yu({title:i,email:e,limitPerTransaction:1,quantity:1,mintMethod:{args:o,payment:{currency:a,value:`${c} * $QUANTITY`},name:l},walletAddress:u},s?{contractArgs:{collectionContractAddress:s}}:{})),{secret:m}=await d.paperSessionSecret2({chainName:h,contractAddress:r,abi:n,paramsJson:p});return m},P9={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},Mke=t=>qn({queryKey:["balances",t],queryFn:()=>Tke(t),retry:!0,staleTime:10*P9.oneMinute,enabled:!!t.chainId&&!!t.accountAddress}),Nke=t=>qn({queryKey:["useTokenMetadata",t],queryFn:()=>Oke(t),retry:!0,staleTime:10*P9.oneMinute,enabled:!!t.chainId&&!!t.contractAddress}),pW=t=>qn({queryKey:["useContractInfo",t],queryFn:()=>Rke(t),retry:!0,staleTime:60*P9.oneMinute,enabled:!!t.chainID&&!!t.contractAddress}),[Dke,Lke]=rh(),jke=({settings:t})=>{var e,r;const[n,i]=w.useState(!0),[s,o]=w.useState(((e=t.creditCardCheckout)==null?void 0:e.email)||""),[a,c]=w.useState(s),[l,u]=w.useState(null),[f,d]=w.useState(!1),{setNavigation:h}=ih(),p=()=>{n&&o(a||""),n||c(s),i(!n)},m=async()=>{d(!0);try{if(!s)throw"No email address found";if(!t.creditCardCheckout)throw"No credit card checkout settings found";const P=await $ke(yu({email:s},t.creditCardCheckout));u(P)}catch(P){console.error("Failed to fetch paper secret",P),h({location:"transaction-error",params:{error:P}})}d(!1)};w.useEffect(()=>{const P=setInterval(()=>{const M=document.getElementById("paper-js-sdk-modal");M&&(M.style.pointerEvents="visible")},100);return()=>{clearInterval(P)}},[]),w.useEffect(()=>{s!==""&&m()},[s]);const v=()=>/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/.test(a||""),y=P=>{c(P.target.value)},b=P=>{h({location:"transaction-pending",params:{transactionId:P}})},E=P=>{h({location:"transaction-error",params:{error:P}})},S=()=>n?g.createElement(q,{as:"form",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",onSubmit:p},g.createElement(q,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},g.createElement(ae,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),g.createElement(sl,{autoFocus:!0,name:"email",type:"email",placeholder:"Email Address",value:a,onChange:y,"data-1p-ignore":!0})),g.createElement(rt,{size:"xs",label:"Save",leftIcon:Bd,disabled:!v(),type:"submit"})):g.createElement(q,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},g.createElement(q,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},g.createElement(ae,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),g.createElement(ae,{fontSize:"normal",fontWeight:"bold",color:"text100"},s)),g.createElement(rt,{size:"xs",label:"Edit",leftIcon:Nle,onClick:p}));return g.createElement(q,null,S(),f&&g.createElement(q,{width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",style:{height:"200px"}},g.createElement(Fc,{size:"lg",style:{width:"60px",height:"60px"}})),l&&!f&&g.createElement(kn,{marginY:"4",flexDirection:"column"},g.createElement(wke,{sdkClientSecret:l,appName:t==null||(r=t.creditCardCheckout)==null?void 0:r.receiptTitle,onReview:()=>{},onPaymentSuccess:P=>{b(P.id)},onError:P=>{console.error("Payment error:",P),E(P.error)},options:{colorPrimary:"#447dd1",colorText:"#ffffff",borderRadius:12}})))},I9="54px",Bke=()=>{const{settings:t}=_p();return g.createElement(q,{paddingX:"4",paddingBottom:"8",gap:"4",flexDirection:"column",style:{marginTop:I9}},t&&g.createElement(jke,{settings:t}))},Fke=10*1e3,Uke=()=>{const t=ih(),{params:{transactionId:e}}=t.navigation,{setNavigation:r}=t,n=`https://withpaper.com/api/v1/transaction-status/${e}`,i=async()=>{try{console.log("Polling for transaction status");const s=await fetch(n,{method:"GET",headers:{accept:"application/json"}}).then(c=>c.json()),o=s.result.status,a=s.result.transactionHash;if(console.log("transaction status poll response:",o),o==="PENDING")return;if(o==="TRANSFER_SUCCEEDED"){r&&r({location:"transaction-success",params:{transactionHash:a}});return}if(o==="TRANSFER_FAILED"||o==="PAYMENT_FAILED"){r&&r({location:"transaction-error",params:{error:new Error("Failed to transfer collectible")}});return}}catch(s){console.error("An error occurred while fetching the transaction status"),r&&r({location:"transaction-error",params:{error:s}})}};return w.useEffect(()=>{const s=setInterval(()=>{i()},Fke);return()=>{clearInterval(s)}},[]),g.createElement(q,{style:{height:"500px"}},g.createElement(q,{position:"absolute",top:"0",left:"0",width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},g.createElement(Fc,{size:"lg",style:{width:"60px",height:"60px"}}),g.createElement(ae,{variant:"medium",color:"text50",textAlign:"center",marginTop:"8"},"Transaction in progress. ",g.createElement("br",null),"This may take a few minutes.")))},zke=()=>{const{closeCheckout:t,settings:e}=_p(),n=ih().navigation;return w.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onSuccess&&(e==null||(s=e.creditCardCheckout)==null||s.onSuccess(n.params.transactionHash))},3e3)},[]),g.createElement(q,{style:{height:"500px"}},g.createElement(q,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},g.createElement(qke,null),g.createElement(ae,{fontSize:"xlarge"},"Success!"),g.createElement(ae,{textAlign:"center",variant:"normal",color:"text80"},"The transaction was successful.")))},qke=()=>g.createElement(q,{color:"white",background:"positive",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2"},g.createElement(Bd,{size:"xl"})),Wke=()=>{const{closeCheckout:t,settings:e}=_p(),n=ih().navigation;return w.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onError&&(e==null||(s=e.creditCardCheckout)==null||s.onError(n.params.error))},3e3)},[]),g.createElement(q,{style:{height:"500px"}},g.createElement(q,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},g.createElement(Hke,null),g.createElement(ae,{fontSize:"xlarge"},"Error"),g.createElement(ae,{textAlign:"center",variant:"normal",color:"text80"},"An error occurred while processing the transaction.")))},Hke=()=>g.createElement(q,{color:"white",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2",background:"negative"},g.createElement(Cu,{size:"xl"})),Vke=({size:t=30})=>g.createElement(q,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",style:{width:`${t}px`,height:`${t}px`}},g.createElement(ae,{style:{fontSize:`${t-4}px`},display:"inline-block",variant:"large",color:"textInverse100"},"?")),w0=({imageUrl:t,size:e=30})=>t?g.createElement(br,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):g.createElement(Vke,{size:e});Iu("packages/checkout/src/shared/components/Skeleton/styles.css.ts","kit");const Gke=dz({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),Kke=Wn({height:"76px",backgroundColor:"#909090",animation:`${Gke} 2s ease-in-out infinite`},"skeleton");Tu();const _f=({width:t="100%",height:e="100%",borderRadius:r="md"})=>g.createElement(q,{className:Kke,borderRadius:r,style:{width:t,height:e}}),Qke=({contractAddress:t,tokenId:e,quantityRaw:r,chainId:n})=>{const{chains:i}=vt(),{data:s,isLoading:o}=Nke({chainId:n,contractAddress:t,tokenId:e}),{data:a,isLoading:c}=pW({chainID:String(n),contractAddress:t});if(o||c)return g.createElement(Yke,null);const u=Pr(n,[...i]),{name:f="unknown",image:d,decimals:h=0}=s||{},{logoURI:p,name:m="Unknown Collection"}=a||{},v=Nt(r,h);return g.createElement(kn,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},g.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},g.createElement(q,{aspectRatio:"1/1",height:"full",justifyContent:"center",alignItems:"center",style:{width:"80px"}},g.createElement(br,{src:d,borderRadius:"md",style:{height:"80px"}})),g.createElement(q,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},g.createElement(q,{gap:"1",alignItems:"center"},g.createElement(w0,{size:12,imageUrl:p}),g.createElement(ae,{marginLeft:"1",fontSize:"small",color:"text80",fontWeight:"bold"},m),g.createElement(w0,{size:12,imageUrl:u.logoURI})),g.createElement(q,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",style:{width:"180px"}},g.createElement(ae,{color:"text100",fontSize:"normal",fontWeight:"normal"},f),g.createElement(ae,{color:"text50",fontSize:"normal",fontWeight:"normal"},`#${e}`)))),g.createElement(q,{height:"full",fontSize:"small",color:"text50",fontWeight:"bold"},`x${r8(v)}`))},Yke=()=>g.createElement(kn,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},g.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},g.createElement(_f,{height:"80px",width:"80px"}),g.createElement(q,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},g.createElement(_f,{width:"100px",height:"14px"}),g.createElement(_f,{width:"180px",height:"34px"}))),g.createElement(_f,{height:"14px",width:"14px"}));Iu("packages/checkout/src/views/CheckoutSelection/styles.css.ts","kit");const mW=Wn({},"insufficientBalanceButton");fs(`${mW} > div`,{justifyContent:"center"});Tu();const Jke=()=>{var t,e,r,n;const{chains:i}=vt();ih();const{closeCheckout:s,settings:o}=_p(),{address:a}=fn(),c=o==null?void 0:o.cryptoCheckout,l=!!c,{data:u,isLoading:f}=pW({contractAddress:(c==null||(t=c.coinQuantity)==null?void 0:t.contractAddress)||"",chainID:String((c==null?void 0:c.chainId)||1)}),{data:d,isLoading:h}=Mke({accountAddress:a||"",chainId:(c==null?void 0:c.chainId)||1}),p=(f||h)&&c,m=NI((c==null||(e=c.coinQuantity)==null?void 0:e.contractAddress)||"",Dt),v=Pr((c==null?void 0:c.chainId)||1,i),y=m?v.decimals:(u==null?void 0:u.decimals)||0,b=m?v.symbol:(u==null?void 0:u.symbol)||"COIN",E=m?v.logoURI:(u==null?void 0:u.logoURI)||"",S=d==null?void 0:d.find(F=>{var x;return NI(F.contractAddress,(c==null||(x=c.coinQuantity)==null?void 0:x.contractAddress)||"")}),P=S?S.balance:"0",M=(c==null||(r=c.coinQuantity)==null?void 0:r.amountRequiredRaw)||"0",L=Nt(P,y),j=Nt(M,y),H=te.from(P).lt(te.from(M)),K=(o==null?void 0:o.orderSummaryItems)||[],Q=(o==null||(n=o.cryptoCheckout)==null?void 0:n.chainId)||1,Y=()=>{var F;console.log("trigger transaction");const x=o==null||(F=o.cryptoCheckout)==null?void 0:F.triggerTransaction;x&&x(),s()};return g.createElement(q,{paddingX:"5",paddingBottom:"5",style:{marginTop:I9},flexDirection:"column",gap:"3"},K.length>0&&g.createElement(g.Fragment,null,g.createElement(ae,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Order summary"),g.createElement(q,{flexDirection:"column",gap:"2"},K.map((F,x)=>g.createElement(Qke,yu({key:x},F,{chainId:Q})))),g.createElement(q,{marginTop:"2"},g.createElement(s1,{color:"backgroundSecondary",style:{margin:"0px"}}))),l&&g.createElement(q,{justifyContent:"space-between",alignItems:"center"},g.createElement(ae,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Total"),p?g.createElement(_f,{width:"100px",height:"17px"}):g.createElement(q,{flexDirection:"row",gap:"1",alignItems:"center"},g.createElement(w0,{imageUrl:E,size:12}),g.createElement(ae,{fontWeight:"normal",fontSize:"normal",color:"text100"},`${r8(j)} ${b}`))),g.createElement(q,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2"},l&&!H&&!p&&g.createElement(rt,{style:{borderRadius:Te.radii.md,height:"56px"},width:"full",leftIcon:()=>g.createElement(w0,{size:20,imageUrl:E}),variant:"primary",label:`Pay with ${b}`,rightIcon:yo,onClick:Y}),l&&(H||p)&&g.createElement(rt,{className:mW,style:{borderRadius:Te.radii.md,height:"56px",justifyContent:"center"},width:"full",leftIcon:()=>g.createElement(w0,{size:20,imageUrl:E}),variant:"glass",label:`Insufficient ${b}`,onClick:Y,disabled:!0})),l&&g.createElement(q,{width:"full",justifyContent:"flex-end"},p?g.createElement(_f,{width:"102px",height:"14px"}):g.createElement(ae,{fontWeight:"bold",fontSize:"small",color:"text50"},"Balance: ",`${r8(L)} ${b}`)))},Uw=({secondaryText:t,primaryText:e,disableBack:r=!1})=>{const{goBack:n,history:i}=ih(),s=()=>{n()};return g.createElement(q,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:I9,paddingTop:"6px",backgroundColor:Te.colors.backgroundPrimary}},i.length>0&&!r?g.createElement(Ao,{onClick:s,icon:_b,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):g.createElement(q,null),g.createElement(q,null,g.createElement(ae,{fontWeight:"medium",variant:"small",color:"text50"},t),g.createElement(ae,{fontWeight:"medium",variant:"small",color:"text100"},e)),g.createElement(q,{style:{width:"44px"}}))};Iu("packages/checkout/src/shared/styles.css.ts","kit");const T9=Wn({},"walletContent");fs(`${T9} + button`,{backgroundColor:"transparent"});fs(`${T9} + button > svg`,{width:"20px",height:"20px"});Tu();const vW={location:"select-method-checkout"},Xke=t=>{const e=new z4;return g.createElement(H4,{client:e},g.createElement(Zke,t))},Zke=({children:t})=>{const{theme:e,position:r}=kp(),[n,i]=w.useState(!1),[s,o]=w.useState(),[a,c]=w.useState([]),l=a.length>0?a[a.length-1]:vW,u=p=>{o(p),i(!0)},f=()=>{i(!1)},d=()=>{const{location:p}=l;switch(p){case"select-method-checkout":return g.createElement(Jke,null);case"transaction-pending":return g.createElement(Uke,null);case"transaction-success":return g.createElement(zke,null);case"transaction-error":return g.createElement(Wke,null);case"transaction-form":default:return g.createElement(Bke,null)}},h=()=>{const{location:p}=l;switch(p){case"select-method-checkout":return g.createElement(Uw,{primaryText:"Checkout"});case"transaction-success":case"transaction-error":case"transaction-pending":return g.createElement(Uw,{disableBack:!0,primaryText:"Pay with credit or debit card"});case"transaction-form":default:return g.createElement(Uw,{primaryText:"Pay with credit or debit card"})}};return w.useEffect(()=>{n&&c([])},[n]),g.createElement(kke,{value:{triggerCheckout:u,closeCheckout:f,settings:s,theme:e}},g.createElement(Lke,{value:{history:a,setHistory:c}},g.createElement("div",{id:"kit-checkout"},g.createElement(Lb,{root:"#kit-checkout",scope:"kit",theme:e},g.createElement(dd,null,n&&g.createElement(zy,{contentProps:{style:yu({maxWidth:"400px",height:"auto"},Eg(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},g.createElement(q,{id:"sequence-kit-checkout-content",className:T9},h(),d()))))),t))},ih=()=>{const{setHistory:t,history:e}=Dke(),r=s=>{const o=document.getElementById("sequence-kit-wallet-content"),a=o==null?void 0:o.parentElement;a==null||a.scrollTo(0,0);const c=[...e,s];t(c)},n=()=>{const s=[...e];s.pop(),t(s)},i=e.length>0?e[e.length-1]:vW;return{setNavigation:r,history:e,setHistory:t,goBack:n,navigation:i}},DI="Two roads diverged in a yellow wood",eAe=[{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"}],tAe=[{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 LI="u3q5o00";const rAe=()=>{const{theme:t}=op(),e=hF("isMobile"),r=s=>{typeof window<"u"&&window.open(s)},n=()=>pe.jsx(q,{flexDirection:"row",gap:"4",children:eAe.map((s,o)=>pe.jsx(q,{onClick:()=>r(s.url),className:LI,gap:"4",children:pe.jsx(ae,{fontWeight:"normal",fontSize:"small",color:"text50",children:s.label})},o))}),i=()=>pe.jsx(q,{gap:"4",justifyContent:"center",alignItems:"center",children:tAe.map((s,o)=>pe.jsx(q,{className:LI,onClick:()=>{typeof window<"u"&&window.open(s.url)},children:pe.jsx(br,{height:"3",src:s.icon,alt:s.id,style:{filter:t==="dark"?"invert(0)":"invert(1)"}})},o))});return e?pe.jsxs(q,{flexDirection:"column",padding:"5",gap:"2",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"center",alignItems:"center",children:[pe.jsx(n,{}),pe.jsx(i,{})]}):pe.jsxs(q,{padding:"5",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"space-between",children:[pe.jsx(n,{}),pe.jsx(i,{})]})},nAe=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},iAe=t=>`0x${nAe((t==null?void 0:t.substring(2))||"",8)}`,sAe=[{inputs:[],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"owner",type:"address"}],name:"ERC721IncorrectOwner",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC721InsufficientApproval",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC721InvalidApprover",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC721InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"ERC721InvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC721InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC721InvalidSender",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC721NonexistentToken",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"_fromTokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"_toTokenId",type:"uint256"}],name:"BatchMetadataUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"MetadataUpdate",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"player",type:"address"},{internalType:"string",name:"tokenURI",type:"string"}],name:"awardItem",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}];function oAe(){var $e;const{theme:t,setTheme:e}=op(),{setTheme:r}=kp(),{address:n,connector:i,isConnected:s}=fn(),{setOpenConnectModal:o}=K7e(),{setOpenWalletModal:a}=Cp();_p();const{disconnect:c}=YU(),{data:l}=Kbe(),{switchChain:u}=G4(),d=f2().find(ge=>ge.connector.id.includes("waas"))!==void 0,h=hF("isMobile"),{data:p,sendTransaction:m,isLoading:v}=V4(),{data:y,isLoading:b,writeContract:E}=Qbe(),[S,P]=g.useState(!1),[M,L]=g.useState(),[j,H]=g.useState(),[K,Q]=g.useState(),[Y,F]=g.useState(),[x,k]=g.useState(localStorage.getItem("confirmationEnabled")==="true"),[R,N,A]=Y7e(),[O,B]=g.useState();w.useEffect(()=>{R&&B(R.options[0].token.name)},[R]);const I=u2(),C=lu.network.allNetworks.find(ge=>ge.chainId===I),D=Gbe({chainId:I}),{debug:z}=YD.parse(location.search),_=z==="true",W=async()=>{if(!(!l||!D))try{const ge=await C7e(l);console.log("proof:",ge);const Ee=await S7e(l,D,ge);console.log("isValid?:",Ee)}catch(ge){console.error(ge)}};w.useEffect(()=>{p&&Q(p.hash??p),y&&F(y.hash??p)},[p,y]);const G=async()=>{if(l){P(!0);try{const ge=DI,Ee=await l.signMessage({account:n||"",message:ge});console.log("address",n),console.log("signature:",Ee),console.log("chainId in homepage",I);const[Ue]=await l.getAddresses(),Ke=await D.verifyMessage({address:Ue,message:ge,signature:Ee});P(!1),L(Ke),H(Ee),console.log("isValid?",Ke)}catch(ge){P(!1),console.error(ge)}}},J=async()=>{if(!l)return;const[ge]=await l.getAddresses();m({to:ge,value:"0",gas:null})},ee=async()=>{if(!l)return;const[ge]=await l.getAddresses();E({address:"0x0d402C63cAe0200F0723B3e6fa0914627a48462E",abi:sAe,functionName:"awardItem",args:[ge,"https://dev-metadata.sequence.app/projects/277/collections/62/tokens/0.json"]})},se=()=>{e(t==="dark"?"light":"dark"),r(t==="dark"?"light":"dark")},ie=()=>s?pe.jsxs(q,{padding:"5",justifyContent:"space-between",children:[pe.jsxs(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[pe.jsx(br,{style:{width:"36px"},src:"kit-logo.svg"}),pe.jsx(br,{style:{width:"24px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),pe.jsx(q,{children:pe.jsxs(q,{flexDirection:"column",children:[pe.jsxs(q,{flexDirection:"row",gap:"2",justifyContent:"flex-end",alignItems:"center",children:[pe.jsx(he,{}),pe.jsx(ae,{fontWeight:"medium",fontSize:"normal",color:"text100",children:h?iAe(n||""):n})]}),pe.jsx(q,{alignItems:"center",justifyContent:"flex-end",flexDirection:"row",children:pe.jsx(ae,{fontWeight:"medium",fontSize:"normal",color:"text50",children:i==null?void 0:i.name})})]})})]}):pe.jsx(q,{padding:"5",justifyContent:"flex-end",children:pe.jsx(he,{})}),oe=({title:ge,description:Ee,disabled:Ue,isLoading:Ke,onClick:Ye})=>pe.jsxs(kn,{style:{width:"332px"},clickable:!Ue,onClick:Ue?()=>{}:Ye,opacity:Ue?"50":"100",children:[pe.jsx(ae,{color:"text100",lineHeight:"5",fontSize:"normal",fontWeight:"bold",children:ge}),pe.jsx(q,{marginTop:"1",children:pe.jsx(ae,{fontWeight:"medium",lineHeight:"5",color:"text50",fontSize:"normal",children:Ee})}),Ke&&pe.jsx(Fc,{marginTop:"3",size:"sm",color:"text100"})]}),be=()=>{o(!0)},he=()=>pe.jsx(Ao,{onClick:se,icon:t==="dark"?Zle:Ble}),ve=()=>{u(I===421614?{chainId:42170}:{chainId:421614}),L(void 0)};return pe.jsxs(q,{background:"backgroundPrimary",children:[_&&pe.jsx(q,{justifyContent:"center",alignItems:"center",children:pe.jsx(ae,{children:"Debug mode"})}),pe.jsx(q,{style:{height:"72px"},position:"fixed",width:"full",top:"0",children:pe.jsx(ie,{})}),pe.jsx(q,{style:h?{paddingTop:"85px",paddingBottom:"80px"}:{height:"100vh"},flexDirection:"column",justifyContent:"center",alignItems:"center",children:s?pe.jsxs(q,{flexDirection:"column",gap:"4",children:[pe.jsxs(q,{flexDirection:"column",gap:"2",children:[pe.jsx(ae,{color:"text50",fontSize:"small",fontWeight:"medium",children:"Demos"}),pe.jsx(oe,{title:"Embedded wallet",description:"Connect a Sequence wallet to view, swap, send, and receive collections",onClick:()=>a(!0)}),pe.jsx(oe,{title:"Send transaction",description:"Send a transaction with your wallet",isLoading:v,onClick:J}),K&&((p==null?void 0:p.chainId)===I||p)&&pe.jsxs(ae,{as:"a",marginLeft:"4",variant:"small",underline:!0,href:`${C.blockExplorer.rootUrl}/tx/${p.hash??p}`,target:"_blank",rel:"noreferrer",children:["View on ",C.blockExplorer.name]}),pe.jsx(oe,{title:"Sign message",description:"Sign a message with your wallet",onClick:G,isLoading:S}),M&&pe.jsxs(kn,{style:{width:"332px"},color:"text100",flexDirection:"column",gap:"2",children:[pe.jsx(ae,{variant:"medium",children:"Signed message:"}),pe.jsx(ae,{children:DI}),pe.jsx(ae,{variant:"medium",children:"Signature:"}),pe.jsx(ae,{variant:"code",as:"p",ellipsis:!0,children:j}),pe.jsxs(ae,{variant:"medium",children:["isValid: ",pe.jsx(ae,{variant:"code",children:M.toString()})]})]}),pe.jsx(oe,{title:"Mint an NFT",description:"Test minting an NFT to your wallet",isLoading:b,onClick:ee}),Y&&((y==null?void 0:y.chainId)===I||y)&&pe.jsxs(ae,{as:"a",marginLeft:"4",variant:"small",underline:!0,href:`${C.blockExplorer.rootUrl}/tx/${y.hash??y}`,target:"_blank",rel:"noreferrer",children:["View on ",C.blockExplorer.name]}),_&&pe.jsx(oe,{title:"Generate EthAuth proof",description:"Generate EthAuth proof",onClick:W}),pe.jsx(oe,{title:"Switch network",description:`Current network: ${C.title}`,onClick:ve})]}),R&&pe.jsxs(q,{marginY:"3",children:[pe.jsx(Z0e,{name:"feeOption",labelLocation:"top",label:"Pick a fee option",onValueChange:ge=>{var Ue;const Ee=(Ue=R==null?void 0:R.options)==null?void 0:Ue.find(Ke=>Ke.token.name===ge);Ee&&B(Ee.token.name)},value:O,options:[...($e=R==null?void 0:R.options)==null?void 0:$e.map(ge=>({label:pe.jsxs(q,{alignItems:"center",gap:"2",children:[pe.jsx(ae,{children:ge.token.name}),pe.jsx(ae,{children:Nt(ge.value,ge.token.decimals)})]}),value:ge.token.name}))]}),pe.jsx(q,{marginY:"2",alignItems:"center",justifyContent:"center",children:pe.jsx(rt,{onClick:()=>{var Ee;const ge=(Ee=R==null?void 0:R.options)==null?void 0:Ee.find(Ue=>Ue.token.name===O);ge.token.contractAddress!==void 0&&(console.log("a3",ge.token.contractAddress),N(R==null?void 0:R.id,ge.token.contractAddress))},label:"Confirm fee option"})})]}),d&&pe.jsx(q,{marginY:"3",children:pe.jsxs(q,{as:"label",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[pe.jsx(ae,{fontWeight:"semibold",variant:"small",color:"text50",children:"Confirmations"}),pe.jsx(q,{alignItems:"center",gap:"2",children:pe.jsx(t3,{name:"confirmations",checked:x,onCheckedChange:async ge=>{ge?(localStorage.setItem("confirmationEnabled","true"),k(!0)):(localStorage.removeItem("confirmationEnabled"),k(!1)),await aAe(300),window.location.reload()}})})]})}),pe.jsx(q,{width:"full",gap:"2",flexDirection:"row",justifyContent:"flex-end",children:pe.jsx(rt,{onClick:()=>{c(),Q(void 0),F(void 0),L(void 0)},leftIcon:Bj,label:"Sign out"})})]}):pe.jsx(q,{children:pe.jsxs(q,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5",children:[pe.jsxs(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[pe.jsx(br,{style:{width:"48px"},src:"kit-logo.svg"}),pe.jsx(br,{style:{width:"32px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),pe.jsx(q,{gap:"2",flexDirection:"row",alignItems:"center",children:pe.jsx(rt,{onClick:be,variant:"feature",label:"Connect"})})]})})}),!h&&pe.jsx(rAe,{})]})}function aAe(t){return new Promise(e=>setTimeout(e,t))}const cAe=s2({id:42170,name:"Arbitrum Nova",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://nova.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://nova.arbiscan.io",apiUrl:"https://api-nova.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:1746963}}}),lAe=s2({id:421614,name:"Arbitrum Sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://sepolia.arbiscan.io",apiUrl:"https://sepolia.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:81930}},testnet:!0}),uAe=s2({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}}}),fAe=s2({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}}}),dAe=new z4;function hAe(){const{debug:t}=YD.parse(location.search),e=t==="true",r=[cAe,lAe,uAe,fAe],n="T3czhtWsTONJpbjFgAdLAuEAAAAAAAAA",i=[...c2e({walletConnectProjectId:"c65a6cb1aa83c4e24500130f23a437d8",defaultChainId:42170,appName:"demo app",projectAccessKey:n}),...e?Yq(n,[i2e({accounts:["0xCb88b6315507e9d8c35D81AFB7F190aB6c3227C9"]})]):[]],s={};r.forEach(c=>{const l=lu.network.findNetworkConfig(lu.network.allNetworks,c.id);l&&(s[c.id]=nye(l.rpcUrl))});const o=vge({transports:s,chains:r,connectors:i}),a={defaultTheme:"dark",signIn:{projectName:"Kit Demo",useMock:e},displayedAssets:[{contractAddress:Dt,chainId:42170},{contractAddress:Dt,chainId:421614},{contractAddress:"0x0d402c63cae0200f0723b3e6fa0914627a48462e",chainId:42170},{contractAddress:"0x0d402c63cae0200f0723b3e6fa0914627a48462e",chainId:421614},{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",chainId:137}]};return pe.jsx($ge,{config:o,children:pe.jsx(H4,{client:dAe,children:pe.jsx(G7e,{config:a,children:pe.jsx(z9e,{children:pe.jsx(Xke,{children:pe.jsx("div",{id:"app",children:pe.jsx(Lb,{root:"#app",scope:"app",theme:"dark",children:pe.jsx(oAe,{})})})})})})})})}const pAe=zw.createRoot(document.getElementById("root"));pAe.render(pe.jsx(g.StrictMode,{children:pe.jsx(hAe,{})}));export{Zc as B,b0 as H,yd as I,R4 as _,Pi as a,UG as b,mi as c,Bn as d,rge as e,ye as f,wr as g,h4 as h,DQ as i,ga as j,ive as k,t2 as l,ya as m,lp as n,_o as o,rn as p,FG as r,ai as s,EAe as t}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./index-B4v1t5IB.js","./___vite-browser-external_commonjs-proxy-DBU2Szs-.js","./index.es-DEIq-t2i.js"] + __vite__mapDeps.viteFileDeps = ["./index-CDfblNjf.js","./___vite-browser-external_commonjs-proxy-CJKNagiQ.js","./index.es-BzNvGBBU.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/assets/index.es-DEIq-t2i.js b/assets/index.es-BzNvGBBU.js similarity index 99% rename from assets/index.es-DEIq-t2i.js rename to assets/index.es-BzNvGBBU.js index 3af5ae98..a407e699 100644 --- a/assets/index.es-DEIq-t2i.js +++ b/assets/index.es-BzNvGBBU.js @@ -1,4 +1,4 @@ -import{g as Pu,p as si,d as st,B as Cu,c as Jr,a as Au,_ as P_}from"./index-DwS12Swv.js";import{r as C_,e as zr,U as Tu}from"./___vite-browser-external_commonjs-proxy-DBU2Szs-.js";/*! ***************************************************************************** +import{g as Pu,p as si,d as st,B as Cu,c as Jr,a as Au,_ as P_}from"./index-uA4vqshg.js";import{r as C_,e as zr,U as Tu}from"./___vite-browser-external_commonjs-proxy-CJKNagiQ.js";/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -43,10 +43,10 @@ __p += '`),Ze&&(ne+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+ne+`return __p -}`;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-BphuedKL.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-BBfF6sxO.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-BphuedKL.js","./index-DwS12Swv.js","./index-hzRzMXhE.css"] + __vite__mapDeps.viteFileDeps = ["./index-BBfF6sxO.js","./index-uA4vqshg.js","./index-hzRzMXhE.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/index.html b/index.html index d56e7c1b..e20bce0c 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 - +